LaTeX: selecting font with fontenc package

  • LaTeX
  • Thread starter AlephZero
  • Start date
  • Tags
    Font Latex
In summary, the conversation discusses the use of the Adobe Utopia font in XeTeX on Windows, with the use of the fontenc package. However, due to the font being in Postscript Type 1 format, it cannot be used with the fontenc package. Suggestions for alternative fonts are mentioned, but it is noted that converting Type 1 fonts to TrueType accurately is difficult.
  • #1
AlephZero
Science Advisor
Homework Helper
6,982
298
Running XeTeX from TexLive 2011 on windows, I have been using
Code:
\usepackage{fourier}
To get the Adobe Utopia font. That works fine.

For reasons irrelevant to the question, I want to use the fontenc package to select fonts. So I need to do something like
Code:
\usepackage{fontenc}
\setmainfont{ ... what goes here? }
Utopia, utopia, and Utopia-Regular don't work (lots of errors, TeX tries to build the fonts using textmf, and fails).

Searching for file names containing utopia and Fourier didn't help.

The fontenc package documentation doesn't help either - it makes the assumption that if you want to use a font, you know what it's called. WRONG!

Any suggestions?

FWIW the fontenc package itself is working - a demo file using a different font (Junicode) works fine.
 
Physics news on Phys.org
  • #2
I think I've answered my own question. The version of the Adobe Utopia font that is free with TeX distributions in in Postscript Type 1 format. The font handling in XeTeX and the fontenc package is meant for TrueType or OpenType fonts.

Adobe do a TrueType version of Utopia, but it's not free.

And unfortunately, converting Type 1 fonts to TrueType accurately is hard, unlike the reverse conversion.

That doesn't solve the problem, but at least it explains it.
 

1. What is the purpose of the fontenc package in LaTeX?

The fontenc package allows users to specify the font encoding for their document. This is important because different fonts have different encodings, and if the encoding is not specified, it can lead to errors or incorrect display of characters.

2. How do I select a font with the fontenc package in LaTeX?

To select a font with the fontenc package, you can use the \usepackage{fontenc} command in the preamble of your document. Then, you can use the \fontencoding{} command to specify the font encoding you want to use.

3. Can I use any font with the fontenc package in LaTeX?

No, the fontenc package only works with fonts that are compatible with the selected font encoding. It is recommended to use fonts that are specifically designed for use with LaTeX, such as Computer Modern, Times New Roman, or Arial.

4. How do I know which font encoding to use?

The font encoding you should use depends on the language and characters you will be using in your document. For example, T1 encoding is commonly used for European languages, while UTF-8 encoding is recommended for documents with a mix of different languages.

5. Can I change the font encoding in the middle of my document?

No, the font encoding should be specified in the preamble of your document. Changing the encoding in the middle of the document can cause errors or inconsistent display of characters.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
11K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
16
Views
28K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
11K
  • Computing and Technology
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
11K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
Back
Top