fix width i
This commit is contained in:
BIN
aifont.ttf
BIN
aifont.ttf
Binary file not shown.
BIN
aifont.woff2
BIN
aifont.woff2
Binary file not shown.
@@ -81,6 +81,22 @@ for g in ['a', 'i']:
|
||||
xmin, ymin, xmax, ymax = bb
|
||||
glyph_w = xmax - xmin
|
||||
|
||||
# For 'i': slight horizontal stretch to reduce side margins
|
||||
if g == 'i' and glyph_w > 0:
|
||||
stretch = (target_w * 0.3) / glyph_w
|
||||
if stretch > 1.0:
|
||||
cx = (xmin + xmax) / 2.0
|
||||
glyph.transform(psMat.compose(
|
||||
psMat.translate(-cx, 0),
|
||||
psMat.compose(
|
||||
psMat.scale(stretch, 1.0),
|
||||
psMat.translate(cx, 0)
|
||||
)
|
||||
))
|
||||
bb = glyph.boundingBox()
|
||||
xmin, ymin, xmax, ymax = bb
|
||||
glyph_w = xmax - xmin
|
||||
|
||||
# Center horizontally within the glyph width
|
||||
x_offset = (target_w - glyph_w) / 2.0 - xmin
|
||||
# Align baseline
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 2400" width="1024" height="2400">
|
||||
<!-- dot: ai mark scaled down 50%, centered -->
|
||||
<!-- dot: ai mark scaled 50%, centered -->
|
||||
<g transform="translate(512,200) scale(0.5) translate(-512,-400)">
|
||||
<path fill="#000000" d="
|
||||
M 619,232
|
||||
@@ -15,6 +15,6 @@
|
||||
Z
|
||||
"/>
|
||||
</g>
|
||||
<!-- bar: vertical stroke (wider, longer) -->
|
||||
<rect x="352" y="650" width="320" height="1700" rx="20" fill="#000000"/>
|
||||
<!-- bar: vertical stroke -->
|
||||
<rect x="392" y="650" width="240" height="1700" rx="18" fill="#000000"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 592 B After Width: | Height: | Size: 571 B |
Reference in New Issue
Block a user