Bug 1418818 - Allow downloadable fonts to include CBLC/CBDT tables on platforms where we're using Freetype. r=jrmuizel

This commit is contained in:
Jonathan Kew 2017-12-01 15:18:09 +00:00
Родитель 3b01ad4cc3
Коммит d78445777f
3 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -460,6 +460,7 @@ private:
DECL_GFX_PREF(Once, "gfx.direct3d11.enable-debug-layer", Direct3D11EnableDebugLayer, bool, false);
DECL_GFX_PREF(Once, "gfx.direct3d11.break-on-error", Direct3D11BreakOnError, bool, false);
DECL_GFX_PREF(Once, "gfx.direct3d11.sleep-on-create-device", Direct3D11SleepOnCreateDevice, int32_t, 0);
DECL_GFX_PREF(Live, "gfx.downloadable_fonts.keep_color_bitmaps", KeepColorBitmaps, bool, false);
DECL_GFX_PREF(Live, "gfx.downloadable_fonts.keep_variation_tables", KeepVariationTables, bool, false);
DECL_GFX_PREF(Live, "gfx.downloadable_fonts.otl_validation", ValidateOTLTables, bool, true);
DECL_GFX_PREF(Live, "gfx.draw-color-bars", CompositorDrawColorBars, bool, false);

Просмотреть файл

@ -180,6 +180,8 @@ public:
mCheckOTLTables = gfxPrefs::ValidateOTLTables();
// Whether to preserve Variation tables in downloaded fonts
mKeepVariationTables = gfxPrefs::KeepVariationTables();
// Whether to preserve color bitmap glyphs
mKeepColorBitmaps = gfxPrefs::KeepColorBitmaps();
}
virtual ots::TableAction GetTableAction(uint32_t aTag) override {
@ -199,7 +201,11 @@ public:
aTag == TRUETYPE_TAG('V', 'V', 'A', 'R'))) ||
aTag == TRUETYPE_TAG('S', 'V', 'G', ' ') ||
aTag == TRUETYPE_TAG('C', 'O', 'L', 'R') ||
aTag == TRUETYPE_TAG('C', 'P', 'A', 'L')) {
aTag == TRUETYPE_TAG('C', 'P', 'A', 'L') ||
(mKeepColorBitmaps &&
(aTag == TRUETYPE_TAG('C', 'B', 'D', 'T') ||
aTag == TRUETYPE_TAG('C', 'B', 'L', 'C'))) ||
false) {
return ots::TABLE_ACTION_PASSTHRU;
}
return ots::TABLE_ACTION_DEFAULT;
@ -232,6 +238,7 @@ private:
nsTHashtable<nsCStringHashKey> mWarningsIssued;
bool mCheckOTLTables;
bool mKeepVariationTables;
bool mKeepColorBitmaps;
};
// Call the OTS library to sanitize an sfnt before attempting to use it.

Просмотреть файл

@ -791,6 +791,11 @@ pref("gfx.downloadable_fonts.otl_validation", false);
pref("gfx.downloadable_fonts.otl_validation", true);
#endif
// Whether to preserve color bitmap tables in fonts (bypassing OTS).
// Currently these are supported only on platforms where we use Freetype
// to render fonts (Linux/Gtk and Android).
pref("gfx.downloadable_fonts.keep_color_bitmaps", false);
// Whether to preserve OpenType variation tables in fonts (bypassing OTS)
pref("gfx.downloadable_fonts.keep_variation_tables", false);