[XeTeX] fontspec and scaling

Zdenek Wagner zdenek.wagner at gmail.com
Sat Jan 17 15:08:44 CET 2015


2015-01-16 23:19 GMT+01:00 maxwell <maxwell at umiacs.umd.edu>:
> I have a question about how scaling is done in fontspec.
>
I am not an expert but there is no answer so far. I will add my opinion.

> We produce some multi-script documents (grammars).  It's sometimes the case
> that for the non-Roman script, the glyphs at the normal point size seem (in
> comparison with the Roman script glyphs) small.  For example, we're using a
> Dhivehi (Thaana script) font which at any given point size looks quite a bit
> smaller than the Roman script.  In part, this difference is probably
> compensating for the fact that vowel get stacked above (or occasionally
> below) consonant characters, so the Thaana consonant and vowel glyphs are
> smaller to make the line height similar to what you'd get with a Roman font
> at the same point size.  Regardless, the Thaana is hard to read unless we
> make it somewhat larger; at the same time, I don't want to go to a larger
> Roman point size.  (Frankly, at my age *any* font is hard to read at a
> normal point size.  But I won't go there...)
>
This may happen with many scripts. I wrote an article in Hindi which
contained a few wrods in Czech, Englich, and Russian. If I used the
same size for all fonts, the result looked quite ugly. It was
necessary to scale them in order to make them visually compatible.

> The same thing happens with Arabic, particularly in the Nastaliq style.
>
> In order to enlarge these Thaana glyphs into something readable at a given
> point size, I've used fontspec's "scaling" attribute, e.g.
>    \newfontfamily\thaanafont[Scale=1.4,Script=thaa]{Mv Elaaf Normal}
> Mv Elaaf Normal is an OpenType font.
>
> One effect of this is that for any line where a Thaana word appears, the
> separation between that line and the following line increases.
>
This may be solved by setting \lineskiplimit to zero or even to a
negative value. It is explained in the TeXbook. However, Nastaleeq is
usually very tall, Urdu word مجھے written in Nastaleeq is almost
vertical. I have looked into a textbook of Urdu (Teach Yourself Urdu).
If a paragraph is written in Urdu only, the font is quite large. In
English paragraphs the Nastaleeq font used is smaller in order to fit
the Urdu words without the need of extending the line spacing.

> Apart from this, is there any negative?  I'm not familiar with font
> technology, but I have heard that it's not the best method to simply magnify
> a font to be a larger size; rather, some things in glyphs may change in
> proportion as the glyphs get bigger.  (Or maybe I'm just making that up, I
> can't find a reference to it now.)
>
If you scale the characters, you will not only get bigger characters
but the stems will be thicker. This is the well known problem of small
caps produced by scaling down uppercase letters to 70%. You will have
the same problem in your case. It can only be solved by optical sizes.

Imagine how an Arabic calligrapher works. He uses the same pen no
matter what the character size is, the width of all lines will be the
same. You can achieve the same effect in Metafont if the pen size is
defined as truept independent of the font size. If you generate larger
font, the thickness of the lines will not change. If you enlarge the
font, the lines will become thicker.

> How does Fontspec do scaling?  Do I get the same typographic results by
> using Scale as I would if I simply specified a larger point size?
>
Fontspec does not do any magic. It just provides human friendly
interface to the raw commands. It is somewhere in between the raw
commands and GUI selection. It cannot in principle emulate optical
sizes but it has properties for selecting them if they are available
in the font.

I am afraid it is impssible to give a universal answer.Of course, the
optical font size should be compatible but the thickness of the stems
should be compatible as well. If you have only one Thaana font, you
should find such a Roman font that can be made visually compatible.

>    Mike Maxwell
>
Zdeněk Wagner
http://hroch486.icpf.cas.cz/wagner/
http://icebearsoft.euweb.cz



>
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>  http://tug.org/mailman/listinfo/xetex



More information about the XeTeX mailing list