2

One of font package (i.e. Adobe Garamond Pro) is not compatible with vowels encoding using xpinyin package. Can I exclude these fonts?

\documentclass[margin=10pt]{standalone}
\usepackage{xeCJK,xpinyin}
\setmainfont{Adobe Garamond Pro} %%problematic with pinyin
\begin{document}
  \xpinyin*{学而不思则罔}
\end{document}

enter image description here

  • 3
    I am assuming that you understand Chinese, so I will copy and paste the following description in the user manual of xpinyin: 设置拼音的字体,缺省值是 \normalfont,即以正文西文字体相同。为了保证拼音能正确输出,最好选用收字量较大的西文字体, which roughly translates to The font for pīnyīn is the same as the Latin main font. To guarantee correct output of pīnyīn, better choose a Latin font which contains a lot of glyphs So clearly Adobe Garamond Pro is NOT suitable for pīnyīn here. – Ruixi Zhang Feb 3 at 4:37
  • 2
    For a comprehensive discussion on pīnyīn, I suggest this article by Type is Beautiful. The article (in Chinese, simplified and traditional versions available) also gives suggestions on the font choice for pīnyīn. – Ruixi Zhang Feb 3 at 4:45
  • @HenriMenke Deleting my answer: Huh. For whatever reason, when Adobe’s site gives me the ability to type in a font sample for Adobe Garamond Pro, and I enter that combination, it works. Is that a newer version of the font, or is the website giving inaccurate information? – Davislor Feb 3 at 6:26
4

Adobe Garamond does not encode ǎ (U+01CE LATIN SMALL LETTER A WITH CARON) and is also missing ̌ (U+030C COMBINING CARON). I can think of two solutions:

  1. Use a different font. There are plenty of nice Garamond-derived typefaces out there which do not have such spotty encoding (and are non-commercial!).

    \documentclass[margin=10pt]{standalone}
    \usepackage{xeCJK,xpinyin}
    \setmainfont{EB Garamond}
    \begin{document}
      \xpinyin*{学而不思则罔}
    \end{document}
    

    enter image description here

    \documentclass[margin=10pt]{standalone}
    \usepackage{xeCJK,xpinyin}
    \setmainfont{Cormorant Garamond}
    \begin{document}
      \xpinyin*{学而不思则罔}
    \end{document}
    

    enter image description here

  2. Remap ǎ (U+01CE LATIN SMALL LETTER A WITH CARON) to something else. Here I map it to just the regular a (U+0061 LATIN SMALL LETTER A). The mapping below is derived from the standard tex-text mapping.

    acaron.map

    LHSName "acaron"
    RHSName "a"
    pass(Unicode)
    ; replace acaron with a
    U+01CE > U+0061 ;
    ; ligatures from Knuth's original CMR fonts
    U+002D U+002D           <>  U+2013  ; -- -> en dash
    U+002D U+002D U+002D    <>  U+2014  ; --- -> em dash
    
    U+0027          <>  U+2019  ; ' -> right single quote
    U+0027 U+0027   <>  U+201D  ; '' -> right double quote
    U+0022           >  U+201D  ; " -> right double quote
    
    U+0060          <>  U+2018  ; ` -> left single quote
    U+0060 U+0060   <>  U+201C  ; `` -> left double quote
    
    U+0021 U+0060   <>  U+00A1  ; !` -> inverted exclam
    U+003F U+0060   <>  U+00BF  ; ?` -> inverted question
    

    The I compile the mapping using the TECkit tool.

    teckit_compile -u acaron.map -o acaron.tec
    

    Afterwards it can be used in XeLaTeX.

    \documentclass[margin=10pt]{standalone}
    \usepackage{xeCJK,xpinyin}
    \setmainfont[Mapping=acaron]{Adobe Garamond Pro}
    \begin{document}
      \xpinyin*{学而不思则罔}
    \end{document}
    

    enter image description here

    You could also choose the mapping U+01CE > U+02C7 U+0061 ;, i.e. caron followed by a, which then renders as

    enter image description here

    That's not pretty but at least preserves the meaning.

  • 1
    +1 for mentioning EB Garamond! However, as a native speaker, I disagree with the last solution with U+01CE > U+02C7 U+0061 ;. A more acceptable solution would be wang3 with the 3 denoting the tone, while wang (with only the regular a) would be utterly wrong. ;-) – Ruixi Zhang Feb 3 at 4:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.