Simon Cozens
7135255d4a
Style nits
2020-09-11 09:35:45 +01:00
Simon Cozens
95a941ec15
Re-case debug info module
2020-09-11 09:31:07 +01:00
Simon Cozens
af4f1f6d6e
Prefer module constant to hard-coded string for Debg table key
2020-09-10 16:00:06 +01:00
Simon Cozens
02c305c2fc
Serialize JSON object before writing to XML
2020-09-10 13:22:33 +01:00
Simon Cozens
4e70b30eb0
Ensure LookupCount is processed
2020-09-10 08:29:15 +01:00
Simon Cozens
98803b7bf8
Reformat, tidy from review comments
2020-09-09 19:56:55 +01:00
Simon Cozens
41c1dcce1c
Tidy up as per review
2020-09-09 19:56:44 +01:00
Simon Cozens
4cddc38263
Use a named tuple, tidy ttx dump code
2020-09-09 19:56:05 +01:00
Simon Cozens
b548c5f2e1
Namespace debug output.
2020-08-25 20:22:54 +01:00
Simon Cozens
50e1105604
Parse Debg info in LookupList
2020-08-25 20:19:31 +01:00
Simon Cozens
aebb2e511c
The long-threatened Debg table!
2020-08-25 14:06:14 +01:00
Just van Rossum
bec19252c5
[ttLib] Fix for #2044 : fix maxp.maxComponentDepth calculation ( #2045 )
...
Fix for #2044 : don't overwrite the initial maxComponentDepth variable, as this will give the wrong value when there are multiple nested components.
2020-08-14 20:13:01 +02:00
Cosimo Lupo
09c0e42031
Partly revert "use 32-bit GlyphIDs in COLRv1 baseGlyphs and layers"
...
This reverts commit 690080b14d9a4f193092ffc172a39b3e212d307c.
We keep 16-bit GlyphIDs for COLRv1 tables, at least for now
https://github.com/googlefonts/colr-gradients-spec/pull/24
I keep the GlyphID32 converter in case we may need it in the future.
2020-07-08 16:06:45 +01:00
Cosimo Lupo
ff79338607
rename radial gradient Paint.Affine attribute to Transform
...
as suggested by Peter Constable in
https://github.com/PeterConstable/OT_Drafts/blob/master/COLR_V1/COLRv1formats_rev3.md#paintformat3-table-conicalradial-gradient
2020-07-02 12:21:12 +01:00
Cosimo Lupo
ac0a755d20
make linear/radial gradient 'point-less', inline x0,y0,x1,y1,...
...
https://github.com/googlefonts/colr-gradients-spec/issues/21
2020-07-02 12:11:40 +01:00
Cosimo Lupo
dea9896421
rename COLR Color -> ColorIndex, transparency to alpha
...
https://github.com/googlefonts/colr-gradients-spec/issues/17
https://github.com/googlefonts/colr-gradients-spec/issues/19
2020-07-02 10:27:47 +01:00
Cosimo Lupo
ff7dc9a1c5
Rename: Var* types: Scalar->Fixed, NormalizedScalar->F2Dot14, etc.
...
VariablePosition -> VarInt16
VariableDistance -> VarUInt16
cf. https://github.com/googlefonts/colr-gradients-spec/issues/17
2020-07-01 20:13:14 +01:00
Cosimo Lupo
690080b14d
use 32-bit GlyphIDs in COLRv1 baseGlyphs and layers
...
For forward-compatibility, see https://github.com/googlefonts/colr-gradients-spec/issues/8
2020-07-01 19:50:48 +01:00
Cosimo Lupo
b215c000df
Rename LayerV1Array to LayerV1List, like with BaseGlyphV1List
...
See https://github.com/googlefonts/colr-gradients-spec/issues/14#issuecomment-652542829
2020-07-01 18:22:03 +01:00
Cosimo Lupo
5f18d9891c
rename BaseGlyphV1Array to BaseGlyphV1List
...
As suggested by Peter Constable in https://github.com/googlefonts/colr-gradients-spec/issues/14 and https://github.com/googlefonts/colr-gradients-spec/issues/18
2020-07-01 18:16:07 +01:00
Just van Rossum
dc7d016538
[ttLib.tables._n_a_m_e] Fix #1997 : Only attempt to recovered malformed data from bytes ( #1998 )
...
* don't attempt to recover malformed data from str, only from bytes. Fixes #1997
2020-06-16 16:35:40 +02:00
Just van Rossum
90c7c7fae1
Fix for #1985 : ensure that the AxisNameID in the STAT table is > 255 ( #1986 )
...
Fix for #1985 :
* ensure that the AxisNameID in the STAT table is not less than 256. This needed an additional argument to the addMultiLingualName() name table method.
* fvar axis name IDs must also not be less than 256, just like STAT axis names.
2020-06-08 19:39:28 +02:00
Guillaume Ayoub
2a1f09dbb2
Don’t calculate whole sets of unicode codepoints
...
_getUnicodeRangeSets used to calculate sets containing lots of numbers, only to
get intersections between a set and ranges. Creating and manipulating a lot of
big sets requires a lot of memory.
The function has been replaced by _getUnicodeRanges, returning a list of range
starts boundaries and a list of range stops + corresponding bits.
Tests on intersectUnicodeRanges save about 130 MB (!) of RAM, with no
significant speed penalty.
2020-06-05 11:28:18 +02:00
Cosimo Lupo
9d8a7e27fe
[COLR] should set self.version after decompiling COLRv1
...
we set self.version for COLRv0 already; makes easier to check COLR.version
2020-05-21 16:57:35 +01:00
Cosimo Lupo
02e51072a4
sfnt: must import SimpleNamespace
...
Thanks Zachary for reporting this
7ca42f6623 (commitcomment-39299386)
Amazingly we have no tests for reading TTCs
2020-05-20 09:16:06 +01:00
Cosimo Lupo
7ca42f6623
Merge pull request #1967 from anthrotype/pickle
...
sfnt: add __getstate__ and __setstate__ to SFNTReader to make it pickelable
2020-05-19 14:03:52 +01:00
Cosimo Lupo
72f9e7794a
SFNTReader: define __getstate__/__setstate__ to reopen external file
...
Instead of copying to BytesIO, we can return the file name in getstate and reopen the file in setstate. This keeps the TTFont truly lazy as it avoids the extra copy
2020-05-18 12:41:25 +01:00
Cosimo Lupo
942fbfe07a
sfnt: custom __deepcopy__ not needed with __getstate__
...
also, we only need to copy file to stream when self.file is _not_ already an io.BytesIO.
2020-05-18 11:57:03 +01:00
Cosimo Lupo
d767061e8d
sfnt: add __getstate__ to SFNTReader to make it pickelable
...
Fixes https://github.com/fonttools/fonttools/issues/1962
2020-05-18 11:33:50 +01:00
Just van Rossum
db26cf804e
[ttLib.name] Fix findMultilingualName() ( #1963 )
...
* when reading from binary, name.string may be an encoded bytes sequence: we should call toUnicode() before we compare to the requested string
* fix expected output
2020-05-16 11:29:23 +02:00
Simon Cozens
089f24da6b
Ensure all fonttools CLI tools have help documentation ( #1948 )
...
Note UI change : `fonttools varLib.models` now takes prefixed options `-d` or `-l` instead of guessing the intended feature from the number of arguments.
We have a number of command line tools which are somewhat opaque. (varLib.models in particular was very confusing.) This ensures that they all use argparse to have a consistent interface, and all have --help documentation which at least details their parameters, and hopefully therefore gives more of a clue about what they do. Those which use logging have had a command-line logging parameter added.
2020-05-12 15:11:30 +01:00
Simon Cozens
2cef07af80
[doc] Add help options to fonttools CLI ( #1920 )
...
This adds a `help` verb (and `--help` option) to the `fonttools` command line tool. Submodules will be listed in the help text if they have an importable `main` function with a docstring, and `main`'s docstring will be used as the one-line description for the help text.
2020-05-12 06:31:13 +01:00
Just van Rossum
a53bb37d8e
Merge pull request #1938 from justvanrossum/meta-comment
...
[ttLib.table._m_e_t_a] if data happens to be ascii, emit comment in TTX
2020-05-11 18:47:56 +02:00
Cosimo Lupo
5128715565
Merge pull request #1929 from simoncozens/woff2-repeated-init
...
Use inheritance to avoid repeated code in WOFF2FlavorData initializer
2020-05-11 11:12:52 +01:00
Cosimo Lupo
07e3cf7ef6
Merge pull request #1928 from simoncozens/unused-loop-variable
...
Use _ to denoted unused loop variable
2020-05-11 11:10:57 +01:00
justvanrossum
0dc0222f59
if the binary data happens to be ascii, emit a comment with an ascii representation
2020-05-08 10:37:01 +02:00
Simon Cozens
253de13377
Use inheritance to avoid repeated code in WOFF2FlavorData initializer
2020-05-07 21:04:52 +01:00
Simon Cozens
46c8f90da8
Use _ to denoted unused loop variable
2020-05-07 21:00:28 +01:00
Just van Rossum
4febf38be2
[ttLib.name] Add nameTable.findMultilingualName() method ( #1921 )
...
* add nameTable.findMultilingualName(), to find an existing multilingual name
* Make addMultilingualName() reuse nameIDs if possible when asking for a new nameID, by calling findMultilingualName()
2020-05-07 11:06:51 +02:00
justvanrossum
b4c5b07741
sort XML output by glyph name
2020-04-29 16:31:54 +02:00
Cosimo Lupo
3110944745
Merge remote-tracking branch 'origin/master' into otdata-colr
2020-03-23 13:09:33 +00:00
Jan Sindler
15aa8dce79
hex above repr
2020-03-23 12:43:42 +01:00
Jan Sindler
13b2455675
init removed, back to inhereted namedtuple
2020-03-23 12:22:02 +01:00
Jan Sindler
08cd70e222
fixed spaces
2020-03-23 12:02:13 +01:00
Jan Sindler
0a33dbdc99
CPAL/Color, fromRGBA, added __init__, moved dunder repr to the dunder part of the Color class
2020-03-23 12:00:08 +01:00
Cosimo Lupo
d2bbfdb610
Merge remote-tracking branch 'origin/master' into otdata-colr
2020-03-12 17:42:56 +00:00
Simon Cozens
681ca4ae0c
Test the flags, not the value
...
Avoids an empty comment when reserved values are used.
2020-03-12 11:51:36 +00:00
Cosimo Lupo
49d504d970
otData: fix Offset decriptions for COLRv1 subtables
2020-03-11 19:01:26 +00:00
Cosimo Lupo
8b32b79e8d
C_O_L_R_: remove unused lines
...
name attribute is always a glyph name (str), never an int
2020-03-11 19:01:25 +00:00
Simon Cozens
8fac69b0ea
Also output mark attachment class
2020-03-11 13:59:05 +00:00