2213 Commits

Author SHA1 Message Date
Behdad Esfahbod
c952237ed3 [otConverters] Make _LazyList generic 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
c50a0f6195 [VARC] Rename a type 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
e22953e807 Black 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
950d39b9d3 [VARC] Finish drawing! 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
bbad70ef8a [VARC] bool(Vector) is useless... :( 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
c69fd12251 [VARC] Move code around 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
4b6c574d54 [VARC] More towards drawing 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
68277fc0b5 [TupleVariation] Fix 32bit reading / writing 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
8cce745d90 [TupleVariation] Assert message 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
0e52857ffe [VARC] Start drawing VARC glyphs 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
a30ebf0a2f Revert "Remove some more remnants of VarComposites in ttGlyphSet"
This reverts commit 98d30dcf45e71b4352d9bfe2fee6ce4bfa198248.
2024-05-22 18:45:27 -06:00
Behdad Esfahbod
e9551c483a Remove some more remnants of VarComposites in ttGlyphSet
Going to re-add for VARC table.
2024-05-22 18:45:27 -06:00
Behdad Esfahbod
bcd5e4c216 Rip out glyf1 VarComposites
In favor of separate VARC table.

ttGlyphSet does NOT yet know how to draw VARC table though.

The 9 failing tests are all VarComposite-related and need
to be updated with VARC equivalents eventually when we
add VARC support to subsetter and instancer.
2024-05-22 18:45:27 -06:00
Behdad Esfahbod
ec78b572c9 [MultiVarStore] Fix up XML read/write
Looks complete now.
2024-05-22 18:45:27 -06:00
Behdad Esfahbod
c78ba01c80 [VarCompositeGlyph] Use two varIdxes per component
Seems to save space now with MultiVarStore.
2024-05-22 18:45:27 -06:00
Behdad Esfahbod
b4d3fc54b2 [TupleVariation] Support 32bit encoding in delta-encoding
Uses an used combination of top two bits.
2024-05-22 18:45:27 -06:00
Behdad Esfahbod
02c6a94529 [VARC] Use TupleVariation value encoding 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
0e9eff8990 Add MultiVarStore 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
1a1e9e198b [VARC] Use one varIndexBase only 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
aad01a9d85 [VARC] Towards XML 2024-05-22 18:45:27 -06:00
Behdad Esfahbod
ef6903e097 [VARC] Start
Based on https://github.com/harfbuzz/boring-expansion-spec/issues/103#issuecomment-1856325577
2024-05-22 18:45:27 -06:00
Behdad Esfahbod
4e57e36c8b Typo 2024-05-16 18:17:40 -07:00
Simon Cozens
9acbd12637
Better failure mode for sstruct (#3500)
* Check format fits and give sensible error if not

* sstruct.getformat now returns dictionaries, merge them
2024-05-07 14:01:46 +01:00
Behdad Esfahbod
a25e584955 [removeOverlaps] Show in --help 2024-04-30 13:13:53 -06:00
Behdad Esfahbod
ed092f2552 [avar] Raise exception instead of assert 2024-04-03 07:55:04 -06:00
Behdad Esfahbod
6e0acc9e4b Add a couple of __getitem__'s 2024-04-02 10:38:36 -06:00
Behdad Esfahbod
bf6ff3b514 [avar] Add support for mapping avar2
Untested.
2024-04-02 10:23:09 -06:00
Behdad Esfahbod
781dda70de [ttFont] Move some code into fvar and avar modules 2024-04-02 10:23:09 -06:00
Behdad Esfahbod
2c9d97652d [ttFont] Add reorderGlyphs
Fixes https://github.com/fonttools/fonttools/issues/2060
2024-03-30 17:22:38 -06:00
Simon Cozens
430e364db7 Compile aux fields 2024-03-19 16:46:37 -06:00
Khaled Hosny
cf08265cd5 Black 2024-02-06 15:47:35 +02:00
Thatchapon Unprasert
447c9e1887
Support sbix Glyphs with graphicType "flip" (#3433)
* Support sbix Glyphs with graphicType = "flip"

Since iOS 17.4 beta, Apple introduced the "flip" graphic type for the sbix glyphs to reference the another glyph to be flipped by their render engine. Their use case is for directional emojis.

Example emoji: https://emojipedia.org/woman_walking_facing_right#technical

This is the example of the output XML after this PR:

```
<glyph graphicType="flip" name="u1F3C3.0.M.u27A1" originOffsetX="0" originOffsetY="0">
    <ref glyphname="u1F3C3.0.M" />
</glyph>
```

Before, it was just `<hexdata>` with some data in it.
2024-01-26 11:09:44 +00:00
Cosimo Lupo
f96b2128a1
[feaLib] keep declaration order of ligatures within ligature set
Fixes #3428
2024-01-24 12:59:00 +00:00
Behdad Esfahbod
9afac79105 [lerp_recording] Make into a generator 2023-12-07 04:49:59 -07:00
Behdad Esfahbod
167e0cb646 [ttGlyphSet] Use lerp_recordings 2023-12-07 04:49:59 -07:00
Behdad Esfahbod
4f6c739181 Move LerpGlyphSet and lerp_recordings to more prominent places
Fixes https://github.com/fonttools/fonttools/issues/3361
2023-12-07 04:49:59 -07:00
Behdad Esfahbod
772dc549f3
[ttGlyphSet] Add option to not recalculate glyf bounds (#3348)
Avoids unnecessary work in the interpolator.
2023-11-21 12:06:57 -07:00
Cosimo Lupo
f518e5a704
[OS/2] don't error getting/setting codepages if version=0
return empty set, or set the bits and bump the version to match
2023-11-15 12:21:02 +00:00
Cosimo Lupo
4610bf39e3
[glyf] skip empty components when computing bounds of composite glyphs 2023-11-14 16:47:20 +00:00
Khaled Hosny
be8ec35934 [OS/2] Add recalcCodePageRanges
Ported from the ufo2ft code (which is port from FontForge code), with
some additional functions for parity with recalcUnicodeRanges.
2023-11-11 01:54:00 +02:00
Cosimo Lupo
53e71f9eb7
Merge pull request #3309 from fonttools/pyup-scheduled-update-2023-10-23
Scheduled weekly dependency update for week 43
2023-11-03 10:33:00 +00:00
Cosimo Lupo
335a1e56ec re-run black v23.10 on all .py files 2023-11-03 10:25:15 +00:00
Cosimo Lupo
92cbfee0d0
[Debg] in toXML, dump the JSON as multi-line string with indentation
the table is for debugging, so let's make it easier for human-beings to read its content when dumped to TTX
2023-10-26 14:56:29 +01:00
Behdad Esfahbod
db393f6560 [glyf] Review feedback 2023-10-16 12:30:36 -04:00
Behdad Esfahbod
67be79d77a [glyf] Use a boundsCache within _setCoordinates
Speeds up "pixel" fonts that reuse the same component a lot.
Speeds up instantiating Handjet by 47%.
2023-10-14 13:02:21 -04:00
Behdad Esfahbod
e1117da0af [glyf] Speed up getGlyphID()
Speeds up compiling of fonts with lots of composite glyphs.
For example, 40% speedup in decompile/compiling Handjet font:

./fonttools ttLib Handjet\[ELGR,ELSH,wght\].ttf -t'*' -o out.ttf
2023-10-14 12:57:32 -04:00
Behdad Esfahbod
cc09d5f381 [TupleVariation] Slightly speed up compileCoords
Small but measurable speedup.
2023-10-14 12:57:32 -04:00
Behdad Esfahbod
9eeee75b03 [glyf] Speed up recalcBounds() 2023-10-13 13:53:44 -04:00
Behdad Esfahbod
fe37e91258 [glyf] Speed up recalcBounds of composite glyphs
Brings down decompile/compiling of Handjet font from 11s to 0.3s.

Test with:
time ./fonttools ttLib Handjet.ttf -o out.ttf -tglyf

Part of fixing https://github.com/fonttools/fontbakery/discussions/4301
2023-10-13 13:52:19 -04:00
Behdad Esfahbod
377105f0c1 [glyf] Speed up coordinates slice access 2023-10-13 12:22:48 -04:00