bug 785291 - Add support to load fonts from an APK, search for fonts in res/fonts r=jfkthame

This commit is contained in:
Brad Lassey 2012-10-03 12:28:43 -07:00
parent 8be661e839
commit 8e39cb742a

View File

@ -944,9 +944,9 @@ gfxFT2FontList::FindFonts()
NS_RUNTIMEABORT("Could not read the system fonts directory");
}
// look for locally-added fonts in the profile
// look for fonts shipped with the product
nsCOMPtr<nsIFile> localDir;
nsresult rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_LOCAL_50_DIR,
nsresult rv = NS_GetSpecialDirectory(NS_APP_RES_DIR,
getter_AddRefs(localDir));
if (NS_SUCCEEDED(rv)) {
nsCString localPath;
@ -956,6 +956,17 @@ gfxFT2FontList::FindFonts()
}
}
// look for locally-added fonts in the profile
rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_LOCAL_50_DIR,
getter_AddRefs(localDir));
if (NS_SUCCEEDED(rv)) {
nsCString localPath;
rv = localDir->GetNativePath(localPath);
if (NS_SUCCEEDED(rv)) {
FindFontsInDir(localPath, &fnc);
}
}
// Finalize the families by sorting faces into standard order
// and marking "simple" families.
// Passing non-null userData here says that we want faces to be sorted.