[MathML] Symbol font uses greek letters for roman ones on linux and Windows
authordbarton@mathscribe.com <dbarton@mathscribe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Oct 2012 21:14:10 +0000 (21:14 +0000)
committerdbarton@mathscribe.com <dbarton@mathscribe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Oct 2012 21:14:10 +0000 (21:14 +0000)
commitc1ce383134b18616f90ba6331a8b1427495f8e1e
tree92fadbf4f08fd27a7fb8897f3bbb9db3404f1f56
parent5f1d6e7031061a281946b4fd4ff6380a8204c590
[MathML] Symbol font uses greek letters for roman ones on linux and Windows
https://bugs.webkit.org/show_bug.cgi?id=99921

Reviewed by Eric Seidel.

Source/WebCore:

For parts of stretched parentheses and brackets, mathml.css currently uses the Symbol font,
which on linux and Windows has greek letters at roman code points. To fix this, we switch
to the STIXSizeOneSym font when available. However, this can cause vertical gaps between
glyph parts, because of hard-coded constants in RenderMathMLOperator.cpp. We eliminate all
these constants. We also shift glyphs upward by 1px and truncate them to avoid the gaps.

Tested by existing tests, and one test added to LayoutTests/mathml/presentation/mo.xhtml.

* css/mathml.css:
(math, mfenced > *):
    - Set font-family for mn, mi, etc.
(mo, mfenced):
    - Set font-family for mo and anonymous operators, including extension glyphs for
      stretched operators like parentheses and brackets.
(math):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore):
    - Change 0x23d0 to 0x23aa for STIX & Cambria Math fonts.
(WebCore::RenderMathMLOperator::glyphHeightForCharacter):
(WebCore::RenderMathMLOperator::updateFromElement):
(WebCore::RenderMathMLOperator::createStackableStyle):
    - Eliminate unused lineHeight and topRelative parameters, and the hard-coded font size
      of 14.
(WebCore::RenderMathMLOperator::createGlyph):
    - Eliminate unused lineHeight and topRelative parameters.
* rendering/mathml/RenderMathMLOperator.h:
(RenderMathMLOperator):

Tools:

Enable the STIXSizeOneSym font for testing.

* DumpRenderTree/mac/DumpRenderTree.mm:
(allowedFontFamilySet):
* WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm:
(WTR::allowedFontFamilySet):

LayoutTests:

* mathml/presentation/mo.xhtml:
* platform/chromium/TestExpectations:
* platform/chromium/mathml/presentation/attributes-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/attributes-expected.txt:
* platform/chromium/mathml/presentation/fenced-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/fenced-expected.txt:
* platform/chromium/mathml/presentation/fenced-mi-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/fenced-mi-expected.txt:
* platform/chromium/mathml/presentation/fractions-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/fractions-expected.txt:
* platform/chromium/mathml/presentation/fractions-vertical-alignment-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/fractions-vertical-alignment-expected.txt:
* platform/chromium/mathml/presentation/mo-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/mo-expected.txt:
* platform/chromium/mathml/presentation/mo-stretch-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/mo-stretch-expected.txt:
* platform/chromium/mathml/presentation/mroot-pref-width-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/mroot-pref-width-expected.txt:
* platform/chromium/mathml/presentation/over-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/over-expected.txt:
* platform/chromium/mathml/presentation/roots-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/roots-expected.txt:
* platform/chromium/mathml/presentation/row-alignment-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/row-alignment-expected.txt:
* platform/chromium/mathml/presentation/row-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/row-expected.txt:
* platform/chromium/mathml/presentation/style-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/style-expected.txt:
* platform/chromium/mathml/presentation/sub-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/sub-expected.txt:
* platform/chromium/mathml/presentation/subsup-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/subsup-expected.txt:
* platform/chromium/mathml/presentation/sup-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/sup-expected.txt:
* platform/chromium/mathml/presentation/tables-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/tables-expected.txt:
* platform/chromium/mathml/presentation/tokenElements-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/tokenElements-expected.txt:
* platform/chromium/mathml/presentation/under-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/under-expected.txt:
* platform/chromium/mathml/presentation/underover-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/presentation/underover-expected.txt:
* platform/chromium/mathml/xHeight-expected.png: Modified property svn:mime-type.
* platform/chromium/mathml/xHeight-expected.txt:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132264 268f45cc-cd09-0410-ab3c-d52691b4dbfc
55 files changed:
LayoutTests/ChangeLog
LayoutTests/mathml/presentation/mo.xhtml
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/chromium/mathml/presentation/attributes-expected.png
LayoutTests/platform/chromium/mathml/presentation/attributes-expected.txt
LayoutTests/platform/chromium/mathml/presentation/fenced-expected.png
LayoutTests/platform/chromium/mathml/presentation/fenced-expected.txt
LayoutTests/platform/chromium/mathml/presentation/fenced-mi-expected.png
LayoutTests/platform/chromium/mathml/presentation/fenced-mi-expected.txt
LayoutTests/platform/chromium/mathml/presentation/fractions-expected.png
LayoutTests/platform/chromium/mathml/presentation/fractions-expected.txt
LayoutTests/platform/chromium/mathml/presentation/fractions-vertical-alignment-expected.png
LayoutTests/platform/chromium/mathml/presentation/fractions-vertical-alignment-expected.txt
LayoutTests/platform/chromium/mathml/presentation/mo-expected.png
LayoutTests/platform/chromium/mathml/presentation/mo-expected.txt
LayoutTests/platform/chromium/mathml/presentation/mo-stretch-expected.png
LayoutTests/platform/chromium/mathml/presentation/mo-stretch-expected.txt
LayoutTests/platform/chromium/mathml/presentation/mroot-pref-width-expected.png
LayoutTests/platform/chromium/mathml/presentation/mroot-pref-width-expected.txt
LayoutTests/platform/chromium/mathml/presentation/over-expected.png
LayoutTests/platform/chromium/mathml/presentation/over-expected.txt
LayoutTests/platform/chromium/mathml/presentation/roots-expected.png
LayoutTests/platform/chromium/mathml/presentation/roots-expected.txt
LayoutTests/platform/chromium/mathml/presentation/row-alignment-expected.png
LayoutTests/platform/chromium/mathml/presentation/row-alignment-expected.txt
LayoutTests/platform/chromium/mathml/presentation/row-expected.png
LayoutTests/platform/chromium/mathml/presentation/row-expected.txt
LayoutTests/platform/chromium/mathml/presentation/style-expected.png
LayoutTests/platform/chromium/mathml/presentation/style-expected.txt
LayoutTests/platform/chromium/mathml/presentation/sub-expected.png
LayoutTests/platform/chromium/mathml/presentation/sub-expected.txt
LayoutTests/platform/chromium/mathml/presentation/subsup-expected.png
LayoutTests/platform/chromium/mathml/presentation/subsup-expected.txt
LayoutTests/platform/chromium/mathml/presentation/sup-expected.png
LayoutTests/platform/chromium/mathml/presentation/sup-expected.txt
LayoutTests/platform/chromium/mathml/presentation/tables-expected.png
LayoutTests/platform/chromium/mathml/presentation/tables-expected.txt
LayoutTests/platform/chromium/mathml/presentation/tokenElements-expected.png
LayoutTests/platform/chromium/mathml/presentation/tokenElements-expected.txt
LayoutTests/platform/chromium/mathml/presentation/under-expected.png
LayoutTests/platform/chromium/mathml/presentation/under-expected.txt
LayoutTests/platform/chromium/mathml/presentation/underover-expected.png
LayoutTests/platform/chromium/mathml/presentation/underover-expected.txt
LayoutTests/platform/chromium/mathml/xHeight-expected.png
LayoutTests/platform/chromium/mathml/xHeight-expected.txt
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/css/mathml.css
Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
Source/WebCore/rendering/mathml/RenderMathMLOperator.h
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm