mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Enable the dot-notation
ESLint rule
*Please note:* These changes were done automatically, using the `gulp lint --fix` command. This rule is already enabled in mozilla-central, see https://searchfox.org/mozilla-central/rev/567b68b8ff4b6d607ba34a6f1926873d21a7b4d7/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js#103-104 The main advantage, besides improved consistency, of this rule is that it reduces the size of the code (by 3 bytes for each case). In the PDF.js code-base there's close to 8000 instances being fixed by the `dot-notation` ESLint rule, which end up reducing the size of even the *built* files significantly; the total size of the `gulp mozcentral` build target changes from `3 247 456` to `3 224 278` bytes, which is a *reduction* of `23 178` bytes (or ~0.7%) for a completely mechanical change. A large number of these changes affect the (large) lookup tables used on the worker-thread, but given that they are still initialized lazily I don't *think* that the new formatting this patch introduces should undo any of the improvements from PR 6915. Please find additional details about the ESLint rule at https://eslint.org/docs/rules/dot-notation
This commit is contained in:
parent
c218e94f66
commit
1cc3dbb694
26 changed files with 7773 additions and 7785 deletions
|
@ -21,11 +21,11 @@ import { getLookupTableFactory } from "./core_utils.js";
|
|||
* fonts and their acronyms.
|
||||
*/
|
||||
const getStdFontMap = getLookupTableFactory(function (t) {
|
||||
t["ArialNarrow"] = "Helvetica";
|
||||
t.ArialNarrow = "Helvetica";
|
||||
t["ArialNarrow-Bold"] = "Helvetica-Bold";
|
||||
t["ArialNarrow-BoldItalic"] = "Helvetica-BoldOblique";
|
||||
t["ArialNarrow-Italic"] = "Helvetica-Oblique";
|
||||
t["ArialBlack"] = "Helvetica";
|
||||
t.ArialBlack = "Helvetica";
|
||||
t["ArialBlack-Bold"] = "Helvetica-Bold";
|
||||
t["ArialBlack-BoldItalic"] = "Helvetica-BoldOblique";
|
||||
t["ArialBlack-Italic"] = "Helvetica-Oblique";
|
||||
|
@ -33,26 +33,26 @@ const getStdFontMap = getLookupTableFactory(function (t) {
|
|||
t["Arial-Black-Bold"] = "Helvetica-Bold";
|
||||
t["Arial-Black-BoldItalic"] = "Helvetica-BoldOblique";
|
||||
t["Arial-Black-Italic"] = "Helvetica-Oblique";
|
||||
t["Arial"] = "Helvetica";
|
||||
t.Arial = "Helvetica";
|
||||
t["Arial-Bold"] = "Helvetica-Bold";
|
||||
t["Arial-BoldItalic"] = "Helvetica-BoldOblique";
|
||||
t["Arial-Italic"] = "Helvetica-Oblique";
|
||||
t["Arial-BoldItalicMT"] = "Helvetica-BoldOblique";
|
||||
t["Arial-BoldMT"] = "Helvetica-Bold";
|
||||
t["Arial-ItalicMT"] = "Helvetica-Oblique";
|
||||
t["ArialMT"] = "Helvetica";
|
||||
t.ArialMT = "Helvetica";
|
||||
t["Courier-Bold"] = "Courier-Bold";
|
||||
t["Courier-BoldItalic"] = "Courier-BoldOblique";
|
||||
t["Courier-Italic"] = "Courier-Oblique";
|
||||
t["CourierNew"] = "Courier";
|
||||
t.CourierNew = "Courier";
|
||||
t["CourierNew-Bold"] = "Courier-Bold";
|
||||
t["CourierNew-BoldItalic"] = "Courier-BoldOblique";
|
||||
t["CourierNew-Italic"] = "Courier-Oblique";
|
||||
t["CourierNewPS-BoldItalicMT"] = "Courier-BoldOblique";
|
||||
t["CourierNewPS-BoldMT"] = "Courier-Bold";
|
||||
t["CourierNewPS-ItalicMT"] = "Courier-Oblique";
|
||||
t["CourierNewPSMT"] = "Courier";
|
||||
t["Helvetica"] = "Helvetica";
|
||||
t.CourierNewPSMT = "Courier";
|
||||
t.Helvetica = "Helvetica";
|
||||
t["Helvetica-Bold"] = "Helvetica-Bold";
|
||||
t["Helvetica-BoldItalic"] = "Helvetica-BoldOblique";
|
||||
t["Helvetica-BoldOblique"] = "Helvetica-BoldOblique";
|
||||
|
@ -61,18 +61,18 @@ const getStdFontMap = getLookupTableFactory(function (t) {
|
|||
t["Symbol-Bold"] = "Symbol";
|
||||
t["Symbol-BoldItalic"] = "Symbol";
|
||||
t["Symbol-Italic"] = "Symbol";
|
||||
t["TimesNewRoman"] = "Times-Roman";
|
||||
t.TimesNewRoman = "Times-Roman";
|
||||
t["TimesNewRoman-Bold"] = "Times-Bold";
|
||||
t["TimesNewRoman-BoldItalic"] = "Times-BoldItalic";
|
||||
t["TimesNewRoman-Italic"] = "Times-Italic";
|
||||
t["TimesNewRomanPS"] = "Times-Roman";
|
||||
t.TimesNewRomanPS = "Times-Roman";
|
||||
t["TimesNewRomanPS-Bold"] = "Times-Bold";
|
||||
t["TimesNewRomanPS-BoldItalic"] = "Times-BoldItalic";
|
||||
t["TimesNewRomanPS-BoldItalicMT"] = "Times-BoldItalic";
|
||||
t["TimesNewRomanPS-BoldMT"] = "Times-Bold";
|
||||
t["TimesNewRomanPS-Italic"] = "Times-Italic";
|
||||
t["TimesNewRomanPS-ItalicMT"] = "Times-Italic";
|
||||
t["TimesNewRomanPSMT"] = "Times-Roman";
|
||||
t.TimesNewRomanPSMT = "Times-Roman";
|
||||
t["TimesNewRomanPSMT-Bold"] = "Times-Bold";
|
||||
t["TimesNewRomanPSMT-BoldItalic"] = "Times-BoldItalic";
|
||||
t["TimesNewRomanPSMT-Italic"] = "Times-Italic";
|
||||
|
@ -83,19 +83,19 @@ const getStdFontMap = getLookupTableFactory(function (t) {
|
|||
* a standard fonts without glyph data.
|
||||
*/
|
||||
const getNonStdFontMap = getLookupTableFactory(function (t) {
|
||||
t["Calibri"] = "Helvetica";
|
||||
t.Calibri = "Helvetica";
|
||||
t["Calibri-Bold"] = "Helvetica-Bold";
|
||||
t["Calibri-BoldItalic"] = "Helvetica-BoldOblique";
|
||||
t["Calibri-Italic"] = "Helvetica-Oblique";
|
||||
t["CenturyGothic"] = "Helvetica";
|
||||
t.CenturyGothic = "Helvetica";
|
||||
t["CenturyGothic-Bold"] = "Helvetica-Bold";
|
||||
t["CenturyGothic-BoldItalic"] = "Helvetica-BoldOblique";
|
||||
t["CenturyGothic-Italic"] = "Helvetica-Oblique";
|
||||
t["ComicSansMS"] = "Comic Sans MS";
|
||||
t.ComicSansMS = "Comic Sans MS";
|
||||
t["ComicSansMS-Bold"] = "Comic Sans MS-Bold";
|
||||
t["ComicSansMS-BoldItalic"] = "Comic Sans MS-BoldItalic";
|
||||
t["ComicSansMS-Italic"] = "Comic Sans MS-Italic";
|
||||
t["LucidaConsole"] = "Courier";
|
||||
t.LucidaConsole = "Courier";
|
||||
t["LucidaConsole-Bold"] = "Courier-Bold";
|
||||
t["LucidaConsole-BoldItalic"] = "Courier-BoldOblique";
|
||||
t["LucidaConsole-Italic"] = "Courier-Oblique";
|
||||
|
@ -116,103 +116,103 @@ const getNonStdFontMap = getLookupTableFactory(function (t) {
|
|||
t["MS-PMincho-Bold"] = "MS PMincho-Bold";
|
||||
t["MS-PMincho-BoldItalic"] = "MS PMincho-BoldItalic";
|
||||
t["MS-PMincho-Italic"] = "MS PMincho-Italic";
|
||||
t["NuptialScript"] = "Times-Italic";
|
||||
t["SegoeUISymbol"] = "Helvetica";
|
||||
t["Wingdings"] = "ZapfDingbats";
|
||||
t.NuptialScript = "Times-Italic";
|
||||
t.SegoeUISymbol = "Helvetica";
|
||||
t.Wingdings = "ZapfDingbats";
|
||||
t["Wingdings-Regular"] = "ZapfDingbats";
|
||||
});
|
||||
|
||||
const getSerifFonts = getLookupTableFactory(function (t) {
|
||||
t["Adobe Jenson"] = true;
|
||||
t["Adobe Text"] = true;
|
||||
t["Albertus"] = true;
|
||||
t["Aldus"] = true;
|
||||
t["Alexandria"] = true;
|
||||
t["Algerian"] = true;
|
||||
t.Albertus = true;
|
||||
t.Aldus = true;
|
||||
t.Alexandria = true;
|
||||
t.Algerian = true;
|
||||
t["American Typewriter"] = true;
|
||||
t["Antiqua"] = true;
|
||||
t["Apex"] = true;
|
||||
t["Arno"] = true;
|
||||
t["Aster"] = true;
|
||||
t["Aurora"] = true;
|
||||
t["Baskerville"] = true;
|
||||
t["Bell"] = true;
|
||||
t["Bembo"] = true;
|
||||
t.Antiqua = true;
|
||||
t.Apex = true;
|
||||
t.Arno = true;
|
||||
t.Aster = true;
|
||||
t.Aurora = true;
|
||||
t.Baskerville = true;
|
||||
t.Bell = true;
|
||||
t.Bembo = true;
|
||||
t["Bembo Schoolbook"] = true;
|
||||
t["Benguiat"] = true;
|
||||
t.Benguiat = true;
|
||||
t["Berkeley Old Style"] = true;
|
||||
t["Bernhard Modern"] = true;
|
||||
t["Berthold City"] = true;
|
||||
t["Bodoni"] = true;
|
||||
t.Bodoni = true;
|
||||
t["Bauer Bodoni"] = true;
|
||||
t["Book Antiqua"] = true;
|
||||
t["Bookman"] = true;
|
||||
t.Bookman = true;
|
||||
t["Bordeaux Roman"] = true;
|
||||
t["Californian FB"] = true;
|
||||
t["Calisto"] = true;
|
||||
t["Calvert"] = true;
|
||||
t["Capitals"] = true;
|
||||
t["Cambria"] = true;
|
||||
t["Cartier"] = true;
|
||||
t["Caslon"] = true;
|
||||
t["Catull"] = true;
|
||||
t["Centaur"] = true;
|
||||
t.Calisto = true;
|
||||
t.Calvert = true;
|
||||
t.Capitals = true;
|
||||
t.Cambria = true;
|
||||
t.Cartier = true;
|
||||
t.Caslon = true;
|
||||
t.Catull = true;
|
||||
t.Centaur = true;
|
||||
t["Century Old Style"] = true;
|
||||
t["Century Schoolbook"] = true;
|
||||
t["Chaparral"] = true;
|
||||
t.Chaparral = true;
|
||||
t["Charis SIL"] = true;
|
||||
t["Cheltenham"] = true;
|
||||
t.Cheltenham = true;
|
||||
t["Cholla Slab"] = true;
|
||||
t["Clarendon"] = true;
|
||||
t["Clearface"] = true;
|
||||
t["Cochin"] = true;
|
||||
t["Colonna"] = true;
|
||||
t.Clarendon = true;
|
||||
t.Clearface = true;
|
||||
t.Cochin = true;
|
||||
t.Colonna = true;
|
||||
t["Computer Modern"] = true;
|
||||
t["Concrete Roman"] = true;
|
||||
t["Constantia"] = true;
|
||||
t.Constantia = true;
|
||||
t["Cooper Black"] = true;
|
||||
t["Corona"] = true;
|
||||
t["Ecotype"] = true;
|
||||
t["Egyptienne"] = true;
|
||||
t["Elephant"] = true;
|
||||
t["Excelsior"] = true;
|
||||
t["Fairfield"] = true;
|
||||
t.Corona = true;
|
||||
t.Ecotype = true;
|
||||
t.Egyptienne = true;
|
||||
t.Elephant = true;
|
||||
t.Excelsior = true;
|
||||
t.Fairfield = true;
|
||||
t["FF Scala"] = true;
|
||||
t["Folkard"] = true;
|
||||
t["Footlight"] = true;
|
||||
t["FreeSerif"] = true;
|
||||
t.Folkard = true;
|
||||
t.Footlight = true;
|
||||
t.FreeSerif = true;
|
||||
t["Friz Quadrata"] = true;
|
||||
t["Garamond"] = true;
|
||||
t["Gentium"] = true;
|
||||
t["Georgia"] = true;
|
||||
t["Gloucester"] = true;
|
||||
t.Garamond = true;
|
||||
t.Gentium = true;
|
||||
t.Georgia = true;
|
||||
t.Gloucester = true;
|
||||
t["Goudy Old Style"] = true;
|
||||
t["Goudy Schoolbook"] = true;
|
||||
t["Goudy Pro Font"] = true;
|
||||
t["Granjon"] = true;
|
||||
t.Granjon = true;
|
||||
t["Guardian Egyptian"] = true;
|
||||
t["Heather"] = true;
|
||||
t["Hercules"] = true;
|
||||
t.Heather = true;
|
||||
t.Hercules = true;
|
||||
t["High Tower Text"] = true;
|
||||
t["Hiroshige"] = true;
|
||||
t.Hiroshige = true;
|
||||
t["Hoefler Text"] = true;
|
||||
t["Humana Serif"] = true;
|
||||
t["Imprint"] = true;
|
||||
t.Imprint = true;
|
||||
t["Ionic No. 5"] = true;
|
||||
t["Janson"] = true;
|
||||
t["Joanna"] = true;
|
||||
t["Korinna"] = true;
|
||||
t["Lexicon"] = true;
|
||||
t.Janson = true;
|
||||
t.Joanna = true;
|
||||
t.Korinna = true;
|
||||
t.Lexicon = true;
|
||||
t["Liberation Serif"] = true;
|
||||
t["Linux Libertine"] = true;
|
||||
t["Literaturnaya"] = true;
|
||||
t["Lucida"] = true;
|
||||
t.Literaturnaya = true;
|
||||
t.Lucida = true;
|
||||
t["Lucida Bright"] = true;
|
||||
t["Melior"] = true;
|
||||
t["Memphis"] = true;
|
||||
t["Miller"] = true;
|
||||
t["Minion"] = true;
|
||||
t["Modern"] = true;
|
||||
t.Melior = true;
|
||||
t.Memphis = true;
|
||||
t.Miller = true;
|
||||
t.Minion = true;
|
||||
t.Modern = true;
|
||||
t["Mona Lisa"] = true;
|
||||
t["Mrs Eaves"] = true;
|
||||
t["MS Serif"] = true;
|
||||
|
@ -220,48 +220,48 @@ const getSerifFonts = getLookupTableFactory(function (t) {
|
|||
t["New York"] = true;
|
||||
t["Nimbus Roman"] = true;
|
||||
t["NPS Rawlinson Roadway"] = true;
|
||||
t["NuptialScript"] = true;
|
||||
t["Palatino"] = true;
|
||||
t["Perpetua"] = true;
|
||||
t["Plantin"] = true;
|
||||
t.NuptialScript = true;
|
||||
t.Palatino = true;
|
||||
t.Perpetua = true;
|
||||
t.Plantin = true;
|
||||
t["Plantin Schoolbook"] = true;
|
||||
t["Playbill"] = true;
|
||||
t.Playbill = true;
|
||||
t["Poor Richard"] = true;
|
||||
t["Rawlinson Roadway"] = true;
|
||||
t["Renault"] = true;
|
||||
t["Requiem"] = true;
|
||||
t["Rockwell"] = true;
|
||||
t["Roman"] = true;
|
||||
t.Renault = true;
|
||||
t.Requiem = true;
|
||||
t.Rockwell = true;
|
||||
t.Roman = true;
|
||||
t["Rotis Serif"] = true;
|
||||
t["Sabon"] = true;
|
||||
t["Scala"] = true;
|
||||
t["Seagull"] = true;
|
||||
t["Sistina"] = true;
|
||||
t["Souvenir"] = true;
|
||||
t["STIX"] = true;
|
||||
t.Sabon = true;
|
||||
t.Scala = true;
|
||||
t.Seagull = true;
|
||||
t.Sistina = true;
|
||||
t.Souvenir = true;
|
||||
t.STIX = true;
|
||||
t["Stone Informal"] = true;
|
||||
t["Stone Serif"] = true;
|
||||
t["Sylfaen"] = true;
|
||||
t["Times"] = true;
|
||||
t["Trajan"] = true;
|
||||
t.Sylfaen = true;
|
||||
t.Times = true;
|
||||
t.Trajan = true;
|
||||
t["Trinité"] = true;
|
||||
t["Trump Mediaeval"] = true;
|
||||
t["Utopia"] = true;
|
||||
t.Utopia = true;
|
||||
t["Vale Type"] = true;
|
||||
t["Bitstream Vera"] = true;
|
||||
t["Vera Serif"] = true;
|
||||
t["Versailles"] = true;
|
||||
t["Wanted"] = true;
|
||||
t["Weiss"] = true;
|
||||
t.Versailles = true;
|
||||
t.Wanted = true;
|
||||
t.Weiss = true;
|
||||
t["Wide Latin"] = true;
|
||||
t["Windsor"] = true;
|
||||
t["XITS"] = true;
|
||||
t.Windsor = true;
|
||||
t.XITS = true;
|
||||
});
|
||||
|
||||
const getSymbolsFonts = getLookupTableFactory(function (t) {
|
||||
t["Dingbats"] = true;
|
||||
t["Symbol"] = true;
|
||||
t["ZapfDingbats"] = true;
|
||||
t.Dingbats = true;
|
||||
t.Symbol = true;
|
||||
t.ZapfDingbats = true;
|
||||
});
|
||||
|
||||
// Glyph map for well-known standard fonts. Sometimes Ghostscript uses CID
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue