2
0

fix width i

This commit is contained in:
2026-04-03 13:29:06 +09:00
parent f85060265d
commit 41c87206f2
4 changed files with 19 additions and 3 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -81,6 +81,22 @@ for g in ['a', 'i']:
xmin, ymin, xmax, ymax = bb xmin, ymin, xmax, ymax = bb
glyph_w = xmax - xmin 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 # Center horizontally within the glyph width
x_offset = (target_w - glyph_w) / 2.0 - xmin x_offset = (target_w - glyph_w) / 2.0 - xmin
# Align baseline # Align baseline

View File

@@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 2400" width="1024" height="2400"> <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)"> <g transform="translate(512,200) scale(0.5) translate(-512,-400)">
<path fill="#000000" d=" <path fill="#000000" d="
M 619,232 M 619,232
@@ -15,6 +15,6 @@
Z Z
"/> "/>
</g> </g>
<!-- bar: vertical stroke (wider, longer) --> <!-- bar: vertical stroke -->
<rect x="352" y="650" width="320" height="1700" rx="20" fill="#000000"/> <rect x="392" y="650" width="240" height="1700" rx="18" fill="#000000"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 592 B

After

Width:  |  Height:  |  Size: 571 B