|
|
4cf60e |
diff -up mozilla-aurora/gfx/thebes/gfxFcPlatformFontList.cpp.build-el5-fontconfig mozilla-aurora/gfx/thebes/gfxFcPlatformFontList.cpp
|
|
|
4cf60e |
--- mozilla-aurora/gfx/thebes/gfxFcPlatformFontList.cpp.build-el5-fontconfig 2015-12-16 16:47:28.000000000 +0100
|
|
|
4cf60e |
+++ mozilla-aurora/gfx/thebes/gfxFcPlatformFontList.cpp 2016-01-19 14:20:43.676153725 +0100
|
|
|
4cf60e |
@@ -367,7 +367,48 @@ gfxFontconfigFontEntry::gfxFontconfigFon
|
|
|
4cf60e |
// "blanks", effectively assuming that, if the font has a blank glyph,
|
|
|
4cf60e |
// then the author intends any associated character to be rendered
|
|
|
4cf60e |
// blank.
|
|
|
4cf60e |
- mFontPattern = FcFreeTypeQueryFace(mFTFace, ToFcChar8Ptr(""), 0, nullptr);
|
|
|
4cf60e |
+ // BACKPORT: FcFreeTypeQueryFace is not available in RHEL5's fontconfig
|
|
|
4cf60e |
+ // mFontPattern = FcFreeTypeQueryFace(mFTFace, ToFcChar8Ptr(""), 0, nullptr);
|
|
|
4cf60e |
+
|
|
|
4cf60e |
+
|
|
|
4cf60e |
+ // FC_CHARSET is vital to determine which characters are supported.
|
|
|
4cf60e |
+ nsAutoRef<FcCharSet> charset(FcFreeTypeCharSet(mFTFace, nullptr));
|
|
|
4cf60e |
+ // If there are no characters then assume we don't know how to read
|
|
|
4cf60e |
+ // this font.
|
|
|
4cf60e |
+ if (!charset || FcCharSetCount(charset) == 0)
|
|
|
4cf60e |
+ return;
|
|
|
4cf60e |
+
|
|
|
4cf60e |
+ mFontPattern = FcPatternCreate();
|
|
|
4cf60e |
+ FcPatternAddCharSet(mFontPattern, FC_CHARSET, charset);
|
|
|
4cf60e |
+
|
|
|
4cf60e |
+ // FC_PIXEL_SIZE can be important for font selection of fixed-size
|
|
|
4cf60e |
+ // fonts.
|
|
|
4cf60e |
+ if (!(mFTFace->face_flags & FT_FACE_FLAG_SCALABLE)) {
|
|
|
4cf60e |
+ for (FT_Int i = 0; i < mFTFace->num_fixed_sizes; ++i) {
|
|
|
4cf60e |
+#if HAVE_FT_BITMAP_SIZE_Y_PPEM
|
|
|
4cf60e |
+ double size = FLOAT_FROM_26_6(mFTFace->available_sizes[i].y_ppem);
|
|
|
4cf60e |
+#else
|
|
|
4cf60e |
+ double size = mFTFace->available_sizes[i].height;
|
|
|
4cf60e |
+#endif
|
|
|
4cf60e |
+ FcPatternAddDouble (mFontPattern, FC_PIXEL_SIZE, size);
|
|
|
4cf60e |
+ }
|
|
|
4cf60e |
+
|
|
|
4cf60e |
+ // Not sure whether this is important;
|
|
|
4cf60e |
+ // imitating FcFreeTypeQueryFace:
|
|
|
4cf60e |
+ FcPatternAddBool (mFontPattern, FC_ANTIALIAS, FcFalse);
|
|
|
4cf60e |
+ }
|
|
|
4cf60e |
+
|
|
|
4cf60e |
+ // Setting up the FC_LANGSET property is very difficult with the APIs
|
|
|
4cf60e |
+ // available prior to FcFreeTypeQueryFace. Having no FC_LANGSET
|
|
|
4cf60e |
+ // property seems better than having a property with an empty LangSet.
|
|
|
4cf60e |
+ // With no FC_LANGSET property, fontconfig sort functions will
|
|
|
4cf60e |
+ // consider this face to have the same priority as (otherwise equal)
|
|
|
4cf60e |
+ // faces that have support for the primary requested language, but
|
|
|
4cf60e |
+ // will not consider any language to have been satisfied (and so will
|
|
|
4cf60e |
+ // continue to look for a face with language support in fallback
|
|
|
4cf60e |
+ // fonts).
|
|
|
4cf60e |
+
|
|
|
4cf60e |
+ // END BACKPORT
|
|
|
4cf60e |
// given that we have a FT_Face, not really sure this is possible...
|
|
|
4cf60e |
if (!mFontPattern) {
|
|
|
4cf60e |
mFontPattern = FcPatternCreate();
|
|
|
4cf60e |
@@ -1015,9 +1056,12 @@ gfxFcPlatformFontList::gfxFcPlatformFont
|
|
|
4cf60e |
, mAlwaysUseFontconfigGenerics(true)
|
|
|
4cf60e |
{
|
|
|
4cf60e |
// if the rescan interval is set, start the timer
|
|
|
4cf60e |
- int rescanInterval = FcConfigGetRescanInterval(nullptr);
|
|
|
4cf60e |
+ // BACKPORT - do not implement rescan interval
|
|
|
4cf60e |
+ //int rescanInterval = FcConfigGetRescanInterval(nullptr);
|
|
|
4cf60e |
+ int rescanInterval = 0;
|
|
|
4cf60e |
if (rescanInterval) {
|
|
|
4cf60e |
- mLastConfig = FcConfigGetCurrent();
|
|
|
4cf60e |
+ nsAutoRef<FcConfig> fc_conf(FcConfigGetCurrent());
|
|
|
4cf60e |
+ mLastConfig = fc_conf.out();
|
|
|
4cf60e |
mCheckFontUpdatesTimer = do_CreateInstance("@mozilla.org/timer;1");
|
|
|
4cf60e |
if (mCheckFontUpdatesTimer) {
|
|
|
4cf60e |
mCheckFontUpdatesTimer->
|
|
|
4cf60e |
@@ -1131,7 +1175,8 @@ gfxFcPlatformFontList::AddFontSetFamilie
|
|
|
4cf60e |
nsresult
|
|
|
4cf60e |
gfxFcPlatformFontList::InitFontList()
|
|
|
4cf60e |
{
|
|
|
4cf60e |
- mLastConfig = FcConfigGetCurrent();
|
|
|
4cf60e |
+ nsAutoRef<FcConfig> fc_conf(FcConfigGetCurrent());
|
|
|
4cf60e |
+ mLastConfig = fc_conf.out();
|
|
|
4cf60e |
|
|
|
4cf60e |
// reset font lists
|
|
|
4cf60e |
gfxPlatformFontList::InitFontList();
|
|
|
4cf60e |
diff -up mozilla-aurora/gfx/thebes/gfxFcPlatformFontList.h.build-el5-fontconfig mozilla-aurora/gfx/thebes/gfxFcPlatformFontList.h
|
|
|
4cf60e |
--- mozilla-aurora/gfx/thebes/gfxFcPlatformFontList.h.build-el5-fontconfig 2016-01-19 11:45:08.927745469 +0100
|
|
|
4cf60e |
+++ mozilla-aurora/gfx/thebes/gfxFcPlatformFontList.h 2016-01-19 13:49:58.296124911 +0100
|
|
|
4cf60e |
@@ -33,7 +33,8 @@ class nsAutoRefTraits<FcConfig> : public
|
|
|
4cf60e |
{
|
|
|
4cf60e |
public:
|
|
|
4cf60e |
static void Release(FcConfig *ptr) { FcConfigDestroy(ptr); }
|
|
|
4cf60e |
- static void AddRef(FcConfig *ptr) { FcConfigReference(ptr); }
|
|
|
4cf60e |
+ // AddRef is not supported in older font-config
|
|
|
4cf60e |
+ // static void AddRef(FcConfig *ptr) { FcConfigReference(ptr); }
|
|
|
4cf60e |
};
|
|
|
4cf60e |
|
|
|
4cf60e |
// Helper classes used for clearning out user font data when cairo font
|
|
|
4cf60e |
@@ -290,7 +291,7 @@ protected:
|
|
|
4cf60e |
nsRefPtrHashtable<nsCStringHashKey, gfxFontFamily> mFcSubstituteCache;
|
|
|
4cf60e |
|
|
|
4cf60e |
nsCOMPtr<nsITimer> mCheckFontUpdatesTimer;
|
|
|
4cf60e |
- nsCountedRef<FcConfig> mLastConfig;
|
|
|
4cf60e |
+ nsAutoRef<FcConfig> mLastConfig;
|
|
|
4cf60e |
|
|
|
4cf60e |
// By default, font prefs under Linux are set to simply lookup
|
|
|
4cf60e |
// via fontconfig the appropriate font for serif/sans-serif/monospace.
|