mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
bug 987357 - support .woff-format fonts installed in the system fonts directory on android/b2g devices. r=roc
This commit is contained in:
parent
eb0a2e7f1e
commit
e53ad4cb65
@ -1278,14 +1278,13 @@ gfxFT2FontList::FindFontsInDir(const nsCString& aDir, FontNameCache *aFNC)
|
||||
|
||||
struct dirent *ent = nullptr;
|
||||
while ((ent = readdir(d)) != nullptr) {
|
||||
int namelen = strlen(ent->d_name);
|
||||
if (namelen <= 4) {
|
||||
// cannot be a usable font filename
|
||||
const char *ext = strrchr(ent->d_name, '.');
|
||||
if (!ext) {
|
||||
continue;
|
||||
}
|
||||
const char *ext = ent->d_name + namelen - 4;
|
||||
if (strcasecmp(ext, ".ttf") == 0 ||
|
||||
strcasecmp(ext, ".otf") == 0 ||
|
||||
strcasecmp(ext, ".woff") == 0 ||
|
||||
strcasecmp(ext, ".ttc") == 0) {
|
||||
bool isStdFont = false;
|
||||
for (unsigned int i = 0;
|
||||
@ -1295,7 +1294,7 @@ gfxFT2FontList::FindFontsInDir(const nsCString& aDir, FontNameCache *aFNC)
|
||||
|
||||
nsCString s(aDir);
|
||||
s.Append('/');
|
||||
s.Append(ent->d_name, namelen);
|
||||
s.Append(ent->d_name);
|
||||
|
||||
// Add the face(s) from this file to our font list;
|
||||
// note that if we have cached info for this file in fnc,
|
||||
|
Loading…
Reference in New Issue
Block a user