OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 default: | 171 default: |
172 return 0; | 172 return 0; |
173 } | 173 } |
174 } | 174 } |
175 | 175 |
176 static inline bool glyphOrientationIsMultiplyOf180Degrees(float orientationAngle
) | 176 static inline bool glyphOrientationIsMultiplyOf180Degrees(float orientationAngle
) |
177 { | 177 { |
178 return !fabsf(fmodf(orientationAngle, 180)); | 178 return !fabsf(fmodf(orientationAngle, 180)); |
179 } | 179 } |
180 | 180 |
181 float SVGTextLayoutEngineBaseline::calculateGlyphAdvanceAndOrientation(bool isVe
rticalText, SVGTextMetrics& metrics, float angle, float& xOrientationShift, floa
t& yOrientationShift) const | 181 float SVGTextLayoutEngineBaseline::calculateGlyphAdvanceAndOrientation(bool isVe
rticalText, const SVGTextMetrics& metrics, float angle, float& xOrientationShift
, float& yOrientationShift) const |
182 { | 182 { |
183 bool orientationIsMultiplyOf180Degrees = glyphOrientationIsMultiplyOf180Degr
ees(angle); | 183 bool orientationIsMultiplyOf180Degrees = glyphOrientationIsMultiplyOf180Degr
ees(angle); |
184 | 184 |
185 // The function is based on spec requirements: | 185 // The function is based on spec requirements: |
186 // | 186 // |
187 // Spec: If the 'glyph-orientation-horizontal' results in an orientation ang
le that is not a multiple of | 187 // Spec: If the 'glyph-orientation-horizontal' results in an orientation ang
le that is not a multiple of |
188 // of 180 degrees, then the current text position is incremented according t
o the vertical metrics of the glyph. | 188 // of 180 degrees, then the current text position is incremented according t
o the vertical metrics of the glyph. |
189 // | 189 // |
190 // Spec: If if the 'glyph-orientation-vertical' results in an orientation an
gle that is not a multiple of | 190 // Spec: If if the 'glyph-orientation-vertical' results in an orientation an
gle that is not a multiple of |
191 // 180 degrees, then the current text position is incremented according to t
he horizontal metrics of the glyph. | 191 // 180 degrees, then the current text position is incremented according to t
he horizontal metrics of the glyph. |
(...skipping 30 matching lines...) Expand all Loading... |
222 xOrientationShift = metrics.width(); | 222 xOrientationShift = metrics.width(); |
223 | 223 |
224 // Horizontal advance calculation. | 224 // Horizontal advance calculation. |
225 if (angle && !orientationIsMultiplyOf180Degrees) | 225 if (angle && !orientationIsMultiplyOf180Degrees) |
226 return metrics.height(); | 226 return metrics.height(); |
227 | 227 |
228 return metrics.width(); | 228 return metrics.width(); |
229 } | 229 } |
230 | 230 |
231 } | 231 } |
OLD | NEW |