0

I am trying to type PUA characters (such as omicron with perispomeni) using the Gentium Plus font on macOS.

I have tried setting Gentium Plus as the font for Greek using babel and fontspec but it doesn't seem to work. I only get a blank square as a replacement character. I'm assuming LaTeX isn't recognizing the character and therefore can't call for the correct glyph but don't know how to correct that.

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass[12pt]{article}

\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont[Mapping=tex-text]{Times New Roman}
\newfontfamily\greekfont{Gentium Plus}
\usepackage[greek.ancient,english,spanish]{babel}

\begin{document}
υσσκι κατὰ σκιρ�ν
\end{document}
4
  • 1
    latex does no checking for the characters, it just (asks harfbuzz to) render the supplied string with glyphs from the font. the example here is showing U+fffd (the replacement character) are you sure your real input was correctly encoded to access PUA characters? Apr 29, 2022 at 11:57
  • 1
    @DavidCarlisle, I might have inserted the character wrong. I just copied the glyph from Font Book. The character doesn't display a unicode code when moving over it so it might not have one assigned. If that is the problem here and there is no workaround, which I was hoping for, this is off-topic and I'll go looking for an answer somewhere else
    – morteu
    Apr 29, 2022 at 12:11
  • Welcome to TeX.SE!
    – Mensch
    Apr 29, 2022 at 12:30
  • @Mensch Thanks!!! ☺️
    – morteu
    Apr 29, 2022 at 14:12

2 Answers 2

1

Font Book tells you the glyph number, in this case 3232, so you can use \XeTeXglyph3232

However, you might use the combination

U+03BF GREEK SMALL LETTER OMICRON
U+0342 COMBINING GREEK PERISPOMENI

as shown in the second line of the example code below.

\documentclass[12pt]{article}

\usepackage{fontspec}
\usepackage[greek.ancient,english,spanish]{babel}

\setmainfont{Times New Roman}
\newfontfamily\greekfont{GentiumPlus}[
  Extension=.ttf,
  UprightFont=*-R,
  ItalicFont=*-I,
]

\begin{document}

\greekfont

υσσκι κατὰ σκιρ\XeTeXglyph3232 ν

υσσκι κατὰ σκιρο͂ν

\end{document}

Note that xltxtra and xunicode are no longer recommended: to the contrary, it's now recommended not to load them. I loaded Gentium Plus by file name, because the system font seems not to be seen on my machine.

enter image description here

1
  • Thanks, it's working now. It appears I was switching fonts wrong, using babel instead of fontspec. I had tried using the combination diacritic with TNR, but (obviously) it didn't work. I didn't know I could call for glyphs directly. Thanks for your advice regarding xlxtra and xunicode ☺️.
    – morteu
    Apr 29, 2022 at 14:10
1

You can declare this as a text composite command for \^. This example replaces ^{ο} (Where ο is the Greek omicron) with the glyph for o-with-tilde.

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass[12pt]{article}
\tracinglostchars=3 % Halt with error if a glyph is missing.
\usepackage[greek.ancient,english,spanish]{babel}
\usepackage{fontspec}
\usepackage{inputnormalization}

\defaultfontfeatures{Ligatures=TeX}

\babelfont{rm}{Times New Roman}
\babelfont[greek]{rm}
          [Scale=MatchLowercase]{Gentium Plus}

\DeclareTextComposite{\^}{TU}{^^^^03bf}{"F5} % Small omicron with perispomeni

\begin{document}
\foreignlanguage{greek}{υσσκι κατὰ σκιρ\^{ο}ν}
\end{document}

Gentium Plus sample

Your original MWE attempted to use Polyglossia commands with Babel (such as \greekfont) in a way that will not work. I substituted \babelfont to change your fonts. This example also needs explicit language tagging. (You could get rid of that in LuaTeX.)

An alternative approach would be to define a new font supstitution that would automatically replace omicron + combining circumflex. This would involve a TEC .map file in XeTeX or Lua code in LuaTeX.

Finally, although this particular substitution happens to be mapped into the range of glyphs XeLaTeX can access, Gentium Plus stores some glyphs in positions that are out of XeTeX’s range.

You must log in to answer this question.

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