To see the current value of an option, pass a value of '?' to it, with
or without a '='.
Examples:
$ pyftsubset --glyph-names?
Current setting for 'glyph-names' is: False
$ ./pyftsubset --name-IDs=?
Current setting for 'name-IDs' is: [1, 2]
$ ./pyftsubset --hinting? --no-hinting --hinting?
Current setting for 'hinting' is: True
Current setting for 'hinting' is: False
Fixes https://github.com/behdad/fonttools/issues/142
Otherwise don't add padding. This is against the spec, but "should"
work everywhere. The spec only says offsets "should" be padded:
"""Note that the local offsets should be long-aligned, i.e., multiples
of 4. Offsets which are not long-aligned may seriously degrade
performance of some processors."""
We don't add any padded that we absolutely don't have to. Should save
an average of one byte per glyph on large fonts.
When I added the font.lazy setting, I made glyf table non-lazy
by default. This is helpful to users who typically access glyphs
like:
glyf_table.glyphs[glyfname]
instead of the correct way:
glyf_table[glyfname]
and also forget to call expand() on the glyph. However, this
significantly slows down most scripts that load the font without
lazy=True... As such, add a third mode to laziness. By default
lazy=None and does NOT expand glyphs. If lazy=False is passed
in, all glyphs are loaded.
I hope this is an acceptable middle ground and not too confusing.
But preserve it...
For example, with this font:
https://code.google.com/p/googlefontdirectory/source/browse/ofl/phetsarath/Phetsarath-Regular.ttf
we now get:
...
<GlyphID id="136" name="uni0EDD.am"/>
<GlyphID id="137" name="uni0EB3.right"/>
<GlyphID id="138" name="glyph00138"/>
<GlyphID id="139" name="glyph00139"/>
<GlyphID id="140" name="glyph00140"/>
...
<GlyphID id="161" name="glyph00161"/>
</GlyphOrder>
...
<post>
<formatType value="2.0"/>
<italicAngle value="0.0"/>
<underlinePosition value="-217"/>
<underlineThickness value="150"/>
<isFixedPitch value="0"/>
<minMemType42 value="0"/>
<maxMemType42 value="0"/>
<minMemType1 value="0"/>
<maxMemType1 value="0"/>
<psNames>
<!-- This file uses unique glyph names based on the information
found in the 'post' table. Since these names might not be unique,
we have to invent artificial names in case of clashes. In order to
be able to retain the original information, we need a name to
ps name mapping for those cases where they differ. That's what
you see below.
-->
<psName name="glyph00107" psName=""/>
<psName name="glyph00138" psName=""/>
<psName name="glyph00139" psName=""/>
...
<psName name="glyph00161" psName=""/>
</psNames>
Part of https://github.com/behdad/fonttools/issues/124
This is a followup fix to 85be2e0a9773acec3c6d14c345b1fd94ab3aa5c3
Before this change, if some glyph names had a "#-number" suffix in
the post table, we could generate duplicate glyph names. Fix that,
even though "#" is NOT a valid character in PS glyph names.