3

I'm working on a document using a typeface that does not have a glyph for Unicode 0107 Latin Small Letter C with Acute, or "ć". I really like this typeface otherwise, so I'd prefer to not have to change it just over the lack of this one glyph.

Unfortunately, another problem with this typeface is that it also does not have a glyph for Unicode 0301 Combining Acute Accent, or "◌́". Otherwise, I'd (probably?) be able to just do something like \renewcommand{\'}[1]{\add@accent{`^^^^0301}{#1}}.

What I'd like to do is pull the combining acute accent glyph from a different typeface and put it over the "c" glyph from the main typeface. While it won't match perfectly, it should be close enough for my purposes.

I've tried a few things, and managed to get the following working:

\documentclass{article}

\usepackage{fontspec}
\setmainfont{Baskerville Old Face} 
% not actually what I'm using, 
% but an example of another font lacking the relevant glyphs
\newfontfamily{\ccfont}{TeX Gyre Pagella}
\newfontfamily{\mainfont}{Baskerville Old Face}

\newcommand{\cc}{c\llap{\ccfont\'\ }}

\begin{document}
    \cc
\end{document}

However, I cannot seem to get this to work without defining a new macro like \cc. If I try \newcommand{\'c}{...}, I get an error message that Use of \' doesn't match its definition. Is there a way I can do this without having to replace every \'c with \cc in my documents and .bib file?

1 Answer 1

7

as in pdftex you can declare the composite:

enter image description here

\documentclass{article}

\usepackage{fontspec}
\setmainfont{Baskerville Old Face} 
% not actually what I'm using, 
% but an example of another font lacking the relevant glyphs
\newfontfamily{\ccfont}{TeX Gyre Pagella}
\newfontfamily{\mainfont}{Baskerville Old Face}

\DeclareTextCompositeCommand{\'}{TU}{c}{{\ccfont\'{{\mainfont c}}}}

\begin{document}
  ab\'cd
\end{document}
2
  • And maybe \newunicodechar{ć}{\'{c}}
    – egreg
    Commented Sep 23, 2022 at 22:46
  • Such a wonderful suggestion, hats off.
    – MadyYuvi
    Commented May 20, 2023 at 14:17

You must log in to answer this question.

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