Jump to content
  • Advertisement
irreversible

Font weights and thickness classification (in Freetype)

This topic is 514 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What is the standardized way to quantify font weights in FreeType? FT seems to expose the style name via FT_Face, which provides a string-based descriptive name, but I'm encountering a number of styles that do not have a one-to-one match on the weight scale used by WinAPI (I'm not sure where the origin of the weight scale is from). For instance, "Narrow" does not seem to be a quantifiable descriptor. Nor does "Condensed". I presently have the following table, but it's incomplete (eg in addition to the two abovementioned styles it lacks things like "Semilight", etc):

 

Extra Light = 100
Ultra Light = 100

Light = 200
Thin = 200

Book = 300
Demi = 300

Normal = 400
Regular = 400

Medium = 500

Semibold = 600
Demibold = 600

Bold = 700

Black = 800
Extra Bold = 800
Heavy = 800

ExtraBlack = 900
Fat = 900
Poster = 900
Ultra Black = 900

 

In addition to this, the PostScript descriptor seems to have a weight member (though I cannot tell whether it uses the same scale as above) and there seems to be no entirely consistent way in which the literal style tokens  are written in the first place ("Semi Light" != "Semilight"). Am I missing something obvious or is there some voodoo involved here?

Share this post


Link to post
Share on other sites
Advertisement

Hm - I accidentally stumbled across the usWeightClass member inside the TT_OS2 structure, which seems to be present for most fonts (at least on my system). Statistically speaking, it seems most other fonts either seem to be Regular (weight 400) in nature or can blindly be assumed to have the default weight.

Edited by irreversible

Share this post


Link to post
Share on other sites
  • Narrow and Condensed are widths, not weights: they are traditional adjectives for variant font families that have a smaller character width than the normal font and a similar design. Wider designs are usually called Expanded, Extended or Wide
    For example typical Windows fonts include Arial (main design) and Arial Narrow, and Arial Narrow has the same set of weights as Arial, e.g. Arial Narrow Bold that looks like a narrower Arial Bold.
     
  • Quote

    I'm encountering a number of styles that do not have a one-to-one match on the weight scale used by WinAPI

    If you use FreeType, why do you bother with matching a different API? What use do you have for descriptions of the font weight, except to report in some debug log or end-user report interesting details, found in the font file, of the fonts you are using? None of this data has any relevance to using the font to render characters.
    In case you are letting the users select fonts interactively, you can conservatively group them by name heuristics, without trying to guess and sort weights and widths.

Edited by LorenzoGatti

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!