Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Is it possible to know the size of text in pixels?  (Read 2603 times)

0 Members and 1 Guest are viewing this topic.

Lion

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 101
    • View Profile
Is it possible to know the size of text in pixels?
« on: October 05, 2009, 11:46:21 AM »

story.window:

WINDOW
{
  X = 0
  Y = 0
  WIDTH = 1024
  HEIGHT = 768

  STATIC
  {
    NAME = "Caption"
    TEXT = "Is it possible to know the size of text in pixels?"
    TEXT_ALIGN = "left"
    FONT = "fonts\truetype12.font"
    X = 350
    Y = 150
    WIDTH = 400
    HEIGHT = 400
  }
}

truetype12.font:

TTFONT
{
  SIZE = 12
  FACE = "Arial"
  FILENAME = "fonts\arial.ttf"
}
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Is it possible to know the size of text in pixels?
« Reply #1 on: October 05, 2009, 05:41:34 PM »

Using the SizeToFit() and SizeToHeight() methods only.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.037 seconds with 18 queries.