2

Currently working with a text that has a maltese cross character (U+2720) in a signature and my EBGaramond main font for this document does not provide the corresponding glyph. As expected I end up with a little square/rectangle in the xelatex output.

Here's what I have in my text editor:

… con el emblema de nuestra redención tu amigo—✠*Pedro Hillo*.

I imagine I would need to temporarily switch to a font that has a glyph for U+2720 … obviously without introducing extra spacing or a line break etc.

I looked at different questions/answers on this site and didn't find a solution.

Is this possible with xelatex and if so what would be a font that might provide a decent looking glyph for the maltese cross preferably one that more or less matches the looks of EBGaramond?

Or is there something in xelatex that might emulate the fontconfig mechanism (on linux) that automatically pulls the missing glyph from a compatible font?

Thank you.

1
  • 1
    you can change to a font simply by amigo—{\myfont ✠}P once you have picked a font and declared it via fontspec, but you could also use amigo—\includegraphics[height=1.5ex]{mycross}P and use any image of the cross you find Mar 7, 2020 at 16:36

2 Answers 2

5

Define a suitable font and map the character to use it.

\documentclass{article}
\usepackage{fontspec}
\usepackage{newunicodechar}

\setmainfont{EB Garamond}
\newfontface{\maltesecross}{TeX Gyre Pagella} % or whatever

\newunicodechar{✠}{{\maltesecross✠}}

\begin{document}

con el emblema de nuestra redención tu amigo—✠\emph{Pedro Hillo}.

\end{document}

enter image description here

-1

Added this to my preamble:

  \newfontfamily{\myfont}{TeXGyrePagella}

and changed the body of the document to

… con el emblema de nuestra redención tu amigo—\myfont{✠}\textit{Pedro Hillo.}

I had to "curly-bracket-ize" the maltese cross to avoid the remainder of the document using TeX Gyre Patella.

Thank you for your help.

RSF

6
  • Your syntax is wrong. \myfont is a switch, not a command with argument like \textit. So you should use it like this: {\myfont ✠}. Mar 7, 2020 at 19:16
  • The proof of the pudding… give it a try. Mar 7, 2020 at 19:50
  • Is this directed to me? If yes: I know what I'm saying. Mar 7, 2020 at 19:57
  • 2
    I can't test what your are doing. You didn't provide a complete example. But I get a garamond italic before and a pagella italic behind your \myfont{✠} see i.stack.imgur.com/gQh5f.png. Mar 7, 2020 at 20:26
  • 2
    @RicherSaint-Faure your syntax will make the rest of the document (or current group) in \myfont just as if you had used \bfseries{✠} when you intended \textbf{✠} (which would make the rest of the document bold. Mar 7, 2020 at 21:37

You must log in to answer this question.

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