bug 822048 - use a /fonts/ subdir for any locally-added fonts stored in the profile. r=blassey
authorJonathan Kew <jkew@mozilla.com>
Tue, 18 Dec 2012 11:18:56 +0000
changeset 125496 3d464fe9bd01ace3cd9063bc1f726b8fbb52f9e6
parent 125495 f4c12b8bf11f7cc60f2e04b54be93092389a28b2
child 125497 fd40e91ec70351ba0c88685575fd3d6a2dc0ac23
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs822048
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 822048 - use a /fonts/ subdir for any locally-added fonts stored in the profile. r=blassey
gfx/thebes/gfxFT2FontList.cpp
--- a/gfx/thebes/gfxFT2FontList.cpp
+++ b/gfx/thebes/gfxFT2FontList.cpp
@@ -1076,32 +1076,33 @@ gfxFT2FontList::FindFonts()
     FindFontsInDir(root, &fnc);
 
     if (mFontFamilies.Count() == 0) {
         // if we can't find/read the font directory, we are doomed!
         NS_RUNTIMEABORT("Could not read the system fonts directory");
     }
 
     // look for fonts shipped with the product
+    NS_NAMED_LITERAL_STRING(kFontsDirName, "fonts");
     nsCOMPtr<nsIFile> localDir;
     nsresult rv = NS_GetSpecialDirectory(NS_APP_RES_DIR,
                                          getter_AddRefs(localDir));
-    if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(localDir->Append(NS_LITERAL_STRING("fonts")))) {
+    if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(localDir->Append(kFontsDirName))) {
         ExtractFontsFromJar(localDir);
         nsCString localPath;
         rv = localDir->GetNativePath(localPath);
         if (NS_SUCCEEDED(rv)) {
             FindFontsInDir(localPath, &fnc);
         }
     }
 
-    // look for locally-added fonts in the profile
+    // look for locally-added fonts in a "fonts" subdir of the profile
     rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_LOCAL_50_DIR,
                                 getter_AddRefs(localDir));
-    if (NS_SUCCEEDED(rv)) {
+    if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(localDir->Append(kFontsDirName))) {
         nsCString localPath;
         rv = localDir->GetNativePath(localPath);
         if (NS_SUCCEEDED(rv)) {
             FindFontsInDir(localPath, &fnc);
         }
     }
 
     // Finalize the families by sorting faces into standard order