[texhax] Combining fontspec, fontsize, fontstretch

Peter Davis pfd at pfdstudio.com
Mon Dec 20 15:40:41 CET 2010


On Mon, Dec 20, 2010 at 5:41 AM, Ulrike Fischer <news3 at nililand.de> wrote:

> Am Sun, 19 Dec 2010 10:52:51 -0500 schrieb Peter Davis:
>
> > I'm trying to use XeLaTeX with the fontspec and setspace packages.
>  However,
> > using \setstretch seems to override the previously specified \fontsize.
>  So,
> > for example
> >
> > \fontsize{20}{20}
> > \selectfont
> > \setstretch{1.2}
> > \fontspec{Lucida Sans Unicode}
> >
> > I would expect to produce 20 point Lucida Sans on 24 point leading, but
> I'm
> > *not* getting 20 pt text.  Is there some magical order in which I have to
> > specify these? Thanks!
>
> \setstretch calls \normalsize. So move it before your \fontsize
> command.
>


That fixes the size of the text, but I'm not getting the stretch.  The
example below outputs the same paragraph twice, once with default spacing,
and once with \setstretch{1.6}.  They look identical to me.

Thanks,

\documentclass[letterpaper]{article}
\usepackage[landscape]{geometry}
\usepackage{fontspec}
\usepackage{setspace}
\setlength{\parindent}{0pt}
\pagestyle{empty}
\setlength{\topmargin}{36.000000bp}
\setlength{\oddsidemargin}{36.000000bp}
\begin{document}

\setlength{\topmargin}{36.000000bp}
\setlength{\oddsidemargin}{36.000000bp}
\raggedright

{\par \fontsize{14.000000}{14.000000}
  \selectfont

  \fontspec{Lucida Sans Unicode}

  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ullamcorper
  rutrum malesuada. Pellentesque habitant morbi tristique senectus et netus
et
  malesuada fames ac turpis egestas. Fusce at aliquet erat. Mauris porta
cursus
  pretium. Pellentesque non odio lectus.
}

\vspace{14pt}

{\par \setstretch{1.6} \fontsize{14.000000}{14.000000}
  \selectfont

  \fontspec{Lucida Sans Unicode}

  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ullamcorper
  rutrum malesuada. Pellentesque habitant morbi tristique senectus et netus
et
  malesuada fames ac turpis egestas. Fusce at aliquet erat. Mauris porta
cursus
  pretium. Pellentesque non odio lectus.
}

\end{document}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20101220/193258dd/attachment.html>


More information about the texhax mailing list