[XeTeX] XeTeX, fontspec, OTF, and fontdimens

mskala at ansuz.sooke.bc.ca mskala at ansuz.sooke.bc.ca
Tue Feb 22 17:57:12 CET 2011


On Sun, 20 Feb 2011, Ulrike Fischer wrote:
> >From the other posting I gathered that you use \raggedright anyway.
> Does the stretchability has actually any effect?

I thought I'd replied to this, but then found my intended reply in my
"unsent drafts" folder, and it doesn't seem to be in the list archives, so
although belated, I'll post it for future reference:

I'm not certain that stretchability really has an effect when ragged-right
is turned on, but shrinkability does.  Here's code that demonstrates it:

\documentclass[12pt]{article}

\usepackage{fontspec}

\begin{document}

\ttfamily\noindent\raggedright
a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f

a b c d e f g h i j k l m n o p q r s t u v w x y z a velocipede
\end{document}

With fontspec, the spaces are shrinkable, and the second paragraph, which
doesn't quite fit on a line, gets squashed to fit, spoiling the vertical
alignment.  Without fontspec, the word "velocipede" is placed on a new
line by itself - which would be a bad linebreak with a proportional font,
but is the correct behaviour with a monospace font.  WordSpace could be
used to make the spaces non-shrinkable, but as we've heard, that has other
issues.
-- 
Matthew Skala
mskala at ansuz.sooke.bc.ca                 People before principles.
http://ansuz.sooke.bc.ca/


More information about the XeTeX mailing list