Changeset 174011 in webkit
- Timestamp:
- Sep 26, 2014 10:18:57 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r174010 r174011 1 2014-09-26 Myles C. Maxfield <mmaxfield@apple.com> 2 3 SVG -> OTF converter bug gardening 4 https://bugs.webkit.org/show_bug.cgi?id=137088 5 6 Reviewed by Darin Adler. 7 8 This test fixes some (but not all) of the svg/ layout tests that never worked with the 9 SVG -> OTF font converter. The actual list of tests this fixes is shown below. I will be 10 filing bugs for the remaining issues along with the relevant tests that those issues 11 cause to fail. 12 13 Tests: svg/W3C-SVG-1.1/fonts-elem-05-t.svg 14 svg/W3C-SVG-1.1/fonts-kern-01-t.svg 15 svg/custom/glyph-setting-d-attribute.svg 16 svg/custom/scrolling-embedded-svg-file-image-repaint-problem.html 17 svg/custom/skip-underline-missing-glyph.html 18 svg/custom/svg-fonts-fallback.xhtml 19 svg/custom/svg-fonts-in-text-controls.html 20 21 * svg/SVGToOTFFontConversion.cpp: 22 (WebCore::SVGToOTFFontConverter::appendHEADTable): We use the font's minimum and maximum 23 bounding box information to size <textarea>s and <input>s. 24 (WebCore::SVGToOTFFontConverter::addCodepointRanges): Codepoint ranges are closed. 25 (WebCore::SVGToOTFFontConverter::computeKerningData): Typo in appending glyphs to the 26 wrong set. 27 (WebCore::SVGToOTFFontConverter::transcodeGlyphPaths): Use the font's horizontal 28 origin if the glyph doesn't have one. 29 (WebCore::SVGToOTFFontConverter::convertSVGToOTFFont): r173852 implemented vhea, vmtx, 30 and kern. 31 (WebCore::transcodeGlyphPaths): Moved inside SVGToOTFFontConverter. 32 1 33 2014-09-26 Dan Bernstein <mitz@apple.com> 2 34 -
trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp
r173852 r174011 131 131 void appendVORGTable(Vector<char>&) const; 132 132 133 template <typename T> 134 Vector<char> transcodeGlyphPaths(float width, const T& glyphElement, FloatRect& boundingBox) const; 135 133 136 void addCodepointRanges(const UnicodeRanges&, HashSet<uint16_t>& glyphSet) const; 134 137 void addCodepoints(const HashSet<String>& codepoints, HashSet<uint16_t>& glyphSet) const; … … 229 232 write32(result, 0); // First half of modification date 230 233 write32(result, 0); // Last half of modification date 231 write16(result, std::numeric_limits<int16_t>::min()); // Minimum X232 write16(result, std::numeric_limits<int16_t>::min()); // Minimum Y233 write16(result, std::numeric_limits<int16_t>::max()); // Maximum X234 write16(result, std::numeric_limits<int16_t>::max()); // Maximum Y234 write16(result, m_boundingBox.x()); // Minimum X 235 write16(result, m_boundingBox.y()); // Minimum Y 236 write16(result, m_boundingBox.maxX()); // Maximum X 237 write16(result, m_boundingBox.maxY()); // Maximum Y 235 238 write16(result, (m_italic ? 1 << 1 : 0) | (m_weight >= 7 ? 1 : 0)); 236 239 write16(result, 3); // Smallest readable size in pixels … … 604 607 { 605 608 for (auto& unicodeRange : unicodeRanges) { 606 for (auto codepoint = unicodeRange.first; codepoint < unicodeRange.second; ++codepoint) {609 for (auto codepoint = unicodeRange.first; codepoint <= unicodeRange.second; ++codepoint) { 607 610 if (!codepoint || codepoint >= std::numeric_limits<Codepoint>::max()) 608 611 continue; … … 661 664 addGlyphNames(kerningPair.glyphName2, glyphSet2); 662 665 addCodepoints(kerningPair.unicodeName1, glyphSet1); 663 addCodepoints(kerningPair.unicodeName2, glyphSet 1);666 addCodepoints(kerningPair.unicodeName2, glyphSet2); 664 667 665 668 // FIXME: Use table format 2 so we don't have to append each of these one by one … … 836 839 837 840 template <typename T> 838 static Vector<char> transcodeGlyphPaths(float width, const T& glyphElement, FloatRect& boundingBox) 841 Vector<char> SVGToOTFFontConverter::transcodeGlyphPaths(float width, const T& glyphElement, FloatRect& boundingBox) const 839 842 { 840 843 Vector<char> result; … … 852 855 bool ok; 853 856 float horizontalOriginX = glyphElement.fastGetAttribute(SVGNames::horiz_origin_xAttr).toFloat(&ok); 854 if (!ok )855 horizontalOriginX = 0;857 if (!ok && m_fontFaceElement) 858 horizontalOriginX = m_fontFaceElement->horizontalOriginX(); 856 859 float horizontalOriginY = glyphElement.fastGetAttribute(SVGNames::horiz_origin_yAttr).toFloat(&ok); 857 if (!ok )858 horizontalOriginY = 0;860 if (!ok && m_fontFaceElement) 861 horizontalOriginY = m_fontFaceElement->horizontalOriginY(); 859 862 860 863 CFFBuilder builder(result, width, FloatPoint(horizontalOriginX, horizontalOriginY)); … … 1063 1066 result.append(0); 1064 1067 1065 // FIXME: Implement more tables, like vhea and vmtx (and kern!)1066 1068 appendTable("CFF ", result, &SVGToOTFFontConverter::appendCFFTable); 1067 1069 appendTable("OS/2", result, &SVGToOTFFontConverter::appendOS2Table);
Note: See TracChangeset
for help on using the changeset viewer.