setting fonts with XeTeX+fontspec

I am using Archlinux, emacs, XeLaTeX. I have some related problems.

1. I like the utopia font of the fourier package that I used to use before converting to XeTeX. Now, fontspec resets the font set by fourier.

2. When trying setting the font by fontspec as the example below, fontspec does not find the font!

3. Other fonts are found by fontspec but with ONLY using the Path option, although the font is found by fc-list.

MWE:

\documentclass[a4paper,10pt,article,twoside]{memoir}

\usepackage{fourier}
\usepackage{fontspec}
%\setmainfont{Utopia}[Path = /usr/share/fonts/Type1/]
\setmainfont{UTRG____.pfa}[Path = /usr/share/fonts/Type1/]

\begin{document}

This is to see whether it works.

\end{document}


If you want to keep using your old font, it still works with XeLaTeX. Just do not load fontspec.

The problem with loading Adobe Utopia via fontspec is the font format: UTRG____.pfa is a pfa file, this is an ASCII encoded font. To use the font with TeX, you need a binary font (.pfb). While you could convert the existing file with t1binary, the binary encoded Type1 Utopia font is already installed with TeXLive under the filename putr8a.pfb.

So to load the Type1 font with fontspec, use

\setmainfont{putr8a}[Extension = .pfb]


Then again, with XeLaTeX it would be better to use an Opentype version of the font. A free OpenType font derived from Adobe Utopia and available in TeX is Heuristica, so you should try

\setmainfont{Heuristica}


to get all the advantages of a Unicode based engine like XeLaTeX with a Utopia like font.

• Thanks so much; 1. For using putf8a, I had tried that already. However, it produces ugly output; I do not know why. it is not beautiful as fourier package. 2. Regarding using fontspec, I already using Polyglossia which loads fontspec either way. 3. I tried Heuristica after installing it from AUR, the result is not as beautiful as fourier. Do you have any suggestion? – Waleed A. Yousef Mar 5 '18 at 15:59
• One more thing is that, when I use fourier after 'fontspec' the font renders very nicely as in LaTeX – Waleed A. Yousef Mar 5 '18 at 16:22
• Oops, I almost managed to produce a very similar compilation by using the scaling option: \setmainfont[Scale=0.925]{Heuristica} The only difference is that, the output by the fourier package seems to be a little bolder than the output with scaled Heuristica! – Waleed A. Yousef Mar 5 '18 at 16:28
• First you don't need to install Heuristica from the AUR, it's included in the texlive-fontsextra package. I can't see the difference in weight between the scaled Heuristica and fourier, but you might want to try the FakeBold option for \setmainfont: With FakeBold=1.2 you get a slightly bolder version of Heuristica. – Marcel Krüger Mar 5 '18 at 16:53
• Finally, I found it on the Archlinux page wiki.archlinux.org/index.php/TeX_Live : sudo ln -s /etc/fonts/conf.avail/09-texlive-fonts.conf /etc/fonts/conf.d/09-texlive-fonts.conf fc-cache && mkfontscale && mkfontdir Thanks so much – Waleed A. Yousef Mar 5 '18 at 20:52