Commit f6475ace authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

gdi32: Improve vertical writing metrics.

parent a221654a
...@@ -6443,6 +6443,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, ...@@ -6443,6 +6443,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
} else { } else {
INT xc, yc; INT xc, yc;
FT_Vector vec; FT_Vector vec;
FT_Pos lsb;
left = right = 0; left = right = 0;
...@@ -6468,41 +6469,24 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, ...@@ -6468,41 +6469,24 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
bottom = bottom & -64; bottom = bottom & -64;
top = (top + 63) & -64; top = (top + 63) & -64;
if (tategaki) if (tategaki && (font->potm || get_outline_text_metrics(font)))
{
for(xc = 0; xc < 2; xc++)
{
for(yc = 0; yc < 2; yc++)
{ {
if (vertical_metrics) if (vertical_metrics)
{ lsb = metrics.horiBearingY + metrics.vertBearingY;
vec.x = metrics.vertBearingY + xc * metrics.height;
vec.y = metrics.horiBearingX - yc * (metrics.vertBearingX * 2);
}
else else
{ lsb = metrics.vertAdvance + (font->potm->otmDescent << 6);
vec.x = metrics.horiBearingY - xc * metrics.height; vec.x = lsb;
vec.y = metrics.horiBearingX + yc * metrics.width; vec.y = font->potm->otmDescent << 6;
}
TRACE ("Vec %ld,%ld\n", vec.x>>6, vec.y>>6); TRACE ("Vec %ld,%ld\n", vec.x>>6, vec.y>>6);
pFT_Vector_Transform(&vec, &transMat); pFT_Vector_Transform(&vec, &transMat);
if(xc == 0 && yc == 0) { origin_x = (vec.x + left) & -64;
origin_x = vec.x; origin_y = (vec.y + top + 63) & -64;
origin_y = vec.y;
} else {
if(vec.x < origin_x) origin_x = vec.x;
if(vec.y > origin_y) origin_y = vec.y;
}
}
}
origin_x = origin_x & -64;
origin_y = (origin_y + 63) & -64;
} }
else else
{ {
origin_x = left; origin_x = left;
origin_y = top; origin_y = top;
lsb = metrics.horiBearingX;
} }
TRACE("transformed box: (%d,%d - %d,%d)\n", left, top, right, bottom); TRACE("transformed box: (%d,%d - %d,%d)\n", left, top, right, bottom);
...@@ -6537,7 +6521,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, ...@@ -6537,7 +6521,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
adv = pFT_MulFix(vec.x, em_scale) * 2; adv = pFT_MulFix(vec.x, em_scale) * 2;
} }
vec.x = metrics.horiBearingX; vec.x = lsb;
vec.y = 0; vec.y = 0;
pFT_Vector_Transform(&vec, &transMatUnrotated); pFT_Vector_Transform(&vec, &transMatUnrotated);
abc->abcA = vec.x >> 6; abc->abcA = vec.x >> 6;
......
...@@ -5294,13 +5294,11 @@ static void check_vertical_metrics(const char *face) ...@@ -5294,13 +5294,11 @@ static void check_vertical_metrics(const char *face)
} }
else else
{ {
todo_wine
ok(vgm.gmptGlyphOrigin.x == rgm.gmptGlyphOrigin.x + vgm.gmCellIncX + otm.otmDescent, ok(vgm.gmptGlyphOrigin.x == rgm.gmptGlyphOrigin.x + vgm.gmCellIncX + otm.otmDescent,
"got %d, expected rgm.origin.x(%d) + vgm.cellIncX(%d) + descent(%d)\n", "got %d, expected rgm.origin.x(%d) + vgm.cellIncX(%d) + descent(%d)\n",
vgm.gmptGlyphOrigin.x, rgm.gmptGlyphOrigin.x, vgm.gmCellIncX, otm.otmDescent); vgm.gmptGlyphOrigin.x, rgm.gmptGlyphOrigin.x, vgm.gmCellIncX, otm.otmDescent);
} }
todo_wine
ok(vgm.gmptGlyphOrigin.y == abc.abcA + abc.abcB + otm.otmDescent, ok(vgm.gmptGlyphOrigin.y == abc.abcA + abc.abcB + otm.otmDescent,
"got %d, expected abcA(%d) + abcB(%u) + descent(%d)\n", "got %d, expected abcA(%d) + abcB(%u) + descent(%d)\n",
(INT)vgm.gmptGlyphOrigin.y, abc.abcA, abc.abcB, otm.otmDescent); (INT)vgm.gmptGlyphOrigin.y, abc.abcA, abc.abcB, otm.otmDescent);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment