diff --git a/gfx/src/gtk/nsFontMetricsGTK.cpp b/gfx/src/gtk/nsFontMetricsGTK.cpp index 0deafd53a79..43fa2884b5c 100644 --- a/gfx/src/gtk/nsFontMetricsGTK.cpp +++ b/gfx/src/gtk/nsFontMetricsGTK.cpp @@ -2051,9 +2051,8 @@ GetMapFor10646Font(XFontStruct* aFont) } PRBool -nsFontGTK::IsEmptyFont(nsXFont* aXFont) +nsFontGTK::IsEmptyFont(XFontStruct* xFont) { - XFontStruct* xFont = aXFont->GetXFontStruct(); // // scan and see if we can find at least one glyph @@ -2116,12 +2115,17 @@ nsFontGTK::LoadFont(void) if (gdkFont) { XFontStruct* xFont = mXFont->GetXFontStruct(); + XFontStruct* xFont_with_per_char; + if (mAABaseSize==0) + xFont_with_per_char = xFont; + else + xFont_with_per_char = (XFontStruct *)GDK_FONT_XFONT(mFontHolder); mMaxAscent = xFont->ascent; mMaxDescent = xFont->descent; if (mCharSetInfo == &ISO106461) { - mCCMap = GetMapFor10646Font(xFont); + mCCMap = GetMapFor10646Font(xFont_with_per_char); if (!mCCMap) { mXFont->UnloadFont(); mXFont = nsnull; @@ -2145,7 +2149,7 @@ if ((mCharSetInfo == &JISX0201) || (mCharSetInfo == &CNS116437) ) { - if (IsEmptyFont(mXFont)) { + if (IsEmptyFont(xFont_with_per_char)) { #ifdef NS_FONT_DEBUG_LOAD_FONT if (gDebug & NS_FONT_DEBUG_LOAD_FONT) { printf("\n"); diff --git a/gfx/src/gtk/nsFontMetricsGTK.h b/gfx/src/gtk/nsFontMetricsGTK.h index 425be7d042c..3b82aa6941f 100644 --- a/gfx/src/gtk/nsFontMetricsGTK.h +++ b/gfx/src/gtk/nsFontMetricsGTK.h @@ -82,7 +82,7 @@ public: NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW void LoadFont(void); - PRBool IsEmptyFont(nsXFont*); + PRBool IsEmptyFont(XFontStruct*); inline int SupportsChar(PRUnichar aChar) { return mFont && CCMAP_HAS_CHAR(mCCMap, aChar); };