[Webkit-unassigned] [Bug 140994] [GTK] Fonts loaded via @font-face look bad

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 23 08:52:08 PST 2015


Martin Robinson <mrobinson at webkit.org> changed:

           What    |Removed                     |Added
 Attachment #247101|review?, commit-queue?      |review-
              Flags|                            |

--- Comment #19 from Martin Robinson <mrobinson at webkit.org> ---
Comment on attachment 247101
  --> https://bugs.webkit.org/attachment.cgi?id=247101
[GTK] Fonts loaded via @font-face look bad

View in context: https://bugs.webkit.org/attachment.cgi?id=247101&action=review

Looks good, though I have some minor suggestions.

> Source/WebCore/ChangeLog:9
> +        Reviewed by NOBODY (OOPS!).
> +
> +        No new tests because I haven't found a freely-distributable font that triggers the bug.
> +

This is a great change, but I think it deserves a full explanation in the changelog which describes the change and why it fixes the problem.

> Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp:129
> +    RefPtr<FcPattern> pattern = adoptRef(FcPatternCreate());
> +    FcConfigSubstitute(nullptr, pattern.get(), FcMatchPattern);
> +    FcDefaultSubstitute(pattern.get());
> +    FcPatternRemove(pattern.get(), FC_FAMILY, 0);
> +    FcConfigSubstitute(nullptr, pattern.get(), FcMatchFont);
> +
> +    return pattern;

We can probably allocate this once and simply keep returning it from a static variable.

> Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp:186
> -    : m_fallbacks(nullptr)
> +    : m_pattern(getDefaultFontconfigOptions())
> +    , m_fallbacks(nullptr)

Instead of making a new pattern per font, I think you should explicitly handle a null pattern in FontPlatformData::initializeWithFontFace. The way you have this now, it looks like it makes two separate instances with otherwise equal data, fail the equality test.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150223/db0345fe/attachment-0002.html>

More information about the webkit-unassigned mailing list