[XeTeX] From LaTeX to XeLaTeX

Charles de Miramon cmiramon at kde-france.org
Fri Feb 1 14:09:03 CET 2008


Manuel Pégourié-Gonnard wrote:

> Well, I used the following sample file. If you comment out the
> \frenchbsetup line, you can see the line breaking isn't correct. If you
> keep the \frenchbsetup line, or if you replace « français » with
> «~français~» or \og français\fg{}, the line are correctly broken.

Yes. Indeed, it was my problem. I was using MinionPro distributed with
Acrobat Reader which has very bad kerning pairs for the quote and tried to
hack a little space after the quote like that :

% test file:
\XeTeXdefaultencoding utf-8
\documentclass{article}
\usepackage{fontspec}
 \usepackage{xunicode}
\usepackage{xltxtra}
\usepackage[french, myspacing]{babel}
\frenchbsetup{og=«, fg=»}
\defaultfontfeatures{Scale=MatchLowercase}
\setromanfont [Mapping = tex-text, Ligatures=Common, Numbers=OldStyle,
BoldFont = MinionPro-Bold,
ItalicFont = MinionPro-It,
Kerning = Uppercase]
{MinionPro-Regular}
\Myspacingtrue
\begin{document}
\begin{minipage}{5.2cm}
  On voit ici que les guillemets « français » saisis au clavier sans
  espace insécable à l'intérieur sont bien « gérés » par frenchb2.
\end{minipage}

\end{document}
% end test file

%myspacing.ldf
\LdfInit{myspacing} \captionsmyspacing
\ifx\l at myspacing\@undefined
    \@nopatterns{Localspacing}
    \adddialect\l at myspacing0\fi
\addto\captionsmyspacing{}
\def\datemyspacing{}
\newif\ifMyspacing \Myspacingtrue
\initiate at active@char{'}
\addto\extrasmyspacing{\languageshorthands{myspacing}}
\addto\extrasmyspacing{%
  \bbl at activate{'}}
\addto\noextrasmyspacing{%
 \bbl at deactivate{'}}
\declare at shorthand{myspacing}{'}{%
    \ifMyspacing
    \kern0.03em\string'\kern0.03em
    \else\string'%
    \fi
}
\ldf at finish{myspacing}
%End myspacing.ldf

The problem is the loading order of myspacing and frenchb. If you intervert
them it works.
Is there a better way to modify kerning pairs ?

Cheers,
Charles
-- 
http://www.kde-france.org



More information about the XeTeX mailing list