0

With GDI you can retrieve the LSB (left side bearing) and width of text by using GetCharABCWidthsW. However, there is no equivalent for the bottom side bearing that I can find. With DirectWrite it's included with DWRITE_GLYPH_METRICS but I cannot find the equivalent for GDI. Just wondering why this seems to be missing, and any other way to retrieve it?

As far as why I need the information, I have run into a rare font that has a negative bottom side bearing that needs to be accounted for during the render process. If it's not, then the glyph gets partly cut off.

Charlie
  • 680
  • 4
  • 11
  • 2
    Don't think you can do that with GDI, also see the answer here: https://stackoverflow.com/a/13925802/403671 that explicitly says it's not possible (I'll add that WPF uses some kind of a DirectWrite ancestor) – Simon Mourier Dec 31 '21 at 17:12
  • WPF now uses directwrite directly, starting from Windows 7. It's possible you don't need bottom side bearing at all, what you usually need is a resulting bitmap dimensions, and origin vector. – bunglehead Jan 01 '22 at 11:01

0 Answers0