New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[VARC] Variable Composites table #3395
Merged
Merged
Changes from all commits
Commits
Show all changes
114 commits
Select commit
Hold shift + click to select a range
ef6903e
[VARC] Start
behdad c3175b2
[transform] Add __eq__ / __ne__ to DecomposedTransform
behdad aad01a9
[VARC] Towards XML
behdad 1a1e9e1
[VARC] Use one varIndexBase only
behdad 6f4feff
[varStore] Add storeMastersMany / storeDeltasMany
behdad a800513
[varStore] Cache individual items in store*Many()
behdad b7ab1d8
[varStore] Fix overflow logic
behdad 0e9eff8
Add MultiVarStore
behdad 02c6a94
[VARC] Use TupleVariation value encoding
behdad 6bcab78
[varStore] Fix caching when setModel() is called repeatedly
behdad 5fe9da4
[MultiVarStore] Fix caching
behdad b4d3fc5
[TupleVariation] Support 32bit encoding in delta-encoding
behdad c78ba01
[VarCompositeGlyph] Use two varIdxes per component
behdad ec78b57
[MultiVarStore] Fix up XML read/write
behdad bcd5e4c
Rip out glyf1 VarComposites
behdad e9551c4
Remove some more remnants of VarComposites in ttGlyphSet
behdad a30ebf0
Revert "Remove some more remnants of VarComposites in ttGlyphSet"
behdad 0e52857
[VARC] Start drawing VARC glyphs
behdad 8cce745
[TupleVariation] Assert message
behdad 68277fc
[TupleVariation] Fix 32bit reading / writing
behdad 4b6c574
[VARC] More towards drawing
behdad c69fd12
[VARC] Move code around
behdad bbad70e
[VARC] bool(Vector) is useless... :(
behdad 950d39b
[VARC] Finish drawing!
behdad e22953e
Black
behdad c50a0f6
[VARC] Rename a type
behdad c952237
[otConverters] Make _LazyList generic
behdad 5faf139
[CFF2Index] Minor massage
behdad 450c8f1
[CFF2Index] Make loading lazy
behdad feb6820
[_LazyList] Make much faster
behdad 7de1306
[CFF2Index] Make even faster
behdad 61916c1
[gvar] Speed up loading a bit
behdad 7471ac6
[gvar] Speed up loading by not reading all offsets
behdad 3806fd2
Move a couple of functions outline
behdad 3ff2ee6
Move lazy datastructures to misc.lazyTools
behdad cae76d5
[glyf] Load using LazyDict
behdad 0a79939
Revert "[glyf] Load using LazyDict"
behdad 4db90f5
[loca] Minor speedup
behdad 44a32f8
Minor refactor
behdad 42d6b6b
[svgPen] Write two digits after decimal by default
behdad 1514158
[subset] Support VARC
behdad f37f2e4
[subset] Close over MATH before GSUB
behdad 5c27846
[subset/VARC] Subset MultiVarStore
behdad 27e5182
[VARC/instancer] Implement
behdad 272f736
[VARC] Fix instanciating component
behdad 38d190a
Black
behdad 57dd288
[VARC/instancer] Comment
behdad 3c60c0e
[VARC/subset] Fix closure
behdad ebd877b
[VARC/test] Start adding
behdad 2ca627d
[VARC/instancer] Fix
behdad 22e02cc
[VARC/test] Adjust a test
behdad 28385ec
[VARC/test] Adjust test
behdad ce3e260
[VARC/test] Update the rest of the test expectations
behdad 2852055
[VARC] Allow drawing same-name glyph
behdad 2056577
[VARC/scaleUpem] Start
behdad f24808c
Black
behdad febbb34
[CFF2Index] Avoid infinite loop visitor by hiding symbol
behdad 0f0148e
[VARC/scaleUpem] Implement
behdad 2b09b0d
Black
behdad 45f7f4f
Try fixing Python < 3.12
behdad 93fe240
[scaleUpem] Comment
behdad 232d9cf
[VARC/scaleUpem] Remove early return
behdad a958c68
[VARC] Simplify TupleValues
behdad c91984e
[VARC] Use sparse-regions in MultiVarStore
behdad 42a5fbd
[VARC] Redesign table
behdad 9cc3689
[VARC] Towards drawing new design
behdad f73d6f2
[VARC] Fixups
behdad 8ea9765
[VARC] Fix copilot mistake in decompile
behdad 2229607
Black
behdad 43e054b
[VARC] Minor
behdad 822351f
[VARC] Minor rename
behdad 76d293e
[VARC] Simplify reading
behdad b772f1d
Reuse a variable
behdad f7337b5
[VARC] Make HAVE_VARIATIONS flag automatic
behdad d07d960
Fix RESERVED
behdad cd15139
[VARC] Minor
behdad 263d4d9
Handle scaleY
behdad d37b394
[VARC] Encode indices as 1,2,3,4 bytes long
behdad 58bb96b
[VARC] Use a DeltaSetIndexMap
behdad 6af1d5c
Fix RESERVED
behdad bfb8490
[VARC] Apparently __iadd__ is optional
behdad 668a40d
[VARC] Pivot on design again
behdad cfc66a3
[VARC] Simplify VarCompositeRecord
behdad 735859f
[VARC] Implement XML read/write
behdad a7ca67a
[VARC] Update subsetting
behdad 902b2a1
[VARC] Fix scaleUpem
behdad e88e47f
[VARC] Take a stab at instancing
behdad bc82985
[VARC] Speed up subsetting
behdad c3dfe10
[VARC] Use TupleVariations tuple encoding for axisValues
behdad 6a09096
[VARC] Use variable-length encoding for VarIdx'es
behdad 297e0bd
[VARC] Use var-int encoding for AxisIndicesIndex
behdad b1142b6
[VARC] Adjust to latest flags change
behdad 9f66edb
[varLib.models] Add validate=False to normalizeLocation
behdad d6482c9
[VARC] Rename VarInt32 to uint32var
behdad 87ddb24
[otBase] Add comment based on review feedback
behdad b3a0a21
[transform] Remove redundant methods
behdad e3ba7a7
[lazyTools] Simplify based on review feedback
behdad 5ad4045
[VarComponent] Nicer XML output
behdad 037bbe1
[VARC] Load axisValues as float
behdad 5b2df6b
[VARC] Compute flags from XML transform components
behdad 7d6df04
[VARC] Minor, match spec better
behdad 40584ad
[VARC] Adjust XML output based on review feedback
behdad 1acc80e
[VARC] Deepcopy the component
behdad 3bada5d
Fix otConverters lazy reader
behdad a1641d9
Newer black
behdad 88828e0
[CFF2IndexOf] Fix data_base
behdad c155632
[varc] Skip reserved records
behdad 74f870f
[varc] Add ConditionSets
behdad d53c08a
[varc] Conditionals tested!
behdad 9cb73da
[varc] Add a conditional VarComponent test
behdad 973dc5c
[varc] Use Condition instead of ConditionSet
behdad 77add05
Don't emit addVarComponent() if the component references the parent g…
justvanrossum 973072b
[Condition] Implement ConditionValue
behdad 753197e
[varc] Use multiVarStore instead of GDEF varStore
behdad File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from itertools import * | ||
|
||
# Python 3.12: | ||
if "batched" not in globals(): | ||
# https://docs.python.org/3/library/itertools.html#itertools.batched | ||
def batched(iterable, n): | ||
# batched('ABCDEFG', 3) --> ABC DEF G | ||
if n < 1: | ||
raise ValueError("n must be at least one") | ||
it = iter(iterable) | ||
while batch := tuple(islice(it, n)): | ||
yield batch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from collections import UserDict, UserList | ||
|
||
__all__ = ["LazyDict", "LazyList"] | ||
|
||
|
||
class LazyDict(UserDict): | ||
def __init__(self, data): | ||
super().__init__() | ||
self.data = data | ||
|
||
def __getitem__(self, k): | ||
v = self.data[k] | ||
if callable(v): | ||
v = v(k) | ||
self.data[k] = v | ||
return v | ||
|
||
|
||
class LazyList(UserList): | ||
def __getitem__(self, k): | ||
if isinstance(k, slice): | ||
indices = range(*k.indices(len(self))) | ||
return [self[i] for i in indices] | ||
v = self.data[k] | ||
if callable(v): | ||
v = v(k) | ||
self.data[k] = v | ||
return v | ||
|
||
def __add__(self, other): | ||
if isinstance(other, LazyList): | ||
other = list(other) | ||
elif isinstance(other, list): | ||
pass | ||
else: | ||
return NotImplemented | ||
return list(self) + other | ||
|
||
def __radd__(self, other): | ||
if not isinstance(other, list): | ||
return NotImplemented | ||
return other + list(self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the swapping of GSUB and MATH closure order should arguably go to a separate PR.. unless is really required for the changes at hand