OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 m_horizontalKerningPairs.clear(); | 66 m_horizontalKerningPairs.clear(); |
67 m_verticalKerningPairs.clear(); | 67 m_verticalKerningPairs.clear(); |
68 } | 68 } |
69 m_isGlyphCacheValid = false; | 69 m_isGlyphCacheValid = false; |
70 } | 70 } |
71 | 71 |
72 SVGMissingGlyphElement* SVGFontElement::firstMissingGlyphElement() const | 72 SVGMissingGlyphElement* SVGFontElement::firstMissingGlyphElement() const |
73 { | 73 { |
74 for (Node* child = firstChild(); child; child = child->nextSibling()) { | 74 for (Node* child = firstChild(); child; child = child->nextSibling()) { |
75 if (child->hasTagName(SVGNames::missing_glyphTag)) | 75 if (child->hasTagName(SVGNames::missing_glyphTag)) |
76 return static_cast<SVGMissingGlyphElement*>(child); | 76 return toSVGMissingGlyphElement(child); |
77 } | 77 } |
78 | 78 |
79 return 0; | 79 return 0; |
80 } | 80 } |
81 | 81 |
82 void SVGFontElement::registerLigaturesInGlyphCache(Vector<String>& ligatures) | 82 void SVGFontElement::registerLigaturesInGlyphCache(Vector<String>& ligatures) |
83 { | 83 { |
84 ASSERT(!ligatures.isEmpty()); | 84 ASSERT(!ligatures.isEmpty()); |
85 | 85 |
86 // Register each character of a ligature in the map, if not present. | 86 // Register each character of a ligature in the map, if not present. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 // Register ligatures, if needed, don't mix up with surrogate pairs
though! | 135 // Register ligatures, if needed, don't mix up with surrogate pairs
though! |
136 if (unicode.length() > 1 && !U16_IS_SURROGATE(unicode[0])) | 136 if (unicode.length() > 1 && !U16_IS_SURROGATE(unicode[0])) |
137 ligatures.append(unicode.string()); | 137 ligatures.append(unicode.string()); |
138 } else if (child->hasTagName(SVGNames::hkernTag)) { | 138 } else if (child->hasTagName(SVGNames::hkernTag)) { |
139 SVGHKernElement* hkern = static_cast<SVGHKernElement*>(child); | 139 SVGHKernElement* hkern = static_cast<SVGHKernElement*>(child); |
140 hkern->buildHorizontalKerningPair(m_horizontalKerningPairs); | 140 hkern->buildHorizontalKerningPair(m_horizontalKerningPairs); |
141 } else if (child->hasTagName(SVGNames::vkernTag)) { | 141 } else if (child->hasTagName(SVGNames::vkernTag)) { |
142 SVGVKernElement* vkern = static_cast<SVGVKernElement*>(child); | 142 SVGVKernElement* vkern = static_cast<SVGVKernElement*>(child); |
143 vkern->buildVerticalKerningPair(m_verticalKerningPairs); | 143 vkern->buildVerticalKerningPair(m_verticalKerningPairs); |
144 } else if (child->hasTagName(SVGNames::missing_glyphTag) && !firstMissin
gGlyphElement) | 144 } else if (child->hasTagName(SVGNames::missing_glyphTag) && !firstMissin
gGlyphElement) { |
145 firstMissingGlyphElement = static_cast<SVGMissingGlyphElement*>(chil
d); | 145 firstMissingGlyphElement = toSVGMissingGlyphElement(child); |
| 146 } |
146 } | 147 } |
147 | 148 |
148 // Register each character of each ligature, if needed. | 149 // Register each character of each ligature, if needed. |
149 if (!ligatures.isEmpty()) | 150 if (!ligatures.isEmpty()) |
150 registerLigaturesInGlyphCache(ligatures); | 151 registerLigaturesInGlyphCache(ligatures); |
151 | 152 |
152 // Register missing-glyph element, if present. | 153 // Register missing-glyph element, if present. |
153 if (firstMissingGlyphElement) { | 154 if (firstMissingGlyphElement) { |
154 SVGGlyph svgGlyph = SVGGlyphElement::buildGenericGlyphIdentifier(firstMi
ssingGlyphElement); | 155 SVGGlyph svgGlyph = SVGGlyphElement::buildGenericGlyphIdentifier(firstMi
ssingGlyphElement); |
155 m_glyphMap.appendToGlyphTable(svgGlyph); | 156 m_glyphMap.appendToGlyphTable(svgGlyph); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 254 |
254 Glyph SVGFontElement::missingGlyph() | 255 Glyph SVGFontElement::missingGlyph() |
255 { | 256 { |
256 ensureGlyphCache(); | 257 ensureGlyphCache(); |
257 return m_missingGlyph; | 258 return m_missingGlyph; |
258 } | 259 } |
259 | 260 |
260 } | 261 } |
261 | 262 |
262 #endif // ENABLE(SVG_FONTS) | 263 #endif // ENABLE(SVG_FONTS) |
OLD | NEW |