OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. |
6 * Copyright (C) 2008 Holger Hans Peter Freyther | 6 * Copyright (C) 2008 Holger Hans Peter Freyther |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "wtf/text/CharacterNames.h" | 42 #include "wtf/text/CharacterNames.h" |
43 | 43 |
44 namespace blink { | 44 namespace blink { |
45 | 45 |
46 struct CharacterRange; | 46 struct CharacterRange; |
47 class FloatPoint; | 47 class FloatPoint; |
48 class FloatRect; | 48 class FloatRect; |
49 class FontFallbackIterator; | 49 class FontFallbackIterator; |
50 class FontData; | 50 class FontData; |
51 class FontSelector; | 51 class FontSelector; |
52 class GlyphBuffer; | |
53 class ShapeCache; | 52 class ShapeCache; |
54 class TextRun; | 53 class TextRun; |
55 struct TextRunPaintInfo; | 54 struct TextRunPaintInfo; |
56 | 55 |
57 class PLATFORM_EXPORT Font { | 56 class PLATFORM_EXPORT Font { |
58 DISALLOW_NEW(); | 57 DISALLOW_NEW(); |
59 | 58 |
60 public: | 59 public: |
61 Font(); | 60 Font(); |
62 Font(const FontDescription&); | 61 Font(const FontDescription&); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 bool canShapeWordByWord() const; | 164 bool canShapeWordByWord() const; |
166 | 165 |
167 void setCanShapeWordByWordForTesting(bool b) { | 166 void setCanShapeWordByWordForTesting(bool b) { |
168 m_canShapeWordByWord = b; | 167 m_canShapeWordByWord = b; |
169 m_shapeWordByWordComputed = true; | 168 m_shapeWordByWordComputed = true; |
170 } | 169 } |
171 | 170 |
172 private: | 171 private: |
173 enum ForTextEmphasisOrNot { NotForTextEmphasis, ForTextEmphasis }; | 172 enum ForTextEmphasisOrNot { NotForTextEmphasis, ForTextEmphasis }; |
174 | 173 |
175 // Returns the total advance. | |
176 float buildGlyphBuffer(const TextRunPaintInfo&, | |
177 GlyphBuffer&, | |
178 const GlyphData* emphasisData = nullptr) const; | |
179 void drawGlyphBuffer(PaintCanvas*, | |
180 const PaintFlags&, | |
181 const GlyphBuffer&, | |
182 const FloatPoint&, | |
183 float deviceScaleFactor) const; | |
184 | |
185 GlyphData getEmphasisMarkGlyphData(const AtomicString&) const; | 174 GlyphData getEmphasisMarkGlyphData(const AtomicString&) const; |
186 | 175 |
187 bool computeCanShapeWordByWord() const; | 176 bool computeCanShapeWordByWord() const; |
188 | 177 |
189 friend struct SimpleShaper; | |
190 | |
191 public: | 178 public: |
192 FontSelector* getFontSelector() const; | 179 FontSelector* getFontSelector() const; |
193 PassRefPtr<FontFallbackIterator> createFontFallbackIterator( | 180 PassRefPtr<FontFallbackIterator> createFontFallbackIterator( |
194 FontFallbackPriority) const; | 181 FontFallbackPriority) const; |
195 | 182 |
196 void willUseFontData(const String& text) const; | 183 void willUseFontData(const String& text) const; |
197 | 184 |
198 bool loadingCustomFonts() const; | 185 bool loadingCustomFonts() const; |
199 bool isFallbackValid() const; | 186 bool isFallbackValid() const; |
200 | 187 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 // advance an additional tab stop. | 230 // advance an additional tab stop. |
244 if (distanceToTabStop < fontData->spaceWidth() / 2) | 231 if (distanceToTabStop < fontData->spaceWidth() / 2) |
245 distanceToTabStop += baseTabWidth; | 232 distanceToTabStop += baseTabWidth; |
246 | 233 |
247 return distanceToTabStop; | 234 return distanceToTabStop; |
248 } | 235 } |
249 | 236 |
250 } // namespace blink | 237 } // namespace blink |
251 | 238 |
252 #endif | 239 #endif |
OLD | NEW |