views:

208

answers:

1

When I open the Windows Common Font Dialog, it lists, for each font, a bunch of sizes. For all of the OpenType/TrueType fonts, it has the same list - 9, 10, 11, 12, 14, 16, 18... For bitmap fonts, the list varies according to the available bitmaps. "Small fonts" has 2,3,4,5,6,7, while plain old Courier has 10, 12, 15. I don't know, but I'm lead from previous reading to believe that even for TrueType fonts, certain sizes will be hinted and will look nicer than all those other sizes, so presumably I could also see a TrueType font with a more restricted set of sizes.

I'm implementing a feature in my application whereby Ctrl+Mousewheel will scale the font size up and down, as it does in browsers. I'd like to determine the available list of sizes for a font so that if I'm currently at size 12, my application knows that for Courier New, the next appropriate larger size is 14, while for plain old Courier, it's 15.

How do I go about doing this?

+3  A: 

See here for an explanation on how to enumerate fonts / font sizes for a specific font. Note, that TrueType fonts can be displayed at any size (and not just predetermined ones), since they are vector-based.

ASk
Thanks. I realise OpenType/TrueType will scale to any size, but they do often have particular sizes that have been manually hinted to look good.
Jon Bright