Ejemplo n.º 1
0
void
gfxFT2FontList::AppendFaceFromFontListEntry(const FontListEntry& aFLE,
                                            bool aStdFile)
{
    FT2FontEntry* fe = FT2FontEntry::CreateFontEntry(aFLE);
    if (fe) {
        fe->mStandardFace = aStdFile;
        nsAutoString name(aFLE.familyName());
        gfxFontFamily *family = mFontFamilies.GetWeak(name);
        if (!family) {
            family = new FT2FontFamily(name);
            mFontFamilies.Put(name, family);
            if (mBadUnderlineFamilyNames.Contains(name)) {
                family->SetBadUnderlineFamily();
            }
        }
        family->AddFontEntry(fe);
        if (family->IsBadUnderlineFamily()) {
            fe->mIsBadUnderlineFont = true;
        }

        // bug 721719 - set the IgnoreGSUB flag on entries for Roboto
        // because of unwanted on-by-default "ae" ligature.
        // This totally sucks, but if we don't hack around these broken fonts
        // we get really bad text rendering, which we can't inflict on users. :(
        // If we accumulate a few more examples of this stuff, it'll be time
        // to create some prefs for the list of fonts where we need to ignore
        // layout tables. Sigh.
        if (name.EqualsLiteral("roboto")) {
            fe->mIgnoreGSUB = true;
        }
    }
}
void
gfxFT2FontList::AppendFaceFromFontListEntry(const FontListEntry& aFLE,
                                            bool aStdFile)
{
    FT2FontEntry* fe = FT2FontEntry::CreateFontEntry(aFLE);
    if (fe) {
        fe->mStandardFace = aStdFile;
        nsAutoString name(aFLE.familyName());
        gfxFontFamily *family = mFontFamilies.GetWeak(name);
        if (!family) {
            family = new FT2FontFamily(name);
            mFontFamilies.Put(name, family);
            if (mBadUnderlineFamilyNames.Contains(name)) {
                family->SetBadUnderlineFamily();
            }
        }
        family->AddFontEntry(fe);

        fe->CheckForBrokenFont(family);
    }
}