[XeTeX] no hyphenation with fontspec

Jonathan Kew jonathan_kew at sil.org
Thu Dec 21 17:38:58 CET 2006


On 21 Dec 2006, at 4:24 pm, Pablo Rodríguez wrote:

> I wanted to show
>  a missing hyphenation on a document of mine, such as:
>
> \documentclass[a4paper,12pt,draft]{article}
> \usepackage[english,italian,french]{babel}
> \usepackage{fontspec}
> \setromanfont{Junicode}
> \usepackage[french]{babel}
> \setlength{\parindent}{2.25em}
>
> \begin{document}
>
> \selectlanguage{english}\textsc{K.-O. Apel}, \emph{Regulative Ideas or
> Truth-Happening?: An Attempt to Answer the Question of the  
> Conditions of
> the Possibility of a Valid Understanding}, en \textsc{L.E. Hahn}  
> (ed.),
> \emph{The Philosophy of Hans-Georg Gadamer}, (The Library of Living
> Philosophers XXIV), Open Court, Chicago - La Salle~1997, pp.~67-94.
>
> \selectlanguage{french}\textsc{P. Aubenque}, \emph{Herméneutique et
> ontologie. Remarques sur le Perí Hermenías d’Aristote}, en \textsc 
> {M.A.
> Sinaceur} (ed.) \emph{Penser avec Aristote}, Erès, Tolouse~1991,  
> pp.~93-105.
>
> \selectlanguage{italian}\textsc{F. Aronadio}, \emph{Il Cratilo, il
> linguaggio e la sintassi dell’eidos}, “Elenchos” 8 (1987) 329-362.
> \end{document}
>
> For some strange reason, d’Aristote is not hyphenated. Increasing
> \parindent only moves the whole word to the next line.
>
> I guess this is a bug. Isn't it?

Ah, I see. Sorry, I misunderstood your question!

No, it's not really a bug; or at least, not a xe(la)tex bug. It's a  
shortcoming of the French patterns and/or Babel setup, in relation to  
Unicode (which of course they weren't designed for).

If you change "d’Aristote" to "d'Aristote" (look carefully: I've  
replaced your curly apostrophe U+2019 with a straight ASCII one U 
+0027), then you'll find that a hyphen position is found. The reason  
is that the patterns are written for legacy TeX-encoded text, using  
the ASCII apostrophe, and there is no similar pattern with U+2019.

I suppose we could look at patching the French patterns to deal with  
this, but I'm trying to avoid maintaining separate pattern files for  
xetex; I'd rather see the "master" pattern files extended and  
organized better.

As a workaround, you can add a line in your preamble:

   \lccode`\’=`\'

or if you want to make it more explicit:

   \lccode"2019="27

This will cause the curly apostrophe to be treated the same as the  
straight ASCII one for the purposes of hyphenation, so xetex will  
find the expected break. (Provided you don't use something else that  
overrides this code.)

HTH,

JK



More information about the XeTeX mailing list