Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 * Copyright (C) 2014 Google Inc. All rights reserved. | 4 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 | 200 |
| 201 Glyph glyph = glyphData.glyph; | 201 Glyph glyph = glyphData.glyph; |
| 202 const SimpleFontData* fontData = glyphData.fontData; | 202 const SimpleFontData* fontData = glyphData.fontData; |
| 203 ASSERT(fontData); | 203 ASSERT(fontData); |
| 204 | 204 |
| 205 if (m_fallbackFonts && lastFontData != fontData && width) { | 205 if (m_fallbackFonts && lastFontData != fontData && width) { |
| 206 lastFontData = fontData; | 206 lastFontData = fontData; |
| 207 cacheFallbackFont(fontData, primaryFont); | 207 cacheFallbackFont(fontData, primaryFont); |
| 208 } | 208 } |
| 209 | 209 |
| 210 if (hasExtraSpacing) | 210 if (hasExtraSpacing && width) |
|
pdr.
2014/10/13 23:53:30
(Maybe as a followup) Can you add a bool to better
| |
| 211 width = adjustSpacing(width, charData, *fontData, glyphBuffer); | 211 width = adjustSpacing(width, charData, *fontData, glyphBuffer); |
|
pdr.
2014/10/13 23:53:30
Does it make sense to check for width in adjustSpa
| |
| 212 | 212 |
| 213 if (m_bounds) | 213 if (m_bounds) |
| 214 updateGlyphBounds(glyphData, width, !charData.characterOffset); | 214 updateGlyphBounds(glyphData, width, !charData.characterOffset); |
| 215 | 215 |
| 216 if (m_forTextEmphasis && !Character::canReceiveTextEmphasis(charData.cha racter)) | 216 if (m_forTextEmphasis && !Character::canReceiveTextEmphasis(charData.cha racter)) |
| 217 glyph = 0; | 217 glyph = 0; |
| 218 | 218 |
| 219 // Advance past the character we just dealt with. | 219 // Advance past the character we just dealt with. |
| 220 textIterator.advance(charData.clusterLength); | 220 textIterator.advance(charData.clusterLength); |
| 221 m_runWidthSoFar += width; | 221 m_runWidthSoFar += width; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 254 float initialWidth = m_runWidthSoFar; | 254 float initialWidth = m_runWidthSoFar; |
| 255 | 255 |
| 256 if (!advance(m_currentCharacter + 1)) | 256 if (!advance(m_currentCharacter + 1)) |
| 257 return false; | 257 return false; |
| 258 | 258 |
| 259 width = m_runWidthSoFar - initialWidth; | 259 width = m_runWidthSoFar - initialWidth; |
| 260 return true; | 260 return true; |
| 261 } | 261 } |
| 262 | 262 |
| 263 } // namespace blink | 263 } // namespace blink |
| OLD | NEW |