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

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

Issue 343813002: Explicitly compare FontVariant to enumerators. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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.cpp ('k') | Source/platform/fonts/harfbuzz/HarfBuzzShaper.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) 2003, 2006, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2003, 2006, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Holger Hans Peter Freyther 3 * Copyright (C) 2008 Holger Hans Peter Freyther
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 } 177 }
178 178
179 if (fontData != lastFontData && width) { 179 if (fontData != lastFontData && width) {
180 if (shouldApplyFontTransforms()) 180 if (shouldApplyFontTransforms())
181 m_runWidthSoFar += applyFontTransforms(glyphBuffer, m_run.ltr(), lastGlyphCount, lastFontData, m_typesettingFeatures, charactersTreatedAsSpace); 181 m_runWidthSoFar += applyFontTransforms(glyphBuffer, m_run.ltr(), lastGlyphCount, lastFontData, m_typesettingFeatures, charactersTreatedAsSpace);
182 182
183 lastFontData = fontData; 183 lastFontData = fontData;
184 if (m_fallbackFonts && fontData != primaryFont) { 184 if (m_fallbackFonts && fontData != primaryFont) {
185 // FIXME: This does a little extra work that could be avoided if 185 // FIXME: This does a little extra work that could be avoided if
186 // glyphDataForCharacter() returned whether it chose to use a sm all caps font. 186 // glyphDataForCharacter() returned whether it chose to use a sm all caps font.
187 if (!m_font->fontDescription().variant() || character == toUpper (character)) 187 if (m_font->fontDescription().variant() == FontVariantNormal || character == toUpper(character))
188 m_fallbackFonts->add(fontData); 188 m_fallbackFonts->add(fontData);
189 else { 189 else {
190 ASSERT(m_font->fontDescription().variant() == FontVariantSma llCaps);
190 const GlyphData& uppercaseGlyphData = m_font->glyphDataForCh aracter(toUpper(character), rtl); 191 const GlyphData& uppercaseGlyphData = m_font->glyphDataForCh aracter(toUpper(character), rtl);
191 if (uppercaseGlyphData.fontData != primaryFont) 192 if (uppercaseGlyphData.fontData != primaryFont)
192 m_fallbackFonts->add(uppercaseGlyphData.fontData); 193 m_fallbackFonts->add(uppercaseGlyphData.fontData);
193 } 194 }
194 } 195 }
195 } 196 }
196 197
197 if (hasExtraSpacing) { 198 if (hasExtraSpacing) {
198 // Account for letter-spacing. 199 // Account for letter-spacing.
199 if (width && m_font->fontDescription().letterSpacing()) 200 if (width && m_font->fontDescription().letterSpacing())
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 unsigned oldSize = glyphBuffer.size(); 332 unsigned oldSize = glyphBuffer.size();
332 advance(m_currentCharacter + 1, &glyphBuffer); 333 advance(m_currentCharacter + 1, &glyphBuffer);
333 float w = 0; 334 float w = 0;
334 for (unsigned i = oldSize; i < glyphBuffer.size(); ++i) 335 for (unsigned i = oldSize; i < glyphBuffer.size(); ++i)
335 w += glyphBuffer.advanceAt(i).width(); 336 w += glyphBuffer.advanceAt(i).width();
336 width = w; 337 width = w;
337 return glyphBuffer.size() > oldSize; 338 return glyphBuffer.size() > oldSize;
338 } 339 }
339 340
340 } 341 }
OLDNEW
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698