From 4fd5a5e57e359bba2ec426f44e57e7721978d4ac Mon Sep 17 00:00:00 2001 From: "karlt+@karlt.net" Date: Thu, 7 Feb 2008 14:17:50 -0800 Subject: [PATCH] use FC_PIXEL_SIZE instead of pango_font_describe_with_absolute_size b=414239 r+sr=roc --- gfx/thebes/src/gfxPangoFonts.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gfx/thebes/src/gfxPangoFonts.cpp b/gfx/thebes/src/gfxPangoFonts.cpp index 23823325748e..baf569672f1a 100644 --- a/gfx/thebes/src/gfxPangoFonts.cpp +++ b/gfx/thebes/src/gfxPangoFonts.cpp @@ -376,14 +376,18 @@ gfxPangoFont::GetOrMakeFont(PangoFont *aPangoFont) (g_object_get_qdata(G_OBJECT(aPangoFont), GetFontQuark())); if (!font) { - PangoFontDescription *desc = - pango_font_describe_with_absolute_size(aPangoFont); + // pango_font_describe_with_absolute_size requires Pango-1.14 + PangoFontDescription *desc = pango_font_describe(aPangoFont); + + PangoFcFont *fcfont = PANGO_FC_FONT(aPangoFont); + double size; + if (FcPatternGetDouble(fcfont->font_pattern, FC_PIXEL_SIZE, 0, &size) + != FcResultMatch) + size = pango_font_description_get_size(desc) / FLOAT_PANGO_SCALE; // Shouldn't actually need to take too much care about the correct // family or style, as size is the only thing expected to be // important. - gfxFloat size = - pango_font_description_get_size(desc) / FLOAT_PANGO_SCALE; PRUint8 style = PangoStyleToThebesStyle(pango_font_description_get_style(desc)); PRUint16 weight = pango_font_description_get_weight(desc);