Menu

#163 Box dimensions of vertical character are wrong

Future
open
nobody
vertical (3)
5
2020-01-21
2020-01-21
Anonymous
No

In the following example, the rotated glyph U+4E00 clearly extends below the horizontal Latin baseline, but the box containing the glyph reports a depth of zero.

In fact, the height of this box, 5.14pt, is exactly the Glyph Height of the un-rotated U+4E00; the depth of this box, 0.0pt, is exactly the Glyph Depth of the un-rotated U+4E00; both according to HarfBuzz.

\font\chinesefont="Source Han Serif SC:vertical" at 10pt
\setbox0\hbox{\chinesefont \char"4E00 }% CJK ideograph `one'
\the\wd0\ %
\the\ht0\ %
\the\dp0\ %
\box0 %
\bye

Perhaps the function getGlyphHeightDepth in XeTeXLayoutInterface.cpp should be redefined as

void
getGlyphHeightDepth(XeTeXLayoutEngine engine, uint32_t glyphID, float* height, float* depth)
{
    if (engine->font->getLayoutDirVertical()) {
        /* do something else */
    } else {
        engine->font->getGlyphHeightDepth(glyphID, height, depth);
    }
}

Discussion

Anonymous
Anonymous

Add attachments
Cancel