Results 1 to 2 of 2

Thread: character width needed

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    8

    Post

    Ok, this should be easy to do but I just cant seem to make it work. Anyone know how to get the width of a character?

    Basically I have a string going into a picture box with a fixed width font but I want to convert it to true type font. In order for everything else to work, I need to know the width of the characters (not the number the charcters, I need their width) i.e. the width of the first character in pixels.

    Ive tried all kinds of getcharwidth type functions but cant get anything to work. Using tmAveCharWidth I can get the average width of a fixed width font, but how do I get the individual widths of characters in a true type font since they could all be different?

    Anyone have an example of how to do this?

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Post

    Well, I can't help you much, but I know there's a API function to get the width of a string (Something like GetCharWidth). IMO it's used to autosize labels...

    Good luck!

    Fox

    ------------------
    [email protected]
    ...
    Every program can be reduced to one instruction which doesn't work.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width