[XeTeX] fontspec and scaling

Zdenek Wagner zdenek.wagner at gmail.com
Tue Jan 20 10:55:24 CET 2015

2015-01-20 3:01 GMT+01:00 Mike Maxwell <maxwell at umiacs.umd.edu>:
> On 1/17/2015 3:57 PM, Zdenek Wagner wrote:
>> 2015-01-17 20:39 GMT+01:00 Mike Maxwell <maxwell at umiacs.umd.edu>:
>>> ...I guess my question is: _If_ a font provides
>>> optical sizes, then presumably telling Fontspec which point size to use
>>> causes it to choose the optical size provided in the font (assuming one
>>> exists for the requested point size).  If this is correct, then to
>>> re-phrase
>>> my original question: If instead of specifying a point size for a
>>> particular
>>> font/stretch of text, I tell Fontspec to use scaling, then does it choose
>>> the closest optical point size provided in the font (and maybe
>>> magnify/demagnify it slightly if the scaling doesn't result in an exact
>>> optical point size)?  Or does Fontspec instead magnify/demagnify the
>>> glyphs
>>> from the document's default point size?
>> See section 7.6 (page 21) of the fontspec manual, it is explained there.
> I read that, but it doesn't refer to the 'scaling' attribute (it does use
> \scalebox in example 16, but I presume that's different).  Maybe the fact
> that it doesn't mention scaling is my clue; scaling simply resizes whatever
> optical size is already chosen?
Maybe the example is not clearly explained. \Huge sets the size to
24pt and it is then scaled by 0.4, thus the resulting size is
approximately 10pt. If there were no optical sizes, both line will be
the same. However, due to automatically selected optical size the
lower line is narrower with thinner stems.

If I understand the scaling attribute correctly, let say, you have
scaling=1.4 and you request \normalsize which id 10pt. Fontspec will
multiply it and request 14pt font size instead. If there is an optical
size available, it will be used.

> If that's correct, then I should be using the 'OpticalSize' attribute
> instead of 'scaling'.  But how do I know whether a font supports optical
> sizes (and which specific sizes it has)?  Are such sizes embedded within a
> single font file, or do TTF fonts that support this have separate files for
> specific sizes?  There's nothing obvious in the output of fc-list -v.

fontinfo -z FILENAME

> --
>         Mike Maxwell
>         maxwell at umiacs.umd.edu
>         "My definition of an interesting universe is
>         one that has the capacity to study itself."
>         --Stephen Eastmond

Zdeněk Wagner

More information about the XeTeX mailing list