Skip to content

Primes in Chrome #246

Closed
Closed

Description

@tmke8

As I understand it, Latin Modern Math has two variants for the prime, and Chrome is supposed to select the "lower" variant when prime appears in <msup> (as Firefox does), but Chrome doesn't.

Now, one way to fix this, is to have only the lower variant in the font file. You can achieve this by using Libertinus Math and then using the font feature ssty. ssty refers to alternative characters that are supposed to be used in "script style" which is the style used in subscripts and superscripts. For most characters, the difference between normal style and script style is very small: the characters are a little thicker and a little wider. But for primes, the difference is very large. And I don't actually see where in MathML I need to use the "normal style" primes.

So, what I would ideally have is a Latin Modern Math font file where prime only has the lower variant. As I understand it, that's what the Temml font provides, but the Temml font seems to only have the primes in it (and calligraphic math characters; it's still only 10kB). I'm guessing it was done this way so that the locally installed Latin Modern Math can still be used for everything that is not primes, but it has of course the downside that I need to specify a custom class for all primes.

Not sure what to conclude from this...

Activity

  1. tmke8 commented on Sep 24, 2024

    @tmke8
    OwnerAuthor

    It's so weird: the latinmodern-math.otf should have the ssty feature (otfinfo says so) but I can't activate it in Chrome. I tried with .otf, .ttf, .woff2. And the thing is, for LibertinusMath-Regular.woff2 it works! I can toggle the ssty font feature in the Chrome inspection tool and I see the result. But somehow the ssty font feature doesn't work for latinmodern-math.otf.

    Maybe it's because the feature got lost in the conversion to woff2 (which I did with this tool). The Libertinus font file is directly created as a woff2, so maybe that works better in Chrome.

    On the other hand, I did try it with the otf file directly, and Chrome still didn't do the right thing. So, it must be that the otf is already wrong for Chrome.

    I also tried the woff2 file from https://github.com/fred-wang/MathFonts but as those are based on the same otf file I used, it was not surprising that those also didn't work.

  2. tmke8 commented on Sep 24, 2024

    @tmke8
    OwnerAuthor

    I used the program FontForge to replace the normal prime glyphs with the lowered prime glyphs in the Latin Modern Math otf file (simply by selecting the lowered glyph, pressing ctrl+c, selecting the normal glyph and pressing ctrl+v).

    This then worked in Chrome.

  3. tmke8 commented on Sep 25, 2024

    @tmke8
    OwnerAuthor

    I guess this is solve for now by #247

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions