Gosh! This is the kind of thinko that doesn't happen with less dynamic languages...
Good one hour of debugging at TYPO Labs. Glad this one is fixed finally!
Fixes https://github.com/fonttools/fonttools/issues/888
Tolerance is set to .5 by default. Most designspaces never hit this since
for most, all deltas are integers anyway. Moreover, all such detas will
round to zero anyway.
This reverts commit d83c2fb2090fa58f94fdf32d1aa2d2d8665cec05.
This is wrong. We should insert if and only iff there's at least one of the
fonts with a Format1. Yours doesn't look at all fonts. Since this one is not a
bugfix but improvement, I'll fix it separately.
Class2Record is mutable, hence doing `[rec2] * l.Class2Count` produces a list containing multiple references to the same instance. When later on we do the interpolation, modifying one would modify them all.
We need to instantiate distinct objects.
See 6f41c2ab53 (commitcomment-21310803)
The problem was that `break` statement: we stopped searching for SHORT columns in each delta set after finding the first, but rows can contain more than one in any order.
Fixes https://github.com/googlei18n/fontmake/issues/271
The syntax tree representation now reflects the syntax of feature files.
Before this change, FeatureNames did not have their own `ast.Block`,
which had made the code quite messy.
$ ttx -t CFF "font.otf"
Dumping "font.otf" to "font.ttx"...
Dumping 'CFF ' table...
ERROR: Unhandled exception has occurred
Traceback (most recent call last):
File "fonttools/Lib/fontTools/ttx.py", line 384, in main
process(jobs, options)
File "fonttools/Lib/fontTools/ttx.py", line 358, in process
action(input, output, options)
File "fonttools/Lib/fontTools/misc/loggingTools.py", line 372, in wrapper
return func(*args, **kwds)
File "fonttools/Lib/fontTools/ttx.py", line 258, in ttDump
newlinestr=options.newlinestr)
File "fonttools/Lib/fontTools/ttLib/__init__.py", line 311, in saveXML
self._tableToXML(tableWriter, tag, progress)
File "fonttools/Lib/fontTools/ttLib/__init__.py", line 348, in _tableToXML
table.toXML(writer, self, progress)
File "fonttools/Lib/fontTools/ttLib/tables/C_F_F_.py", line 42, in toXML
self.cff.toXML(writer, progress)
File "fonttools/Lib/fontTools/cffLib.py", line 135, in toXML
font.toXML(xmlWriter, progress)
File "fonttools/Lib/fontTools/cffLib.py", line 2178, in toXML
BaseDict.toXML(self, xmlWriter, progress)
File "fonttools/Lib/fontTools/cffLib.py", line 2128, in toXML
conv.xmlWrite(xmlWriter, name, value, progress)
File "fonttools/Lib/fontTools/cffLib.py", line 1120, in xmlWrite
value.toXML(xmlWriter, progress)
File "fonttools/Lib/fontTools/cffLib.py", line 2128, in toXML
conv.xmlWrite(xmlWriter, name, value, progress)
File "fonttools/Lib/fontTools/cffLib.py", line 1089, in xmlWrite
if isinstance(value[0], list):
IndexError: list index out of range
After 2b2aca1, DictCompiler/Decompiler's `arg_delta` method unconditionally attempts to get the first item to check if it's a list, but this fails with `IndexError` when the value is empty.
```
Traceback (most recent call last):
[...]
File "/Users/cosimolupo/Documents/Github/ufo2ft/Lib/ufo2ft/otfPostProcessor.py", line 15, in __init__
otf.save(stream)
File "/Users/cosimolupo/Documents/Github/fonttools/Lib/fontTools/ttLib/__init__.py", line 219, in save
self._writeTable(tag, writer, done)
File "/Users/cosimolupo/Documents/Github/fonttools/Lib/fontTools/ttLib/__init__.py", line 658, in _writeTable
tabledata = self.getTableData(tag)
File "/Users/cosimolupo/Documents/Github/fonttools/Lib/fontTools/ttLib/__init__.py", line 669, in getTableData
return self.tables[tag].compile(self)
File "/Users/cosimolupo/Documents/Github/fonttools/Lib/fontTools/ttLib/tables/C_F_F_.py", line 20, in compile
self.cff.compile(f, otFont)
File "/Users/cosimolupo/Documents/Github/fonttools/Lib/fontTools/cffLib.py", line 124, in compile
writer.toFile(file)
File "/Users/cosimolupo/Documents/Github/fonttools/Lib/fontTools/cffLib.py", line 300, in toFile
endPos = pos + item.getDataLength()
File "/Users/cosimolupo/Documents/Github/fonttools/Lib/fontTools/cffLib.py", line 1858, in getDataLength
return len(self.compile("getDataLength"))
File "/Users/cosimolupo/Documents/Github/fonttools/Lib/fontTools/cffLib.py", line 1879, in compile
data.append(arghandler(value))
File "/Users/cosimolupo/Documents/Github/fonttools/Lib/fontTools/cffLib.py", line 1910, in arg_delta
val0 = value[0]
IndexError: list index out of range
``
Before this change, some table statements would allow empty statements
(just a semicolon) while others would not allow them. After this change,
we're more consistent.
Set Coverage.Format to 1. This is rather arbitrary, which is exactly
why Coverage.Format doesn't make sense and should not have been
exposed to begin with.