PassRefPtr<Font> Font::createScaledFont(const FontDescription& fontDescription, float scaleFactor) const { if (isSVGFont()) return nullptr; return platformCreateScaledFont(fontDescription, scaleFactor); }
PassRefPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const { // FIXME: Support scaled SVG fonts. Given that SVG is scalable in general this should be achievable. if (isSVGFont()) return nullptr; return platformCreateScaledFontData(fontDescription, scaleFactor); }
String Font::description() const { if (isSVGFont()) return "[SVG font]"; if (isCustomFont()) return "[custom font]"; return platformData().description(); }
SimpleFontData::~SimpleFontData() { if (!isSVGFont()) platformDestroy(); if (isCustomFont()) GlyphPageTreeNode::pruneTreeCustomFontData(this); else GlyphPageTreeNode::pruneTreeFontData(this); }
SVGFontElement* Font::svgFont() const { if (!isSVGFont()) return 0; SVGFontElement* fontElement = 0; SVGFontFaceElement* fontFaceElement = 0; if (svgFontAndFontFaceElementForFontData(primaryFont(), fontFaceElement, fontElement)) return fontElement; return 0; }
bool Font::applyTransforms(GlyphBufferGlyph* glyphs, GlyphBufferAdvance* advances, size_t glyphCount, TypesettingFeatures typesettingFeatures) const { // We need to handle transforms on SVG fonts internally, since they are rendered internally. ASSERT(!isSVGFont()); #if PLATFORM(COCOA) CTFontTransformOptions options = (typesettingFeatures & Kerning ? kCTFontTransformApplyPositioning : 0) | (typesettingFeatures & Ligatures ? kCTFontTransformApplyShaping : 0); return CTFontTransformGlyphs(m_platformData.ctFont(), glyphs, reinterpret_cast<CGSize*>(advances), glyphCount, options); #else UNUSED_PARAM(glyphs); UNUSED_PARAM(advances); UNUSED_PARAM(glyphCount); UNUSED_PARAM(typesettingFeatures); return false; #endif }