CFF: set FontMatrix based on unitsPerEm automatically, unless manually overridden
This commit is contained in:
parent
de1dbe5f16
commit
874c08dcd2
@ -478,6 +478,9 @@ class FontBuilder(object):
|
|||||||
topDict.Private = private
|
topDict.Private = private
|
||||||
for key, value in fontInfo.items():
|
for key, value in fontInfo.items():
|
||||||
setattr(topDict, key, value)
|
setattr(topDict, key, value)
|
||||||
|
if "FontMatrix" not in fontInfo:
|
||||||
|
scale = 1 / self.font["head"].unitsPerEm
|
||||||
|
topDict.FontMatrix = [scale, 0, 0, scale, 0, 0]
|
||||||
|
|
||||||
charStrings = CharStrings(None, topDict.charset, globalSubrs, private, fdSelect, fdArray)
|
charStrings = CharStrings(None, topDict.charset, globalSubrs, private, fdSelect, fdArray)
|
||||||
for glypnName, charString in charStringsDict.items():
|
for glypnName, charString in charStringsDict.items():
|
||||||
|
@ -161,7 +161,7 @@
|
|||||||
<UnderlineThickness value="50"/>
|
<UnderlineThickness value="50"/>
|
||||||
<PaintType value="0"/>
|
<PaintType value="0"/>
|
||||||
<CharstringType value="2"/>
|
<CharstringType value="2"/>
|
||||||
<FontMatrix value="0.001 0 0 0.001 0 0"/>
|
<FontMatrix value="0.0009765625 0 0 0.0009765625 0 0"/>
|
||||||
<FontBBox value="100 100 500 1000"/>
|
<FontBBox value="100 100 500 1000"/>
|
||||||
<StrokeWidth value="0"/>
|
<StrokeWidth value="0"/>
|
||||||
<!-- charset is dumped separately as the 'GlyphOrder' element -->
|
<!-- charset is dumped separately as the 'GlyphOrder' element -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user