2

I need to use a specific font (New Aster LT Standard), and I am running into issues with 2 characters in my text. One is the polish ogonek on the name "Dąbrówka", the other is an accented c in the name "Matanić". Oddly, the font seems to have the ogonek diacritic (see line 2 of the PDF image), but it does not show correctly when combined, only as a standalone. I have \usepackage[utf8]{inputenc} and \usepackage[T1]{fontenc} in my preamble. I must compile with XeLaTeX. My .tex document is in UTF8. I tried various ways (see example), but none is working (see screen capture).

Help?

\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}

\setmainfont{New Aster LT Std}

\setmainlanguage{french} \setotherlanguage{polish}

\begin{document}

   Johannes Dąbrówka.  A. Matanić.
   \par

   ‬Johannes Da˛brówka.  A. Matani\'c.
    \par

   Johannes D\k{a}brówka.  A. Matani\'{c}.
   \par


\end{document}

screen capture

Oni
  • 705
  • 2
    don't use the packages fontenc, xunicode and inputenc with xelatex. – Ulrike Fischer May 06 '21 at 16:07
  • @UlrikeFischer thanks, I tried without fontenc, and only xunicode and inputenc, and it gives the same result. Or do you mean I should us neither of those three packages?? – user1940642 May 06 '21 at 16:23
  • 2
    do not use xunicode or inputenc (although fontenc was doing the most damage) – David Carlisle May 06 '21 at 16:37
  • If you try it then without the setmainfont command you find two missing characters in latin modern the log will show Missing character: There is no ̨ (U+0328) in font [lmroman10-regular]:mapping=t Missing character: There is no ‬ (U+202C) in font [lmroman10-regular]:mapping=t

    I don't have your font so I can't say whether that has all the characters.

    – David Carlisle May 06 '21 at 16:41
  • but U+202C is "pop directional formatting" did you intend that to be in the file? 0328 is a combining Ogonek (lines 1 and 3 look OK in latin modern as far as I can tell) – David Carlisle May 06 '21 at 16:43
  • @DavidCarlisle thanks, sorry I don't understand what I am doing. I just copied those characters from a Word document where they appeared fine. In the log, if I leave the setmainfont to my problematic font, the log has:

    Missing character: There is no ̨ in font New Aster LT Std/OT:script=latn;language=dflt;mapping=tex-text;! Missing character: There is no ́ in font New Aster LT Std/OT:script=latn;language=dflt;mapping=tex-text;! Missing character: There is no ć in font New Aster LT Std/OT:script=latn;language=dflt;mapping=tex-text;! etc.

    Without setmainfont the result looks fine

    – user1940642 May 06 '21 at 17:32
  • The fontspec manual does have some suggestions on using tex accent constructs if the font does not have the unicode accented glyphs but the details are font specific and it's hard to comment or test answers when you are using a commercial font. – David Carlisle May 06 '21 at 17:55
  • I managed to solve the issue of the accented c using the solution suggested here: https://tex.stackexchange.com/questions/493741/vc-character-not-rendered-in-fonts-which-dont-have-%C4%8C-with-t1-encoding It does not work for the ogonek though. – user1940642 May 06 '21 at 19:56
  • does ą work (that is U+0105 a with ogonek) rather than using the combining ogonek character as in your examples. – David Carlisle May 06 '21 at 20:09
  • The character U+202c POP DIRECTIONAL FORMATTING is immediately before the J on the middle example. – David Carlisle May 06 '21 at 20:21

2 Answers2

2

You can try any of the following:

Load your modern font through fontspec and type in the character ą (U+0105). In XeLaTeX or LuaLaTeX, you can also write ^^^^0105.

A font might also support the combining accent ą (a + U+0328). You can also type this as a^^^^0328. Latin Modern Roman does not have this accent, but New Computer Modern does.

The LaTeX command is \k{a}. If this doesn’t work for your font but ^^^^0105 does, you can try loading uninormalize to convert to NFC form.

If your font contains the non-combining ogonek ˛ (U+02DB), you might be able to overlay it with the TeX primitive \accent"02DB a. With Latin Modern Roman, the ogonek below is positioned wrong, but accents above should be better.

\documentclass{article}
\tracinglostchars=2 % Warn if a font does not contain a character!
\usepackage{newcomputermodern}

\newcommand\aogonek{\accent a ^^^^02db}

\begin{document} ^^^^0105 a^^^^0328 \accent"02DB a \k{a} \end{document}

a with ogonek

In PDFTeX, a-with-ogonek is in the T1 encoding. The precomposed character should work, as well as \k{a}, but combining accents generally don’t in PDFTeX.

All of the same methods should also work for, in the order you should try them, ć (U+0107), ć (c + U+0301), \'{c}, \accent"02CA c, or \accent"00B4 c.

Davislor
  • 44,045
  • 1
    With TeX Live 2021 you can set \tracinglostchars=3 and you'll get an error for nonexisting characters. This is backwards compatible, in the sense that with previous versions you'll get a warning as before. – egreg May 06 '21 at 22:02
  • @egreg That’s a great feature! Thanks. – Davislor May 07 '21 at 04:14
  • @egreg In this case, I think I’ll leave it as-is, because the test document is supposed to display whatever the font gives you. – Davislor May 07 '21 at 04:24
  • Thanks, it worked! I had tried something similar but I probably did not have the right syntax – user1940642 May 07 '21 at 16:00
1

Use font that has the letters you need, in example TexGyre. names(with TexGyre)

But If you really need to use that font you can define new letters with newunicodechar4.

% !TeX program = xelatex
\documentclass[xetex,twoside]{article}
\tracinglostchars=3 % Warn if a font does not contain a character
\usepackage{fontspec}
%\setmainfont[Ligatures=TeX]{TeX Gyre Pagella}
\setmainfont[Ligatures=TeX]{New Aster LT Std}
\usepackage{polyglossia}

\setmainlanguage{french} \setotherlanguage{polish}

\usepackage{newunicodechar} \makeatletter \newunicodechar{ć}{\add@accent{^^^^00b4}{c}} \newunicodechar{ó}{\add@accent{^^^^00b4}{o}} \newunicodechar{á}{\add@accent{^^^^00b4}{a}} \newunicodechar{ą}{\add@accent{^^^^02db}{a}} \makeatother

\begin{document}

   Johannes Dąbrówka.  A. Matanić.\par

\end{document}

names(with (Old) New Aster LT Std) names(with newunicodechar)

Oni
  • 705
  • Unfortunately, the position of the ogonek is incorrect; it should be very close to the right edge. (See the example with the TeX Gyre font.) – barbara beeton May 07 '21 at 22:37
  • Easies way to solve this is use font with right signs in it, or try if ^^^^0328 works any better. – Oni May 14 '21 at 01:10