Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Pixel length of strings

by TruthSeeker (Initiate)
on Jul 11, 2009 at 19:42 UTC ( [id://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.

    Steve
    --
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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-19 06:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found