fred-wang / Mathzilla

Collection of Mozilla MathML add-ons
35 stars 8 forks source link

MathML fonts add-on is not working on Firefox for Android #31

Closed david-a-wheeler closed 7 years ago

david-a-wheeler commented 8 years ago

The turnstile character is currently not supported. This makes all metamath results very difficult to read in Unicode. Here is an example... http://us.metamath.org/mpeuni/2p2e4.html

Please add the turnstile character. It is 22a2 in hex, or 8866 in decimal.

Thanks.

fred-wang commented 8 years ago

I believe this character as well as all those mentioned issue notofonts/noto-fonts#32 are already available in the Latin Modern Math and XITS fonts. On which platform are you testing?

If you're testing on desktop, have you tried and installed the fonts directly, instead of using the MathML fonts add-on? http://www.gust.org.pl/projects/e-foundry/lm-math https://github.com/khaledhosny/xits-math/releases

david-a-wheeler commented 8 years ago

I'm using Firefox on Android with the addon MathML-fonts 2.1.1-signed.

fred-wang commented 8 years ago

Thanks. I wonder whether the addon works at all... Bill Gianopoulos mentioned a problem some time ago with a dev build, but this issue disappeared later without explanation.

Can you please provide screenshots of https://developer.mozilla.org/en-US/docs/Mozilla/MathML_Project/MathML_Torture_Test with "Latin Modern" and "XITS" selected?

BTW, you might be interested in https://github.com/googlei18n/noto-fonts/issues/330 where Google mentioned creating a "Noto Math" font.

david-a-wheeler commented 8 years ago

Can you please provide screenshots of https://developer.mozilla.org/en-US/docs/Mozilla/MathML_Project/MathML_Torture_Test with "Latin Modern" and "XITS" selected?

I'm having trouble doing that, but everything looks just fine with those 2 fonts on Firefox on Android. --- David A.Wheeler

fred-wang commented 8 years ago

I'm having trouble doing that, but everything looks just fine with those 2 fonts on Firefox on Android.

I'm not sure what you mean by "everything looks just fine", one has to check the style of the math font to be sure they are actually used. You can compare with http://fred-wang.github.io/MathFonts/ (for this page, Web fonts are used).

david-a-wheeler commented 8 years ago

Ok. In http://fred-wang.github.io/MathFonts/ with "Default fonts" I see a large number of black rectangles instead of text. When I switch to Latin Modern they work, e.g. the shadowed "Q" (rationals) now displays.

But how can I make it so I can read pages that do not let me switch fonts? Firefox on Android lets me change the size of the displayed font, but does not let me pick what font to use for display. As a result, I may have fonts installed but it doesn't matter since I never see them. alternatively, is it possible to set the system so that if a glyph is missing to use a backup font instead?

fred-wang commented 8 years ago

Firefox has a fallback mechanism to try and find a system font with a given unicode character, in case that character is not present in the specified CSS font-family list. Unfortunately, Android has no math fonts by default (again this is issue notofonts/math#14) and AFAIK it is not possible to install your own fonts on Android... The MathFonts test page and the Firefox add-on use Web fonts to workaround this issue. Unfortunately, it seems that the add-on is not working for you for some reason...

@wgianopoulos do you have any idea about what's happening? You told me that you had a similar problem at some point?

wgianopoulos commented 8 years ago

I thought there was an open bug on this issue, but if there is my first search did not find it.

I suspect this is a general issue with @font-face under android and not just this extension. It does not appear that it repaints the page after the font is loaded. if you manually reload the page it displays correctly.

On Mon, Dec 28, 2015 at 8:49 AM, Frédéric Wang notifications@github.com wrote:

Firefox has a fallback mechanism to try and find a system font with a given unicode character, in case that character is not present in the specified CSS font-family list. Unfortunately, Android has no math fonts by default (again this is issue notofonts/math#14) and AFAIK it is not possible to install your own fonts on Android... The MathFonts test page and the Firefox add-on use Web fonts to workaround this issue. Unfortunately, it seems that the add-on is not working for you for some reason...

@wgianopoulos https://github.com/wgianopoulos do you have any idea about what's happening? You told me that you had a similar problem at some point?

— Reply to this email directly or view it on GitHub https://github.com/fred-wang/Mathzilla/issues/31#issuecomment-167575161.

wgianopoulos commented 8 years ago

I did more testing and I bet this is why i never filed a bug. I can not duplicate this issue with any online @font-face demo page on the Internet. It seems to be related somehow to the way this extension works. What I see is that if i launch the browser, and run the mathml font test (the one that displays the grid of lines) it displays incorrectly. However, if I reload the page it displays correctly. I really don't know what is causing this behavior.

On Mon, Dec 28, 2015 at 9:03 AM, Bill Gianopoulos wgianopoulos@gmail.com wrote:

I thought there was an open bug on this issue, but if there is my first search did not find it.

I suspect this is a general issue with @font-face under android and not just this extension. It does not appear that it repaints the page after the font is loaded. if you manually reload the page it displays correctly.

On Mon, Dec 28, 2015 at 8:49 AM, Frédéric Wang notifications@github.com wrote:

Firefox has a fallback mechanism to try and find a system font with a given unicode character, in case that character is not present in the specified CSS font-family list. Unfortunately, Android has no math fonts by default (again this is issue notofonts/math#14) and AFAIK it is not possible to install your own fonts on Android... The MathFonts test page and the Firefox add-on use Web fonts to workaround this issue. Unfortunately, it seems that the add-on is not working for you for some reason...

@wgianopoulos https://github.com/wgianopoulos do you have any idea about what's happening? You told me that you had a similar problem at some point?

— Reply to this email directly or view it on GitHub https://github.com/fred-wang/Mathzilla/issues/31#issuecomment-167575161 .

david-a-wheeler commented 8 years ago

The page http://us.metamath.org/mpeuni/2p2e4.html reliably does not work, even on reload. I do not think it uses Web Fonts.

wgianopoulos commented 8 years ago

This page seems to be specifying to use the font sans-serif to display this character. It also does not seem to use mathml at all. So, it would seem that this character does not appear in the Android supplied sans-serif font. I am not sure how the MathML-fonts add-on has anything to do with this issue.

On Mon, Dec 28, 2015 at 9:39 AM, David A. Wheeler notifications@github.com wrote:

The page http://us.metamath.org/mpeuni/2p2e4.html reliably does not work, even on reload. I do not think it uses Web Fonts.

— Reply to this email directly or view it on GitHub https://github.com/fred-wang/Mathzilla/issues/31#issuecomment-167581846.

fred-wang commented 8 years ago

This page seems to be specifying to use the font sans-serif to display this character. It also does not seem to use mathml at all. So, it would seem that this character does not appear in the Android supplied sans-serif font. I am not sure how the MathML-fonts add-on has anything to do with this issue.

Good point. The stylesheet used by the addon is here: https://github.com/fred-wang/Mathzilla/blob/master/mathml-fonts/MathML-fonts/resource/mathml.css So the Metamath page would have to explicitly specify font-family "Latin Modern Math" or "XITS Math" (or one would have to use an addon similar to https://addons.mozilla.org/en-US/firefox/addon/mathml-font-settings/).

fred-wang commented 8 years ago

I forgot to say. There is also an alternative way to "install" fonts for Firefox OS & Firefox for Android. See for example this addon: https://addons.mozilla.org/en-US/firefox/addon/khmer-fonts-package/ (note: the xpi is a zip archive that contains the source). However, I'm not sure it's still working with recent add-on restrictions...

david-a-wheeler commented 8 years ago

Thank you - it sounds like I need to try to convince the maintainers of http://us.metamath.org/mpeuni/2p2e4.html to use a Web Font. I'm sure that they want it to 'just work' automatically.

Two questions:

  1. Do all the fonts have libre licenses if they are listed in https://developer.mozilla.org/en-US/docs/Mozilla/MathML_Project/MathML_Torture_Test (or http://fred-wang.github.io/MathFonts)? I'd like to know if they can be freely redistributed and modified (requiring a rename is fine).
  2. Would it be possible to modify the MathML 'torture test? I mean the one at: https://developer.mozilla.org/en-US/docs/Mozilla/MathML_Project/MathML_Torture_Test - it'd be great if it specifically included a test for the turnstyle and at least one double-struck character (say "C" for complex numbers - widely used in mathematics of course). That would make it easy to see when those characters aren't correctly supported. E.G., perhaps it could add the HTML: ⊢ 1 ∈ ℂ which represents (if you can see it): ⊢ 1 ∈ ℂ
david-a-wheeler commented 8 years ago

Just to clarify, I'd like to know if http://fred-wang.github.io/MathFonts/ also lists only libre-licensed fonts, and if it could be modified to test: ⊢ 1 ∈ ℂ.

Even if Google added math fonts to default build of Android (e.g., https://github.com/googlei18n/noto-fonts/issues/330) it would take many years for that to be distributed across systems, so I expect these to be common problems for years to come.

fred-wang commented 8 years ago

Not all fonts listed there are libre-licensed. Basically, Cambria, Lucida & Minion are proprietary and those mentioned on http://fred-wang.github.io/MathFonts/#testcase_individual are open source. For details, see mathfont.css & licenses on https://github.com/fred-wang/MathFonts/archive/gh-pages.zip

I'd like to note that the MathML font add-on, the test pages and the fonts were designed for math layout. This is much more than what you ask here (only a row of basic Unicode symbols). In particular, the torture test is used to compare MathML support in browser against TeX so adding a simple HTML test is not really relevant. Such glyph tables are certainly useful though and are available elsewhere see http://www.w3.org/TR/xml-entity-names/#blocks and http://www.stixfonts.org/allGlyphs.html for example. Also, the fonts listed have an OpenType MATH table, but you can certainly find other math fonts with the desired Unicode symbols even if they do not have a MATH table.

I believe that if the font-family of http://us.metamath.org/mpeuni/2p2e4.html lists "Latin Modern Math" or "XITS" then the MathML add-on would work as expected. As I suggested above, you can also create your own Firefox add-on to force such font-family on all websites. Web fonts are great but it's a pain to have to use them on all websites that need math symbols :-( Hence early next year, I'll try to contact Google font people to see how we can make progress on googlei18n/noto-fonts#330

fred-wang commented 7 years ago

Version 3 has been migrated to WebExtension format (https://developer.mozilla.org/en-US/Add-ons/WebExtensions) and source code has been moved to https://github.com/fred-wang/MathFonts/tree/master/webextension

I'm closing this. Please report any issue to https://github.com/fred-wang/MathFonts/issues