Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^2: Pixel length of strings

by TruthSeeker (Initiate)
on Jul 11, 2009 at 19:42 UTC ( #779247=note: print w/replies, xml ) Need Help??

in reply to Re: Pixel length of strings
in thread Pixel length of strings

I don't know what SVG is. My perl programs generate HTML which is then (after a little massaging) published as a web page. This is all part of a softball website that I support.

Replies are listed 'Best First'.
Re^3: Pixel length of strings
by skx (Parson) on Jul 11, 2009 at 20:25 UTC

    I believe the point the monk above was making is that "HTML IS NOT PIXEL PERFECT".

    You're at the whim of the fonts the end user has chosen, their preferred display size, differences in rendering, and more.

    If you absolutely must have something be pixel perfect use an image, PDF, or similar.

Re^3: Pixel length of strings
by psini (Deacon) on Jul 11, 2009 at 20:27 UTC

    Scalable Vector Graphics (SVG) is a standard for including vector graphics (drawings) into a HTML page.

    HTML itself does not (and can not) guarantee how your page is rendered, for it is a device independent format. You can't be sure even that your page is rendered as text (braille browsers, voice synthesis, etc.)

    So pure HTML is not the right choice for a fixed format output; on the other hand, SVG is a format for specifying graphics and compliant browsers (most if not all modern browsers) try to render it exactly as you specified.

    Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."

      > and compliant browsers (most if not all modern browsers) try to render it exactly as you specified.

      Unfortunately Internet Explorer does not currently (as of IE 7.0) support SVG natively, (but third-party plug-ins are available such as Adobe SVG Viewer)

      Cheers Rolf

Re^3: Pixel length of strings
by mzedeler (Pilgrim) on Jul 11, 2009 at 22:09 UTC

    Trying to emulate the layout descisions made by the browser (note that there are many browser distributions and versions each doing it slightly differently) is neither anticipated by the browser developers nor a generally good design, since HTML never was supposed to give complete control of the final layout.

    SVG is very easy to generate and you have much more accurate control of the layout. If you have to deal with browsers that doesn't understand it, you can use a server side tool to render a bitmap image from SVG.

    Since it is an XML based standard, it is straight forward to create templates and use them much the same way you'd publish web pages. All you need to change is the content type.

    Try taking a look at some SVG examples or the SVG specification.

    Another obvious alternative to SVG is generating bitmap graphics straight away as suggested in other posts.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://779247]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2021-04-19 19:37 GMT
Find Nodes?
    Voting Booth?

    No recent polls found