Akihiro Sagawa : gdi32: Return fake BBox when requesting empty glyph metrics.
Alexandre Julliard
julliard at winehq.org
Tue Oct 1 14:54:30 CDT 2013
Module: wine
Branch: master
Commit: db86409db66362c56031429ec124e65064e4f0bd
URL: http://source.winehq.org/git/wine.git/?a=commit;h=db86409db66362c56031429ec124e65064e4f0bd
Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date: Tue Oct 1 22:03:18 2013 +0900
gdi32: Return fake BBox when requesting empty glyph metrics.
---
dlls/gdi32/freetype.c | 4 ++--
dlls/gdi32/tests/font.c | 24 ++++++++----------------
2 files changed, 10 insertions(+), 18 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index bd4c895..15f401a 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -6520,8 +6520,8 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
width = (right - left) >> 6;
height = (top - bottom) >> 6;
- lpgm->gmBlackBoxX = width;
- lpgm->gmBlackBoxY = height;
+ lpgm->gmBlackBoxX = width ? width : 1;
+ lpgm->gmBlackBoxY = height ? height : 1;
lpgm->gmptGlyphOrigin.x = origin_x >> 6;
lpgm->gmptGlyphOrigin.y = origin_y >> 6;
abc->abcA = left >> 6;
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index a6f439b..f6e4d07 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -4120,10 +4120,8 @@ static void test_GetGlyphOutline(void)
ok(ret != GDI_ERROR, "%2d:GetGlyphOutlineW should succeed, got %d\n", fmt[i], ret);
else
ok(ret == 0, "%2d:GetGlyphOutlineW should return 0, got %d\n", fmt[i], ret);
- todo_wine {
- ok(gm.gmBlackBoxX == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxX);
- ok(gm.gmBlackBoxY == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxY);
- }
+ ok(gm.gmBlackBoxX == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxX);
+ ok(gm.gmBlackBoxY == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxY);
}
memset(&gm, 0xab, sizeof(gm));
@@ -4135,10 +4133,8 @@ static void test_GetGlyphOutline(void)
ok(ret != GDI_ERROR, "%2d:GetGlyphOutlineW should succeed, got %d\n", fmt[i], ret);
else
ok(ret == 0, "%2d:GetGlyphOutlineW should return 0, got %d\n", fmt[i], ret);
- todo_wine {
- ok(gm.gmBlackBoxX == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxX);
- ok(gm.gmBlackBoxY == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxY);
- }
+ ok(gm.gmBlackBoxX == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxX);
+ ok(gm.gmBlackBoxY == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxY);
}
memset(&gm, 0xab, sizeof(gm));
@@ -4150,10 +4146,8 @@ static void test_GetGlyphOutline(void)
ok(ret != GDI_ERROR, "%2d:GetGlyphOutlineW should succeed, got %d\n", fmt[i], ret);
else
ok(ret == 0, "%2d:GetGlyphOutlineW should return 0, got %d\n", fmt[i], ret);
- todo_wine {
- ok(gm.gmBlackBoxX == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxX);
- ok(gm.gmBlackBoxY == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxY);
- }
+ ok(gm.gmBlackBoxX == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxX);
+ ok(gm.gmBlackBoxY == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxY);
}
memset(&gm, 0xab, sizeof(gm));
@@ -4163,10 +4157,8 @@ static void test_GetGlyphOutline(void)
{
if (fmt[i] == GGO_METRICS) {
ok(ret != GDI_ERROR, "%2d:GetGlyphOutlineW should succeed, got %d\n", fmt[i], ret);
- todo_wine {
- ok(gm.gmBlackBoxX == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxX);
- ok(gm.gmBlackBoxY == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxY);
- }
+ ok(gm.gmBlackBoxX == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxX);
+ ok(gm.gmBlackBoxY == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxY);
}
else
ok(ret == GDI_ERROR, "%2d:GetGlyphOutlineW should return GDI_ERROR, got %d\n", fmt[i], ret);
More information about the wine-cvs
mailing list