1550 Commits

Author SHA1 Message Date
Sascha Brawer
790ea83a02 [feaLib] Parse GPOS type 4 aka Mark-to-Base Attachment Positioning
However, no output tables are being built yet. This change is just
implementing the feature file parser.
2015-12-08 19:04:42 +01:00
Sascha Brawer
bc4828589e [feaLib] Merge test cases from the OpenType Feature File specification
The setup code for these unit tests was copied and pasted,
and this became a little repetitive.
2015-12-08 17:19:30 +01:00
Sascha Brawer
dfa1551ece [feaLib] Implement markClass statement 2015-12-08 17:04:21 +01:00
Cosimo Lupo
66386ab488 Merge pull request #428 from anthrotype/ttx-pad-tags
ttx: pad tags with space if length is less than 4
2015-12-08 13:08:52 +00:00
Cosimo Lupo
9f6055d5d9 Merge pull request #427 from anthrotype/recalc-bbox-expand
_g_l_y_f: expand glyphs inside `compile` if recalcBBoxes==True
2015-12-08 13:08:40 +00:00
Cosimo Lupo
9049d5f866 Merge pull request #425 from anthrotype/xmlreader-fileobj
make XMLReader accept file objects
2015-12-08 13:08:19 +00:00
Cosimo Lupo
e12aec52ed ttx: use ljust to pad tags with space (more Pythonic)
as suggested by @adrientetar
2015-12-08 12:45:22 +00:00
Cosimo Lupo
79c2b8cbc1 ttx: pad tags with space if length is less than 4
so that you don't need to do `-t "CFF "` anymore.

Fixes https://github.com/behdad/fonttools/issues/265
2015-12-08 10:11:26 +00:00
Cosimo Lupo
db57418b55 Merge pull request #420 from moyogo/fealib-typo
feaLib: misnamed function in builder_test.py
2015-12-08 09:48:40 +00:00
Cosimo Lupo
738866492d _g_l_y_f: expand glyphs inside compile if recalcBBoxes==True; delete empty self.data lingering around
Fixes https://github.com/behdad/fonttools/issues/410.

See also:
ecbe8f2c37 (commitcomment-14464893)
2015-12-08 09:35:00 +00:00
Sascha Brawer
c6ee46f299 [feaLib] Implement GPOS type 3: Cursive Attachment Positioning 2015-12-07 23:56:08 +01:00
Sascha Brawer
2391a11fc8 [feaLib] Test that the parser rejects enum pos cursive constructs 2015-12-07 22:53:38 +01:00
Sascha Brawer
b0fda8ec45 [feaLib] Replace invocation of deprecated has_key() by in 2015-12-07 22:49:20 +01:00
Sascha Brawer
6240593839 [feaLib] Parse anchors in format A, B, C, D, and E 2015-12-07 22:48:10 +01:00
Sascha Brawer
bdc72e1198 [feaLib] Do not emit empty GSUB and GPOS tables
The AFDKO `makeotf` tool does not emit empty tables, either.
2015-12-07 21:38:41 +01:00
Sascha Brawer
3433f363e7 [feaLib] Implement GPOS type 2, format 1 2015-12-07 21:26:58 +01:00
Cosimo Lupo
8933062db0 xmlReader: make xmlReader accept file objects
Fixes https://github.com/behdad/fonttools/issues/404

Also, fixed typo for ProgressPrinter method call: 'setlabel' -> 'setLabel'
2015-12-07 19:31:33 +00:00
Ben Kiel
e53d2068ca Update doc
Added text for woff2
2015-12-07 13:26:16 -06:00
Cosimo Lupo
5cf297ca44 xmlReader_test: test ProgressPrinter and reading from path vs file object 2015-12-07 19:26:04 +00:00
Cosimo Lupo
af62ebf2b6 ttLib: rename 'fileName' arg to 'fileOrPath' in importXML function for consistency with saveXML method 2015-12-07 18:26:48 +00:00
Sascha Brawer
46983f573f [feaLib] Parse GPOS type 2 format A and B, and ValueRecord format D
This is just the change on the parser. Building the output tables
is still marked as a TODO.
2015-12-07 17:18:18 +01:00
Behdad Esfahbod
5133e3777e Undo accidentally commit changes 2015-12-07 15:15:51 +01:00
Cosimo Lupo
bc690a565d Merge pull request #422 from anthrotype/vdmx-sort
[V_D_M_X_] sort records by yPelHeight when writing toXML
2015-12-07 11:15:10 +00:00
Cosimo Lupo
983c21c745 [V_D_M_X_] sort records by yPelHeight when writing toXML 2015-12-07 11:07:56 +00:00
Behdad Esfahbod
c65c16d3f6 Fix previous commit
Humm, no idea how I had committed it locally before.
2015-12-07 12:05:24 +01:00
Behdad Esfahbod
5a08924075 Add high-level API for LigatureSubst
Ala MultipleSubst and AlternateSubst.  For now, just support compiling it.
2015-12-07 12:01:42 +01:00
Sascha Brawer
83dbae1da5 [feaLib] Do not emit any Value if ValueFormat is 0 2015-12-07 11:47:55 +01:00
Sascha Brawer
117683680e [feaLib] Emit SinglePos (GPOS type 1) in format 2 when this is more compact 2015-12-07 11:39:14 +01:00
Behdad Esfahbod
f129f658c9 [subset] Fix Options parsing
Fixes https://github.com/behdad/fonttools/issues/413
Test passes now.
2015-12-07 11:14:04 +01:00
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