985 Commits

Author SHA1 Message Date
Behdad Esfahbod
0c577bb7da [ot] Add support for long counts 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
846d969209 [varLib] Remove unused VarAxisID 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
ae93928275 [varLib] Rename fields in fvar, to accommodate for postscriptNameID 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
3da7de7452 [varLib] Use Tag() in fvar 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
72fe29359b [varLib] Start building Device table for variations 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
687c2c1812 [varLib] Build indirect advance-width in HVAR
Fixes VarIdxMap implementation as well.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
32bd6bcc31 [varLib] Add optimizeVarData()
Though not really effective right now since we don't split into
multiple VarData sets.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
3064985880 VarStore: Remove Reserved field 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
47a7dde070 [varLib] Make VarData.NumShorts automatic 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
f11414c93b [varLib] Implement new VarData, aka. ItemVariationData, table 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
38c88f6996 [varLib] Rename VarTuple to VarRegion 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
e7163eddb0 [varLib] Rename VarTupleList to VarRegionList
Aka. ItemVariationRegionList.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
35a401f04d [varLib] Add support for VarIdxMap, aka. DeltaSetIndexMap.
Update HVAR / VVAR to latest draft.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
a174aa76af [ot] Implement template converters
Eg. "OffsetTo(TypeName)"
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
c1717224da [varLib] Generate direct HVAR 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
e2da17e032 [opentype-gx/varLib] More work towards VariationStore
And HVAR/VVAR tables.
2016-09-27 19:49:41 +02:00
Behdad Esfahbod
32dd2e9e7e Add a VarStore at the end of GDEF 2016-09-27 19:49:41 +02:00
Behdad Esfahbod
4d7b5f6472 [varLib] Start implementing VariationStore 2016-09-27 19:49:41 +02:00
Cosimo Lupo
5dabba6699 [ttLib] get 'ttLibVersion' from fontTools.version.__version__, but only write MAJOR.MINOR
otherwise it risks changing too often... ;)
2016-09-27 00:28:01 +01:00
Cosimo Lupo
f171719e05 TSI5: set group to 0 (i.e. "AnyGroup") when compiling if glyph name is missing
This is also what VTT does when one does "Prepare font..." and a character is not present in the character groups template file ("CharGrp.txt"): it gets assigned to the default "AnyGroup" group, or 0.

Note that the TSI1 and TSI3 tables do not raise when a glyph name is in the glyphOrder but is missing in their internal mapping; they instead write an empty entry.

This makes easier to merge TSI* tables from different fonts or from earlier revision of the same font containing only a subset of the glyphs.
2016-09-26 16:15:29 +01:00
moyogo
304994851b TSI1: text can be utf-8 2016-09-15 07:16:57 +01:00
Miguel Sousa
f502bbba98 [CPAL] write paletteEntryLabels names 2016-08-28 16:24:58 -07:00
Miguel Sousa
3c6537de88 [CPAL] remove extra newline before palette label name 2016-08-28 16:21:21 -07:00
Cosimo Lupo
855c3b17c9 [woff2_test] adjust 'test_incorrect_compressed_size' to make it work with brotlipy
In the upstream google/brotli, if the `decompress` function receives an empty byte
string, it returns a brotli.error; whereas in 'brotlipy' it does not raise but
returns an empty string b"":
https://github.com/python-hyper/brotlipy/issues/43#issuecomment-240378257

This test case asserts that when 'totalCompressedSize' in the WOFF2 header is
incorrectly set, the woff2 reader fails -- either because the brotli decoder
raises an exception, or it returns a string whose length is not the one expected.
2016-08-17 12:07:02 +01:00
Behdad Esfahbod
5cd0a55635 Ignore up to 4 bytes excess in kern subtables
Fixes https://github.com/behdad/fonttools/issues/314

Previously the warning message was wrong (probably a regression)
as it was reporting the the length of all kern data as "excess".
Fixing that, I see 4 bytes excess in Calibri.  Up to 4 is alright,
since many compilers add padding and wrongly add 4 instead of 0
sometimes.
2016-08-08 13:02:34 -07:00
Behdad Esfahbod
9c037fc826 [gvar] Add TODO 2016-07-16 21:22:20 -07:00
Behdad Esfahbod
b1eeaa5151 [gvar] Fix point encoding
Where more than one run is used, it's only the first run's first point
that is absolute, all other values are relative.

Similar fix landing in FreeType soon.  Fixes lizzard glyph (glyphname
"dollar") in Zycon.
2016-07-15 18:15:17 -07:00
Behdad Esfahbod
e9fb97d858 Fix overflow-fixing of Extension subtables
Fixes https://github.com/behdad/fonttools/issues/574
This was broken by 319643ad.  Ouch!
Was quite a debugging session to pin it down.
2016-07-12 23:55:47 -07:00
Behdad Esfahbod
c794ff85d6 Fix typo in comments 2016-06-06 22:06:33 -07:00
justvanrossum
123d7c10b6 Found a font that has an empty SingleSubst mapping. While that's silly, it's not necessarily illegal. FontTools, however, would crash with an AssertionError upon compilation. Fixed. 2016-05-28 22:20:31 +09:00
justvanrossum
650aae7cf3 making error and warning consistent #604 2016-05-13 07:10:47 +02:00
justvanrossum
1394416821 Better error message for broken hmtx/vmtx table, addressing #604. 2016-05-13 07:07:52 +02:00
Khaled Hosny
b5afd862e1 [glyf] Round component offset before compiling
We can get a float here.
2016-04-30 00:16:15 +02:00
Sascha Brawer
9f287353f3 [CPAL] Support CPAL table version 1 2016-04-27 13:15:45 +02:00
Behdad Esfahbod
e391cdb787 [glyf] GlyphCoordinates: Implement __del__() 2016-04-27 01:14:08 -07:00
Behdad Esfahbod
e36b7069d9 [glyf] GlyphCoordinates: Upgrade to float in math ops if needed 2016-04-27 01:11:40 -07:00
Sascha Brawer
9e7e77bdf4 [CPAL] Share color records when possible 2016-04-26 17:40:00 +02:00
Sascha Brawer
15781e4183 Add unit tests for handling CPAL table 2016-04-26 11:53:09 +02:00
Khaled Hosny
cdda278bd4 Use ttLib.newTable when possible
I learnt about it from [1] and seems like a nice thing to use.

1. https://github.com/behdad/fonttools/pull/586#issuecomment-213285350
2016-04-23 02:00:24 +02:00
Miguel Sousa
cc5d6c96fa don't hardcode the table tags, rely on ttLib.getClassTag instead 2016-04-21 23:42:13 -07:00
Miguel Sousa
883ff5fbdc [sbix] correct __init__ method 2016-04-21 21:32:30 -07:00
Cosimo Lupo
d169acd10e Merge pull request #584 from miguelsousa/svg_init_fix
[SVG] correct __init__ method
2016-04-21 10:46:49 +01:00
Miguel Sousa
ce4af2a0a2 [SVG] correct __init__ method 2016-04-20 17:08:45 -07:00
Behdad Esfahbod
0ee799fb03 [glyf] Add math operators to GlyphCoordinates 2016-04-13 22:54:39 -07:00
Behdad Esfahbod
c4fe9c7c57 Before splitting subtables when overflow happens, try disabling table sharing
More bandaid for https://github.com/behdad/fonttools/issues/537
2016-04-13 16:34:14 -07:00
Behdad Esfahbod
4268e6345d Fix splitPairPos for TTFont loaded from XML
When loading from XML count variables are missing...

Fixes https://github.com/behdad/fonttools/issues/537#issuecomment-207849194
2016-04-13 16:17:05 -07:00
Miguel Sousa
b9fc0b84ed [SVG] Don't make <colorPalettes> element a requirement 2016-04-13 03:32:07 -07:00
Miguel Sousa
30c89b8a2f [SVG] Don't write <colorPalettes> element if it's empty 2016-04-13 03:31:01 -07:00
Miguel Sousa
ff06131e47 [SVG] Better handling of empty <colorPalettes> element 2016-04-13 02:28:20 -07:00
Behdad Esfahbod
d82401bb8d Fix SVG version-1 decompile
Untested.  We should add tests for these.
2016-04-10 17:20:10 -07:00