diff --git a/aifont.ttf b/aifont.ttf index 0556623..6b0a0bd 100644 Binary files a/aifont.ttf and b/aifont.ttf differ diff --git a/aifont.woff2 b/aifont.woff2 index f226481..d64fc49 100644 Binary files a/aifont.woff2 and b/aifont.woff2 differ diff --git a/py/build_font.py b/py/build_font.py index 9bc2f3d..b02168e 100644 --- a/py/build_font.py +++ b/py/build_font.py @@ -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 diff --git a/svg/lower/i.svg b/svg/lower/i.svg index 586ee07..1afecef 100644 --- a/svg/lower/i.svg +++ b/svg/lower/i.svg @@ -1,5 +1,5 @@ - + - - + +