[XeTeX] Using --, ---, ``, '' and ' with CM

J. P. Blevins jpb39 at cam.ac.uk
Wed Jul 21 19:44:13 CEST 2004


FWIW, I had the same problem with these ligatures. I started with a 
document that I had been processing with LaTeX, and introduced OpenType 
text fonts via:

\DeclareFontFamily{U}{AdobeGaramondPro}{}
\DeclareFontShape{U}{AdobeGaramondPro}{m}{n}%
     {<-> "Adobe\space Garamond\space Pro:+onum"}{}

...

\renewcommand*{\encodingdefault}{U}
\renewcommand*{\rmdefault}{AdobeGaramondPro}

(Oddly, these declarations only work consistently in the preamble; when 
they are loaded via a style file the entire document sometimes defaults to 
CM Roman).

When these fonts are loaded, the CM math fonts are unaffected. But the text 
font declarations seem to disable text dashes, quotes, accents (which place 
umlauts far above vowels), etc.

A simple solution for dashes is to assign a unicode glyph to the verbose 
command names, like:

\def\textemdash{—}

Using the ifthen package, once can introduce a block of these 
redefinitions, along with the various accent redefinitions posted by 
Steffen Prohaska, and have them evaluated only when:

\newcommand{\opentype}{true} 

The quotation marks all have command names too, and can accommodated in the 
same way, but the resulting portability comes at the cost of making the 
source text much more verbose and command-laden.

-Jim

P.S. Loading \usepackage[utf8]{inputenc} in LaTeX defines 
\DeclareUnicodeCharacter, which could also be useful for XeTeX 
conditionalization, but I have not managed to get this to work in XeTeX 
yet.


On Jul 21 2004, Jonathan Kew wrote:

> On 20 Jul 2004, at 11:37 pm, Atip Asvanund wrote:
> 
> > There are times when I would like to use Computer Modern along with OTF
> > fonts. Since, the preferred method for entering these punctuations is 
> > via
> > Unicode, they only work with the fonts that XeTeX loads in. However, I
> > cannot get those punctuations to show up in Computer Modern at all,
> > whether I enter them them using unicode or with the --, ---, ``, '' 
> > and '.
> 
> I don't understand why this would be a problem; the CM fonts should 
> work just like in any standard TeX. Are any warning messages shown in 
> the console window when you run XeTeX? Do the CM fonts work fine for 
> the rest of the text? How are you specifying the fonts in your 
> document?
> 
> It should work to do something like this, for example (in Plain TeX):
> 
> 	\font\cm=cmr10 \cm
> 	This is ``Computer Modern Roman''---using TeX legacy conventions.
> 
> 	\font\lg="Lucida Grande" at 10pt \lg
> 	This is “Lucida Grande”—using Unicode characters directly.
> 
> 	\bye
> 
> Both fonts appear fine when I run this. What happens for you?
> 
> Jonathan
> 
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
> 



More information about the XeTeX mailing list