freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft] How to get nominal width of monospaced fonts


From: Sam Varshavchik
Subject: [ft] How to get nominal width of monospaced fonts
Date: Mon, 20 May 2019 07:16:36 -0400

I'm trying to determine the nominal width of monospaced fonts, in pixels, that is the normal horizontal advance of rendered glyphs when FT_FACE_FLAG_FIXED_WIDTH is set.

I thought, at first, to look at face->size->metrics.max_advance, but if I do that I find that it's always several pixels more than what I eventually get after FT_LOAD_RENDERing each glyph, and computing face->glyph->advance.x >> 6.

For example, using Liberation Mono: with a height of 16 pixels, I get 11 in metrics.max_advance, but the actual advance width, based on advance.x, is 10. With a height of 21 pixels, I get a max_advance of 15, and the actual advance based on advance.x is 13. Is it possible to get the advance width, of fixed width fonts, without actually rendering some sample glyphs and seeing what it is?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]