Changeset 69117 in webkit


Ignore:
Timestamp:
Oct 5, 2010 9:58:53 AM (14 years ago)
Author:
Martin Robinson
Message:

2010-10-05 Martin Robinson <mrobinson@igalia.com>

Reviewed by Gustavo Noronha Silva.

[GTK] Complex text rendering does not render custom fonts
https://bugs.webkit.org/show_bug.cgi?id=41091

Added a layout test that verifies that custom fonts are rendered with
the correct font when hitting the complex text code path.

  • platform/gtk/fonts/font-face-with-complex-text-expected.checksum: Added.
  • platform/gtk/fonts/font-face-with-complex-text-expected.png: Added.
  • platform/gtk/fonts/font-face-with-complex-text-expected.txt: Added.
  • platform/gtk/fonts/font-face-with-complex-text.html: Added.
  • platform/gtk/fonts/resources/Ahem.ttf: Copied from LayoutTests/fast/css/resources/Ahem.ttf.

2010-10-05 Martin Robinson <mrobinson@igalia.com>

Reviewed by Gustavo Noronha Silva.

[GTK] Complex text rendering does not render custom fonts
https://bugs.webkit.org/show_bug.cgi?id=41091

For fonts that do not have a FontConfig pattern (including custom
fonts), fall back to the simple text rendering path. This is a work-
-around for not supporting Pango rendering with non-FontConfig fonts.

Test: platform/gtk/fonts/font-face-with-complex-text.html

  • platform/graphics/gtk/FontGtk.cpp: (WebCore::Font::drawComplexText): Fall back to the simple path for custom fonts. (WebCore::Font::floatWidthForComplexText): Ditto. (WebCore::Font::offsetForPositionForComplexText): Ditto. (WebCore::Font::selectionRectForComplexText): Ditto.
Location:
trunk
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r69102 r69117  
     12010-10-05  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Gustavo Noronha Silva.
     4
     5        [GTK] Complex text rendering does not render custom fonts
     6        https://bugs.webkit.org/show_bug.cgi?id=41091
     7
     8        Added a layout test that verifies that custom fonts are rendered with
     9        the correct font when hitting the complex text code path.
     10
     11        * platform/gtk/fonts/font-face-with-complex-text-expected.checksum: Added.
     12        * platform/gtk/fonts/font-face-with-complex-text-expected.png: Added.
     13        * platform/gtk/fonts/font-face-with-complex-text-expected.txt: Added.
     14        * platform/gtk/fonts/font-face-with-complex-text.html: Added.
     15        * platform/gtk/fonts/resources/Ahem.ttf: Copied from LayoutTests/fast/css/resources/Ahem.ttf.
     16
    1172010-10-05  Kent Tamura  <tkent@chromium.org>
    218
  • trunk/WebCore/ChangeLog

    r69114 r69117  
     12010-10-05  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Gustavo Noronha Silva.
     4
     5        [GTK] Complex text rendering does not render custom fonts
     6        https://bugs.webkit.org/show_bug.cgi?id=41091
     7
     8        For fonts that do not have a FontConfig pattern (including custom
     9        fonts), fall back to the simple text rendering path. This is a work-
     10        -around for not supporting Pango rendering with non-FontConfig fonts.
     11
     12        Test: platform/gtk/fonts/font-face-with-complex-text.html
     13
     14        * platform/graphics/gtk/FontGtk.cpp:
     15        (WebCore::Font::drawComplexText): Fall back to the simple path for custom fonts.
     16        (WebCore::Font::floatWidthForComplexText): Ditto.
     17        (WebCore::Font::offsetForPositionForComplexText): Ditto.
     18        (WebCore::Font::selectionRectForComplexText): Ditto.
     19
    1202010-10-05  Kwang Yul Seo  <skyul@company100.net>
    221
  • trunk/WebCore/platform/graphics/gtk/FontGtk.cpp

    r67724 r69117  
    207207void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
    208208{
     209#if defined(USE_FREETYPE)
     210    if (!primaryFont()->platformData().m_pattern) {
     211        drawSimpleText(context, run, point, from, to);
     212        return;
     213    }
     214#endif
     215
    209216    cairo_t* cr = context->platformContext();
    210217    cairo_save(cr);
     
    324331}
    325332
    326 float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */, GlyphOverflow*) const
    327 {
     333float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* overflow) const
     334{
     335#if defined(USE_FREETYPE)
     336    if (!primaryFont()->platformData().m_pattern)
     337        return floatWidthForSimpleText(run, 0, fallbackFonts, overflow);
     338#endif
     339
    328340    if (run.length() == 0)
    329341        return 0.0f;
     
    346358int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat, bool includePartialGlyphs) const
    347359{
     360#if defined(USE_FREETYPE)
     361    if (!primaryFont()->platformData().m_pattern)
     362        return offsetForPositionForSimpleText(run, xFloat, includePartialGlyphs);
     363#endif
    348364    // FIXME: This truncation is not a problem for HTML, but only affects SVG, which passes floating-point numbers
    349365    // to Font::offsetForPosition(). Bug http://webkit.org/b/40673 tracks fixing this problem.
     
    370386FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& point, int h, int from, int to) const
    371387{
     388#if defined(USE_FREETYPE)
     389    if (!primaryFont()->platformData().m_pattern)
     390        return selectionRectForSimpleText(run, point, h, from, to);
     391#endif
     392
    372393    PangoLayout* layout = getDefaultPangoLayout(run);
    373394    setPangoAttributes(this, run, layout);
Note: See TracChangeset for help on using the changeset viewer.