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

Unified Diff: Source/core/css/CSSSegmentedFontFace.cpp

Issue 26702008: Allow small-caps synthesis for @font-face with multiple sources including SVG format (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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
« no previous file with comments | « Source/core/css/CSSSegmentedFontFace.h ('k') | Source/core/css/CSSSegmentedFontFaceCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSSegmentedFontFace.cpp
diff --git a/Source/core/css/CSSSegmentedFontFace.cpp b/Source/core/css/CSSSegmentedFontFace.cpp
index 46b7ed8a10babd1abfed2d245d6babd79f0fdab1..96c553fdbd33fe0deb17e70128670c671f0e15f2 100644
--- a/Source/core/css/CSSSegmentedFontFace.cpp
+++ b/Source/core/css/CSSSegmentedFontFace.cpp
@@ -138,6 +138,12 @@ PassRefPtr<FontData> CSSSegmentedFontFace::getFontData(const FontDescription& fo
continue;
if (RefPtr<SimpleFontData> faceFontData = m_fontFaces[i]->getFontData(fontDescription, syntheticBold, syntheticItalic)) {
ASSERT(!faceFontData->isSegmented());
+#if ENABLE(SVG_FONTS)
+ // For SVG Fonts that specify that they only support the "normal" variant, we will assume they are incapable
+ // of small-caps synthesis and just ignore the font face.
+ if (faceFontData->isSVGFont() && (desiredTraitsMask & FontVariantSmallCapsMask) && !(m_traitsMask & FontVariantSmallCapsMask))
+ continue;
+#endif
appendFontData(fontData.get(), faceFontData.release(), m_fontFaces[i]->ranges());
}
}
@@ -147,16 +153,6 @@ PassRefPtr<FontData> CSSSegmentedFontFace::getFontData(const FontDescription& fo
return 0;
}
-bool CSSSegmentedFontFace::hasSVGFontFaceSource() const
-{
- unsigned size = m_fontFaces.size();
- for (unsigned i = 0; i < size; i++) {
- if (m_fontFaces[i]->hasSVGFontFaceSource())
- return true;
- }
- return false;
-}
-
bool CSSSegmentedFontFace::isLoading() const
{
unsigned size = m_fontFaces.size();
« no previous file with comments | « Source/core/css/CSSSegmentedFontFace.h ('k') | Source/core/css/CSSSegmentedFontFaceCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698