Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: Source/platform/fonts/Font.h

Issue 652483002: TextRun::length() should return an unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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&, int& charsConsumed, Glyph& glyphId) const; 107 float width(const TextRun&, unsigned& 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698