Dynamically detect text-size?

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

    Dynamically detect text-size?

    Hi...

    Is there a way of calculating the pixel value of the width/height of a
    string, taking into account the font being used?
    For example, in Arial 14px, the following is 100 pixels wide and 10 pixels
    high:

    this is some text


    Plankmeister.


  • Evertjan.

    #2
    Re: Dynamically detect text-size?

    The Plankmeister wrote on 19 aug 2003 in comp.lang.javas cript:[color=blue]
    > Is there a way of calculating the pixel value of the width/height of a
    > string, taking into account the font being used?
    > For example, in Arial 14px, the following is 100 pixels wide and 10
    > pixels high:[/color]

    7th of August in this NG:

    <http://tinyurl.com/kgi0>

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    Comment

    • The Plankmeister

      #3
      Re: Dynamically detect text-size?

      Fantastic!! Thanks :)



      "Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message
      news:Xns93DC76E BC9AFFeejj99@19 4.109.133.29...[color=blue]
      > The Plankmeister wrote on 19 aug 2003 in comp.lang.javas cript:[color=green]
      > > Is there a way of calculating the pixel value of the width/height of a
      > > string, taking into account the font being used?
      > > For example, in Arial 14px, the following is 100 pixels wide and 10
      > > pixels high:[/color]
      >
      > 7th of August in this NG:
      >
      > <http://tinyurl.com/kgi0>
      >
      > --
      > Evertjan.
      > The Netherlands.
      > (Please change the x'es to dots in my emailaddress)[/color]


      Comment

      Working...