[Tex/LaTex] Why are all Heiti fonts appearing below the baseline in ConTeXt

cjkcontextcontext-mkiv

When using Chinese, heiti (黑体) fonts are the equivalent of sans serif. They generally have simple lines.

I want to use a heiti font for all of the titles and description labels in my document, however, I found when using any heiti font, the words are not appearing properly on the baseline.

This source, using STSong, STHeiti, and STKaiti, fonts available on OS X computers, demonstrates the problem:

\setscript[hanzi]
\mainlanguage[cn]
\starttypescript[serif][stsong]
    \definefontsynonym[Serif][name:stsong][features=chinese]
\stoptypescript
\starttypescript[sans][stheiti]
    \definefontsynonym[Sans][name:stheitijlight][features=chinese]
\stoptypescript
\starttypescript[mono][stkaiti]
    \definefontsynonym[Mono][name:stkaiti][features=chinese]
\stoptypescript
\definetypeface[stsong][rm][serif][stsong]
\definetypeface[stheiti][ss][sans][stheiti]
\definetypeface[stkaiti][tt][mono][stkaiti]
\setupbodyfont[stsong, 12pt]
\setuppapersize[A5]
\setuplayout[grid=yes]
\showgrid
\setupdescriptions[headstyle=\stheiti, width=2em, align=right]
\definedescription[descr]
\starttext
    \language[en]{
        {\stsong This is some text in STSong.}
        {\stheiti This is some text in STHeiti.}
        {\stkaiti This is some text in STKaiti.}
    }
    \language[cn]{
        {\stsong 这是一个句子。}
        {\stheiti 这是一个句子。}
        {\stkaiti 这是一个句子。}
    }
    \startdescr{\language[cn]{标签}}
        \language[en]{This is some text.}
    \stopdescr
\stoptext

After compiling, I find that the STHeiti text is not on the baseline on lines 2 and 7:

Example of uneven text.

  • One line 2, the STHeiti text appears a good deal above the baseline. This is more visible in the PDF.
  • Line 5 does not have any problem. Most of these characters have parts which correctly extend below the baseline.
  • On line 7, the descriptions label, in Chinese, appears much lower than the English text.

I tried substituting STHeiti with other Heiti fonts, such as Adobe Heiti Std and STXihei, but these exhibited the same problems.

Why is the text appearing at different levels? How can I ensure that the different fonts, particularly in the description environment, appear on the same baseline?

Best Answer

As far as the off-the-baseline problem is concerned, I believe this is a "problem" in the font or in the way how they try to fit both Latin and Chinese characters on the same baseline. You can try the following example in plain XeTeX and you'll get the same result:

\font\a="[STHeiti Light.ttc]"
hello \a hello  这是一个句子
\bye

You might file a feature request to adjust baseline manually for certain fonts, but then you might end up with Chinese characters being too low for the baseline.

The rest of the answer comes from Hans Hagen. You get the same problem with the following input:

\definefont[BigOne][SerifBold at 30pt]
\definedescription[descr][headstyle=\BigOne, width=2em, align=right]

\starttext
\startdescr{bla}
    \language[en]{This is some text.}
\stopdescr
\stoptext

and version 2012.05.24 15:18 is supposed to fix the problem. Can you please try it out?