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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 bool drawText(SkCanvas*, const TextRunPaintInfo&, const FloatPoint&, float d
eviceScaleFactor, const SkPaint&) const; | 80 bool drawText(SkCanvas*, const TextRunPaintInfo&, const FloatPoint&, float d
eviceScaleFactor, const SkPaint&) const; |
81 bool drawBidiText(SkCanvas*, const TextRunPaintInfo&, const FloatPoint&, Cus
tomFontNotReadyAction, float deviceScaleFactor, const SkPaint&) const; | 81 bool drawBidiText(SkCanvas*, const TextRunPaintInfo&, const FloatPoint&, Cus
tomFontNotReadyAction, float deviceScaleFactor, const SkPaint&) const; |
82 void drawEmphasisMarks(SkCanvas*, const TextRunPaintInfo&, const AtomicStrin
g& mark, const FloatPoint&, float deviceScaleFactor, const SkPaint&) const; | 82 void drawEmphasisMarks(SkCanvas*, const TextRunPaintInfo&, const AtomicStrin
g& mark, const FloatPoint&, float deviceScaleFactor, const SkPaint&) const; |
83 | 83 |
84 // Glyph bounds will be the minimum rect containing all glyph strokes, in co
ordinates using | 84 // Glyph bounds will be the minimum rect containing all glyph strokes, in co
ordinates using |
85 // (<text run x position>, <baseline position>) as the origin. | 85 // (<text run x position>, <baseline position>) as the origin. |
86 float width(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts =
nullptr, FloatRect* glyphBounds = nullptr) const; | 86 float width(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts =
nullptr, FloatRect* glyphBounds = nullptr) const; |
87 | 87 |
88 int offsetForPosition(const TextRun&, float position, bool includePartialGly
phs) const; | 88 int offsetForPosition(const TextRun&, float position, bool includePartialGly
phs) const; |
89 FloatRect selectionRectForText(const TextRun&, const FloatPoint&, int h, int
from = 0, int to = -1, bool accountForGlyphBounds = false) const; | 89 FloatRect selectionRectForText(const TextRun&, const FloatPoint&, int h, int
from = 0, int to = -1, bool accountForGlyphBounds = false) const; |
| 90 CharacterRange getCharacterRange(const TextRun&, unsigned from, unsigned to)
const; |
90 Vector<CharacterRange> individualCharacterRanges(const TextRun&) const; | 91 Vector<CharacterRange> individualCharacterRanges(const TextRun&) const; |
91 | 92 |
92 // Metrics that we query the FontFallbackList for. | 93 // Metrics that we query the FontFallbackList for. |
93 const FontMetrics& getFontMetrics() const | 94 const FontMetrics& getFontMetrics() const |
94 { | 95 { |
95 RELEASE_ASSERT(primaryFont()); | 96 RELEASE_ASSERT(primaryFont()); |
96 return primaryFont()->getFontMetrics(); | 97 return primaryFont()->getFontMetrics(); |
97 } | 98 } |
98 float spaceWidth() const { return primaryFont()->spaceWidth() + getFontDescr
iption().letterSpacing(); } | 99 float spaceWidth() const { return primaryFont()->spaceWidth() + getFontDescr
iption().letterSpacing(); } |
99 float tabWidth(const SimpleFontData&, const TabSize&, float position) const; | 100 float tabWidth(const SimpleFontData&, const TabSize&, float position) const; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // if the distance to the next tab stop is less than that, advance an additi
onal tab stop. | 198 // if the distance to the next tab stop is less than that, advance an additi
onal tab stop. |
198 if (distanceToTabStop < std::max(getFontDescription().letterSpacing(), Layou
tUnit::epsilon())) | 199 if (distanceToTabStop < std::max(getFontDescription().letterSpacing(), Layou
tUnit::epsilon())) |
199 distanceToTabStop += baseTabWidth; | 200 distanceToTabStop += baseTabWidth; |
200 | 201 |
201 return distanceToTabStop; | 202 return distanceToTabStop; |
202 } | 203 } |
203 | 204 |
204 } // namespace blink | 205 } // namespace blink |
205 | 206 |
206 #endif | 207 #endif |
OLD | NEW |