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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 public: | 51 public: |
52 SVGTextLayoutEngine(Vector<SVGTextLayoutAttributes*>&); | 52 SVGTextLayoutEngine(Vector<SVGTextLayoutAttributes*>&); |
53 ~SVGTextLayoutEngine(); | 53 ~SVGTextLayoutEngine(); |
54 | 54 |
55 Vector<SVGTextLayoutAttributes*>& layoutAttributes() { return m_layoutAttrib
utes; } | 55 Vector<SVGTextLayoutAttributes*>& layoutAttributes() { return m_layoutAttrib
utes; } |
56 | 56 |
57 void layoutCharactersInTextBoxes(InlineFlowBox* start); | 57 void layoutCharactersInTextBoxes(InlineFlowBox* start); |
58 void finishLayout(); | 58 void finishLayout(); |
59 | 59 |
60 private: | 60 private: |
61 void updateCharacterPositionIfNeeded(float& x, float& y); | 61 bool setCurrentTextPosition(const SVGCharacterData&); |
62 void updateCurrentTextPosition(float x, float y, float glyphAdvance); | 62 void advanceCurrentTextPosition(float glyphAdvance); |
63 void updateRelativePositionAdjustmentsIfNeeded(float dx, float dy); | 63 bool applyRelativePositionAdjustmentsIfNeeded(const SVGCharacterData&); |
64 | 64 |
65 void computeCurrentFragmentMetrics(SVGInlineTextBox*); | 65 void computeCurrentFragmentMetrics(SVGInlineTextBox*); |
66 void recordTextFragment(SVGInlineTextBox*); | 66 void recordTextFragment(SVGInlineTextBox*); |
67 | 67 |
68 void beginTextPathLayout(SVGInlineFlowBox*); | 68 void beginTextPathLayout(SVGInlineFlowBox*); |
69 void endTextPathLayout(); | 69 void endTextPathLayout(); |
70 | 70 |
71 void layoutInlineTextBox(SVGInlineTextBox*); | 71 void layoutInlineTextBox(SVGInlineTextBox*); |
72 void layoutTextOnLineOrPath(SVGInlineTextBox*, LineLayoutSVGInlineText, cons
t ComputedStyle&); | 72 void layoutTextOnLineOrPath(SVGInlineTextBox*, LineLayoutSVGInlineText, cons
t ComputedStyle&); |
73 | 73 |
74 bool currentLogicalCharacterAttributes(SVGTextLayoutAttributes*&); | 74 bool currentLogicalCharacterAttributes(SVGTextLayoutAttributes*&); |
75 bool currentLogicalCharacterMetrics(SVGTextLayoutAttributes*&, SVGTextMetric
s&); | 75 bool currentLogicalCharacterMetrics(SVGTextLayoutAttributes*&, SVGTextMetric
s&); |
76 void advanceToNextLogicalCharacter(const SVGTextMetrics&); | 76 void advanceToNextLogicalCharacter(const SVGTextMetrics&); |
77 | 77 |
78 private: | 78 private: |
79 Vector<SVGTextLayoutAttributes*>& m_layoutAttributes; | 79 Vector<SVGTextLayoutAttributes*>& m_layoutAttributes; |
80 | 80 |
81 Vector<SVGInlineTextBox*> m_lineLayoutBoxes; | 81 Vector<SVGInlineTextBox*> m_lineLayoutBoxes; |
82 | 82 |
83 SVGTextFragment m_currentTextFragment; | 83 SVGTextFragment m_currentTextFragment; |
84 unsigned m_layoutAttributesPosition; | 84 unsigned m_layoutAttributesPosition; |
85 unsigned m_logicalCharacterOffset; | 85 unsigned m_logicalCharacterOffset; |
86 unsigned m_logicalMetricsListOffset; | 86 unsigned m_logicalMetricsListOffset; |
87 SVGInlineTextMetricsIterator m_visualMetricsIterator; | 87 SVGInlineTextMetricsIterator m_visualMetricsIterator; |
88 float m_x; | 88 FloatPoint m_textPosition; |
89 float m_y; | |
90 float m_dx; | |
91 float m_dy; | |
92 bool m_isVerticalText; | 89 bool m_isVerticalText; |
93 bool m_inPathLayout; | 90 bool m_inPathLayout; |
94 bool m_textLengthSpacingInEffect; | 91 bool m_textLengthSpacingInEffect; |
95 | 92 |
96 // Text on path layout | 93 // Text on path layout |
97 OwnPtr<PathPositionMapper> m_textPath; | 94 OwnPtr<PathPositionMapper> m_textPath; |
98 float m_textPathStartOffset; | 95 float m_textPathStartOffset; |
99 float m_textPathCurrentOffset; | 96 float m_textPathCurrentOffset; |
| 97 float m_textPathDisplacement; |
100 float m_textPathSpacing; | 98 float m_textPathSpacing; |
101 float m_textPathScaling; | 99 float m_textPathScaling; |
102 }; | 100 }; |
103 | 101 |
104 } // namespace blink | 102 } // namespace blink |
105 | 103 |
106 #endif | 104 #endif |
OLD | NEW |