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

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

Issue 181443002: Use glyph-ids for lookups of SVG font kerning-pairs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Vector<...>::append -> Vector<...>::appendVector. Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGGlyphMap.h ('k') | Source/platform/fonts/Font.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // They are being removed. Do NOT add new uses of this function. Use FontBui lder instead. 92 // They are being removed. Do NOT add new uses of this function. Use FontBui lder instead.
93 FontDescription& mutableFontDescription() { return m_fontDescription; } 93 FontDescription& mutableFontDescription() { return m_fontDescription; }
94 94
95 void update(PassRefPtr<FontSelector>) const; 95 void update(PassRefPtr<FontSelector>) const;
96 96
97 enum CustomFontNotReadyAction { DoNotPaintIfFontNotReady, UseFallbackIfFontN otReady }; 97 enum CustomFontNotReadyAction { DoNotPaintIfFontNotReady, UseFallbackIfFontN otReady };
98 void drawText(GraphicsContext*, const TextRunPaintInfo&, const FloatPoint&, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const; 98 void drawText(GraphicsContext*, const TextRunPaintInfo&, const FloatPoint&, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const;
99 void drawEmphasisMarks(GraphicsContext*, const TextRunPaintInfo&, const Atom icString& mark, const FloatPoint&) const; 99 void drawEmphasisMarks(GraphicsContext*, const TextRunPaintInfo&, const Atom icString& mark, const FloatPoint&) const;
100 100
101 float width(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const; 101 float width(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
102 float width(const TextRun&, int& charsConsumed, String& glyphName) const; 102 float width(const TextRun&, int& charsConsumed, Glyph& glyphId) const;
103 103
104 int offsetForPosition(const TextRun&, float position, bool includePartialGly phs) const; 104 int offsetForPosition(const TextRun&, float position, bool includePartialGly phs) const;
105 FloatRect selectionRectForText(const TextRun&, const FloatPoint&, int h, int from = 0, int to = -1) const; 105 FloatRect selectionRectForText(const TextRun&, const FloatPoint&, int h, int from = 0, int to = -1) const;
106 106
107 bool isFixedPitch() const; 107 bool isFixedPitch() const;
108 108
109 // Metrics that we query the FontFallbackList for. 109 // Metrics that we query the FontFallbackList for.
110 const FontMetrics& fontMetrics() const { return primaryFont()->fontMetrics() ; } 110 const FontMetrics& fontMetrics() const { return primaryFont()->fontMetrics() ; }
111 float spaceWidth() const { return primaryFont()->spaceWidth() + fontDescript ion().letterSpacing(); } 111 float spaceWidth() const { return primaryFont()->spaceWidth() + fontDescript ion().letterSpacing(); }
112 float tabWidth(const SimpleFontData&, unsigned tabSize, float position) cons t; 112 float tabWidth(const SimpleFontData&, unsigned tabSize, float position) cons t;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 { 210 {
211 if (!tabSize) 211 if (!tabSize)
212 return fontDescription().letterSpacing(); 212 return fontDescription().letterSpacing();
213 float tabWidth = tabSize * fontData.spaceWidth() + fontDescription().letterS pacing(); 213 float tabWidth = tabSize * fontData.spaceWidth() + fontDescription().letterS pacing();
214 return tabWidth - fmodf(position, tabWidth); 214 return tabWidth - fmodf(position, tabWidth);
215 } 215 }
216 216
217 } 217 }
218 218
219 #endif 219 #endif
OLDNEW
« no previous file with comments | « Source/core/svg/SVGGlyphMap.h ('k') | Source/platform/fonts/Font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698