Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: font measurement

by preahkumpii (Novice)
on Jan 30, 2012 at 12:50 UTC ( #950764=note: print w/ replies, xml ) Need Help??


in reply to Re: font measurement
in thread font measurement

A ttf, or otf. Really I just want to specify a font on my Windows system. The actual code I will use is much more complex, but seeing I can't even get the basic idea of measuring the string, I figured it would be better to make a simple program to test it first.


Comment on Re^2: font measurement
Replies are listed 'Best First'.
Re^3: font measurement
by afoken (Prior) on Jan 30, 2012 at 13:31 UTC

    Windows has some API functions that can be fed with a string and a font, returning some sizes. Start looking at Font and Text Functions.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re^3: font measurement
by fisher (Priest) on Jan 30, 2012 at 13:39 UTC
    AFAIK the Font::Freetype suite can render you at least one given symbol. Assuming that spacing between characters will be constant, you can calculate the size of any string, using these data.

    But there is also Font::TTF, which I didn't used before - start reading from this point, I guess.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2015-07-29 09:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls