OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 glyphOrigin.setX(svgFontData->horizontalOriginX() * scale); | 119 glyphOrigin.setX(svgFontData->horizontalOriginX() * scale); |
120 glyphOrigin.setY(svgFontData->horizontalOriginY() * scale); | 120 glyphOrigin.setY(svgFontData->horizontalOriginY() * scale); |
121 | 121 |
122 FloatPoint currentPoint = point; | 122 FloatPoint currentPoint = point; |
123 RenderSVGResourceMode resourceMode = context->textDrawingMode() == TextModeS
troke ? ApplyToStrokeMode : ApplyToFillMode; | 123 RenderSVGResourceMode resourceMode = context->textDrawingMode() == TextModeS
troke ? ApplyToStrokeMode : ApplyToFillMode; |
124 for (int i = 0; i < numGlyphs; ++i) { | 124 for (int i = 0; i < numGlyphs; ++i) { |
125 Glyph glyph = glyphBuffer.glyphAt(from + i); | 125 Glyph glyph = glyphBuffer.glyphAt(from + i); |
126 if (!glyph) | 126 if (!glyph) |
127 continue; | 127 continue; |
128 | 128 |
129 float advance = glyphBuffer.advanceAt(from + i); | 129 float advance = glyphBuffer.advanceAt(from + i).width(); |
130 SVGGlyph svgGlyph = fontElement->svgGlyphForGlyph(glyph); | 130 SVGGlyph svgGlyph = fontElement->svgGlyphForGlyph(glyph); |
131 ASSERT(!svgGlyph.isPartOfLigature); | 131 ASSERT(!svgGlyph.isPartOfLigature); |
132 ASSERT(svgGlyph.tableEntry == glyph); | 132 ASSERT(svgGlyph.tableEntry == glyph); |
133 | 133 |
134 SVGGlyphElement::inheritUnspecifiedAttributes(svgGlyph, svgFontData); | 134 SVGGlyphElement::inheritUnspecifiedAttributes(svgGlyph, svgFontData); |
135 | 135 |
136 // FIXME: Support arbitary SVG content as glyph (currently limited to <g
lyph d="..."> situations). | 136 // FIXME: Support arbitary SVG content as glyph (currently limited to <g
lyph d="..."> situations). |
137 if (svgGlyph.pathData.isEmpty()) { | 137 if (svgGlyph.pathData.isEmpty()) { |
138 if (isVerticalText) | 138 if (isVerticalText) |
139 currentPoint.move(0, advance); | 139 currentPoint.move(0, advance); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 // Restore original state of the SVG Font glyph table and the current font f
allback list, | 239 // Restore original state of the SVG Font glyph table and the current font f
allback list, |
240 // to assure the next lookup of the same glyph won't immediately return the
fallback glyph. | 240 // to assure the next lookup of the same glyph won't immediately return the
fallback glyph. |
241 page->setGlyphDataForCharacter(character, glyphData.glyph, originalFontData)
; | 241 page->setGlyphDataForCharacter(character, glyphData.glyph, originalFontData)
; |
242 ASSERT(fallbackGlyphData.fontData); | 242 ASSERT(fallbackGlyphData.fontData); |
243 return fallbackGlyphData; | 243 return fallbackGlyphData; |
244 } | 244 } |
245 | 245 |
246 } | 246 } |
247 | 247 |
248 #endif | 248 #endif |
OLD | NEW |