Fix crashes when core X fonts are disable: ignore the pref to disable Xft when core fonts are disabled so we can't get into a state where we have zero acceptable font backends. b=287187 r+sr=bryner

This commit is contained in:
dbaron%dbaron.org 2005-03-28 02:14:17 +00:00
parent ed0cb8dd8c
commit 36d8dd0018
2 changed files with 14 additions and 6 deletions

View File

@ -97,7 +97,7 @@ NS_FontMetricsFamilyExists(nsIDeviceContext *aDevice, const nsString &aName)
#endif
}
#ifdef MOZ_ENABLE_XFT
#if defined(MOZ_ENABLE_XFT) && defined(MOZ_ENABLE_COREXFONTS)
PRBool
NS_IsXftEnabled(void)
@ -136,9 +136,9 @@ NS_IsXftEnabled(void)
return cachedXftSetting;
}
#endif /* MOZ_ENABLE_XFT */
#endif
#ifdef MOZ_ENABLE_PANGO
#if defined(MOZ_ENABLE_PANGO) && (defined(MOZ_ENABLE_XFT) || defined(MOZ_ENABLE_COREXFONTS))
PRBool
NS_IsPangoEnabled(void)

View File

@ -40,15 +40,23 @@
#ifndef __nsFontMetricsUtils_h
#define __nsFontMetricsUtils_h
extern PRUint32 NS_FontMetricsGetHints (void);
extern PRUint32 NS_FontMetricsGetHints ();
extern nsresult NS_FontMetricsFamilyExists(nsIDeviceContext *aDevice,
const nsString &aName);
#ifdef MOZ_ENABLE_XFT
extern PRBool NS_IsXftEnabled(void);
#ifdef MOZ_ENABLE_COREXFONTS
extern PRBool NS_IsXftEnabled();
#else
inline PRBool NS_IsXftEnabled() { return PR_TRUE; }
#endif
#endif
#ifdef MOZ_ENABLE_PANGO
extern PRBool NS_IsPangoEnabled(void);
#if defined(MOZ_ENABLE_XFT) || defined(MOZ_ENABLE_COREXFONTS)
extern PRBool NS_IsPangoEnabled();
#else
inline PRBool NS_IsPangoEnabled() { return PR_TRUE; }
#endif
#endif
#endif /* __nsFontMetricsUtils_h */