[scale-upem] Scale GPOS using register_attrs as well
This commit is contained in:
parent
3a6fa9812d
commit
c588b2d5b3
@ -51,6 +51,8 @@ class ScalerVisitor(TTVisitor):
|
||||
"sCapHeight",
|
||||
),
|
||||
),
|
||||
(otTables.ValueRecord, ("XAdvance", "YAdvance", "XPlacement", "YPlacement")),
|
||||
(otTables.Anchor, ("XCoordinate", "YCoordinate")),
|
||||
)
|
||||
)
|
||||
def visit(visitor, obj, attr, value):
|
||||
@ -102,28 +104,6 @@ def visit(visitor, obj, attr, kernTables):
|
||||
kernTable[k] = visitor.scale(kernTable[k])
|
||||
|
||||
|
||||
# GPOS
|
||||
|
||||
|
||||
@ScalerVisitor.register(otTables.ValueRecord)
|
||||
def visit(visitor, obj):
|
||||
attrs = ["XAdvance", "YAdvance", "XPlacement", "YPlacement"]
|
||||
for attr in attrs:
|
||||
v = getattr(obj, attr, None)
|
||||
if v is not None:
|
||||
v = visitor.scale(v)
|
||||
setattr(obj, attr, v)
|
||||
|
||||
|
||||
@ScalerVisitor.register(otTables.Anchor)
|
||||
def visit(visitor, obj):
|
||||
attrs = ["XCoordinate", "YCoordinate"]
|
||||
for attr in attrs:
|
||||
v = getattr(obj, attr)
|
||||
v = visitor.scale(v)
|
||||
setattr(obj, attr, v)
|
||||
|
||||
|
||||
# ItemVariationStore
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user