Changeset 29426 in webkit


Ignore:
Timestamp:
Jan 11, 2008 6:22:48 PM (16 years ago)
Author:
alp@webkit.org
Message:

2008-01-11 Sylvain Pasche <sylvain.pasche@gmail.com>

Reviewed by Alp Toker.

[Gtk] Uneven glyph spacing with subpixel antialiasing
http://bugs.webkit.org/show_bug.cgi?id=16715

Use cairo font options from the default GDK screen when creating a
scaled font.

  • platform/graphics/gtk/FontPlatformDataGtk.cpp: (WebCore::FontPlatformData::FontPlatformData):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r29425 r29426  
     12008-01-11  Sylvain Pasche  <sylvain.pasche@gmail.com>
     2
     3        Reviewed by Alp Toker.
     4
     5        [Gtk] Uneven glyph spacing with subpixel antialiasing
     6        http://bugs.webkit.org/show_bug.cgi?id=16715
     7
     8        Use cairo font options from the default GDK screen when creating a
     9        scaled font.
     10
     11        * platform/graphics/gtk/FontPlatformDataGtk.cpp:
     12        (WebCore::FontPlatformData::FontPlatformData):
     13
    1142008-01-11  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
    215
  • trunk/WebCore/platform/graphics/gtk/FontPlatformDataGtk.cpp

    r29418 r29426  
    3232#include <cairo.h>
    3333#include <fontconfig/fcfreetype.h>
     34#include <gtk/gtk.h>
    3435
    3536namespace WebCore {
     
    5657    FcPattern* pattern = FcPatternCreate();
    5758    cairo_font_face_t* fontFace;
    58     cairo_font_options_t* options;
     59    static const cairo_font_options_t* defaultOptions = cairo_font_options_create();
     60    const cairo_font_options_t* options;
    5961    cairo_matrix_t fontMatrix;
    6062
     
    99101    cairo_matrix_init_scale(&fontMatrix, m_fontDescription.computedSize(), m_fontDescription.computedSize());
    100102    cairo_matrix_init_identity(&ctm);
    101     options = cairo_font_options_create();
     103
     104#if GTK_CHECK_VERSION(2,10,0)
     105    if (GdkScreen* screen = gdk_screen_get_default())
     106        options = gdk_screen_get_font_options(screen);
     107    else
     108        options = defaultOptions;
     109#else
     110    options = defaultOptions;
     111#endif
     112
    102113    m_scaledFont = cairo_scaled_font_create(fontFace, &fontMatrix, &ctm, options);
    103114    cairo_font_face_destroy(fontFace);
    104     cairo_font_options_destroy(options);
    105115
    106116freePattern:
Note: See TracChangeset for help on using the changeset viewer.