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

Side by Side Diff: Source/platform/fonts/shaping/SimpleShaper.cpp

Issue 656913006: Remove SVG fonts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update tests for landing Created 6 years, 1 month 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
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 * 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 if (!expansionOpportunityCount) 62 if (!expansionOpportunityCount)
63 m_expansionPerOpportunity = 0; 63 m_expansionPerOpportunity = 0;
64 else 64 else
65 m_expansionPerOpportunity = m_expansion / expansionOpportunityCount; 65 m_expansionPerOpportunity = m_expansion / expansionOpportunityCount;
66 } 66 }
67 } 67 }
68 68
69 GlyphData SimpleShaper::glyphDataForCharacter(CharacterData& charData, bool norm alizeSpace) 69 GlyphData SimpleShaper::glyphDataForCharacter(CharacterData& charData, bool norm alizeSpace)
70 { 70 {
71 ASSERT(m_font); 71 ASSERT(m_font);
72
73 #if ENABLE(SVG_FONTS)
74 if (TextRun::RenderingContext* renderingContext = m_run.renderingContext()) {
75 return renderingContext->glyphDataForCharacter(*m_font, m_run, *this, ch arData.character,
76 m_run.rtl(), charData.characterOffset, charData.clusterLength);
77 }
78 #endif
79
80 return m_font->glyphDataForCharacter(charData.character, m_run.rtl(), normal izeSpace); 72 return m_font->glyphDataForCharacter(charData.character, m_run.rtl(), normal izeSpace);
81 } 73 }
82 74
83 float SimpleShaper::characterWidth(UChar32 character, const GlyphData& glyphData ) const 75 float SimpleShaper::characterWidth(UChar32 character, const GlyphData& glyphData ) const
84 { 76 {
85 const SimpleFontData* fontData = glyphData.fontData; 77 const SimpleFontData* fontData = glyphData.fontData;
86 ASSERT(fontData); 78 ASSERT(fontData);
87 79
88 if (UNLIKELY(character == '\t' && m_run.allowTabs())) 80 if (UNLIKELY(character == '\t' && m_run.allowTabs()))
89 return m_font->tabWidth(*fontData, m_run.tabSize(), m_run.xPos() + m_run WidthSoFar); 81 return m_font->tabWidth(*fontData, m_run.tabSize(), m_run.xPos() + m_run WidthSoFar);
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 float initialWidth = m_runWidthSoFar; 248 float initialWidth = m_runWidthSoFar;
257 249
258 if (!advance(m_currentCharacter + 1)) 250 if (!advance(m_currentCharacter + 1))
259 return false; 251 return false;
260 252
261 width = m_runWidthSoFar - initialWidth; 253 width = m_runWidthSoFar - initialWidth;
262 return true; 254 return true;
263 } 255 }
264 256
265 } // namespace blink 257 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698