1672 Commits

Author SHA1 Message Date
Behdad Esfahbod
59b702c5ca [subset] Add test for subset.Options
Currently fails.
https://github.com/behdad/fonttools/issues/413
2015-12-07 11:13:44 +01:00
moyogo
c01b956ae7 [feaLib] make Device Table from device tuples 2015-12-05 08:56:46 +00:00
moyogo
38b335e131 feaLib: misnamed function in builder_test.py 2015-12-04 16:56:58 +00:00
Sascha Brawer
5644da31d2 [feaLib] Parse device tables 2015-12-04 17:10:20 +01:00
Sascha Brawer
46c76dbf1f [feaLib] Parse ValueRecord format C
However, not sure how to build the otTables object graph for emitting
GPOS tables with device values; the current code thus silently strips
off any device values. Left a TODO comment for implementing this.
2015-12-04 15:49:04 +01:00
Sascha Brawer
b99f1c9af4 [feaLib] Implement GPOS type 1, Single Adjustment Positioning 2015-12-04 12:22:01 +01:00
Sascha Brawer
f45fab8c3a [feaLib] Sort GSUB glyph coverage tables by glyph ID
Before this change, feaLib would sort coverage tables by glyph name,
which is against the OpenType specification.  The current unittests
happen to use only glyphs where the ordering is identical whether
sorting by name or by ID; but I am about to add unittests (for GPOS)
where the ordering is different.

The ordering cannot be enforced by otTables because otTables does
not have access to the font's glyph order; therefore, the sorting
needs to happen inside feaLib.
2015-12-04 11:11:17 +01:00
Sascha Brawer
cab0067c7e [feaLib] Implement GSUB LookupType 8: Reverse chaining single substitutions 2015-12-03 13:05:42 +01:00
Khaled Hosny
301d2db812 [subset] Support subsetting MS color tables
Add support for subsetting COLR table.

The CPAL table does not need subsetting, but unused palettes should be
pruned, this is not implemented however as it depends on COLR table,
which in turn will not be updated after pruning CPAL.
2015-12-01 11:59:52 +04:00
Sascha Brawer
152dff4361 [feaLib] Implement GSUB chain substitution rules 2015-11-30 15:02:09 +01:00
Cosimo Lupo
2eda1785f6 [py23] fix ImportError when trying to import unichr, basestring or unicode when already defined
When one does `from fontTools.misc.py23 import *`, everything seems to work fine.

However, linters will complain when one uses the asterisk to import all names from a module, since they can't detect when names are left undefined -- asterisks are greedy and will eat all names.

If one avoids the asterik and attempts to import explicitly, like in `from fontTools.misc.py23 import basestring`, the problem then is that, if `py23` does not re-define the name -- e.g. under python2 `basestring` or `unicode` are built-ins -- then the import statement raises `ImportError`.

The same happens for the `unichr` function on a "wide" Python 2 build (in which `sys.maxunicode == 0x10FFFF`).

Now, to work around this, we need to re-assign those built-ins to their very same names. This may look silly, but at least it works.
2015-11-23 12:02:12 +00:00
Behdad Esfahbod
505c1a5ea7 Fixup previous change
ecbe8f2c37 (commitcomment-14464749)
2015-11-18 00:08:49 -08:00
Behdad Esfahbod
ecbe8f2c37 Fix decompile of Neirizi 2015-11-17 23:24:03 -08:00
Behdad Esfahbod
5d41ad985e Merge pull request #411 from miguelsousa/subset_unittest
[subset] unittest & .notdef advance width fix
2015-11-16 19:00:18 -08:00
Miguel Sousa
6db7d30ed9 [subset] Preserve the .notdef glyph width when removing its outlines 2015-11-13 17:43:22 -08:00
Miguel Sousa
270b155d45 [subset] First unit tests and test data 2015-11-13 17:40:17 -08:00
Miguel Sousa
51bd7e00b5 white space 2015-11-13 17:36:13 -08:00
Miguel Sousa
29d7edf76f [subset] mv subset.py subset/__init__.py 2015-11-13 17:36:02 -08:00
Cosimo Lupo
8019069f7c [sfnt] make SFNTReader.tables an OrderedDict sorted by table offset
Fixes https://github.com/behdad/fonttools/issues/408
2015-11-13 17:38:50 +00:00
Cosimo Lupo
f10cb1f17d [macCreatorType] fix KeyError raised by old version of xattr module
in version 0.6.4 (installed on OS X 10.10 python lib/extras) it raises
KeyError, whereas in the latest version available fom PyPI (v0.7.8) it
raises IOError.

Fixes issue in https://github.com/googlei18n/nototools/issues/113
2015-11-11 00:01:50 +00:00
Cosimo Lupo
49d929681e [_p_o_s_t] remove max indices "reserved for future use"
the third (2015) edition of ISO/IEC 14496-22 "Open Font Format" increased
the limit from 32767 to 65535 (and thus eliminated the reserved numbers).

`array.array` will take care of raising the right `OverflowError` exception
so we don't need any further checking.
2015-11-10 00:11:28 +00:00
Cosimo Lupo
491b1ebfb0 Merge pull request #401 from jamesgk/pen-tests
TTGlyphPen tests
2015-11-06 21:00:40 +00:00
James Godfrey-Kittle
45e496fdb8 [TTGlyphPen] Use bytes for array.array for python3 2015-11-06 11:50:39 -08:00
James Godfrey-Kittle
981ad5978c Add endPath method to TransformPen
I think this was just forgotten before.
2015-11-06 11:25:48 -08:00
James Godfrey-Kittle
9ff7d62454 [TTGlyphPen] Do special case ignoring anchors
This fixes the ignoring anchors test, which led me to believe we
didn't need to special case them (which we do, and now are).
2015-11-05 15:28:19 -08:00
James Godfrey-Kittle
6dc5092e2b [TTGlyphPen] Move some code around
No effective differences, just lingering un-committed local changes.
2015-11-05 15:19:53 -08:00
James Godfrey-Kittle
ec2daf00e4 [TTGlyphPen] Add unit tests
These test some pen methods which can't be tested via TTFont objects.
The other option seemed to be using UFOs, but this is simpler.
2015-11-05 15:18:32 -08:00
James Godfrey-Kittle
1bff12f311 [TTGlyphPen] Don't explicitly relcalc glyph bounds
There's no need to do this explicitly; it happens during the calls to
compile().
2015-11-05 15:13:43 -08:00
James Godfrey-Kittle
0b3b83f765 [TTGlyphPen] Don't special case ignoring anchors
There's no need to special case this, it happens anyways.
2015-11-05 15:12:18 -08:00
Behdad Esfahbod
db9b537635 [subset] Add 'stch' feature, used in Syriac spec 2015-11-05 14:32:18 -08:00
James Godfrey-Kittle
f5b9ec0186 [TTGlyphPen] Add a new e2e test 2015-11-05 14:11:51 -08:00
James Godfrey-Kittle
b511b2b0d8 [TTGlyphPen] Go back to using AbstractPen
Using BasePen breaks on quadratic splines, since there's no way to
know if a on-curve point was added by the pen or in the original
glyph. Should have considered this before....
2015-11-05 13:57:53 -08:00
James Godfrey-Kittle
7767683ea4 [TTGlyphPen] Abstract out a _popPoint method 2015-11-05 13:57:06 -08:00
James Godfrey-Kittle
9f5c51897c [TTGlyphPen] Move checks for closed contours
We probably don't want to raise errors in init, which allows a drawer
to reset the pen state.
2015-11-05 13:54:51 -08:00
James Godfrey-Kittle
943d258bdb [TTGlyphPen] Add a test using existing test data 2015-11-04 18:01:34 -08:00
James Godfrey-Kittle
fa82fcd213 [TTGlyphPen] Make components with correct defaults
This seems consistent with what one sees opening up an existing TTF.
2015-11-04 17:59:57 -08:00
James Godfrey-Kittle
8c61d08d94 [TTGlyphPen] Remove last point in closed contours
When a pen adds the first point to a contour at the end to close it,
we should remove it for the TrueType outline.
2015-11-04 17:58:27 -08:00
James Godfrey-Kittle
1c73a1942a Don't use lineTo in moveTo
It shouldn't make a difference, but semantically this is now correct.
2015-11-04 17:21:17 -08:00
James Godfrey-Kittle
b83ed7ab2b Allow a TTGlyph pen to be used more than once 2015-11-04 17:19:58 -08:00
James Godfrey-Kittle
58dd55c0ae Use BasePen instead of AbstractPen in TTGlyphPen 2015-11-04 17:18:03 -08:00
Cosimo Lupo
d2e3505708 Merge pull request #396 from jamesgk/new-pen
Add pen which draws to Type 2 charstrings
2015-10-30 19:08:47 +00:00
James Godfrey-Kittle
5d7f3a9a1f Fix author name typo 2015-10-30 10:32:04 -07:00
Sascha Brawer
37a79a330c [feaLib] Fix generated LigatureSubst lookups 2015-10-27 22:53:50 +01:00
Behdad Esfahbod
d6e186d40f Simplify AlternateSubst slightly 2015-10-27 14:11:04 -07:00
Sascha Brawer
3f5e2ae820 [feaLib] Add expected output for chain substitution rules
Generated by running example 1 from the Feature File specification
section 5.f.i (Specifying a Chain Sub rule and marking sub-runs)
through AFDKO's makeotf tool, and then decompiling the resulting
GSUB table with ttx.

The actual test is commented out because the current version of feaLib
is not able to produce this output yet; marked with a TODO comment.
2015-10-27 20:36:56 +01:00
Sascha Brawer
dbefc71d23 [feaLib] Minor: Rename a test file, for consistency with other test caes
It is example 1 in section 5.f.i of the specification, and there
more examples in the same section. For consistency, use the same convention
as the other test cases.
2015-10-27 19:59:25 +01:00
Cosimo Lupo
f8e8ea6e7f [macRes] use tostr(s, encoding='mac-roman') for resource types and names 2015-10-26 14:38:20 +00:00
Cosimo Lupo
c4e05b48b3 [t1Lib_test] forgot to add unittest.main()
I use py.test ;)
2015-10-26 05:23:59 +00:00
Cosimo Lupo
2f212ac59a [macRes] add default value [] to self.get(resType)
ops!
2015-10-26 05:16:22 +00:00
Cosimo Lupo
620db1f9a3 [t1Lib_test] also test parsing LWFN (dumped to data fork) 2015-10-26 04:40:04 +00:00