12

What is the proper way to use LaTeX fonts, for example calligra or other fonts from the Font Catalogue in XeLaTeX.

Something like

\usepackage{fontspec}
\setromanfont{Calligra}

doesn't work. However using it just like in pdflatex via

\usepackage{calligra} and \calligra works. So what's the best way to use LaTeX fonts from the Fonts Catalogue in XeLaTeX?

4
  • 2
    \setromanfont is obsolete and \setmainfont should be used. Apart from this, fonts declared via fontspec's features should be OpenType or TrueType, which Calligra isn't.
    – egreg
    May 20, 2013 at 21:40
  • So I should just use it as I described it? What type of font is Calligra?
    – student
    May 21, 2013 at 8:18
  • Calligra is a traditional TeX font designed with Metafont; there is a Type1 version. It's not difficult to turn a Type1 font into an OpenType one, just use Fontforge; it will have no OpenType features, of course.
    – egreg
    May 21, 2013 at 8:36
  • Similar question on StackOverflow, for crosslinking: How Can I Convert Postscript Type 1 font to .otf or .ttf? - Stack Overflow
    – user202729
    Mar 27 at 12:13

1 Answer 1

5

As @egreg said, it is quite easy to turn a Type 1 font into a TrueType or OpenType font with Fontforge. Depending on your operating system, Fontforge will be more or less integrated, but I have successfully used it on OS X and Linux Mint or Ubuntu (on Windows, I believe you will need to install Cygwin first). Once you have Fontforge, you can use its export function by selecting the appropriate menu item. You will probably be able to get all characters from the Type 1 font into the OpenType version.

The reason why this is necessary is that Type 1 fonts in pdftex are typically used with a package that provides metrics and encodings. If no equivalent package has been prepared for XeTeX or LuaTeX, the Type 1 font cannot be directly used, as it does not have the right mappings. By contrast, the libertine package for example provides mappings for the Type 1 version for use with pdftex and separate mappings for the OpenType version for use with XeTeX and LuaTeX.

Furthermore, the inputenc and fontenc packages are not meant for XeTeX, so one may not load them in order to use packaged Type 1 fonts with this engine. In other words, one may not arbitrarily mix packaged Type 1 and user-provided OpenType fonts in XeTeX. With LuaTeX, as I understand it, it is possible to use a modified fontenc to use packaged Type 1 fonts with something that works like the traditional T1 encoding. Lastly, it is important to note that the T1 (Text 1) font encoding and the Type 1 font format are two different things that happen to have confusingly similar names, even though they are often used together in the context of pdftex. Type 1 is Adobe’s font format, while T1 is the so-called Cork encoding that was developed as a standard in the early nineties by the TeX community.

You must log in to answer this question.

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