1275 Commits

Author SHA1 Message Date
Sascha Brawer
57f01b27cb [morx] Preliminary code for writing AATLookups
Needs more work.
2017-08-14 21:34:15 +02:00
Behdad Esfahbod
f188187b08 [morx] Implement StructWithLength.write() 2017-08-14 21:34:15 +02:00
Sascha Brawer
4b5b8ea53d [morx] Implement AATLookup.xmlRead 2017-08-14 21:34:15 +02:00
Sascha Brawer
b40ba05f6f [morx] Group AATLookup substitutions into a parent XML element 2017-08-14 21:34:15 +02:00
Behdad Esfahbod
75b0eaa5bb [morx] Fix SubStruct xmlWrite() 2017-08-14 21:34:15 +02:00
Sascha Brawer
7f774ae84c [morx] Change MorphType to uint8, to comply with the spec 2017-08-14 21:34:15 +02:00
Sascha Brawer
b00e2dfec4 [morx] Recognize MorphType as another type of lookup
Currently, this makes no difference at all. Later, we'll use this
for dispatching AAT lookup types in the same way how we already
dispatch OpenType lookup types.
2017-08-14 21:34:15 +02:00
Sascha Brawer
f56b71937d Add missing parts from morx branch
After this change, the `morx` table in Zapfino.ttf can be ttx'ed again.
2017-08-14 21:34:15 +02:00
Sascha Brawer
483bb67b60 Rebase morx branch to current master 2017-08-14 21:34:15 +02:00
Masaya Nakamura
3708f2c8d3 Don't cache charString bounds
https://github.com/fonttools/fonttools/pull/970#discussion_r117903692
2017-08-01 10:54:47 +09:00
Masaya Nakamura
68c7275945 [hhea,vhea] Refactor 2017-08-01 10:53:28 +09:00
Masaya Nakamura
69199b3225 [hhea,vhea] Ensure charString has bounds 2017-08-01 10:53:27 +09:00
Masaya Nakamura
1b773c17d7 [hhea,vhea] Fix advance{Width,Height}Max calculations
Before this commit, empty glyphs were wrongly ignored.
2017-08-01 10:51:48 +09:00
Masaya Nakamura
994337ffe2 [ttLib] Update recalcBBoxes description 2017-08-01 10:51:48 +09:00
Masaya Nakamura
d13aab2c70 [hhea,vhea] Add recalcBBoxes support for CFF-flavored fonts 2017-08-01 10:51:48 +09:00
Masaya Nakamura
cf3474ba6a [hhea,vhea] Refactor to support CFF bounds recalculation 2017-08-01 10:51:47 +09:00
Masaya Nakamura
d1bc55756f [hhea,vhea] Use float('inf') instead of INFINITY 2017-08-01 10:51:47 +09:00
Masaya Nakamura
5fd38a762e [head] Recalc bounds when compiling CFF-flavored fonts 2017-08-01 10:51:47 +09:00
Rob McKaughan
b8e2d90cda Add AxisValueFormat4 for STAT table v1.2 from OT v1.8.2. 2017-07-24 16:12:31 -07:00
Cosimo Lupo
8ca53c6a17 [name] fix bcp46 language tag for Mac langID=9: 'si' -> 'sl'
Fixes #1013
2017-07-24 13:03:38 +01:00
Cosimo Lupo
72baa5a7d5 [cffLib/psCharStrings] remove cffCtx, pass down isCFF2
* Removed `CFFContext`
* Added `isCFF2` argument to CFFFontSet.decompile/compile, used from
  respective ttLib classes
* Index classes get a `isCFF2` argument in constructor (used for
  decompiling); must be True/False if `file` argument is not None;
  it is stored as self._isCFF2 to support lazy loading
* Removed `TopDictData` class; reuse same `TopDictIndexCompiler` for
  both CFF and CFF2
* `CFFWriter` and all `*Compiler` classes get an `isCFF2` argument;
  defaults to the parent compiler's `isCFF2` attribute
* Removed `size` argument from `produceItem` method as unused and
  useless (`len(data)` is the same)
* psCharStrings: removed useless ByteCodeBase class
* A reference to the TopDict's VarStoreData is passed down to all
  the FontDicts' PrivateDict, so it can be used to get the number of
  regions while decompiling blend and vsindex operators

See dicussion:
https://github.com/fonttools/fonttools/pull/968#issuecomment-309920007
2017-07-19 18:18:58 +01:00
Miguel Sousa
4a8c1511ec [otData] Label AxisNameID as NameID 2017-07-14 00:08:52 -07:00
Miguel Sousa
9aa3247603 [ttLib] Support CFF2 in getGlyphSet() 2017-07-13 01:13:46 -07:00
ReadRoberts
dee5cfee2f remove duplicated logic in C_F_F_2.py by subclassing from C_F_F_.py. 2017-06-20 16:23:52 -07:00
Behdad Esfahbod
3db5be2195 [gvar] Remove GlyphCoordinates.__abs__()
It's not wel-defined, as abs typically is supposed to return a scalar...

Also combine the tolerance-check with the zero-check in varLib.
2017-05-18 16:06:10 -07:00
Behdad Esfahbod
e46f94950c Change GlyphCoordinates.__bool__() semantics...
...to match those of other iterables.

I confused myself once already by having "if not delta" where delta was a list,
not GlyphCoordinates...
2017-05-18 16:06:10 -07:00
Behdad Esfahbod
3ece5d842c [TupleVariation] Copy items in constructor
Avoids surprises when aller modifies those same objects.
2017-05-18 16:06:10 -07:00
Cosimo Lupo
71486bc0a9
[_g_l_y_f] use 'd' instead of 'f' as array.array typecode in GlyphCoordinates
Fixes #963
2017-05-16 10:50:56 +01:00
Jens Kutilek
6d5ebcc4a9 Change name of MaxpValues to CompositeMaxpValues 2017-05-04 12:35:09 +02:00
Jens Kutilek
d1cf59d2c9 Use a namedtuple for maxp values 2017-05-04 12:28:02 +02:00
Sascha Brawer
017fa4e9c6 [fvar] Expose flags in XML
Fixes https://github.com/fonttools/fonttools/issues/932.
2017-05-02 00:51:44 +08:00
Sascha Brawer
3f839878eb [name] Fix issues with name.addMultilingualName()
Fixes https://github.com/fonttools/fonttools/issues/931.
2017-04-21 13:14:24 +08:00
Sascha Brawer
a5c8977dd3 [name] Fix platform ID for names whose language code is in ltag table
https://github.com/fonttools/fonttools/issues/931
2017-04-20 17:38:31 +08:00
Sascha Brawer
e8530360bd [name] Add helper for building multi-lingual names
Fixes https://github.com/fonttools/fonttools/issues/921.
2017-04-19 02:26:32 +08:00
Sascha Brawer
068ca5afbb [ltag] Helper method for adding language tags 2017-04-18 18:15:32 +08:00
Behdad Esfahbod
806b7dcd8d Minor 2017-04-14 14:30:51 -07:00
Behdad Esfahbod
e886617ab0 [avar] Remove fixupSegments
Fixes https://github.com/fonttools/fonttools/issues/923
2017-04-13 15:50:44 -07:00
Cosimo Lupo
cca1d20b0e
[loggingTools] added LogMixin class
This is useful to quickly add logging functionality to classes, and
to reduce boilerplate.

It adds a 'log' property to the class inheriting from it, which uses
logging.getLogger to get a logging.Logger (sigleton) object named after
<module>.<class> of self.
2017-04-11 18:40:52 +01:00
Cosimo Lupo
f1e9bf30e4
[TSI*] Added docstrings to explain the purpose of VTT private tables 2017-04-11 10:01:47 +01:00
Cosimo Lupo
6567a8bc92
[TSI0] return empty byte string if no 'indices' attribute is set
previously it was returning a str on python3
2017-04-10 20:53:02 +01:00
Cosimo Lupo
be9784c916
[TSI0] use unsigned 'L' instead of signed 'l' as textOffset format
https://gitter.im/caryll/otfcc?at=58eb78288bb56c2d1192d56c
2017-04-10 19:47:48 +01:00
Cosimo Lupo
0e56002348
[TSI1] Fix computation of the textLength of VTT private tables entries
https://gitter.im/caryll/otfcc?at=58e28b284cb8d091735567fe

Thanks Belleve Invis! ;)
2017-04-10 19:47:48 +01:00
Adrien Tétar
a4a3ae6d49 EBLC: fixes for py3 zip
Closes #909.
2017-04-10 01:10:45 +02:00
Behdad Esfahbod
e5a9fd7faa [otTables] When splitting PairPos subtable, don't set class=0
Doesn't matter when compiling to binary, but makes Python objects cleaner.
2017-04-06 15:34:00 +02:00
Behdad Esfahbod
33d57dc2c3 [glyf] Add getter to fetch raw array 2017-04-05 15:43:14 +02:00
Behdad Esfahbod
fdbf066a8c [glyf] Add __bool__ / __nonzero__ to GlyphCoordintes
I'm really unhappy that doctests do NOT work anymore :(.
2017-04-05 15:43:14 +02:00
justvanrossum
8327d73dee Edge case: Fix logic in choosing CFF vs glyf so we get the correct error if the font has neither. 2017-04-01 14:30:17 +02:00
justvanrossum
5ccc1ec59c removed unneeded slice/copy, leftover when upgrading from .sort() to sorted() 2017-03-31 00:07:03 +02:00
Cosimo Lupo
6ac3523d74
[_TTGlyphSet] fetch height and tsb from vmtx if available
The width and lsb from hmtx are already there

Fixes #893

https://github.com/fonttools/fonttools/pull/880#issuecomment-288558012
2017-03-23 12:51:16 +00:00
Behdad Esfahbod
a2b23811a2 Merge pull request #887 from fonttools/class-kern-merge
[varLib.merger] Fix interpolating PairPos Format 2
2017-03-16 16:03:34 -07:00