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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 isVerticalText = parentRenderObjectStyle->svgStyle()->isVerticalWritingM
ode(); | 112 isVerticalText = parentRenderObjectStyle->svgStyle()->isVerticalWritingM
ode(); |
113 } | 113 } |
114 | 114 |
115 float scale = scaleEmToUnits(fontData->platformData().size(), fontFaceElemen
t->unitsPerEm()); | 115 float scale = scaleEmToUnits(fontData->platformData().size(), fontFaceElemen
t->unitsPerEm()); |
116 ASSERT(activePaintingResource); | 116 ASSERT(activePaintingResource); |
117 | 117 |
118 FloatPoint glyphOrigin; | 118 FloatPoint glyphOrigin; |
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 unsigned short resourceMode = context->textDrawingMode() == TextModeStroke ?
ApplyToStrokeMode : ApplyToFillMode; |
| 123 // From a resource perspective this ought to be treated as "text mode". |
| 124 resourceMode |= ApplyToTextMode; |
| 125 |
122 FloatPoint currentPoint = point; | 126 FloatPoint currentPoint = point; |
123 RenderSVGResourceMode resourceMode = context->textDrawingMode() == TextModeS
troke ? ApplyToStrokeMode : ApplyToFillMode; | |
124 for (int i = 0; i < numGlyphs; ++i) { | 127 for (int i = 0; i < numGlyphs; ++i) { |
125 Glyph glyph = glyphBuffer.glyphAt(from + i); | 128 Glyph glyph = glyphBuffer.glyphAt(from + i); |
126 if (!glyph) | 129 if (!glyph) |
127 continue; | 130 continue; |
128 | 131 |
129 float advance = glyphBuffer.advanceAt(from + i).width(); | 132 float advance = glyphBuffer.advanceAt(from + i).width(); |
130 SVGGlyph svgGlyph = fontElement->svgGlyphForGlyph(glyph); | 133 SVGGlyph svgGlyph = fontElement->svgGlyphForGlyph(glyph); |
131 ASSERT(!svgGlyph.isPartOfLigature); | 134 ASSERT(!svgGlyph.isPartOfLigature); |
132 ASSERT(svgGlyph.tableEntry == glyph); | 135 ASSERT(svgGlyph.tableEntry == glyph); |
133 | 136 |
(...skipping 105 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, | 242 // 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. | 243 // to assure the next lookup of the same glyph won't immediately return the
fallback glyph. |
241 page->setGlyphDataForCharacter(character, glyphData.glyph, originalFontData)
; | 244 page->setGlyphDataForCharacter(character, glyphData.glyph, originalFontData)
; |
242 ASSERT(fallbackGlyphData.fontData); | 245 ASSERT(fallbackGlyphData.fontData); |
243 return fallbackGlyphData; | 246 return fallbackGlyphData; |
244 } | 247 } |
245 | 248 |
246 } | 249 } |
247 | 250 |
248 #endif | 251 #endif |
OLD | NEW |