OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 m_needsFontUpdate = true; | 48 m_needsFontUpdate = true; |
49 } | 49 } |
50 | 50 |
51 void RenderCombineText::setTextInternal(PassRefPtr<StringImpl> text) | 51 void RenderCombineText::setTextInternal(PassRefPtr<StringImpl> text) |
52 { | 52 { |
53 RenderText::setTextInternal(text); | 53 RenderText::setTextInternal(text); |
54 | 54 |
55 m_needsFontUpdate = true; | 55 m_needsFontUpdate = true; |
56 } | 56 } |
57 | 57 |
58 float RenderCombineText::width(unsigned from, unsigned length, const Font& font,
float xPosition, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow*
glyphOverflow) const | 58 float RenderCombineText::width(unsigned from, unsigned length, const Font& font,
float xPosition, TextDirection direction, HashSet<const SimpleFontData*>* fallb
ackFonts, GlyphOverflow* glyphOverflow) const |
59 { | 59 { |
60 if (hasEmptyText()) | 60 if (hasEmptyText()) |
61 return 0; | 61 return 0; |
62 | 62 |
63 if (m_isCombined) | 63 if (m_isCombined) |
64 return font.size(); | 64 return font.size(); |
65 | 65 |
66 return RenderText::width(from, length, font, xPosition, fallbackFonts, glyph
Overflow); | 66 return RenderText::width(from, length, font, xPosition, direction, fallbackF
onts, glyphOverflow); |
67 } | 67 } |
68 | 68 |
69 void RenderCombineText::adjustTextOrigin(FloatPoint& textOrigin, const FloatRect
& boxRect) const | 69 void RenderCombineText::adjustTextOrigin(FloatPoint& textOrigin, const FloatRect
& boxRect) const |
70 { | 70 { |
71 if (m_isCombined) | 71 if (m_isCombined) |
72 textOrigin.move(boxRect.height() / 2 - ceilf(m_combinedTextWidth) / 2, s
tyle()->font().pixelSize()); | 72 textOrigin.move(boxRect.height() / 2 - ceilf(m_combinedTextWidth) / 2, s
tyle()->font().pixelSize()); |
73 } | 73 } |
74 | 74 |
75 void RenderCombineText::getStringToRender(int start, StringView& string, int& le
ngth) const | 75 void RenderCombineText::getStringToRender(int start, StringView& string, int& le
ngth) const |
76 { | 76 { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 if (shouldUpdateFont) | 134 if (shouldUpdateFont) |
135 style()->font().update(fontSelector); | 135 style()->font().update(fontSelector); |
136 | 136 |
137 if (m_isCombined) { | 137 if (m_isCombined) { |
138 DEFINE_STATIC_LOCAL(String, objectReplacementCharacterString, (&objectRe
placementCharacter, 1)); | 138 DEFINE_STATIC_LOCAL(String, objectReplacementCharacterString, (&objectRe
placementCharacter, 1)); |
139 RenderText::setTextInternal(objectReplacementCharacterString.impl()); | 139 RenderText::setTextInternal(objectReplacementCharacterString.impl()); |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 } // namespace WebCore | 143 } // namespace WebCore |
OLD | NEW |