Bug 133604

Summary: [GTK][EFL] Use OpenType MATH fonts by default
Product: WebKit Reporter: Frédéric Wang (:fredw) <fred.wang>
Component: MathMLAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dbarton, esprehn+autocc, glenn, gyuyoung.kim, macpherson, menard, mrobinson
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: Linux   
Bug Depends on: 119038, 134094    
Bug Blocks: 22621, 38377, 114565, 133603, 134153    
Attachments:
Description Flags
Patch
none
Screenshot of the MathML torture test with Nightly WebKitGTK+
none
Screenshot of the MathML torture test with Nightly WebKitGTK+
none
Patch cfleizach: review+

Description Frédéric Wang (:fredw) 2014-06-07 06:32:51 PDT
See bug 133603 for the general discussion.

I'll submit a patch when bug 119038 is fixed.

One issue to consider is that the rendering of references depending on which math fonts are installed locally and on the bots.
Comment 1 Frédéric Wang (:fredw) 2014-06-18 01:22:35 PDT
Created attachment 233295 [details]
Patch

I tried to follow what is done for IOS and add a conditional defined(WTF_PLATFORM_GTK) && WTF_PLATFORM_GTK rule in mathml.css. However, that does not seem to work.

@Martin, any idea why?
Comment 2 Frédéric Wang (:fredw) 2014-06-18 01:25:50 PDT
Created attachment 233296 [details]
Screenshot of the MathML torture test with Nightly WebKitGTK+

Here is a screenshot of the torture test with WebKitGTK+, the patch applied and Latin Modern Math installed. As you can see the large operators and horizontal braces now stretch and the radicals are drawn with glyphs. However, math fonts do not have italic style only italic mathvariant in the Math Alpha Num table so italic variables are not "beautiful" (bug 108778).
Comment 3 Frédéric Wang (:fredw) 2014-06-18 01:26:49 PDT
Created attachment 233297 [details]
Screenshot of the MathML torture test with Nightly WebKitGTK+
Comment 4 Frédéric Wang (:fredw) 2014-06-18 15:14:48 PDT
So after discussion with Martin on IRC, I think we'll just try to add "Latin Modern Math" as the first font of font-family. That should hopefully not change the test reference for platforms where the font is not installed. For GTK/EFL, we will need to ensure that the bots have "Latin Modern Math" installed. It should be freely available on most Linux distributions since it is included in texlive: https://developer.mozilla.org/en-US/docs/Mozilla/MathML_Project/Fonts#Linux. We can also drop the woff font from http://trac.webkit.org/browser/trunk/LayoutTests/mathml/opentype once it is available on the systems.

Martin said he could help to install "Latin Modern Math" on the GTK bots. 

@Gyuyoung Kim: could you please take care of the EFL bots?
Comment 5 Frédéric Wang (:fredw) 2014-06-19 02:08:41 PDT
Created attachment 233355 [details]
Patch

(note: I have not been able to build EFL again today)

I just tested locally and as I understand the WebKit test runner seems to force the use of the STIX fonts, so it should not be problematic to take the patch even if the bots are not ready yet. The tests for the OpenType MATH support is done in LayoutTests/mathml/opentype/ but for now a Web font version of Latin Modern Math is used, so we don't need to have them installed on the system to run the tests.

@Martin, could you please review this?
Comment 6 Gyuyoung Kim 2014-06-19 02:13:20 PDT
(In reply to comment #4)
> So after discussion with Martin on IRC, I think we'll just try to add "Latin Modern Math" as the first font of font-family. That should hopefully not change the test reference for platforms where the font is not installed. For GTK/EFL, we will need to ensure that the bots have "Latin Modern Math" installed. It should be freely available on most Linux distributions since it is included in texlive: https://developer.mozilla.org/en-US/docs/Mozilla/MathML_Project/Fonts#Linux. We can also drop the woff font from http://trac.webkit.org/browser/trunk/LayoutTests/mathml/opentype once it is available on the systems.
> 
> Martin said he could help to install "Latin Modern Math" on the GTK bots. 
> 
> @Gyuyoung Kim: could you please take care of the EFL bots?

What should I help you on the EFL bots ? Do you need to install "Latin Modern Math" font to the EFL bots ?
Comment 7 Frédéric Wang (:fredw) 2014-06-19 02:20:57 PDT
(In reply to comment #6)
> What should I help you on the EFL bots ? Do you need to install "Latin Modern Math" font to the EFL bots ?

Yes, I need help to install "Latin Modern Math" on the EFL bots and to rebaseline the references of a few MathML pixel tests after the patch. That way, we could later drop latinmodern-math.woff from the source: http://trac.webkit.org/browser/trunk/LayoutTests/mathml/opentype.

However, as I said in comment 5 the WebKit test runner seems to force the use of STIX fonts (at least on the GTK port) so the patch won't actually change the MathML rendering for now. I'm not really sure about that, though, nor whether it is the case for test execution on EFL.
Comment 8 Martin Robinson 2014-06-19 09:55:47 PDT
I've installed these fonts on the GTK+ bots.
Comment 9 Frédéric Wang (:fredw) 2014-06-19 13:30:00 PDT
@Gyuyoung Kim: after discussion with Martin, installing fonts on the bots is not really necessary to run the tests. We only need to update https://github.com/mrobinson/webkitgtk-test-fonts. Does the EFL port uses that repository or something similar?
Comment 10 Gyuyoung Kim 2014-06-19 22:32:05 PDT
(In reply to comment #9)
> @Gyuyoung Kim: after discussion with Martin, installing fonts on the bots is not really necessary to run the tests. We only need to update https://github.com/mrobinson/webkitgtk-test-fonts. Does the EFL port uses that repository or something similar?

EFL port is using below test font. If you need to update the test font, I will update EFL port font according to your update.

http://github.com/downloads/mrobinson/webkitgtk-test-fonts/webkitgtk-test-fonts-0.0.3.tar.gz
Comment 11 Frédéric Wang (:fredw) 2014-06-21 01:08:09 PDT
Committed r170233: <http://trac.webkit.org/changeset/170233>