From d7a6337c05d0e8c3cfc5950af4d0f7b8196e7642 Mon Sep 17 00:00:00 2001 From: "pavlov@pavlov.net" Date: Thu, 1 Nov 2007 13:51:05 -0700 Subject: [PATCH] bug 399813. set maxAdvance correctly. r=roc a= beltzner --- gfx/thebes/src/gfxPangoFonts.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gfx/thebes/src/gfxPangoFonts.cpp b/gfx/thebes/src/gfxPangoFonts.cpp index 78908b285f4..aa090e90117 100644 --- a/gfx/thebes/src/gfxPangoFonts.cpp +++ b/gfx/thebes/src/gfxPangoFonts.cpp @@ -446,7 +446,7 @@ gfxPangoFont::GetMetrics() mMetrics.emAscent = mMetrics.maxAscent * mMetrics.emHeight / lineHeight; mMetrics.emDescent = mMetrics.emHeight - mMetrics.emAscent; - // XXX should we move this down, get max-advance from FT_Face? + // we're going to overwrite this below if we have a FT_Face (which we should...) mMetrics.maxAdvance = pango_font_metrics_get_approximate_char_width(pfm) / FLOAT_PANGO_SCALE; gfxSize isz, lsz; @@ -473,6 +473,8 @@ gfxPangoFont::GetMetrics() face = pango_fc_font_lock_face (PANGO_FC_FONT (font)); if (face) { + mMetrics.maxAdvance = face->size->metrics.max_advance / 64.0; // 26.6 + float val; TT_OS2 *os2 = (TT_OS2 *) FT_Get_Sfnt_Table(face, ft_sfnt_os2);