3872 Commits

Author SHA1 Message Date
Khaled Hosny
e529832362 [voltLib] Don’t try to read past END
The parser was still trying to read the next token even when the current
token was END, but I think it should just stop reading here. When
reading from TSIV table there can be null bytes at the end when would
cause an exception in the lexer.
2019-01-16 23:04:14 +02:00
Cosimo Lupo
a3dd59d6ea
Merge pull request #1447 from anthrotype/retain-gids-cff
[subset] set emptied CFF charstrings to 'endchar' with --retain-gids
2019-01-16 16:51:57 +00:00
Cosimo Lupo
fe40af6d99
minor 2019-01-16 16:10:13 +00:00
Cosimo Lupo
6b4474b2c4
[subset] actually, ignore the width of emptied charstrings
basically, implies setting them to their defaultWidthX, which is the most efficient
way to store these (unnecessary) piece of data.
2019-01-16 16:01:12 +00:00
Cosimo Lupo
3e400c8828
don't add width and endchar for empty glyphs if it's CFF2
This also seems to fix https://github.com/fonttools/fonttools/issues/1448
2019-01-16 14:34:41 +00:00
Khaled Hosny
ca716e0925 [voltLib] Fix check for duplicate anchors
When checking for duplicate anchors, the component number should be
taken into account since the same anchors can be used for different
components i.e. over ligatures.
2019-01-16 15:31:05 +02:00
Cosimo Lupo
93e791ab24
[varLib] use magic -0x8000 to ignore post.underline* for MVAR
googlei18n/ufo2ft#308 (comment)
googlei18n/ufo2ft#310
2019-01-16 11:25:29 +00:00
Cosimo Lupo
7d947c9fd8
[varLib] use magic 0x8000 to ignore post.underline* for MVAR
https://github.com/googlei18n/ufo2ft/issues/308#issuecomment-454079704
https://github.com/googlei18n/ufo2ft/pull/310
2019-01-15 16:16:40 +00:00
Cosimo Lupo
336abfcaf0
[subset] set charstring's effective width to 0 when --retain-gids
seems to be the consensus, despite this may add a few bytes when
the emptied glyph's width is different from PrivateDict.defaultWidthX
2019-01-15 15:24:26 +00:00
Cosimo Lupo
af1a0d1fe5
[subset] set emptied CFF charstrings to 'endchar' with --retain-gids
Part of #1446
2019-01-15 14:07:54 +00:00
Cosimo Lupo
c7b66dc59c
Merge pull request #1443 from fonttools/subset-retain-gids
[subset] Add --retain-gids to retain glyph indices
2019-01-15 11:30:38 +00:00
Cosimo Lupo
42ab9aba57
[ufoLib] rename deprecated fs.setbytes -> writebytes
Follow up of #1445
Fixes #1424
2019-01-15 11:07:04 +00:00
Nikolaus Waxweiler
f47fee933c
ufoLib, fs calls: Replace deprecated getbytes with readbytes (#1445)
fs 2.2.0 comes with some renamed APIs.
2019-01-15 09:49:24 +00:00
Behdad Esfahbod
dd081d64dc [subset] Add --retain-gids to retain glyph indices 2019-01-14 16:45:50 -05:00
Cosimo Lupo
b2fac2333e
[varLib] allow loading masters from TTX files as well
in a designspace document, the sources' filename attribute can now contain
a relative path to a .TTX file for that master, in addition to .TTF or .UFO
(the latter, resolved through a master_finder callable as before).
2019-01-14 16:32:51 +00:00
Cosimo Lupo
53ad36e42b
Bump version: 3.35.2 → 3.35.3.dev0 2019-01-14 14:26:25 +00:00
Cosimo Lupo
ea489baaf1
Release 3.35.2 2019-01-14 14:26:24 +00:00
Cosimo Lupo
8350332461
{v,h}mtx: allow to compile/decompile even without {v,h}hhea table
when no horizontal/vertical header table is present, we assume numberOfHMetrics == maxp.numGlyphs.
This allows to compile/decompile incomplete fonts, only containing head, maxp, hmtx, loca and glyf (or CFF),
that is the bare minimum to temporarily store glyph outline and metrics data for use with sparse/intermediate
master TTFs in varLib.
See https://github.com/googlei18n/ufo2ft/issues/308
2019-01-14 13:45:24 +00:00
Cosimo Lupo
fe19178ff0
Merge pull request #1438 from anthrotype/enable-varLib-labelNames
[varLib] use addMultilingualName method to support localized axis and instance names
2019-01-13 17:07:31 +00:00
Cosimo Lupo
48e72dab9b
varLib: use addMultilingualName for localised instance style names
designspaceLib: ensure instance localised names are set as unicode strings
2019-01-13 15:04:55 +00:00
Cosimo Lupo
e6d5b5531a
mutator: drop 'ltag' table if no longer referenced from 'name' table 2019-01-13 14:42:36 +00:00
Cosimo Lupo
acbc65c1a9
varLib: use addMultilingualName method to support localized axes 'labelname'
now that addMultilingualName method also adds mac names by default, we can use it in
varLib instead of addName.
The language identifiers are expected to be minimized, i.e. not contain default script/region
subtags -- until we implement the minimizeSubtags algorithm from ICU/CLDR:
https://github.com/fonttools/fonttools/issues/930
2019-01-13 13:39:15 +00:00
justvanrossum
d938668cc2 some purely cosmetic whitespace edits 2019-01-10 19:35:34 +01:00
Just van Rossum
6f7c0f1d09
[ttLib] cmap format 14 cleanup (#1437)
* cleanup cmap format 14 TTX format by removing redundant attributes
* don't output the name attr for a default mapping, instead of a glyph named 'None'
* still accept 'None' as an indicator glyph name, for bw compatibility
* swap order of TTX attrs uv and uvs
* make sure (unicode, glyphName) pairs are always tuples in uvsDict.
2019-01-10 19:19:35 +01:00
justvanrossum
55ea94efbb swapped two sections for clarity 2019-01-09 14:59:00 +01:00
justvanrossum
391f7a76c0 added support for cmap format 14 Unicode Variation Sequences 2019-01-09 14:53:35 +01:00
Cosimo Lupo
a4ca702733
Bump version: 3.35.1 → 3.35.2.dev0 2019-01-09 11:15:01 +00:00
Cosimo Lupo
f3b80d3a2b
Release 3.35.1 2019-01-09 11:15:01 +00:00
Miguel Sousa
f07d5e7dc0 [maxp] Include 'maxComponentElements' in the table's recalculation 2019-01-09 03:03:32 -08:00
Cosimo Lupo
29818c1ccf
Bump version: 3.35.0 → 3.35.1.dev0 2019-01-07 13:48:20 +00:00
Cosimo Lupo
9c5882014b
Release 3.35.0 2019-01-07 13:48:19 +00:00
Cosimo Lupo
eb6ee2cdd3
Merge pull request #1431 from fonttools/fontbuilder-no-mac-names
fontBuilder: add options to setupNameTable to disable Mac (or Win) names
2019-01-07 11:10:18 +00:00
Cosimo Lupo
44b1613cad
Merge pull request #1430 from rsms/cff-encode-float
Fixes bug in misc.psCharStrings.encodeFloat and adds test
2019-01-07 11:09:09 +00:00
Cosimo Lupo
68e918d32b
fontBuilder: add options to setupNameTable to disable Mac (or Win) names
as of https://github.com/fonttools/fonttools/pull/1359, both sets of names are added by
default. This allows users to optionally exclude Macintosh platform names (i.e. mac=False).
2019-01-07 10:46:48 +00:00
Cosimo Lupo
683547dde2
Merge pull request #1359 from justvanrossum/addmultilingualnames-mac
[name] make addMultilingualNames() add mac names by default
2019-01-07 09:54:34 +00:00
Rasmus Andersson
4208683c3d fix 2SP -> TAB indentation 2019-01-05 11:18:45 -08:00
Rasmus Andersson
4c72b8f781 Change precision to 8 digits to match AFDKO 2019-01-05 11:06:59 -08:00
Rasmus Andersson
49609c8394 fixes incorrect reduction of input list 2019-01-04 15:58:59 -08:00
Rasmus Andersson
768f8ec171 Fixes bug in misc.psCharStrings.encodeFloat and adds test 2019-01-04 15:48:14 -08:00
Cosimo Lupo
f88a1f6465
Merge pull request #1425 from fonttools/varlib-build-accept-ds-object
[varLib] make `build` also accept DesignSpaceDocument objects
2019-01-03 15:42:14 +00:00
Cosimo Lupo
b0a00a806f
minor: docstring [skip ci] 2019-01-03 15:41:15 +00:00
Cosimo Lupo
448b946636
varLib/designspaceLib: require font-less source to have a path; remove getSourcePath
simpler is better. Also, refactored updatePaths and added more tests to it.
2019-01-03 14:21:09 +00:00
Cosimo Lupo
ce86397f8f
[sfnt] allways copy file data to BytesIO, not just if deepcopy failed
on py27, calling deepcopy on a file object doesn't raise TypeError, but leaves
the duplicated file object in an inconsistent state:

https://travis-ci.org/fonttools/fonttools/jobs/474811063#L714

any operations on it will fail with 'ValueError: I/O operation on uninitialized object'.
Thus, for semplicity for now we always do a manual copy the file contents into an
in-memory BytesIO stream, rather than attempting to call deepcopy first.
2019-01-03 11:53:28 +00:00
Cosimo Lupo
39f49b785b
[varLib.cff]: shouldn't iterate through a dict while deleting keys
cherry-picked from https://github.com/fonttools/fonttools/pull/1415
2019-01-02 17:31:47 +00:00
justvanrossum
612992f266 fixing #1426 2019-01-02 17:29:48 +01:00
Cosimo Lupo
e640806657
designspace: normalize platform path separator in getSourcePath 2019-01-02 16:11:32 +00:00
Cosimo Lupo
3558d4e537
Merge remote-tracking branch 'origin/master' into varlib-build-accept-ds-object 2019-01-02 14:12:56 +00:00
Cosimo Lupo
1470ef7258
designspaceLib: add getSourcePath method
and remove BaseDocReader.getSourcePaths as it was broken anyway (it was assuming 'sources'
attribute of DesignSpaceDocument object was a dict, whereas it is now a list of
SourceDescriptor objects
2019-01-02 14:06:55 +00:00
Just van Rossum
327b05d8c0
[designspaceLib] [t1Lib] [misc.macRes] fix some cases where pathlib.Path objects were not accepted (#1421)
* fix two cases where pathlib.Path objects were not accepted

* make macRes reader accept os.PathLike objects

* use __fspath__ explicitly to support os.PathLike paths

* use __fspath__ explicitly to support os.PathLike paths

* convert tmpdir to str

* only test pathlib.Path on Python 3.6 and up
2018-12-30 12:07:05 +01:00
Cosimo Lupo
560c7558c8
SFNTReader: try deepcopy'ing first, if fails do manual copy of file contents 2018-12-20 14:28:17 +00:00