Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
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 '13 at 21:40
    
So I should just use it as I described it? What type of font is Calligra? –  student May 21 '13 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 '13 at 8:36
add comment

1 Answer

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.