예제 #1
0
파일: Font.cpp 프로젝트: alexgcastro/webkit
PassRefPtr<Font> Font::createScaledFont(const FontDescription& fontDescription, float scaleFactor) const
{
    if (isSVGFont())
        return nullptr;

    return platformCreateScaledFont(fontDescription, scaleFactor);
}
예제 #2
0
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);
}
예제 #3
0
파일: Font.cpp 프로젝트: alexgcastro/webkit
String Font::description() const
{
    if (isSVGFont())
        return "[SVG font]";
    if (isCustomFont())
        return "[custom font]";

    return platformData().description();
}
예제 #4
0
SimpleFontData::~SimpleFontData()
{
    if (!isSVGFont())
        platformDestroy();

    if (isCustomFont())
        GlyphPageTreeNode::pruneTreeCustomFontData(this);
    else
        GlyphPageTreeNode::pruneTreeFontData(this);
}
예제 #5
0
SVGFontElement* Font::svgFont() const
{ 
    if (!isSVGFont())
        return 0;

    SVGFontElement* fontElement = 0;
    SVGFontFaceElement* fontFaceElement = 0;
    if (svgFontAndFontFaceElementForFontData(primaryFont(), fontFaceElement, fontElement))
        return fontElement;
    
    return 0;
}
예제 #6
0
파일: Font.cpp 프로젝트: alexgcastro/webkit
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
}