154 Commits

Author SHA1 Message Date
Behdad Esfahbod
175c54a9d1 [subset] allow for unicode-based name with suffixes in the subset list
Fixes https://github.com/behdad/fonttools/issues/133

That part of the code is becoming really messy, but I want to get
all the features in first, then clean up.
2014-08-13 18:29:11 -04:00
Behdad Esfahbod
4b0facbc68 [subset] Minor 2014-08-13 18:10:42 -04:00
Behdad Esfahbod
40198c9b4d [subset] Accept separate on whitespace as well as comma
For all options, including the newly added --glyphs.
2014-08-13 18:08:16 -04:00
Behdad Esfahbod
315329845f [subset] Add --glyphs 2014-08-13 18:06:31 -04:00
Behdad Esfahbod
f290394747 [subset] Rename --glyph-file to --glyphs-file 2014-08-13 17:48:46 -04:00
Behdad Esfahbod
015908415a [subset] Add --output-file
As requested many many times:

Fixes https://github.com/behdad/fonttools/pull/79
Fixes https://github.com/behdad/fonttools/pull/15
Fixes https://github.com/behdad/fonttools/issues/44
2014-08-13 17:35:23 -04:00
Behdad Esfahbod
8e51079212 [subset] Minor 2014-08-13 17:32:33 -04:00
Behdad Esfahbod
eac1ee5373 [subset] Add --glyph-file
It only accepts PS glyph names, not gidNNN, U+XXXX, etc, as per
discussion here: https://github.com/behdad/fonttools/issues/113

Requested many times:
https://github.com/behdad/fonttools/pull/15
https://github.com/behdad/fonttools/pull/79
2014-08-13 17:32:33 -04:00
Behdad Esfahbod
3b34ea301a [subset] Add --text-file 2014-08-13 16:55:47 -04:00
Behdad Esfahbod
1633d8e917 [subset] Allow pyftsubset --layout-features? etc
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
2014-08-13 16:33:57 -04:00
Behdad Esfahbod
1e7cb631a8 [subset] Err if options are not provided for list values 2014-08-13 16:20:06 -04:00
Behdad Esfahbod
bce7ef7ede [subset] Add looooooooonger usage
Based on text from Adam Twardoch.

Fixes https://github.com/behdad/fonttools/pull/15
2014-08-13 16:06:49 -04:00
Behdad Esfahbod
3c4b5e0a09 [subset] Work around OTS bug with FDSelect format 0
a049b98c88
https://github.com/khaledhosny/ots/pull/31

Fixes https://github.com/behdad/fonttools/issues/138
2014-07-23 00:04:32 -04:00
Behdad Esfahbod
88d4decc5f [subset] Handle None ChainContext
Fixes https://github.com/behdad/fonttools/issues/134
2014-07-02 17:09:22 -04:00
Behdad Esfahbod
dff3346ead [subset] Handle case of None ChainContext class with non-zero chain
It would be a font bug, but handle regardless.
2014-07-02 17:09:18 -04:00
Behdad Esfahbod
56a9c4cb42 [subset] Fix order of chain for consistency
I'm confident I haven't broken anything.
2014-07-02 16:57:26 -04:00
Behdad Esfahbod
ade1972557 Remove CFF Index.count member
Clean up.  len(index) should be used instead.
2014-06-16 15:35:15 -04:00
Behdad Esfahbod
149a6700a1 [subset] Minor 2014-06-16 15:33:53 -04:00
Behdad Esfahbod
cf2f85e4e2 [subset] Add TODO 2014-06-05 20:39:38 -04:00
Behdad Esfahbod
d15afe9231 [subset] Fix pruning of empty rulesets in (Chain)ContextFormat1
Similar to 98b60757ab9bb0aaa3c1f136e5a837a1b73d22ed and the
recent commits for Format2.
2014-06-05 20:19:38 -04:00
Behdad Esfahbod
a7cd151e14 [subset] Actually prune empty subrulesets in (Chain)ContextFormat2 2014-06-05 18:28:21 -04:00
Behdad Esfahbod
26cb08062d [subset] More fixing of (Chain)ContextFormat2
This is follow up to 98b60757ab9bb0aaa3c1f136e5a837a1b73d22ed
Looks like this lookup type is a curse to stay with us.  Sigh...
2014-06-05 18:24:53 -04:00
Behdad Esfahbod
3e19354bf5 [subset] Unbreak after e898881ed12d7ce96948f2905d725847c76bc9e8 2014-05-13 21:08:51 -04:00
Behdad Esfahbod
11631b4917 [subset] Fix PairPos subsetting
Ouch!

Fixes https://github.com/behdad/fonttools/pull/118
2014-05-13 14:31:42 -04:00
Behdad Esfahbod
e898881ed1 [subset] Implement format14 variation selectors 2014-05-09 17:48:02 -04:00
Behdad Esfahbod
f09164a0de [subset] Don't recalculate "modified" timestamp
To recalculate (which was the default before), use --recalc-timestamp

Fixes https://github.com/behdad/fonttools/issues/115
2014-05-01 15:16:14 -07:00
Behdad Esfahbod
11580c55bb Minor 2014-03-13 17:34:35 -07:00
Behdad Esfahbod
9f6ccad666 [subset] Correctly handle subsetting non-Unicode cmap subtables 2014-03-12 12:35:35 -07:00
Behdad Esfahbod
a08b1b1d20 [subset] Use NameRecord.isUnicode() 2014-03-12 12:33:40 -07:00
Behdad Esfahbod
2007a491e3 [subset] Use CmapSubtable.isUnicode()/isSymbol()
Fixes https://github.com/behdad/fonttools/issues/111
2014-03-12 12:27:11 -07:00
Behdad Esfahbod
1ae29591ef from __future__ import absolute_import
Such that our Python 2 is closer to Python 3.

Part of https://github.com/behdad/fonttools/issues/77
2014-01-14 15:07:50 +08:00
Behdad Esfahbod
fc1d0525b6 Merge branch 'merge' 2013-12-18 17:09:45 -05:00
Behdad Esfahbod
45ed572e31 [subset] Fix up from recent changes 2013-12-17 06:01:08 -05:00
Behdad Esfahbod
0be386edb5 [subset] Fix subsetting of Khmer fonts
Read comment.
2013-12-16 20:52:52 -05:00
Behdad Esfahbod
283fb26820 By default, don't load fonts lazily
Lazy loading has implications on how people use objects.
So, by default, don't load lazily.  This only affects
GSUB/GDEF/GPOS/etc and is closer to what fonttools used
to do traditionally.

Turn lazy loading on in subset and inspect.
2013-12-16 00:52:29 -05:00
Behdad Esfahbod
6c51f500fb [subset] Make sure objects are decompiled during subsetting
We need to ensureDecompiled() whenever an object is modified
before we look up any member of it.

Note that normally objects remaining decompiled until we try
to write them out is fine, except for when they depend on
font.getGlyphOrder().  This however, shouldn't normally happen
since if there's an object depending on the glyph list (eg. a
Coverage table), it should already have been process to subset
it according to the requested glyphs.  Or that's the idea at
least.  The few cases that were not handled are handled
explicitly now.

This was showing a bug when subsetting Cabin for example.
2013-12-15 23:15:15 -05:00
Behdad Esfahbod
fa95e87d42 [subset] Add more TODO items 2013-12-15 22:02:20 -05:00
Behdad Esfahbod
92af6a58b3 [subset] Work around OTS being stupid 2013-12-10 17:51:32 -05:00
Behdad Esfahbod
5fd8779fd3 [subset] Oops. Remove debug prints 2013-12-10 14:48:34 -05:00
Behdad Esfahbod
10a3fff5cb [subset] Fixup --recommended-glyphs 2013-12-08 15:22:32 -05:00
Behdad Esfahbod
c745f69d8a [subset] Remove unnecessary workaround 2013-12-07 16:06:14 -05:00
Behdad Esfahbod
3db5e11c1f [subset] Remove redundant language systems
After subsetting, remove language systems that are effectively
the same as the default language system.
2013-12-07 12:54:44 -05:00
Behdad Esfahbod
ec9436d7f6 [subset] Remove unreferenced features 2013-12-06 21:58:41 -05:00
Behdad Esfahbod
9d2481bedf [subset] Comments 2013-12-06 21:42:36 -05:00
Behdad Esfahbod
baa97d6f17 [subset] Minor 2013-12-06 21:12:05 -05:00
Behdad Esfahbod
05a2862a39 [subset] Ignore out-of-range glyphIDs
We don't want to support out-of-range glyphIDs in cmap or GSUB.
Explicitly drop them.
2013-12-04 23:07:55 -05:00
Behdad Esfahbod
ebcad976c8 [subset] Minor 2013-12-04 23:00:52 -05:00
Behdad Esfahbod
57fb7264a0 [subset] Minor 2013-12-04 21:56:53 -05:00
Behdad Esfahbod
6bd43247f2 [subset] Add allowVID option to load_font()
Not enabled right now.
2013-12-04 21:34:05 -05:00
Behdad Esfahbod
dc87372c88 Use True/False instead of 1/0 2013-12-04 21:28:50 -05:00