2517 Commits

Author SHA1 Message Date
Cosimo Lupo
b63935c6f8 [py23_test] test py23.open for piping binary data through stdin/stdout 2016-01-25 18:25:07 +00:00
Cosimo Lupo
47bde21b86 [py23] add wrapper around io.open bridging py23 differences 2016-01-25 17:52:45 +00:00
Sascha Brawer
c09e8862c0 [feaLib] Handle contextual chained SinglePos rules
Resolves https://github.com/behdad/fonttools/issues/485.
2016-01-25 16:27:18 +01:00
Sascha Brawer
a7c0b5c78f [feaLib] Implement chained contextual single positioning
https://github.com/behdad/fonttools/issues/485
2016-01-25 15:10:40 +01:00
Sascha Brawer
312136356a [feaLib] Raise FeatureLibError for not-yet-implemented construct 2016-01-25 12:26:23 +01:00
Sascha Brawer
82a444d659 [feaLib] Parse glyph patterns with multiple values
For example, we now recognize `pos one' 1 two' 2 three' 3;`
as a SinglePos statement, like makeotf does.

https://github.com/behdad/fonttools/issues/485
2016-01-25 12:18:17 +01:00
Cosimo Lupo
81b290a47b [ttLib] raise if saving TTFont to the same input file when lazy is True 2016-01-25 10:21:09 +00:00
Cosimo Lupo
3f7c67ed50 [ttLib] skip reading the whole file in memory if lazy == True
As discussed in #482.
2016-01-25 10:06:52 +00:00
Cosimo Lupo
2afa2b07cf Merge pull request #484 from miguelsousa/ttx-minor
[ttx] minor changes
2016-01-25 09:05:29 +00:00
Miguel Sousa
d1a1f1dc69 [ttx] minor addition to options' info 2016-01-24 18:42:41 -08:00
Miguel Sousa
a45a149b21 [ttx] don't print error when command is 'ttx -h' 2016-01-24 18:39:53 -08:00
Behdad Esfahbod
f65f7bbe2b [otBase] Output object index for arrays, when exception occurs
Ie, now we get:
...
    assert 0 <= value < 0x10000, value
AssertionError: (None, 'LookupListIndex', 'SubstLookupRecord[0]', 'ChainContextSubst[1]', 'Lookup[3]', 'LookupList')
2016-01-23 21:30:45 +01:00
Behdad Esfahbod
ba42586548 [inspect] Fix decompiling objects 2016-01-23 21:28:10 +01:00
Cosimo Lupo
b63cbbf070 Merge pull request #480 from khaledhosny/subset-math
Add support for subsetting MATH table
2016-01-23 19:44:23 +00:00
Khaled Hosny
279243202a [subset] Test MATH table 2016-01-23 23:09:22 +04:00
Khaled Hosny
0e1cc9fb73 [subset] Add support for MATH table 2016-01-23 23:00:30 +04:00
Behdad Esfahbod
1fbad696c9 Print out object hierarchy, when an Exception happens while compiling otData tables
The common stacktrace like this:

  File "fonttools/Lib/fontTools/ttLib/__init__.py", line 202, in save
    self._writeTable(tag, writer, done)
  File "fonttools/Lib/fontTools/ttLib/__init__.py", line 631, in _writeTable
    tabledata = self.getTableData(tag)
  File "fonttools/Lib/fontTools/ttLib/__init__.py", line 644, in getTableData
    return self.tables[tag].compile(self)
  File "fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 86, in compile
    self.table.compile(writer, font)
  File "fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 681, in compile
    conv.write(writer, font, table, value)
  File "fonttools/Lib/fontTools/ttLib/tables/otConverters.py", line 354, in write
    value.compile(subWriter, font)
  File "fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 661, in compile
    conv.write(writer, font, table, value, i)
  File "fonttools/Lib/fontTools/ttLib/tables/otConverters.py", line 354, in write
    value.compile(subWriter, font)
  File "fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 661, in compile
    conv.write(writer, font, table, value, i)
  File "fonttools/Lib/fontTools/ttLib/tables/otConverters.py", line 354, in write
    value.compile(subWriter, font)
  File "fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 661, in compile
    conv.write(writer, font, table, value, i)
  File "fonttools/Lib/fontTools/ttLib/tables/otConverters.py", line 277, in write
    value.compile(writer, font)
  File "fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 681, in compile
    conv.write(writer, font, table, value)
  File "fonttools/Lib/fontTools/ttLib/tables/otConverters.py", line 175, in write
    writer.writeUShort(value)
  File "fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 457, in writeUShort
    assert 0 <= value < 0x10000, value
AssertionError: None

now has this as the last line:

AssertionError: (None, 'LookupListIndex', 'SubstLookupRecord', 'ChainContextSubst', 'Lookup', 'LookupList')

which means a value of None was tried for writing a LookupListIndex from a ChainContextSubset...

It's a hack, but a very useful one.
2016-01-23 14:20:33 +01:00
Behdad Esfahbod
929dada533 [otlLib] Minor
These count attrs are redundant and we might remove them in the
future.  To simplify things, always write them as:

  self.XXXCount = len(self.XXX)
2016-01-22 19:57:22 +01:00
Behdad Esfahbod
521d1d0e90 [otlLib] Remove duplicate points in buildAttachPoint() 2016-01-22 19:56:10 +01:00
Behdad Esfahbod
46f16347fb [mtiLib] Port to otl.buildAttachList() 2016-01-22 19:52:19 +01:00
Behdad Esfahbod
223a1c8499 [otlLib] Return None from buildAttachPoint() 2016-01-22 19:51:02 +01:00
Behdad Esfahbod
33eb68e21a [otlLib] Disallow negative pixel-size in buildDevice()
These fields are USHORT.
2016-01-22 19:49:22 +01:00
Behdad Esfahbod
58b49a1a42 [otlLib] change buildDevice API to take dict
Makes more sense.  feaLib can be simplified by storing a dict
as well, but for now just cast.
2016-01-22 19:45:56 +01:00
Behdad Esfahbod
e4328fb612 [otlLib] Return None in a few more places 2016-01-22 19:39:54 +01:00
Behdad Esfahbod
4e13a2268e [otlLib] One more rename 2016-01-22 19:38:20 +01:00
Behdad Esfahbod
aea0ce9ae1 [otlLib] Adapt names to newly agreed scheme 2016-01-22 19:32:45 +01:00
Behdad Esfahbod
564af5a65c [otlLib] Return None if coverage is empty 2016-01-22 19:27:33 +01:00
Behdad Esfahbod
577a1500e5 [mtiLib] Cosmetic 2016-01-22 19:25:14 +01:00
Behdad Esfahbod
f63f23e4bd [mtiLib] Port to otlLib.buildLigCaretList() 2016-01-22 19:24:05 +01:00
Behdad Esfahbod
c84eb24a1e [mtiLib] Fix typo! 2016-01-22 18:11:58 +01:00
Sascha Brawer
af48e43371 [otlLib] Move building of MarkLigPos from feaLib to otlLib 2016-01-22 14:50:17 +01:00
Sascha Brawer
036e2ce497 [otlLib] Move building of LigatureArrays from feaLib to otlLib
Not sure if empty ComponentRecords can be optimized away.
For the time being, leaving the output unchanged so that
the refactoring has no effect on the generated files.
2016-01-22 14:14:47 +01:00
Behdad Esfahbod
501480fa70 Revert "[ot] Instead of deleting unnecessary Format, set it to None"
This reverts commit 6851f66d1810a4d3f484f2a82e39960e1a677f42.

See https://github.com/typesupply/compositor/issues/7
Fixes https://github.com/behdad/fonttools/issues/475
2016-01-22 14:03:23 +01:00
Behdad Esfahbod
f8e3ea08fb [mtiLib] Port SinglePos to otlLib 2016-01-22 13:44:27 +01:00
Behdad Esfahbod
59ee0618d7 [otlLib] Explicitly set Value to None if needed
Although the compiler (and now XML writer) assume None if an attribute
is not set, it's extremely frustrating for other code to have to check
before accessing an attribute.  So, explicitly set please!
2016-01-22 13:43:05 +01:00
Cosimo Lupo
258e53044d Revert ".travis.yml: temporarily disable py27-osx10.11 until pip installation issue is fixed"
This reverts commit 15392729ae9800a29bc04649d48c08093b67ec95.

Fixes #473.
2016-01-22 12:02:45 +00:00
Sascha Brawer
1978194caf [otlLib] Move building of LigatureAttach tables from feaLib to otlLib 2016-01-22 12:45:29 +01:00
Sascha Brawer
cf7c670e80 [otlLib] Move building of MarkBasePos from feaLib to otlLib 2016-01-22 11:53:34 +01:00
Sascha Brawer
50cbd5ca78 [otlLib] Move building of BaseArrays from feaLib to otlLib 2016-01-22 10:57:03 +01:00
Sascha Brawer
109989b0c1 Merge pull request #474 from jamesgk/master
[feaLib] Accept empty statements in parser
2016-01-22 09:38:27 +01:00
James Godfrey-Kittle
34115b2f3f [feaLib] Add unit test for empty statement parsing 2016-01-21 13:32:58 -08:00
James Godfrey-Kittle
8fa5073e7e [feaLib] Accept empty statements in parser 2016-01-21 10:32:30 -08:00
Sascha Brawer
de24f4f0d4 [otlLib] Move building of BaseRecords from feaLib to otlLib 2016-01-21 17:23:36 +01:00
Sascha Brawer
08fa0f14dd [otlLib] Move building of MarkArrays from feaLib to otlLib 2016-01-21 16:23:55 +01:00
Sascha Brawer
f09de4277d [otlLib] Make otlLib compliant with PEP8 2016-01-21 15:23:41 +01:00
Sascha Brawer
f42d312580 [otlLib] Move building of ComponentRecords from feaLib to otlLib 2016-01-21 15:16:55 +01:00
Sascha Brawer
15ca8bb0a0 [otlLib] Move building of Mark2Records from feaLib to otlLib 2016-01-21 13:08:16 +01:00
Sascha Brawer
b07d168c0e [feaLib] Simplify how MarkArrays are built 2016-01-21 11:39:34 +01:00
Sascha Brawer
a4318a38c1 [otlLib] Build MarkRecords 2016-01-21 11:29:32 +01:00
Sascha Brawer
3c65e82307 [otlLib] Move building of otTables.Lookup from feaLib to otlLib 2016-01-20 19:25:41 +01:00