[statisticsPen] Micro-optimize
This commit is contained in:
parent
5686bcb342
commit
c7e3348904
@ -85,11 +85,13 @@ def _test(glyphset, upem, glyphs, quiet=False):
|
|||||||
transformer = TransformPen(pen, Scale(1.0 / upem))
|
transformer = TransformPen(pen, Scale(1.0 / upem))
|
||||||
glyph.draw(transformer)
|
glyph.draw(transformer)
|
||||||
|
|
||||||
wght_sum += abs(pen.area)
|
area = abs(pen.area)
|
||||||
wght_sum_perceptual += abs(pen.area) * glyph.width
|
width = glyph.width
|
||||||
wdth_sum += glyph.width
|
wght_sum += area
|
||||||
|
wght_sum_perceptual += pen.area * width
|
||||||
|
wdth_sum += width
|
||||||
slnt_sum += pen.slant
|
slnt_sum += pen.slant
|
||||||
slnt_sum_perceptual += pen.slant * glyph.width
|
slnt_sum_perceptual += pen.slant * width
|
||||||
|
|
||||||
if quiet:
|
if quiet:
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user