1281 Commits

Author SHA1 Message Date
Cosimo Lupo
f62f79eb23
otConverters: don't write XML comment if NameID value is 0 == NULL
Fixes https://github.com/fonttools/fonttools/issues/1151
2018-01-19 13:25:59 +00:00
Cosimo Lupo
bc0480e19e
[sbix] fix TypeError when += str and bytes
Fixes #1145

There's probably more... we'll see once we have some data from chromacheck fonts to proper test this with
2018-01-11 20:15:58 +00:00
Cosimo Lupo
c42749466a [S_V_G_] fix dumping toXML SVG tables containing colorPalettes
As reported by glukfonts in
https://github.com/fonttools/fonttools/issues/1124
2018-01-03 15:40:35 +00:00
Cosimo Lupo
56a84ae905 Temporarily revert PR #1035 bamidei/split_g_l_y_f_to_one_per_file
The split-glyf-to-one-glyph-per-file feature is only partially implemented,
as it was discussed here:

https://github.com/fonttools/fonttools/issues/153#issuecomment-346677171

I need to cut a bugfix release today, but I don't want to ship this as is.
I prefer to temporarily rever, tag a release from master branch, then
revert it again to its present state so that bamidei can complete his
work.

---

Revert "[glyf] make splitGlyphs output more compact"

This reverts commit d08d635a93289982b028aacd3b9039fbe742f3e8.

Revert "more whitespace"

This reverts commit bd030f61c6b360fd360632bbc6c19abb057c9a24.

Revert "minor whitespace"

This reverts commit f2a8c787b13b92ae0e0f61477e584316144747c7.

Revert "Merge pull request #1035 from bamidei/split_g_l_y_f_to_one_per_file"

This reverts commit 17b89d9dde7691dbbb6815efba92eff446af62ac, reversing
changes made to b8482d9666f08d3603ee93d3ca52931550f715fc.
2017-12-18 12:00:43 +00:00
Cosimo Lupo
1e42224af7 [cmap] when compiling format6 subtable, don't assume gid0 is always called '.notdef' 2017-12-15 13:56:48 +00:00
Behdad Esfahbod
1aafae816d Allow decompiling fonts with bad Coverage format number 2017-12-14 19:03:54 -08:00
Cosimo Lupo
df1e8c7702 [post] prune extra names already in standard Mac set
This should fix https://github.com/fonttools/fonttools/issues/1119

Running `ftxvalidator -T tt0004c_#1.ttf` no longer produces this error
message, but passes with 'NA'

```
Fatal
    post: The name data overflow the table bounds.
        kATSFontTestSeverityFatalError
```
2017-11-29 12:06:40 +00:00
Jens Kutilek
e51293f3f0
Merge pull request #1113 from fonttools/varlib-sharedpoints-fix-test
Don't share points in cvar by default
2017-11-27 18:01:48 +01:00
Jens Kutilek
cb6676f93e Don't share points in cvar by default (fails in Chrome), adjust tests to test both shared and private points in cvar 2017-11-24 19:06:36 +01:00
Cosimo Lupo
d08d635a93 [glyf] make splitGlyphs output more compact
removed a few extra newlines
2017-11-23 19:05:30 +01:00
Cosimo Lupo
17b89d9dde
Merge pull request #1035 from bamidei/split_g_l_y_f_to_one_per_file
Add ability to split glyphs to 1 glyph per ttx file.  Issue #153
2017-11-23 18:30:54 +01:00
Bill Amidei
818a4a2d1e Review comment update: Updated white-space and removed unused test data 2017-11-23 07:51:05 -08:00
Bill Amidei
de94613e08 Updates based upon review feedback for glyf to individual files; include table name in contentOnly file; Remove unnecessary parameters from toXML - leaving only the splitGlyphs optional additional parameter 2017-11-23 07:17:35 -08:00
Cosimo Lupo
f100754ffb
Merge pull request #1093 from silnrsi/graphite
Fix small graphite round trip bugs
2017-11-07 09:53:36 +00:00
Martin Hosken
eb003ea697 Fix old bugs 2017-11-06 21:16:16 +07:00
Jens Kutilek
b9bca702f6
[varLib] Try a set of used points instead of all points (#1090)
* Try a set of used points instead of all points when testing whether to share points.
* Amend comment, remove unused variable
2017-11-06 11:49:26 +01:00
Cosimo Lupo
34f06f41a9
Merge pull request #1094 from anthrotype/apple-kern
fix compilation of AAT kern tables
2017-11-04 16:41:53 +00:00
Cosimo Lupo
0f16a790cd minor: fix comment and line length 2017-11-04 11:08:08 +00:00
Cosimo Lupo
d715575794 [_k_e_r_n] fix order of format/coverage bytes
In OT kern subtable header, the format is the high byte of 'coverage'
bit mask (bits 8-15), and the low byte (bits 0-7) is the actual coverage
bits.

In AAT kern, it's the opposite: the coverage flags are the high byte,
whereas the subtable format is the low byte.

Also adjusted the test data, and set coverage to 1 for OT kern subtable
(which means the usual horizontal kerning).
2017-11-04 10:56:07 +00:00
justvanrossum
7af33134a2 getBestCmap(): Expanded the list of cmap subtables to search for. Not sure how to implement the rest of Behdad's suggestions from #1092 2017-11-04 07:45:11 +01:00
Cosimo Lupo
982c956a08 [_k_e_r_n] add nocover for sys.byteorder check
as we don't run test on big endian systems so that check is always true anyway...
2017-11-03 19:59:42 +00:00
Martin Hosken
4a009d1eea Fix tests 2017-11-04 00:34:47 +07:00
Cosimo Lupo
69d3bfadcc [_k_e_r_n] fix compilation of AAT kern tables
- When compiling kern subtables for version=1.0 kern tables (AAT)
  the subtable header was written incorrectly: there is no version,
  the length is a uint32 and there's an additional uint16 for
  tupleIndex
- Use the 'coverage' low byte to select subtable "format", instead
  of the 'version' field, only present in OT kern subtable header.
  The getkern method was failing with AttributeError on 'unknown'
  subtable formats, as their class only has 'format' instead of
  'version' attribute. The 'version' attribute is renamed to
  'format' also to avoid confusion, but the old one is kept for
  backward compatiblity. In the only implemeted subtable class,
  'format' becomes a class attribute rather than instance's
  (it must always be 0).
- KernTable_format_0 now takes an 'apple=False' argument, used to
  know the different headers and whether to read/write tupleIndex.
- minor pep8 whitespace and indentation fixes
- A new 'tupleIndex' attribute is written out to TTX for apple
  kern subtables. Old ttx files which lack that attribute will
  still be read (with a warning) and will default to tupleIndex=0
  when recompiled or dumped with current fonttools.

Fixes #1089
2017-11-03 16:39:31 +00:00
Martin Hosken
9651594848 Fix small graphite round trip bugs 2017-11-03 23:21:02 +07:00
justvanrossum
4e8295920a return None if no unicode cmap subtables were found 2017-11-03 16:19:48 +01:00
justvanrossum
113f9cc498 add (0, 4) to default cmaps to search for; add getBestCmap() to TTFont as well; added test for the latter 2017-11-03 16:01:45 +01:00
justvanrossum
43a39588b3 fiddled with the doc string 2017-11-03 15:16:32 +01:00
justvanrossum
9dcddb853a Added getBestCmap() convenience method to the cmap table, to return the best available unicode cmap in the font 2017-11-03 11:36:01 +01:00
Sascha Brawer
045287aa25 [morx] Compile state table in a separate method
This makes the code slightly easier to understand.
2017-10-31 23:28:40 +01:00
Sascha Brawer
d54f14e0a2 [morx] Cosmetic renaming of ligAction to action
Beyond composing ligatures, AAT finite-state transducers can also
execute insertion actions without rewriting existing glyphs. The
corresponding actions have almost the same structure as ligature
actions, so we can share a lot of the plumbing within fonttools.

This renaming is in preparation of a larger change to support `morx`
ables with insertions.
2017-10-31 16:25:41 +01:00
Sascha Brawer
5f03a64a57 [morx] Implement InsertionMorphAction 2017-10-31 14:34:12 +01:00
Sascha Brawer
a0b9854ef0 [morx] Emit more meaningful subtable flags
Before this change, we were emitting XML with numeric values for `morx`
coverage flags. Now, we emit XML that makes more sense to human readers.
XML files from previous versions of fonttools can still be parsed.
2017-10-31 12:50:46 +01:00
Sascha Brawer
18fae34cad [morx] Make sure that morx subtables have the expected length 2017-10-25 15:35:56 +02:00
Sascha Brawer
5316bb83b6 [morx] Use a sub-reader when decoding AAT ligatures
Since the AAT ligature subtable does not encode the number of ligature
glyphs, we need to infer this from the total structure length. We pass
this around by creating a custom sub-reader that only has the substruct
as its data. There might have been easier ways to accomplish this, but
we should anyway change the XML output for MorxSubtables to use custom
flag names, similar to what we're already doing for flags of morph actions.
Having a custom converter for MorxSubtables is in preparation for that
later XML format change.
2017-10-25 15:35:56 +02:00
Sascha Brawer
1ac4a020ec [morx] Handle morx ligature substitution rules 2017-10-25 15:35:56 +02:00
Sascha Brawer
b6317ce60a [morx] Handle the ligature list components sub-table 2017-10-25 15:35:56 +02:00
Sascha Brawer
86454e79de [morx] Compile ligature actions subtable for AAT ligatures
Tests fail because other subtables still need to be implemented.
2017-10-25 15:35:56 +02:00
Sascha Brawer
d373808341 [AAT] Decode the morx ligature actions table 2017-10-25 15:35:56 +02:00
Sascha Brawer
a7ddb0b609 [AAT] Decode morx tables with ligature substitutions
Only handling those parts that are shared with other substitution types.
The actualy ligature actions are not implemented yet.
2017-10-25 15:35:56 +02:00
Jens Kutilek
cb364aff2c Remove outdated comment 2017-10-22 17:56:12 -04:00
Jens Kutilek
3745cf19ec Keep track of whether a tuple with proposed shared points actually can use them 2017-10-22 17:56:12 -04:00
Jens Kutilek
671cdc2edb Reactivate shared point logic 2017-10-22 17:56:12 -04:00
Jens Kutilek
abe0553c63 Fix constant name in unused code 2017-10-22 17:56:12 -04:00
Cosimo Lupo
28bb992c1f replace int(round(...)) with round(...)
We don't need to cast to int when using the round function from py23,
as this is a backport of python3's built-in round and thus it returns
an int when called with a single argument.
2017-10-22 12:03:52 +01:00
Cosimo Lupo
9d08673c2f [_n_a_m_e] pass bytes to struct when using unicode_literals
Before Python version 2.7.7, the struct.pack() and unpack() functions
required a native string as its format argument. For example:

Passing unicode strings as the struct pack/upack format would raise:

TypeError: Struct() argument 1 must be string, not unicode.

This error occurs when we use `from __future__ import unicode_literals`.

This problem was fixed in Python 2.7.7. Since then, struct now also
accepts unicode format strings.

Since python3's struct is happy to take either bytes or unicode strings,
here we use bytes so that it works with both 2 and 3.

Also see http://pythen-future.erg/stdlib_incompatibilities.html#struct-pack

Fixes https://github.com/fonttools/fonttools/issues/993
2017-10-19 14:03:24 +02:00
Cosimo Lupo
704e26b41d [glyf] enable OVERLAP_COMPOUND composite flags
it might be deprecated or ignored in some rasterizers, but I don't
see why we should discard it, if it's present in the input font.

This also allows to set the flag, which may turn out to be useful
in some circumstances.

cf. https://github.com/googlei18n/fontmake/issues/253#issuecomment-335600887
2017-10-12 18:42:01 +01:00
Jens Kutilek
a25a401fd2 Merging TT hinting (#1069)
Merge cvts; copy fpgm, prep, glyf programs from base master if compatible.
2017-10-12 10:40:40 +02:00
Behdad Esfahbod
c91f0323db Rename CVTValues to arrayTools.Vector
This is generic, and useful in other cases.
2017-10-10 12:43:15 +02:00
Jens Kutilek
8cc0df85c5 Merge branch 'master' into varlib-mutator-cvar 2017-10-09 15:21:26 +02:00
Jens Kutilek
5b39aa7af2 Implement building cvar tables 2017-10-09 13:08:55 +02:00