Changeset 28876 in webkit
- Timestamp:
- Dec 19, 2007 3:22:11 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r28875 r28876 1 2007-12-19 Alp Toker <alp@atoker.com> 2 3 Build fix for Pango < 1.18.0 breakage introduced in r28864. Use Fc and 4 the Pango backend API in these cases. 5 6 * platform/graphics/gtk/FontPlatformDataGtk.cpp: 7 (WebCore::FontPlatformData::FontPlatformData): 8 (WebCore::FontPlatformData::~FontPlatformData): 9 1 10 2007-12-19 Alice Liu <alice.liu@apple.com> 2 11 -
trunk/WebCore/platform/graphics/gtk/FontPlatformDataGtk.cpp
r28864 r28876 27 27 */ 28 28 29 // Use the Pango backend API for compatibility with older Pango versions. 30 #define PANGO_ENABLE_BACKEND 31 29 32 #include "config.h" 30 33 #include "FontPlatformData.h" … … 35 38 #include <cairo.h> 36 39 #include <assert.h> 40 41 #include <pango/pango.h> 42 #include <pango/pangocairo.h> 43 44 // Use cairo-ft if a recent enough Pango version isn't available. 45 #if !PANGO_VERSION_CHECK(1,18,0) 46 #include <cairo-ft.h> 47 #include <pango/pangofc-fontmap.h> 48 #endif 37 49 38 50 namespace WebCore { … … 88 100 89 101 // FIXME: should we set some default font? 102 #if PANGO_VERSION_CHECK(1,18,0) 90 103 if (m_font) 91 m_scaledFont = pango_cairo_font_get_scaled_font(PANGO_CAIRO_FONT(m_font)); 104 m_scaledFont = cairo_scaled_font_reference(pango_cairo_font_get_scaled_font(PANGO_CAIRO_FONT(m_font))); 105 #else 106 // This compatibility code for older versions of Pango is not well-tested. 107 if (m_font) { 108 PangoFcFont* fcfont = PANGO_FC_FONT(m_font); 109 cairo_font_face_t* face = cairo_ft_font_face_create_for_pattern(fcfont->font_pattern); 110 double size; 111 if (FcPatternGetDouble(fcfont->font_pattern, FC_PIXEL_SIZE, 0, &size) != FcResultMatch) 112 size = 12.0; 113 cairo_matrix_t fontMatrix; 114 cairo_matrix_init_scale(&fontMatrix, size, size); 115 cairo_font_options_t* fontOptions; 116 if (pango_cairo_context_get_font_options(m_context)) 117 fontOptions = cairo_font_options_copy(pango_cairo_context_get_font_options(m_context)); 118 else 119 fontOptions = cairo_font_options_create(); 120 cairo_matrix_t ctm; 121 cairo_matrix_init_identity(&ctm); 122 m_scaledFont = cairo_scaled_font_create(face, &fontMatrix, &ctm, fontOptions); 123 cairo_font_options_destroy(fontOptions); 124 cairo_font_face_destroy(face); 125 } 126 #endif 92 127 93 128 pango_font_description_free(description); … … 124 159 FontPlatformData::~FontPlatformData() 125 160 { 161 if (m_scaledFont) 162 cairo_scaled_font_destroy(m_scaledFont); 126 163 } 127 164
Note: See TracChangeset
for help on using the changeset viewer.