[XeTeX] Newbie Question: Accessing Glyph

Michiel Kamermans pomax at nihongoresources.com
Mon Sep 13 16:15:44 CEST 2010


Hi Marc,

> I'm trying to use an opentype "Adobe Garamond Premier Pro"
> and it works mostly fine, except that there are some problems:
>   o I'd like to know how to access certain glyphs in the font files. For example, the euro symbol, the long es, and ornamental symbols.
>    

When switching from LaTeX to XeLaTeX, the first thing to realise is that 
in XeLaTeX, you write your text in unicode, relying on the unicode way 
of representing characters and character sequences. As such, the best 
choice is to not "access glyphs" but to just put them directly in your 
document: just use €, ſ, etc.

If you absolutely must access them through artificial means, you can use 
\char:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Code2000}
\begin{document}
% "latin small letter long S"
\char"017F
\end{document}

but you shouldn't have to resort to this.

>   o I've noticed that certain diacritics don't work such as tie-after accent (\t{oo}) and bar-under accent (\b{o}). I'd appreciate it if somebody could provide some pointers which explain how to define proper commands for individual glyphs and how to fix the diacritics.
>    
Diacritics are handled by the unicode-ness, too. You just type the text 
that you want, relying on the unicode sequencing in your text editor to 
get things right, and then you run xelatex with your file. You should 
emphatically NOT use any of the LaTeX commands for adding diacritics.

> As a related issue (I don't know what's in the font files), I'd appreciate it if somebody could recommend a nice unix tool that allows me to view the font tables? (I've googled
> around a bit but I failed to find anything nice.)
>    

Install Fontforge (should be in every major *nix's package list), use it 
to open the desired font, and proceed to examine the hell out of it =)

- Mike "Pomax" Kamermans
nihongoresources.com



More information about the XeTeX mailing list