notofonts / math

Noto Math
SIL Open Font License 1.1
25 stars 3 forks source link

Unbalanced spacing in fractions #74

Closed Enivex closed 7 months ago

Enivex commented 7 months ago

Noto Sans Math image

As you can see, the numerator is much further from the line than the denominator. For comparison:

Fira Math image

khaledhosny commented 7 months ago

Are you testing display mode or inline? In display mode there is typically more space so that numerators in equations like \frac{1}{2} \frac{1y}{2} remain aligned:

Noto Sans Math:

image

Fira Math:

image

You can also check other math fonts.

Enivex commented 7 months ago

In display mode there is typically more space

I agree that that what Fira Math is doing is suboptimal, but in this case Noto Sans Math does seem to have quite a bit more asymmetric spacing than other fonts

From left to right: New Computer Modern Math -> Stix Two Math -> Noto Sans Math comparison

This is indeed display mode, though the situation is also similar inline.

khaledhosny commented 7 months ago

It took a bit of fiddling since too many constants are at the play here, but I think the end result is better now.

Noto Sans Math with #76:

image

Computer Modern Math (TFM fonts):

image

Cambria Math:

image

STIX Two Math:

image

Fira Math:

image
simoncozens commented 7 months ago

Fira seems to shift stuff upwards when there's a descender in the numerator.

khaledhosny commented 7 months ago

Yes, but that is undesired, you want fraction in these cases to align. The new constants make the gabs above and below look balanced without breaking the alignment.