Αναζήτηση στην υποστήριξη

Προσοχή στις απάτες! Δεν θα σας ζητήσουμε ποτέ να καλέσετε ή να στείλετε μήνυμα σε κάποιον αριθμό τηλεφώνου ή να μοιραστείτε προσωπικά δεδομένα. Αναφέρετε τυχόν ύποπτη δραστηριότητα μέσω της επιλογής «Αναφορά κατάχρησης».

Learn More

Huge gaps in MathML's "mtable" render output

  • 11 απαντήσεις
  • 0 έχουν αυτό το πρόβλημα
  • 28 προβολές
  • Τελευταία απάντηση από Felix Speagel

more options

I don't know if that was supposed to look like, but when rendering MathML in Firefox 124.0.1 when one uses "mtable" element the browser adds very huge gaps around.

The included image shows output for the following code:

<math display="block">

 <mfrac>
   <mi>A</mi>
   <mn>2</mn>
 </mfrac>
 <mo>=</mo>
 <mrow>
 <mo> ( </mo>
 <mtable><mtr><mtd><mn>1</mn></mtd><mtd><mn>0</mn></mtd><mtd><mn>0</mn></mtd></mtr><mtr><mtd><mn>0</mn></mtd><mtd><mn>1</mn></mtd><mtd><mn>0</mn></mtd></mtr><mtr><mtd><mn>0</mn></mtd><mtd><mn>0</mn></mtd><mtd><mn>1</mn></mtd></mtr></mtable>
 <mo> ) </mo>

</mrow> </math>

I don't know if that was supposed to look like, but when rendering MathML in Firefox 124.0.1 when one uses "mtable" element the browser adds very huge gaps around. The included image shows output for the following code: <math display="block"> <mfrac> <mi>A</mi> <mn>2</mn> </mfrac> <mo>=</mo> <mrow> <mo> ( </mo> <mtable><mtr><mtd><mn>1</mn></mtd><mtd><mn>0</mn></mtd><mtd><mn>0</mn></mtd></mtr><mtr><mtd><mn>0</mn></mtd><mtd><mn>1</mn></mtd><mtd><mn>0</mn></mtd></mtr><mtr><mtd><mn>0</mn></mtd><mtd><mn>0</mn></mtd><mtd><mn>1</mn></mtd></mtr></mtable> <mo> ) </mo> </mrow> </math>
Συνημμένα στιγμιότυπα

Επιλεγμένη λύση

It is a "system" font (I can actually find the file on my computer's drive).

I tried yet another thing: in the "about:config" I edited the "font.name-list.serif.x-math" property and deleted "Latin Modern Math" from it (it was first on the list). And (for now) it works. :D

So, unless something can change it to a previous value, right now the gaps are normal, albeit the font is a bit smaller.

Ανάγνωση απάντησης σε πλαίσιο 👍 0

Όλες οι απαντήσεις (11)

more options

It would be better to file a bug about this on bugzilla.mozilla.org.

Χρήσιμο;

more options

It renders properly for me on Ubuntu.

Does it still happen in Troubleshoot Mode?

Χρήσιμο;

more options

Yes, Troubleshoot Mode has the same problem.

Χρήσιμο;

more options

What font is being used here? Have you tried a different font?

Does it still happen in a new profile? An easy way to test a new profile is to install Developer Edition and see if it happens there or refresh your existing profile. Make sure you stay signed out of your sync account when testing.

Χρήσιμο;

more options

The problem still persist :( Also unfortunately I don't know how to check or change the font.

Χρήσιμο;

more options

Does it work here?

jsfiddle.net/76b9jpox/

You can change the font in the top-right CSS section and then click "Run" to apply.

Χρήσιμο;

more options

Well...It helped me. In a way. When I set the font in <math> directly (like so: <math style="font-family: sans-serif;">), then I get the correct rendering. Of course the font that is used then doesn't look nice, so when I remove style it goes back to huge gaps.

I also tried to set global font in FF settings tab to any other font than default ("Noto"), but it seems it has no results in MathML *unless* I do the thing I wrote above.

So, the problem is solvable, if one can set the font in a HTML source :(

Χρήσιμο;

more options

You can right-click and select "Inspect" to open the built-in Inspector with this element selected.

You can check in the Rules tab in the right panel in the Inspector what font-family is used for selected text. You can check in the Fonts tab in the right panel in the Inspector what font is actually used because Firefox might be using a different font than specified by the website. If the Fonts tab is hidden, click the down arrow at the right end.

Χρήσιμο;

more options

I got it! The culprit name is: "LatinModernMathJax_Main-Regular.woff"

Now the only thing left is how can I change the font for any other font globally in FF and we can call it a day :D (I'll try to ask about it also on my distro's forum)

Χρήσιμο;

more options

A 'woff' font is usually downloaded from the server via @font-face rules specified in a CSS file. You can expand "All fonts on this page" under Fonts to see where this font is coming from.

Χρήσιμο;

more options

Επιλεγμένη λύση

It is a "system" font (I can actually find the file on my computer's drive).

I tried yet another thing: in the "about:config" I edited the "font.name-list.serif.x-math" property and deleted "Latin Modern Math" from it (it was first on the list). And (for now) it works. :D

So, unless something can change it to a previous value, right now the gaps are normal, albeit the font is a bit smaller.

Χρήσιμο;

Υποβολή ερώτησης

Πρέπει να συνδεθείτε στον λογαριασμό σας για να απαντήσετε σε δημοσιεύσεις. Ξεκινήστε μια νέα ερώτηση εάν δεν διαθέτετε ακόμα λογαριασμό.