Crash when using an SVG font with > 390 glyphs
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Oct 2015 00:04:10 +0000 (00:04 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Oct 2015 00:04:10 +0000 (00:04 +0000)
commit278121f67bdd9fc75d26a26143dc6cc8e1c1fbf1
treec2a569e4c5ddb77e96ac6384ae92928800c32ef9
parent8fa5ea95f6ca0e349ffab76d6d3f81a702d4a6b6
Crash when using an SVG font with > 390 glyphs
https://bugs.webkit.org/show_bug.cgi?id=149677
<rdar://problem/21676402>

Reviewed by Simon Fraser.

Source/WebCore:

The "Charset Index" in OTF are indices into a collection of strings. There are
390 predefined strings in this collection. We were currently assigning each
glyph to one of these strings. However, if there are more glyphs than strings,
we will be using invalid indices.

The values of the strings themselves are not necessary for SVG fonts. Therefore,
the solution is to create a single dummy string, and have all glyphs target it.

Tests: svg/custom/many-glyphs.svg

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font):
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::appendCFFTable):

LayoutTests:

* svg/custom/many-glyphs-expected.svg: Added.
* svg/custom/many-glyphs.svg: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190375 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/svg/custom/many-glyphs-expected.svg [new file with mode: 0644]
LayoutTests/svg/custom/many-glyphs.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSFontFaceSource.cpp
Source/WebCore/svg/SVGToOTFFontConversion.cpp