available fonts ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mel

    #1

    available fonts ?

    is it possible to get a list of available fonts from client machine running
    a browser ?


  • Joakim Braun

    #2
    Re: available fonts ?

    "Mel" <mel.m.heravi@h p.com> skrev i meddelandet
    news:4202615a$1 @usenet01.boi.h p.com...[color=blue]
    > is it possible to get a list of available fonts from client machine[/color]
    running[color=blue]
    > a browser ?[/color]

    Not with standard Ecmascript. Why would you want to? Anyway, fonts come in
    many variants and versions, not all of which can be distinguished by name.
    Something called "Times" on one computer wouldn't necessarily look the same
    on another. Then there might be issues like is it a
    bitmap/truetype/postscript/open type font, what is the glyph set, kerning
    tables and so on.

    If you want to, say, make headlines in a special font you can use PHP to
    render images using fonts installed on the server. The Onion seems to do
    that. (www.onion.com)

    Joakim Braun


    Comment

    • Ivo

      #3
      Re: available fonts ?

      "Joakim Braun" wrote[color=blue]
      > "Mel" skrev[color=green]
      > > is it possible to get a list of available fonts from client machine
      > > running a browser ?[/color]
      >
      > Not with standard Ecmascript.[/color]

      But fortunately there is a way using a dialog helper object in IE6. See the
      documentation at (mind the wrap)
      < http://msdn.microsoft.com/workshop/a...e/collections/
      fonts.asp >
      or an interactive example at
      < http://4umi.com/web/font/view.htm >
      [color=blue]
      > Why would you want to?[/color]

      Well, to optimize the chances of things looking the intended way of course.
      That is a very natural and healthy desire, it would be rather strange if
      (web) designers didn't care about something so fundamental as fonts, not to
      say criminal. It really is a shame that this has been standardized long ago.
      On top of that, why not?

      hth
      --
      Ivo






      Comment

      • Grant Wagner

        #4
        Re: available fonts ?

        "Ivo" <no@thank.you > wrote in message
        news:4202b1d0$0 $39205$b83b6cc0 @news.wanadoo.n l...[color=blue][color=green]
        >> Why would you want to?[/color]
        >
        > Well, to optimize the chances of things looking the intended way of
        > course.[/color]

        That is what CSS is for. Something like this:

        body {
        font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
        }

        means that the user agent should attempt to use Verdana, then Geneva,
        then Arial, then Helvetica, then if none of those can be found on the
        target platform, use any sans-serif font the platform can provide.
        Failing that, the user agent will display your content in whatever
        default font it chooses (it may do that anyway, more on that below).
        [color=blue]
        > That is a very natural and healthy desire, it would be rather strange
        > if
        > (web) designers didn't care about something so fundamental as fonts,
        > not to
        > say criminal. It really is a shame that this has been standardized
        > long ago.[/color]

        How do you standardize the way fonts will appear using a mechanism that
        can be viewed on multiple operating systems on multiple devices? There
        is simply no way to guarantee a platform is going to have your choice of
        fonts (or any font aside from some uncontrollable default for that
        matter).

        Not only that, but the end-user is always 100% in control of their
        _user_ agent (Web browser). I can override _any_ choice you make about
        which font to use. I can override _any_ choice you make about what color
        the font is, I can override _any_ choice you make about how big the font
        should be.
        [color=blue]
        > On top of that, why not?[/color]

        As explained, because it's impossible from both a technical (you can't
        use ECMAScript running in the user agent on the client to determine what
        fonts are available) and a practical (even if you could determine what
        fonts are installed, you have no guarantee you can actually _use_ those
        fonts) perspective.

        The Web is not desktop publishing. HTML/CSS are nothing more than
        _suggestions_ to user agents about how to layout and display content.
        User agents are completely free to ignore any and all choices you as a
        Web site designer make about how the site should appear.

        --
        Grant Wagner <gwagner@agrico reunited.com>
        comp.lang.javas cript FAQ - http://jibbering.com/faq


        Comment

        Working...