Bourbon_7
Bourbon_7

Reputation: 351

How the GetTextMetrics method gets the font metrics from a font ?

I am designing a font and need to set its font metrics, as mentioned in this article, different software and systems may use different parameters as font metrics. I would like to know how the win32 API GetTextMetrics converts the parameters in the font to TEXTMETRIC, which is not described in the documentation.

Upvotes: 0

Views: 400

Answers (1)

Peter Constable
Peter Constable

Reputation: 3650

Don't focus on the GDI GetTextMetric API: very little in Windows (and nothing commonly used) still uses GDI text functions, and Windows apps increasingly use other libraries. Most of Windows and Office use DirectWrite.

Do focus on the guidance in the Glyphs article, particularly use of the "typo" metrics (including the USE_TYPO_METRICS flag in a font's OS/2.fsSelection field): that is what is increasingly used in software. Also follow the guidance in the articles by Victor Gaultney that are linked from the Glyphs article.

See also https://learn.microsoft.com/en-us/typography/opentype/spec/os2#stypoascender.

Upvotes: 2

Related Questions