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

Akihiro Sagawa sagawa.aki at gmail.com
Tue Sep 17 09:38:13 CDT 2013


On Mon, 16 Sep 2013 11:33:34 -0500, Vincent Povirk wrote:
> > 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
> > case.
> 
> I don't think the existing code for finding the mask size would have a
> problem with gmBlackBoxX being 0. But it would be best to skip
> updating min_x, min_y, max_x, and max_y in this case, since we don't
> really need the mask to include the position of an empty glyph.
> Does Wine's GGO return a non-zero value currently? That would mean a
> regression in gdiplus drawing only empty glyphs when you fix GGO.

I didn't mean that. Native GGO returns a non-zero gmBlackBoxX/Y
value. Wine's GGO currently returns a zero gmBlackBoxX/Y value for empty
glyph.
I ran some tests [1] before submitting. Please read that, for details.
[1] http://newtestbot.winehq.org/JobDetails.pl?Key=2170

Skipping updating min-max variables might be a good idea, but I feel
this is the off topic issue. The patch intends to avoid regressions
after fixing GGO. In other words, the aim is creating the same mask
before and after the commit.

> > 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.
> 
> I think a comment saying just /* empty glyph */ inside the if blocks
> for these new cases would make the code much clearer.

Indeed. I'll add some comments in the next try.


Akihiro Sagawa




More information about the wine-devel mailing list