By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,813 Members | 1,257 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,813 IT Pros & Developers. It's quick & easy.

gdmodule true type font size

P: n/a

When using gdmodule to draw text using true type fonts

im.string_ttf(font, fontsize, angle, (x,y), s, color)

the docs say 'draw string s at (x,y) using the TrueType font at the
given pointsize and angle.' It is not clear to me how gd handles
point size. A fontsize of 12 should be 12/72 = 1/6 inches tall but
how does gd decide what an inch is? 72 pixels? Is there some scale
parameter or constant that allows gd to make the conversion from
pixels to points?

I want my text to scale with image resolution which is determined by a
dpi parameter, and I tried doing

scale = dpi/72.0
im.string_ttf(font, scale*fontsize, angle, (x,y), s, color)

but the fonts are larger than they should be, at least according to my
calculations.

Thanks,
John Hunter

Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.