[5/9] gdiplus: Fix empty glyph handling.

Akihiro Sagawa sagawa.aki at gmail.com
Sun Sep 15 21:29:58 CDT 2013

On Sun, 15 Sep 2013 16:32:25 -0500, Vincent Povirk wrote:
> This seems suspicious to me. Why can't we use those values in
> glyphmetrics if GetGlyphOutlineW returns 0? Does Windows provide bad
> values in this case, or is our GetGlyphOutlineW broken?

Thanks for you comments. The answer is yes, as you guessed.
Typically, native GetGlyphOutlineW(hdc, ' ', GGO_BITMAP, &gm, 0, NULL, ...)
returns gm.gmBlackBoxX = 1 instead of 0. Unfortunately, Wine's didn't,
and existing source codes (winex11, gdiplus, gdi32) expect 0 in this

In patch 98817, I'll update this GGO behavior to native compatible.
Thus, I need to change those code before to avoid regressions.

> When does the call to GetGlyphOutlineW in the second loop fail, and why
> ignore those failures?

Native GGO returns GDI_ERROR in GetGlyphOutlineW(hdc, ' ', GGO_BITMAP,
&gm, bufsize, buf, ...) case. Please note that bufsize and buf are
specified and guess they aren't null.

The second loop is for creating mask bitmaps. We don't need to update
bitmaps if the character is empty. However, we also need to update the
bitmap mask after that character. So, I just ignore the error and
continue at that point.

Akihiro Sagawa

More information about the wine-devel mailing list