Bug 41961

Summary: Use STIX fonts in MathML layout tests
Product: WebKit Reporter: François Sausset <sausset>
Component: MathMLAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: alex, ap, bdakin, commit-queue, darin, ddkilzer, mitz, mjs
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Macintosh Intel   
OS: OS X 10.6   
Bug Depends on:    
Bug Blocks: 3251    
Attachments:
Description Flags
Incomplete patch
none
Complete patch (part 1)
none
Complete patch (part 2)
sam: review-
Complete patch (part 3)
none
Revised patch none

Description François Sausset 2010-07-09 09:31:08 PDT
STIX fonts should be used as the standard ones to test MathML implementation.
Comment 1 François Sausset 2010-07-09 09:37:17 PDT
Created attachment 61048 [details]
Incomplete patch

Patch containing only the fonts.

If it is possible to include the fonts according to WebKit license (any advice is welcomed), patches making DumpRenderTree use these fonts should follow.
Comment 2 François Sausset 2010-07-15 09:56:54 PDT
Created attachment 61678 [details]
Complete patch (part 1)

This patch makes STIX fonts the default to render MathML
Comment 3 François Sausset 2010-07-15 09:58:36 PDT
Created attachment 61679 [details]
Complete patch (part 2)

Make DumpRenderTree use STIX fonts for MathML related layout tests and include fonts.

I included the font license as needed by the font license.

However, as WebKit has no global license (as far as I know), I don't know if the font inclusion is possible (from a WebKit license point of view).
Anyone knows?

This should be solved before committing.
Comment 4 Darin Adler 2010-07-15 09:59:46 PDT
The requirements for the license are mentioned in the patch attachment user interface here in bugs.webkit.org.
Comment 5 François Sausset 2010-07-15 10:00:01 PDT
Created attachment 61680 [details]
Complete patch (part 3)

Update all MathML related layout tests to take into account the new default font
Comment 6 François Sausset 2010-07-15 10:07:38 PDT
(In reply to comment #4)
> The requirements for the license are mentioned in the patch attachment user interface here in bugs.webkit.org.

I just saw that before your answer, when submitting the third patch.

If I'm not wrong, the font corresponds to the third case: I'm not the author and I included the license of the font.
Comment 7 mitz 2010-07-15 20:39:59 PDT
(In reply to comment #6)
> (In reply to comment #4)
> > The requirements for the license are mentioned in the patch attachment user interface here in bugs.webkit.org.
> 
> I just saw that before your answer, when submitting the third patch.
> 
> If I'm not wrong, the font corresponds to the third case: I'm not the author and I included the license of the font.

Item 3 says “we can only take in patches that are BSD- or LGPL-licensed”. Unfortunately, the fonts are not under the BSD or LGPL license.
Comment 8 François Sausset 2010-07-16 04:13:24 PDT
(In reply to comment #7)
> Item 3 says “we can only take in patches that are BSD- or LGPL-licensed”. Unfortunately, the fonts are not under the BSD or LGPL license.

There is a "Generally" at the beginning of the item 3 sentence, so exceptions could be conceivable?
Especially for fonts that are not code and only used by DumpRenderTree, not by WebKit/WebCore where I understand that strict BSD/LGPL licensing is needed.

In our case, STIX fonts are a necessity for the MathML implementation:
- they contain (almost) all the needed glyphs needed by MathML 3 contrary to Symbol fonts for instance.
- they allow a font/rendering homogeneity among different platforms, as default platform fonts corresponding to Symbol vary from platform to platform.

That's why STIX fonts will be the default fonts for MathML (people will have to install them by themselves on their computer) with a CSS degradation to Symbol and then Times.
Thus, MathML layout tests need to use the default font to be consistent.

In addition, if we look carefully at the font license:
1) "Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself."
-> Is it a problem for DumpRenderTree which is only a test tool dedicated to WebKit?
2) "Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can
be included either as stand-alone text files, human-readable headers or in the appropriate machine- readable metadata fields within text or binary files as long as those fields can be easily viewed by the user."
-> It's what I did in the patch.
3) "No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users."
-> We do not modify the fonts, so it's OK.
4) "The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission."
-> We do not modify the fonts, so it's OK.
5) "The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software."
-> So the font cannot be BSD or LPGL

I think that we should have the opinion of at least a few people having a long experience with WebKit to accept or reject including STIX fonts in the trunk.
Comment 9 Alex Milowski 2010-07-16 05:01:03 PDT
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #4)
> > > The requirements for the license are mentioned in the patch attachment user interface here in bugs.webkit.org.
> > 
> > I just saw that before your answer, when submitting the third patch.
> > 
> > If I'm not wrong, the font corresponds to the third case: I'm not the author and I included the license of the font.
> 
> Item 3 says “we can only take in patches that are BSD- or LGPL-licensed”. Unfortunately, the fonts are not under the BSD or LGPL license.

The STIX fonts have been development by a consortium of publishers and associations--including the AMS and IEEE.  We need the fonts for the same reasons that they were developed--that most fonts are grossly insufficient for rendering Mathematics.

Please look at the website for these fonts:

   http://www.stixfonts.org/

These fonts are available as statted in their documentation:

 "The font is available royalty-free under the SIL Open Font License."

You can find this license at:

   http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=ofl

More specifically:

   http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=OFL_web

This license is completely compatible with the BSD and/or LGPL licenses. 
I highly suggest that WebKit needs to adjust its policy to include open-source
font licensing.  It is unlikely that font-producing organizations like SIL or the 
STIX consortium will change.  

Meanwhile, we're stuck without the STIX fonts.  Rendering won't work
consistently without consistent glyph support for Mathematics.
Comment 10 Sam Weinig 2010-07-19 10:07:14 PDT
Comment on attachment 61679 [details]
Complete patch (part 2)

This patch does meet the requirement of using an approved license.
Comment 11 François Sausset 2010-08-05 05:47:36 PDT
Created attachment 63580 [details]
Revised patch

Patch that only activates STIX fonts if they are present in the operating system.
Layout tests will still use Apple Symbol fonts (or equivalents on other platforms).

Using them for Layout tests needs some additional work and Alex should have a convenient solution but won't be able to submit a patch before next week at the earliest.
Comment 12 Kenneth Rohde Christiansen 2010-08-05 05:51:28 PDT
Comment on attachment 63580 [details]
Revised patch

Fine with me.
Comment 13 WebKit Commit Bot 2010-08-05 21:11:27 PDT
Comment on attachment 63580 [details]
Revised patch

Clearing flags on attachment: 63580

Committed r64814: <http://trac.webkit.org/changeset/64814>
Comment 14 WebKit Commit Bot 2010-08-05 21:11:37 PDT
All reviewed patches have been landed.  Closing bug.