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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 | 434 |
435 m_visualMetricsListOffset = 0; | 435 m_visualMetricsListOffset = 0; |
436 m_visualCharacterOffset = 0; | 436 m_visualCharacterOffset = 0; |
437 | 437 |
438 const Vector<SVGTextMetrics>& visualMetricsValues = text.layoutAttributes()-
>textMetricsValues(); | 438 const Vector<SVGTextMetrics>& visualMetricsValues = text.layoutAttributes()-
>textMetricsValues(); |
439 ASSERT(!visualMetricsValues.isEmpty()); | 439 ASSERT(!visualMetricsValues.isEmpty()); |
440 | 440 |
441 const Font& font = style.font(); | 441 const Font& font = style.font(); |
442 | 442 |
443 SVGTextLayoutEngineSpacing spacingLayout(font, style.effectiveZoom()); | 443 SVGTextLayoutEngineSpacing spacingLayout(font, style.effectiveZoom()); |
444 SVGTextLayoutEngineBaseline baselineLayout(font); | 444 SVGTextLayoutEngineBaseline baselineLayout(font, style.effectiveZoom()); |
445 | 445 |
446 bool didStartTextFragment = false; | 446 bool didStartTextFragment = false; |
447 bool applySpacingToNextCharacter = false; | 447 bool applySpacingToNextCharacter = false; |
448 | 448 |
449 float lastAngle = 0; | 449 float lastAngle = 0; |
450 float baselineShift = baselineLayout.calculateBaselineShift(style); | 450 float baselineShift = baselineLayout.calculateBaselineShift(style); |
451 baselineShift -= baselineLayout.calculateAlignmentBaselineShift(m_isVertical
Text, &text); | 451 baselineShift -= baselineLayout.calculateAlignmentBaselineShift(m_isVertical
Text, &text); |
452 | 452 |
453 // Main layout algorithm. | 453 // Main layout algorithm. |
454 while (true) { | 454 while (true) { |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 } | 634 } |
635 | 635 |
636 if (!didStartTextFragment) | 636 if (!didStartTextFragment) |
637 return; | 637 return; |
638 | 638 |
639 // Close last open fragment, if needed. | 639 // Close last open fragment, if needed. |
640 recordTextFragment(textBox, visualMetricsValues); | 640 recordTextFragment(textBox, visualMetricsValues); |
641 } | 641 } |
642 | 642 |
643 } | 643 } |
OLD | NEW |