libertinus icon indicating copy to clipboard operation
libertinus copied to clipboard

Vertically center `integral.size1`

Open tmke8 opened this issue 1 year ago • 7 comments

Closes #542

I used this script to center it. The script seems to have moved it down by 308. It looks correct to me, but I may be wrong.

I also don't know whether I need to change hinting somewhere? I didn't see anything obvious in the .sfd file.

This also seems to center all the other large integral glyphs (including the ss08 glyphs) because they all refer to integral.size1.

tmke8 avatar Oct 08 '24 11:10 tmke8

If we are going to do this, you have to check all big operators not just integral. It should also be centered around math axis.

khaledhosny avatar Oct 08 '24 12:10 khaledhosny

I modified the script to center around the math axis:

startglyph = 1114441
endglyph = 1114441  

thisfont =  fontforge.activeFont()  
for i in range(startglyph,endglyph+1):  
    ytop = thisfont[i].boundingBox()[-1] # counted from baseline, excluding descent!  
    ybot = thisfont[i].boundingBox()[1] # same note as above
    # Calculation method:
    # Current midpoint of glyph (counted from baseline) = (ytop + ybot) / 2
    translation = thisfont.math.AxisHeight - ((ytop + ybot) / 2)
    thisfont[i].transform( psMat.translate( 0, translation ))

The difference to before is 6 coordinate points.

I also investigated the other big operators (those with .size1 suffix in their name), but they all look centered to me:

image

Produced with this latex snippet, rendered on Temml.org

\begin{aligned}
&\cdot\int\iint\iiint\iiiint\oint\oiint\oiiint\intclockwise\varointclockwise\sum\prod\coprod \cdot\\
&\cdot\bigwedge\bigvee\bigcap\bigcup\bigcupdot\biguplus\bigsqcap\bigsqcup\cdot\bigodot\bigoplus\bigotimes\surd\Big(\Big)\Big\lceil\Big\rceil\Big\langle\Big\rangle\cdot
\end{aligned}

I could nevertheless run the script over these?

tmke8 avatar Oct 09 '24 14:10 tmke8

I also investigated the other big operators (those with .size1 suffix in their name), but they all look centered to me:

image

But the image shows that all integrals are not centered. You should also center the text version of the big operators (the radical and parentheses are not big operators so can be left alone).

khaledhosny avatar Oct 09 '24 15:10 khaledhosny

But the image shows that all integrals are not centered.

Yes... I guess I wanted to demonstrate the problem again.

Here it is with the patched font:

image

You should also center the text version of the big operators

You mean the glyphs without .sizeX? Okay, I'll investigate.

tmke8 avatar Oct 11 '24 14:10 tmke8

Oh, looking at the new image, I see that the circles are too high! I'll fix it.

tmke8 avatar Oct 11 '24 14:10 tmke8

Should be fixed now:

image

And also for the slanted integrals:

image

tmke8 avatar Oct 11 '24 15:10 tmke8

I haven’t checked the font files, but the screenshot looks good to me.

khaledhosny avatar Oct 18 '24 06:10 khaledhosny