9

I get three diacritical points in ' ї ' (U+0457) symbol using XeLaTeX and Gentium font, instead of two. This may be an issue only with Gentium, as other fonts work well.

\documentclass[12pt,a4paper]{article} 
\usepackage{polyglossia}
\newfontfamily\cyrillicfont[Script=Cyrillic]{Gentium}
\setdefaultlanguage{ukrainian}

\begin{document}
 ї      %   three diacritical points - wrong symbol
 \"\i   %   right symbol
 \ Ї    %   right capital symbol (U+0407)
\end{document}

4 Answers 4

8

The character U+0457 doesn't exist in Gentium, so \"i is used, which is obviously wrong.

You can use newunicodechar to test if the character exists:

\documentclass[12pt,a4paper]{article}
\usepackage{polyglossia}
\newfontfamily\cyrillicfont[Script=Cyrillic]{Gentium}
\setdefaultlanguage{ukrainian}

\usepackage{newunicodechar}
\newunicodechar{ї}{\iffontchar\font`її\else\"\i\fi}

\begin{document}
ї      %   right symbol
\"{\i} %   right symbol
Ї      %   right capital symbol (U+0407)
\end{document}

enter image description here

1
  • 1
    U+0457 exists in Gentium Plus. But it’s still useful to know how to test for it.
    – Thérèse
    Commented Aug 4, 2013 at 19:20
7

Elaborating on egreg’s answer, what happens is that HarfBuzz (the OpenType layout engine used by XeTeX) tries its best to render any given charter, and since Gentium does not support U+0457 it tries to decompose it into its canonically equivalent decomposed form; U+0457 + U+0308 since both are supported by the font. However, the font does not correctly handle combining U+0457 with diacritical marks (it is a soft dotted character, so it should lose its dot when combined with combining marks), and so this is considered a font bug. See this HarfBuzz mailing list thread for more discussion on this.

1
  • I was asking myself which component was responsible of the substitution. This feature of HarfBuzz seems very interesting.
    – egreg
    Commented Aug 5, 2013 at 15:10
3

Gentium has no smarts in it. Instead we recommend using Gentium Plus that has the full range of smarts found in SIL's other Roman fonts (Charis, Andika, Doulos).

2

Gentium Basic has more weights but a smaller character set than Gentium, and Gentium Plus expands on Gentium to offer almost complete support for Latin, Cyrillic, and Greek. See the Gentium FAQ if you want more details. For your purposes, simply change \newfontfamily\cyrillicfont[Script=Cyrillic]{Gentium} to \newfontfamily\cyrillicfont[Script=Cyrillic]{Gentium Plus}.

You must log in to answer this question.

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