Re: [XeTeX] fontspec and scaling

2015-01-20 Thread Zdenek Wagner
2015-01-20 3:01 GMT+01:00 Mike Maxwell maxw...@umiacs.umd.edu:
 On 1/17/2015 3:57 PM, Zdenek Wagner wrote:

 2015-01-17 20:39 GMT+01:00 Mike Maxwell maxw...@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
 maxw...@umiacs.umd.edu
 My definition of an interesting universe is
 one that has the capacity to study itself.
 --Stephen Eastmond




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


Re: [XeTeX] fontspec and scaling

2015-01-20 Thread maxwell

On 2015-01-20 04:55, Zdenek Wagner wrote:

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.


This last was my question: will the scaling attribute in Fontspec 
automatically use an optical size (or since scaling will probably not 
result in an exact optical size, will Fontspec scale the closest optical 
size).



...how do I know whether a font supports optical
sizes (and which specific sizes it has)?


fontinfo -z FILENAME


There isn't any 'fontinfo' program on our Linux system, and I couldn't 
find such a program in a websearch.  (There is a Firefox plugin by that 
name, written by Jonathan Kew, but that doesn't seem to be what you're 
referring to.  Also some libraries for Python etc.)  There is however a 
font information dialog box in FontForge.  One of its tabs is Size.  
For the font I'm working with (MvElaafNormal.otf.ttf), the design size 
shows up as 0.0 pts.  I suspect that means there are no optical sizes in 
this font.


But none of the other fonts I looked at with FontForge (including Charis 
SIL and several free Adobe fonts) have anything but 0.0pts in the 
design size.  Maybe it's only very high end fonts that have multiple 
optical sizes?  In which case I've been on a wild goose chase worrying 
about whether Fontspec's scaling function will choose the appropriate 
optical size...


   Mike Maxwell
   University of Maryland


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


Re: [XeTeX] fontspec and scaling

2015-01-20 Thread Zdenek Wagner
2015-01-20 17:50 GMT+01:00 maxwell maxw...@umiacs.umd.edu:
 On 2015-01-20 04:55, Zdenek Wagner wrote:

 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.


 This last was my question: will the scaling attribute in Fontspec
 automatically use an optical size (or since scaling will probably not result
 in an exact optical size, will Fontspec scale the closest optical size).

I hope so but you can always explicitly specify which optical sizes
should be used for which font size.
 ...how do I know whether a font supports optical
 sizes (and which specific sizes it has)?


 fontinfo -z FILENAME

My fault, I wanted to write

otfinfo -z FILENAME

 There isn't any 'fontinfo' program on our Linux system, and I couldn't find
 such a program in a websearch.  (There is a Firefox plugin by that name,
 written by Jonathan Kew, but that doesn't seem to be what you're referring
 to.  Also some libraries for Python etc.)  There is however a font
 information dialog box in FontForge.  One of its tabs is Size.  For the
 font I'm working with (MvElaafNormal.otf.ttf), the design size shows up as
 0.0 pts.  I suspect that means there are no optical sizes in this font.

 But none of the other fonts I looked at with FontForge (including Charis SIL
 and several free Adobe fonts) have anything but 0.0pts in the design size.
 Maybe it's only very high end fonts that have multiple optical sizes?  In
 which case I've been on a wild goose chase worrying about whether Fontspec's
 scaling function will choose the appropriate optical size...

Mike Maxwell
University of Maryland

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


Re: [XeTeX] fontspec and scaling

2015-01-19 Thread Mike Maxwell

On 1/17/2015 3:57 PM, Zdenek Wagner wrote:

2015-01-17 20:39 GMT+01:00 Mike Maxwell maxw...@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?


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.

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


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


Re: [XeTeX] fontspec and scaling

2015-01-17 Thread Zdenek Wagner
2015-01-17 20:39 GMT+01:00 Mike Maxwell maxw...@umiacs.umd.edu:
 On 1/17/2015 9:08 AM, Zdenek Wagner wrote:

 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.


 Thanks for the response.  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.
 --
 Mike Maxwell
 maxw...@umiacs.umd.edu
 My definition of an interesting universe is
 one that has the capacity to study itself.
 --Stephen Eastmond


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



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


Re: [XeTeX] fontspec and scaling

2015-01-17 Thread Mike Maxwell

On 1/17/2015 9:08 AM, Zdenek Wagner wrote:

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.


Thanks for the response.  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?

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


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


Re: [XeTeX] fontspec and scaling

2015-01-17 Thread Zdenek Wagner
2015-01-16 23:19 GMT+01:00 maxwell maxw...@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



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


[XeTeX] fontspec and scaling

2015-01-16 Thread maxwell

I have a question about how scaling is done in fontspec.

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...)


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.


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.)


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?


   Mike Maxwell


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