bug 822048 - use a /fonts/ subdir for any locally-added fonts stored in the profile. r=blassey

This commit is contained in:
Jonathan Kew 2012-12-18 11:18:56 +00:00
parent d44ab31b15
commit c346f7ddb4

View File

@ -1081,10 +1081,11 @@ gfxFT2FontList::FindFonts()
}
// 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);
@ -1093,10 +1094,10 @@ gfxFT2FontList::FindFonts()
}
}
// 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)) {