OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 void SVGTextMetricsBuilder::advanceSimpleText() | 59 void SVGTextMetricsBuilder::advanceSimpleText() |
60 { | 60 { |
61 GlyphBuffer glyphBuffer; | 61 GlyphBuffer glyphBuffer; |
62 unsigned metricsLength = m_simpleWidthIterator->advance(m_textPosition + 1,
&glyphBuffer); | 62 unsigned metricsLength = m_simpleWidthIterator->advance(m_textPosition + 1,
&glyphBuffer); |
63 if (!metricsLength) { | 63 if (!metricsLength) { |
64 m_currentMetrics = SVGTextMetrics(); | 64 m_currentMetrics = SVGTextMetrics(); |
65 return; | 65 return; |
66 } | 66 } |
67 | 67 |
68 if (currentCharacterStartsSurrogatePair()) | |
69 ASSERT(metricsLength == 2); | |
70 | |
71 float currentWidth = m_simpleWidthIterator->runWidthSoFar() - m_totalWidth; | 68 float currentWidth = m_simpleWidthIterator->runWidthSoFar() - m_totalWidth; |
72 m_totalWidth = m_simpleWidthIterator->runWidthSoFar(); | 69 m_totalWidth = m_simpleWidthIterator->runWidthSoFar(); |
73 | 70 |
74 #if ENABLE(SVG_FONTS) | 71 #if ENABLE(SVG_FONTS) |
75 m_currentMetrics = SVGTextMetrics(m_text, m_textPosition, metricsLength, cur
rentWidth, m_simpleWidthIterator->lastGlyphName()); | 72 m_currentMetrics = SVGTextMetrics(m_text, m_textPosition, metricsLength, cur
rentWidth, m_simpleWidthIterator->lastGlyphName()); |
76 #else | 73 #else |
77 m_currentMetrics = SVGTextMetrics(m_text, m_textPosition, metricsLength, cur
rentWidth, emptyString()); | 74 m_currentMetrics = SVGTextMetrics(m_text, m_textPosition, metricsLength, cur
rentWidth, emptyString()); |
78 #endif | 75 #endif |
79 } | 76 } |
80 | 77 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 void SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(RenderSVGText* textR
oot, RenderSVGInlineText* stopAtLeaf, SVGCharacterDataMap& allCharactersMap) | 218 void SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes(RenderSVGText* textR
oot, RenderSVGInlineText* stopAtLeaf, SVGCharacterDataMap& allCharactersMap) |
222 { | 219 { |
223 ASSERT(textRoot); | 220 ASSERT(textRoot); |
224 MeasureTextData data(&allCharactersMap); | 221 MeasureTextData data(&allCharactersMap); |
225 walkTree(textRoot, stopAtLeaf, &data); | 222 walkTree(textRoot, stopAtLeaf, &data); |
226 } | 223 } |
227 | 224 |
228 } | 225 } |
229 | 226 |
230 #endif // ENABLE(SVG) | 227 #endif // ENABLE(SVG) |
OLD | NEW |