Jump to content
  • Advertisement
Sign in to follow this  

GetGlyphOutline - different black box for GGO_METRICS and _BITMAP

This topic is 3118 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

Hello, I haven't been able to find an answer to the issue I am having with GetGlyphOutline. When getting info for the same character, passing GGO_METRICS flag returns one black box size, and passing GGO_GRAY8_BITMAP returns another black box size. Which is the correct one to use? Currently what happens is that the texture coordinates cause the right edge of my glyph to be cut off (even though the glyph appears fully on the glyph texture) because the texture coordinates are set using values returned with METRICS flag, and the bitmap is written into texture with size returned from GGO_GRAY8_BITMAP. I am very confused on what's going on - should I never use GGO_METRICS and only use _BITMAP? But then, why do they have GGO_METRICS in the first place?
const MAT2 MTX2_IDENTITY = { 0, 1,  0, 0,  0, 0,  0, 1 };


// Assuming arial 10 is selected into DC

GetGlyphOutline(hDC, 'V', GGO_GRAY8_BITMAP, &gm, 0, NULL, &MTX2_IDENTITY);

// gm.bmBlackBoxX = 13

GetGlyphOutline(hDC, 'V', GGO_METRICS, &gm, 0, NULL, &MTX2_IDENTITY);

// gm.gmBlackBoxX = 11

Share this post

Link to post
Share on other sites
My best bet is that, after hinting (grid fitting), the two glyphs are rasterized differently.
Unfortunatly, the documentation seem to be a bit vague about that. GLYPHMETRICS is described to be in device units, so it seems possible, if not realistic, that hinting is considered.
What xoyojank makes sense, although I am not well aware where he found that information.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!