bool CSSFontFaceSrcValue::isSupportedFormat() const
{
    // Normally we would just check the format, but in order to avoid conflicts with the old WinIE style of font-face,
    // we will also check to see if the URL ends with .eot.  If so, we'll go ahead and assume that we shouldn't load it.
    if (m_format.isEmpty()) {
        // Check for .eot.
        if (!m_resource.startsWith("data:", false) && m_resource.endsWith(".eot", false))
            return false;
        return true;
    }

    if (FontCustomPlatformData::supportsFormat(m_format))
        return true;

    // We have removed SVG font support on non-gdi platforms. For details, see:
    // https://groups.google.com/a/chromium.org/d/msg/blink-dev/pYbbUcYvlYY/LQvFvM8KZZEJ
#if ENABLE(SVG_FONTS)
    if (RuntimeEnabledFeatures::svgFontsOnNonGDIPlatformsEnabled()
#if OS(WIN)
        || !FontCache::useDirectWrite()
#endif
        )
        return isSVGFontFaceSrc();
#endif
    return false;
}
bool CSSFontFaceSrcValue::isSupportedFormat() const
{
    // Normally we would just check the format, but in order to avoid conflicts with the old WinIE style of font-face,
    // we will also check to see if the URL ends with .eot.  If so, we'll go ahead and assume that we shouldn't load it.
    if (m_format.isEmpty()) {
        // Check for .eot.
        if (!m_resource.startsWith("data:", false) && m_resource.endsWith(".eot", false))
            return false;
        return true;
    }

    return FontCustomPlatformData::supportsFormat(m_format)
#if ENABLE(SVG_FONTS)
           || isSVGFontFaceSrc()
#endif
           ;
}
Esempio n. 3
0
bool CSSFontFaceSrcValue::isSupportedFormat() const
{
    // Normally we would just check the format, but in order to avoid conflicts with the old WinIE style of font-face,
    // we will also check to see if the URL ends with .eot.  If so, we'll go ahead and assume that we shouldn't load it.
    if (m_format.isEmpty()) {
        // Check for .eot.
        if (m_resource.endsWith("eot", false))
            return false;
        return true;
    }

    return equalIgnoringCase(m_format, "truetype") || equalIgnoringCase(m_format, "opentype")
#if ENABLE(OPENTYPE_SANITIZER)
           || equalIgnoringCase(m_format, "woff")
#endif
#if ENABLE(SVG_FONTS)
           || isSVGFontFaceSrc()
#endif
           ;
}