Get single glyph metrics (.net)

2020-07-08 06:23发布

问题:

How can I get full information about single glyph from choosen font (for example Arial -> symbol "A")

This picture describe what variables I need to find:

回答1:

You can start with the FontFamily class.

and this CP article http://www.codeproject.com/KB/GDI-plus/ExtendedGraphicsII.aspx



回答2:

I don't think FontFamily will give any information about a particular glyph, but the DirectWrite interface might work: (I haven't used it yet)

  • Glyphs and Glyph Runs
  • IDWriteFontFace::GetGlyphIndices
  • IDWriteFontFace::GetDesignGlyphMetrics