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

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

Issue 642863005: Consolidate Font::codePath kerning & ligatures exceptions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Emphasis fix 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/platform/fonts/Font.cpp » ('j') | Source/platform/fonts/Font.cpp » ('J')
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 const SimpleFontData* primaryFont() const; 124 const SimpleFontData* primaryFont() const;
125 const FontData* fontDataAt(unsigned) const; 125 const FontData* fontDataAt(unsigned) const;
126 inline GlyphData glyphDataForCharacter(UChar32& c, bool mirror, bool spaceNo rmalize = false, FontDataVariant variant = AutoVariant) const 126 inline GlyphData glyphDataForCharacter(UChar32& c, bool mirror, bool spaceNo rmalize = false, FontDataVariant variant = AutoVariant) const
127 { 127 {
128 return glyphDataAndPageForCharacter(c, mirror, spaceNormalize, variant). first; 128 return glyphDataAndPageForCharacter(c, mirror, spaceNormalize, variant). first;
129 } 129 }
130 130
131 std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCharacter(UChar32&, bool mirror, bool normalizeSpace = false, FontDataVariant = AutoVariant) const; 131 std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCharacter(UChar32&, bool mirror, bool normalizeSpace = false, FontDataVariant = AutoVariant) const;
132 bool primaryFontHasGlyphForCharacter(UChar32) const; 132 bool primaryFontHasGlyphForCharacter(UChar32) const;
133 133
134 CodePath codePath(const TextRun&) const; 134 CodePath codePath(const TextRun& run) const { return codePath(run, 0, run.le ngth()); }
135 CodePath codePath(const TextRun&, int from, int to) const;
135 136
136 PassTextBlobPtr buildTextBlob(const TextRunPaintInfo&, const FloatPoint& tex tOrigin, bool couldUseLCDRenderedText, CustomFontNotReadyAction = DoNotPaintIfFo ntNotReady) const; 137 PassTextBlobPtr buildTextBlob(const TextRunPaintInfo&, const FloatPoint& tex tOrigin, bool couldUseLCDRenderedText, CustomFontNotReadyAction = DoNotPaintIfFo ntNotReady) const;
137 void drawTextBlob(GraphicsContext*, const SkTextBlob*, const SkPoint& origin ) const; 138 void drawTextBlob(GraphicsContext*, const SkTextBlob*, const SkPoint& origin ) const;
138 139
139 private: 140 private:
140 enum ForTextEmphasisOrNot { NotForTextEmphasis, ForTextEmphasis }; 141 enum ForTextEmphasisOrNot { NotForTextEmphasis, ForTextEmphasis };
141 142
142 // Returns the initial in-stream advance. 143 // Returns the initial in-stream advance.
143 float getGlyphsAndAdvancesForSimpleText(const TextRunPaintInfo&, GlyphBuffer &, ForTextEmphasisOrNot = NotForTextEmphasis) const; 144 float getGlyphsAndAdvancesForSimpleText(const TextRunPaintInfo&, GlyphBuffer &, ForTextEmphasisOrNot = NotForTextEmphasis) const;
144 float drawSimpleText(GraphicsContext*, const TextRunPaintInfo&, const FloatP oint&) const; 145 float drawSimpleText(GraphicsContext*, const TextRunPaintInfo&, const FloatP oint&) const;
(...skipping 17 matching lines...) Expand all
162 163
163 PassTextBlobPtr buildTextBlobForSimpleText(const TextRunPaintInfo&, const Fl oatPoint& textOrigin, bool couldUseLCDRenderedText) const; 164 PassTextBlobPtr buildTextBlobForSimpleText(const TextRunPaintInfo&, const Fl oatPoint& textOrigin, bool couldUseLCDRenderedText) const;
164 PassTextBlobPtr buildTextBlob(const GlyphBuffer&, float initialAdvance, cons t FloatRect& bounds, float& advance, bool couldUseLCD) const; 165 PassTextBlobPtr buildTextBlob(const GlyphBuffer&, float initialAdvance, cons t FloatRect& bounds, float& advance, bool couldUseLCD) const;
165 166
166 friend struct SimpleShaper; 167 friend struct SimpleShaper;
167 friend class SVGTextRunRenderingContext; 168 friend class SVGTextRunRenderingContext;
168 169
169 public: 170 public:
170 // Useful for debugging the different font rendering code paths. 171 // Useful for debugging the different font rendering code paths.
171 static void setCodePath(CodePath); 172 static void setCodePath(CodePath);
172 static CodePath codePath();
173 static CodePath s_codePath; 173 static CodePath s_codePath;
174 174
175 FontSelector* fontSelector() const; 175 FontSelector* fontSelector() const;
176 176
177 FontFallbackList* fontList() const { return m_fontFallbackList.get(); } 177 FontFallbackList* fontList() const { return m_fontFallbackList.get(); }
178 178
179 void willUseFontData(UChar32) const; 179 void willUseFontData(UChar32) const;
180 180
181 static FloatRect pixelSnappedSelectionRect(float fromX, float toX, float y, float height); 181 static FloatRect pixelSnappedSelectionRect(float fromX, float toX, float y, float height);
182 private: 182 private:
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 { 225 {
226 if (!tabSize) 226 if (!tabSize)
227 return fontDescription().letterSpacing(); 227 return fontDescription().letterSpacing();
228 float tabWidth = tabSize * fontData.spaceWidth() + fontDescription().letterS pacing(); 228 float tabWidth = tabSize * fontData.spaceWidth() + fontDescription().letterS pacing();
229 return tabWidth - fmodf(position, tabWidth); 229 return tabWidth - fmodf(position, tabWidth);
230 } 230 }
231 231
232 } // namespace blink 232 } // namespace blink
233 233
234 #endif 234 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/platform/fonts/Font.cpp » ('j') | Source/platform/fonts/Font.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698