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

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

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/platform/fonts/Font.h ('k') | Source/platform/fonts/WidthIterator.h » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 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, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2006, 2010, 2011 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 if (codePathToUse == ComplexPath) 159 if (codePathToUse == ComplexPath)
160 result = floatWidthForComplexText(run, fallbackFonts, glyphOverflow); 160 result = floatWidthForComplexText(run, fallbackFonts, glyphOverflow);
161 else 161 else
162 result = floatWidthForSimpleText(run, fallbackFonts, glyphOverflow); 162 result = floatWidthForSimpleText(run, fallbackFonts, glyphOverflow);
163 163
164 if (cacheEntry && (!fallbackFonts || fallbackFonts->isEmpty())) 164 if (cacheEntry && (!fallbackFonts || fallbackFonts->isEmpty()))
165 *cacheEntry = result; 165 *cacheEntry = result;
166 return result; 166 return result;
167 } 167 }
168 168
169 float Font::width(const TextRun& run, int& charsConsumed, String& glyphName) con st 169 float Font::width(const TextRun& run, int& charsConsumed, Glyph& glyphId) const
170 { 170 {
171 #if ENABLE(SVG_FONTS) 171 #if ENABLE(SVG_FONTS)
172 if (TextRun::RenderingContext* renderingContext = run.renderingContext()) 172 if (TextRun::RenderingContext* renderingContext = run.renderingContext())
173 return renderingContext->floatWidthUsingSVGFont(*this, run, charsConsume d, glyphName); 173 return renderingContext->floatWidthUsingSVGFont(*this, run, charsConsume d, glyphId);
174 #endif 174 #endif
175 175
176 charsConsumed = run.length(); 176 charsConsumed = run.length();
177 glyphName = ""; 177 glyphId = 0;
178 return width(run); 178 return width(run);
179 } 179 }
180 180
181 FloatRect Font::selectionRectForText(const TextRun& run, const FloatPoint& point , int h, int from, int to) const 181 FloatRect Font::selectionRectForText(const TextRun& run, const FloatPoint& point , int h, int from, int to) const
182 { 182 {
183 to = (to == -1 ? run.length() : to); 183 to = (to == -1 ? run.length() : to);
184 184
185 CodePath codePathToUse = codePath(run); 185 CodePath codePathToUse = codePath(run);
186 // FIXME: Use the fast code path once it handles partial runs with kerning a nd ligatures. See http://webkit.org/b/100050 186 // FIXME: Use the fast code path once it handles partial runs with kerning a nd ligatures. See http://webkit.org/b/100050
187 if (codePathToUse != ComplexPath && fontDescription().typesettingFeatures() && (from || to != run.length())) 187 if (codePathToUse != ComplexPath && fontDescription().typesettingFeatures() && (from || to != run.length()))
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 if (delta <= 0) 818 if (delta <= 0)
819 break; 819 break;
820 } 820 }
821 } 821 }
822 } 822 }
823 823
824 return offset; 824 return offset;
825 } 825 }
826 826
827 } 827 }
OLDNEW
« no previous file with comments | « Source/platform/fonts/Font.h ('k') | Source/platform/fonts/WidthIterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698