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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 const FontDescription& fontDescription() const { return m_fontDescription; } | 98 const FontDescription& fontDescription() const { return m_fontDescription; } |
99 | 99 |
100 void update(PassRefPtrWillBeRawPtr<FontSelector>) const; | 100 void update(PassRefPtrWillBeRawPtr<FontSelector>) const; |
101 | 101 |
102 enum CustomFontNotReadyAction { DoNotPaintIfFontNotReady, UseFallbackIfFontN
otReady }; | 102 enum CustomFontNotReadyAction { DoNotPaintIfFontNotReady, UseFallbackIfFontN
otReady }; |
103 float drawText(GraphicsContext*, const TextRunPaintInfo&, const FloatPoint&,
CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const; | 103 float drawText(GraphicsContext*, const TextRunPaintInfo&, const FloatPoint&,
CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const; |
104 void drawEmphasisMarks(GraphicsContext*, const TextRunPaintInfo&, const Atom
icString& mark, const FloatPoint&) const; | 104 void drawEmphasisMarks(GraphicsContext*, const TextRunPaintInfo&, const Atom
icString& mark, const FloatPoint&) const; |
105 | 105 |
106 float width(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts =
0, GlyphOverflow* = 0) const; | 106 float width(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts =
0, GlyphOverflow* = 0) const; |
107 float width(const TextRun&, unsigned& charsConsumed, Glyph& glyphId) const; | 107 float width(const TextRun&, int& charsConsumed, Glyph& glyphId) const; |
108 | 108 |
109 int offsetForPosition(const TextRun&, float position, bool includePartialGly
phs) const; | 109 int offsetForPosition(const TextRun&, float position, bool includePartialGly
phs) const; |
110 FloatRect selectionRectForText(const TextRun&, const FloatPoint&, int h, int
from = 0, int to = -1, bool accountForGlyphBounds = false) const; | 110 FloatRect selectionRectForText(const TextRun&, const FloatPoint&, int h, int
from = 0, int to = -1, bool accountForGlyphBounds = false) const; |
111 | 111 |
112 bool isFixedPitch() const; | 112 bool isFixedPitch() const; |
113 | 113 |
114 // Metrics that we query the FontFallbackList for. | 114 // Metrics that we query the FontFallbackList for. |
115 const FontMetrics& fontMetrics() const { return primaryFont()->fontMetrics()
; } | 115 const FontMetrics& fontMetrics() const { return primaryFont()->fontMetrics()
; } |
116 float spaceWidth() const { return primaryFont()->spaceWidth() + fontDescript
ion().letterSpacing(); } | 116 float spaceWidth() const { return primaryFont()->spaceWidth() + fontDescript
ion().letterSpacing(); } |
117 float tabWidth(const SimpleFontData&, unsigned tabSize, float position) cons
t; | 117 float tabWidth(const SimpleFontData&, unsigned tabSize, float position) cons
t; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 { | 220 { |
221 if (!tabSize) | 221 if (!tabSize) |
222 return fontDescription().letterSpacing(); | 222 return fontDescription().letterSpacing(); |
223 float tabWidth = tabSize * fontData.spaceWidth() + fontDescription().letterS
pacing(); | 223 float tabWidth = tabSize * fontData.spaceWidth() + fontDescription().letterS
pacing(); |
224 return tabWidth - fmodf(position, tabWidth); | 224 return tabWidth - fmodf(position, tabWidth); |
225 } | 225 } |
226 | 226 |
227 } // namespace blink | 227 } // namespace blink |
228 | 228 |
229 #endif | 229 #endif |
OLD | NEW |