summaryrefslogtreecommitdiffstats
path: root/www/seamonkey2/files/patch-gfx_src_gtk_nsFontMetricsXft.cpp
blob: 2adcd3412e13630c6af6c2d10274fc73f3af0d09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
--- gfx/src/gtk/nsFontMetricsXft.cpp.orig	Tue Nov 25 21:44:50 2003
+++ gfx/src/gtk/nsFontMetricsXft.cpp	Sun Dec  7 15:20:48 2003
@@ -105,6 +105,7 @@
     FcPattern *mPattern;
     FcPattern *mFontName;
     FcCharSet *mCharset;
+    int        mNotXft;
 };
 
 class nsFontXftInfo;
@@ -1093,7 +1094,7 @@
 
     for (PRInt32 i = 1, end = mLoadedFonts.Count(); i < end; ++i) {
         nsFontXft *font = (nsFontXft *)mLoadedFonts.ElementAt(i);
-        if (font->HasChar(PRUint32(aChar)))
+        if (font->HasChar(PRUint32(aChar)) && font->GetXftFont())
             return font;
     }
 
@@ -1960,6 +1961,7 @@
     FcPatternReference(mFontName);
 
     mXftFont = nsnull;
+    mNotXft  = 0;
 
     // set up our charset
     mCharset = nsnull;
@@ -1986,7 +1988,7 @@
 XftFont *
 nsFontXft::GetXftFont(void)
 {
-    if (!mXftFont) {
+    if (!mXftFont && !mNotXft) {
         FcPattern *pat = FcFontRenderPrepare(0, mPattern, mFontName);
         if (!pat)
             return nsnull;
@@ -2005,8 +2007,10 @@
             FcPatternDel(pat, FC_SPACING);
 
         mXftFont = XftFontOpenPattern(GDK_DISPLAY(), pat);
-        if (!mXftFont)
+        if (!mXftFont) {
             FcPatternDestroy(pat);
+            mNotXft = 1;
+        }
     }
 
     return mXftFont;
OpenPOWER on IntegriCloud