From 48b8098416ba484a89ea235cbcc09be842b65b19 Mon Sep 17 00:00:00 2001 From: "karlt+%karlt.net" Date: Thu, 7 Feb 2008 22:17:50 +0000 Subject: [PATCH] use FC_PIXEL_SIZE instead of pango_font_describe_with_absolute_size b=414239 r+sr=roc git-svn-id: svn://10.0.0.236/trunk@245173 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/thebes/src/gfxPangoFonts.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mozilla/gfx/thebes/src/gfxPangoFonts.cpp b/mozilla/gfx/thebes/src/gfxPangoFonts.cpp index 23823325748..baf569672f1 100644 --- a/mozilla/gfx/thebes/src/gfxPangoFonts.cpp +++ b/mozilla/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);