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

Unified Diff: Source/platform/fonts/Font.cpp

Issue 656913006: Remove SVG fonts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update tests for landing 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 side-by-side diff with in-line comments
Download patch
Index: Source/platform/fonts/Font.cpp
diff --git a/Source/platform/fonts/Font.cpp b/Source/platform/fonts/Font.cpp
index 3722d090b89c65b939c9b78945e47e6fefb1254f..e98a2c7eacdddda0d0a959977c5217890296f716 100644
--- a/Source/platform/fonts/Font.cpp
+++ b/Source/platform/fonts/Font.cpp
@@ -261,11 +261,6 @@ float Font::width(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFo
float Font::width(const TextRun& run, int& charsConsumed, Glyph& glyphId) const
{
-#if ENABLE(SVG_FONTS)
- if (TextRun::RenderingContext* renderingContext = run.renderingContext())
- return renderingContext->floatWidthUsingSVGFont(*this, run, charsConsumed, glyphId);
-#endif
-
charsConsumed = run.length();
glyphId = 0;
return width(run);
@@ -286,10 +281,6 @@ bool buildTextBlobInternal(const GlyphBuffer& glyphBuffer, SkScalar initialAdvan
if (fontData->platformData().orientation() == Vertical)
return false;
- // FIXME: Handle SVG fonts.
- if (fontData->isSVGFont())
- return false;
-
// FIXME: FontPlatformData makes some decisions on the device scale
// factor, which is found via the GraphicsContext. This should be fixed
// to avoid correctness problems here.
@@ -381,11 +372,6 @@ CodePath Font::codePath(const TextRunPaintInfo& runInfo) const
if (fontDescription().typesettingFeatures() && (runInfo.from || runInfo.to != run.length()))
return ComplexPath;
-#if ENABLE(SVG_FONTS)
- if (run.renderingContext())
- return SimplePath;
-#endif
-
if (m_fontDescription.featureSettings() && m_fontDescription.featureSettings()->size() > 0 && m_fontDescription.letterSpacing() == 0)
return ComplexPath;
@@ -544,7 +530,7 @@ std::pair<GlyphData, GlyphPage*> Font::glyphDataAndPageForCharacter(UChar32& c,
ASSERT(isMainThread());
if (variant == AutoVariant) {
- if (m_fontDescription.variant() == FontVariantSmallCaps && !primaryFont()->isSVGFont()) {
+ if (m_fontDescription.variant() == FontVariantSmallCaps) {
UChar32 upperC = toUpper(c);
if (upperC != c) {
c = upperC;
@@ -974,20 +960,12 @@ float Font::drawGlyphBuffer(GraphicsContext* context,
float advanceSoFar = 0;
unsigned lastFrom = 0;
unsigned nextGlyph = 0;
-#if ENABLE(SVG_FONTS)
- TextRun::RenderingContext* renderingContext = runInfo.run.renderingContext();
-#endif
while (nextGlyph < glyphBuffer.size()) {
const SimpleFontData* nextFontData = glyphBuffer.fontDataAt(nextGlyph);
if (nextFontData != fontData) {
-#if ENABLE(SVG_FONTS)
- if (renderingContext && fontData->isSVGFont())
- renderingContext->drawSVGGlyphs(context, runInfo.run, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
- else
-#endif
- drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint, runInfo.bounds);
+ drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint, runInfo.bounds);
lastFrom = nextGlyph;
fontData = nextFontData;
@@ -998,13 +976,7 @@ float Font::drawGlyphBuffer(GraphicsContext* context,
nextGlyph++;
}
-#if ENABLE(SVG_FONTS)
- if (renderingContext && fontData->isSVGFont())
- renderingContext->drawSVGGlyphs(context, runInfo.run, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
- else
-#endif
- drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint, runInfo.bounds);
-
+ drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint, runInfo.bounds);
startPoint += FloatSize(advanceSoFar, 0);
return startPoint.x() - point.x();
}

Powered by Google App Engine
This is Rietveld 408576698