1

Unicode includes twelve special symbols used for indicating tones on CJK characters. Four are traditional in Chinese civilization itself: U+302A: ("ideographic level tone mark") through U+302D. Another eight were introduced in the mid-nineteenth century by Western missionaries and have been taken up within native Chinese philology: U+A700: "modifier letter Chinese tone yin ping" through U+A707.

I am wondering if there is a standard way to use these to overstrike CJK characters in xeCJK. (An additional complication is that I am typesetting vertical text, using the built-in xeCJK option for that.)


In the minimal working examples below, I've attempted to mark two occurrences of 遺 with the "level" and "departing" tone marks. The marks appear, but not where they're supposed to.

Vertical text for Chinese with this package is supported chiefly by the Simsun font, which doesn't contain the various tone-mark characters. So I have created new CJK font families in order to load fonts that have the characters in question. But those fonts don't support the RawFeature={vertical} option of xeCJK, and that may be part of what's going wrong.

I had hoped perhaps xeCJK might have a built-in tool for marking characters with these traditional marks.

%!TEX TS-program = xelatex

\documentclass{bxjsarticle}

\usepackage{xeCJK}
\setCJKmainfont[Scale=MatchLowercase,Mapping=tex-text,RawFeature={vertical}]{SimSun}

% To get traditional tone marks for ``ideographic tone mark'' (ITM) characters
\newCJKfontfamily\ITMtones{BabelStone Han}
\newCJKfontfamily\ITMtonesA{HAN NOM A}
\newCJKfontfamily\ITMtonesB{Hanazono Mincho A Regular}

\begin{document}

\fontsize{40}{40}\selectfont

BabelStone Han:\vskip1em

誠宜開張聖聽、以光先帝{\ITMtones{〪}}遺德、恢弘志士之氣、不宜妄自菲薄、\dots 是以先帝簡拔以遺{\ITMtones{  〬}}陛下、愚以為、宮中之事、事無大小、悉以咨之\dots 

\clearpage

HAN NOM A:\vskip1em

誠宜開張聖聽、以光先帝{\ITMtonesA{〪}}遺德、恢弘志士之氣、不宜妄自菲薄、\dots 是以先帝簡拔以遺{\ITMtonesA{  〬}}陛下、愚以為、宮中之事、事無大小、悉以咨之\dots

\clearpage

Hanazono Mincho A Regular:\vskip1em

誠宜開張聖聽、以光先帝{\ITMtonesB{〪}}遺德、恢弘志士之氣、不宜妄自菲薄、\dots 是以先帝簡拔以遺{\ITMtonesB{  〬}}陛下、愚以為、宮中之事、事無大小、悉以咨之\dots

\end{document}

BabelStone Han example


HAN NOM A example


Hanazono Mincho A Regular example

7
  • It would help if you provided an example, does it not work if you simply follow a character by ? Commented Dec 20, 2022 at 9:36
  • 1
    You will need a font with vertical feature, the glyphs, and the rules for attaching the tone marks. Microsoft JhengHei has the first two, but not the rules. Code2003 has the first two and the rules for horizontal mode but not vertical. I would expect a Japanese font to be unlikely to have Chinese tone mark rules (it may). Unrelated - the font switches do not take arguments. Not unrelated - using grouping with {...} will break the font's positioning rules if it has any (glyphs have anchor points, and the {} between glyphs will hide that).
    – Cicada
    Commented Dec 20, 2022 at 15:36
  • 1
    Having said that, the tikz package could be used to "manually" position the marks. Alternatively, kerning with \kern... command, and use of \raisebox, is an option.
    – Cicada
    Commented Dec 20, 2022 at 15:42
  • @Cicada: If I don't use the outer curly brackets of {\ITMtones{〪}}, the vertical functionality breaks. If I don't use the inner ones, TeX then thinks the tone mark is part of the name of the \ITMtones command, and it won't compile. So I guess that's why you're saying all three features must be present in the same font. Commented Dec 20, 2022 at 19:04
  • 1
    Not an answer: the xpinyin, hanzibox, kanbun, gckanbun, and luatexja-ruby packages all, in some form, place marks/text around Chinese characters and work in vertical typesetting. Perhaps looking through their code could be illuminating
    – mbert
    Commented Dec 21, 2022 at 6:00

1 Answer 1

1

Not very good, but a quick and dirty solution using \kern and \raisebox, both tuned manually. In order to avoid font issues, I am using the Roman letter o for the traditional tone-mark circle, instead of the prescribed Unicode characters.

Doing it this way introduces infelicities in both leading and kerning, which I have also tuned manually. The result is still imperfect — among other things, the first line is one character shorter than the rest of the paragraph. I'd be grateful to hear of better solutions.

[In addition to 遺, I have marked both 菲 and 不 here, as they each have alternate píngshēng readings in the philological sources. Here we want their shǎngshēng and rùshēng readings, respectively.]

%!TEX TS-program = xelatex

\documentclass{bxjsarticle}

\usepackage{xeCJK}
\setCJKmainfont[Scale=MatchLowercase,Mapping=tex-text,RawFeature={vertical}]{SimSun}
\usepackage{setspace}  % Provides \setstretch

% To get overstruck ``o'' to represent traditional corner tone marks
% píngshēng 平聲: overstruck circle at lower left corner of character
\newcommand\pyng[1]{#1\kern-14pt{%
 \fontsize{25}{25}\selectfont\textbf{\raisebox{-1.6ex}o}}%
\kern2pt}

% shǎngshēng 上聲: overstruck circle at upper left corner of character
\newcommand\shaang[1]{#1\kern-40pt{%
 \fontsize{25}{25}\selectfont\textbf{\raisebox{-1.6ex}o}}%
\kern27pt}

% qùshēng 去聲: overstruck circle at upper right corner of character
\newcommand\chiuh[1]{#1\kern-40pt{%
 \fontsize{25}{25}\selectfont\textbf{\raisebox{0.6ex}o}}%
\kern27pt}

% rùshēng 入聲: overstruck circle at lower right corner of character
\newcommand\ruh[1]{#1\kern-14pt{%
 \fontsize{25}{25}\selectfont\textbf{\raisebox{0.6ex}o}}{}%
\kern2pt}

\begin{document}

\raggedright      % Reduce kerning distortion (default justified alignment is worse).
\setstretch{1.25} % Reduce leading distortion.

\fontsize{40}{40}\selectfont

Using \texttt{\textbackslash kern} and \texttt{\textbackslash raisebox}, hand-tuned:

誠宜開張聖聽、以光先帝\pyng{遺}德、恢弘志士之氣、\ruh{不}宜妄自\shaang{菲}薄、…是以先帝簡拔以\chiuh{遺}陛下、愚以為、宮中之事、事無大小、悉以咨之…

\end{document}

using \kern and \raisebox, hand-tuned


With all the other bells and whistles I am using to get the full rotated text and adjusted punctuation marks, the result is tolerable:

enter image description here

I'll put the full code in, for reference by interested hands — I'd still be grateful to see a more elegant solution.

%!TEX TS-program = xelatex

\documentclass{bxjsarticle}

\usepackage{xeCJK}
\setCJKmainfont[Scale=MatchLowercase,Mapping=tex-text,RawFeature={vertical}]{SimSun}
\setCJKfallbackfamilyfont{rm}[Script=CJK,RawFeature={vertical}]{SimSun-ExtB}
% To get IPA font, set as nominally \texttt
\setmonofont[Scale=1,Mapping=tex-text]{Doulos SIL}
% The following adjustments improve kerning.
\usepackage{newunicodechar}
\newunicodechar{。}{\hspace{0pt}。\hspace{0pt}}
\newunicodechar{,}{\hspace{0pt},\hspace{0pt}}
\newunicodechar{﹐}{\hspace{0pt}﹐\hspace{0pt}}
\newunicodechar{︐}{\hspace{0pt}︐\hspace{0pt}}
\newunicodechar{;}{\hspace{0pt};\hspace{0pt}}
\newunicodechar{:}{\hspace{0pt}:\hspace{0pt}}
\newunicodechar{、}{\hspace{0pt}、\hspace{0pt}}
\newunicodechar{!}{\hspace{0pt}!\hspace{0pt}}
\newunicodechar{?}{\hspace{0pt}?\hspace{0pt}}
\newunicodechar{(}{\hspace{0pt}(\hspace{0pt}}
\newunicodechar{)}{\hspace{0pt})\hspace{0pt}}
\newunicodechar{《}{\hspace{0pt}《\hspace{0pt}}
\newunicodechar{》}{\hspace{0pt}》\hspace{0pt}}
\newunicodechar{「}{\hspace{0pt}「\hspace{0pt}}
\newunicodechar{」}{\hspace{0pt}」\hspace{0pt}}

\usepackage{xeCJKfntef} % enable \CJKunderline etc.

\usepackage{setspace}  % enable \setstretch

% Settings for a 90-degree rotated "flowframe" to enable vertical typesetting
% (Following https://tex.stackexchange.com/a/402025/3935)
\usepackage{flowfram}
\newflowframe{\textheight}{\textwidth+2em}{0pt}{\textheight}[mainframe] 
\setflowframe{1}{angle=-90} 

% Command to properly align roman characters with Chinese characters:
% (Following https://tex.stackexchange.com/a/402025/3935)
\let\CJKsymbolOrig\CJKsymbol
\let\CJKpunctsymbolOrig\CJKpunctsymbol
\newcommand*\CJKmovesymbol[1]{\raise.35em\hbox{\CJKsymbolOrig{#1}}}
\newcommand*\CJKmovepunctsymbol[1]{\raise.35em\hbox{\CJKpunctsymbolOrig{#1}}}
\newcommand*\CJKmove{\punctstyle{plain}
  \let\CJKsymbol\CJKmovesymbol
  \let\CJKpunctsymbol\CJKmovepunctsymbol
}

% To get overstruck ``o'' to represent the four traditional corner tone marks
% píngshēng 平聲: overstruck circle at lower left corner of character
\newcommand\pyng[1]{#1\kern-14pt{%
 \fontsize{25}{25}\selectfont\textbf{\raisebox{-.4ex}o}}}%
%\kern2pt}

% shǎngshēng 上聲: overstruck circle at upper left corner of character
\newcommand\shaang[1]{#1\kern-40pt{%
 \fontsize{25}{25}\selectfont\textbf{\raisebox{-.4ex}o}}%
\kern27pt}

% qùshēng 去聲: overstruck circle at upper right corner of character
\newcommand\chiuh[1]{#1\kern-40pt{%
 \fontsize{25}{25}\selectfont\textbf{\raisebox{1.9ex}o}}%
\kern27pt}

% rùshēng 入聲: overstruck circle at lower right corner of character
\newcommand\ruh[1]{#1\kern-14pt{%
 \fontsize{25}{25}\selectfont\textbf{\raisebox{1.9ex}o}}}%
%\kern2pt}

\begin{document}
\CJKmove % Adjusts positioning of Roman font vis-à-vis CJK, and also CJK punctuation

\raggedright        % Makes parskip unnecessary here, more neatly.
\setstretch{1.25} % Reduce leading distortion.

\vspace*{\fill}

\pagenumbering{gobble}          % No page-numbering starting here

\fontsize{40}{40}\selectfont

誠宜開張聖聽、以光先帝\pyng{遺}德、恢弘志士之氣、\ruh{不}宜妄自\shaang{菲}薄、…是以先帝簡拔以\chiuh{遺}陛下、愚以為、宮中之事、事無大小、悉以咨之…

\vspace*{\fill}

\end{document}
4
  • 1
    Noto Sans CJK TC font is perfect, except for being sans. Noto Serif CJK TC caters for horizontal marks only.
    – Cicada
    Commented Dec 21, 2022 at 13:54
  • @Cicada: That's interesting to know. How is coverage of rare graphs in Noto Sans CJK TC? Simsun requires the Extension B annex as fallback, and the usually excellent HanaMin font requires a whole bunch of extensions. I now use Babelstone Han in my regular Western-language publications, but it doesn't seem to support vertical text, alas. Commented Dec 22, 2022 at 2:10
  • 1
    Font coverage: Simsun 28737; Microsoft JhengHei 29593; Noto Serif CJK TC 43029; Noto Sans CJK TC 44683. For Noto (from Google), derivation is the free Source Han fonts, at GitHub. Any examples of rare glyphs? I don't know the field.
    – Cicada
    Commented Dec 22, 2022 at 4:24
  • @Cicada: Graphs at or above U+20000 (plane CJK Unified Ideographs Ext. B/C/D/E/F etc.) generally represent rarely seen glyphs. Some are exquisitely outré: 𭖈 (U+2D588), 𭚥 (U+2D6A5), 𫛊 (U+2B6CA), 𪯡 (U+2ABE1), etc. Commented Dec 23, 2022 at 4:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .