: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
;// CONCATENATED MODULE: ./src/core/unicode.js
const getSpecialPUASymbols = getLookupTableFactory(function (t) {
function mapSpecialUnicodeValues(code) {
if (code >= 0xfff0 && code <= 0xffff) {
} else if (code >= 0xf600 && code <= 0xf8ff) {
return getSpecialPUASymbols()[code] || code;
} else if (code === 0x00ad) {
function getUnicodeForGlyph(name, glyphsUnicodeMap) {
let unicode = glyphsUnicodeMap[name];
if (unicode !== undefined) {
const nameLen = name.length;
if (nameLen === 7 && name[1] === "n" && name[2] === "i") {
hexStr = name.substring(3);
} else if (nameLen >= 5 && nameLen <= 7) {
hexStr = name.substring(1);
if (hexStr === hexStr.toUpperCase()) {
unicode = parseInt(hexStr, 16);
const UnicodeRanges = [[0x0000, 0x007f], [0x0080, 0x00ff], [0x0100, 0x017f], [0x0180, 0x024f], [0x0250, 0x02af, 0x1d00, 0x1d7f, 0x1d80, 0x1dbf], [0x02b0, 0x02ff, 0xa700, 0xa71f], [0x0300, 0x036f, 0x1dc0, 0x1dff], [0x0370, 0x03ff], [0x2c80, 0x2cff], [0x0400, 0x04ff, 0x0500, 0x052f, 0x2de0, 0x2dff, 0xa640, 0xa69f], [0x0530, 0x058f], [0x0590, 0x05ff], [0xa500, 0xa63f], [0x0600, 0x06ff, 0x0750, 0x077f], [0x07c0, 0x07ff], [0x0900, 0x097f], [0x0980, 0x09ff], [0x0a00, 0x0a7f], [0x0a80, 0x0aff], [0x0b00, 0x0b7f], [0x0b80, 0x0bff], [0x0c00, 0x0c7f], [0x0c80, 0x0cff], [0x0d00, 0x0d7f], [0x0e00, 0x0e7f], [0x0e80, 0x0eff], [0x10a0, 0x10ff, 0x2d00, 0x2d2f], [0x1b00, 0x1b7f], [0x1100, 0x11ff], [0x1e00, 0x1eff, 0x2c60, 0x2c7f, 0xa720, 0xa7ff], [0x1f00, 0x1fff], [0x2000, 0x206f, 0x2e00, 0x2e7f], [0x2070, 0x209f], [0x20a0, 0x20cf], [0x20d0, 0x20ff], [0x2100, 0x214f], [0x2150, 0x218f], [0x2190, 0x21ff, 0x27f0, 0x27ff, 0x2900, 0x297f, 0x2b00, 0x2bff], [0x2200, 0x22ff, 0x2a00, 0x2aff, 0x27c0, 0x27ef, 0x2980, 0x29ff], [0x2300, 0x23ff], [0x2400, 0x243f], [0x2440, 0x245f], [0x2460, 0x24ff], [0x2500, 0x257f], [0x2580, 0x259f], [0x25a0, 0x25ff], [0x2600, 0x26ff], [0x2700, 0x27bf], [0x3000, 0x303f], [0x3040, 0x309f], [0x30a0, 0x30ff, 0x31f0, 0x31ff], [0x3100, 0x312f, 0x31a0, 0x31bf], [0x3130, 0x318f], [0xa840, 0xa87f], [0x3200, 0x32ff], [0x3300, 0x33ff], [0xac00, 0xd7af], [0xd800, 0xdfff], [0x10900, 0x1091f], [0x4e00, 0x9fff, 0x2e80, 0x2eff, 0x2f00, 0x2fdf, 0x2ff0, 0x2fff, 0x3400, 0x4dbf, 0x20000, 0x2a6df, 0x3190, 0x319f], [0xe000, 0xf8ff], [0x31c0, 0x31ef, 0xf900, 0xfaff, 0x2f800, 0x2fa1f], [0xfb00, 0xfb4f], [0xfb50, 0xfdff], [0xfe20, 0xfe2f], [0xfe10, 0xfe1f], [0xfe50, 0xfe6f], [0xfe70, 0xfeff], [0xff00, 0xffef], [0xfff0, 0xffff], [0x0f00, 0x0fff], [0x0700, 0x074f], [0x0780, 0x07bf], [0x0d80, 0x0dff], [0x1000, 0x109f], [0x1200, 0x137f, 0x1380, 0x139f, 0x2d80, 0x2ddf], [0x13a0, 0x13ff], [0x1400, 0x167f], [0x1680, 0x169f], [0x16a0, 0x16ff], [0x1780, 0x17ff], [0x1800, 0x18af], [0x2800, 0x28ff], [0xa000, 0xa48f], [0x1700, 0x171f, 0x1720, 0x173f, 0x1740, 0x175f, 0x1760, 0x177f], [0x10300, 0x1032f], [0x10330, 0x1034f], [0x10400, 0x1044f], [0x1d000, 0x1d0ff, 0x1d100, 0x1d1ff, 0x1d200, 0x1d24f], [0x1d400, 0x1d7ff], [0xff000, 0xffffd], [0xfe00, 0xfe0f, 0xe0100, 0xe01ef], [0xe0000, 0xe007f], [0x1900, 0x194f], [0x1950, 0x197f], [0x1980, 0x19df], [0x1a00, 0x1a1f], [0x2c00, 0x2c5f], [0x2d30, 0x2d7f], [0x4dc0, 0x4dff], [0xa800, 0xa82f], [0x10000, 0x1007f, 0x10080, 0x100ff, 0x10100, 0x1013f], [0x10140, 0x1018f], [0x10380, 0x1039f], [0x103a0, 0x103df], [0x10450, 0x1047f], [0x10480, 0x104af], [0x10800, 0x1083f], [0x10a00, 0x10a5f], [0x1d300, 0x1d35f], [0x12000, 0x123ff, 0x12400, 0x1247f], [0x1d360, 0x1d37f], [0x1b80, 0x1bbf], [0x1c00, 0x1c4f], [0x1c50, 0x1c7f], [0xa880, 0xa8df], [0xa900, 0xa92f], [0xa930, 0xa95f], [0xaa00, 0xaa5f], [0x10190, 0x101cf], [0x101d0, 0x101ff], [0x102a0, 0x102df, 0x10280, 0x1029f, 0x10920, 0x1093f], [0x1f030, 0x1f09f, 0x1f000, 0x1f02f]];
function getUnicodeRangeFor(value, lastPosition = -1) {
if (lastPosition !== -1) {
const range = UnicodeRanges[lastPosition];
for (let i = 0, ii = range.length; i < ii; i += 2) {
if (value >= range[i] && value <= range[i + 1]) {
for (let i = 0, ii = UnicodeRanges.length; i < ii; i++) {
const range = UnicodeRanges[i];
for (let j = 0, jj = range.length; j < jj; j += 2) {
if (value >= range[j] && value <= range[j + 1]) {
const SpecialCharRegExp = new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$", "u");
const CategoryCache = new Map();
function getCharUnicodeCategory(char) {
const cachedCategory = CategoryCache.get(char);
const groups = char.match(SpecialCharRegExp);
isWhitespace: !!groups?.[1],
isZeroWidthDiacritic: !!groups?.[2],
isInvisibleFormatMark: !!groups?.[3]
CategoryCache.set(char, category);
function clearUnicodeCaches() {
;// CONCATENATED MODULE: ./src/core/fonts_utils.js
const SEAC_ANALYSIS_ENABLED = true;
const MacStandardGlyphOrdering = [".notdef", ".null", "nonmarkingreturn", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute", "agrave", "acircumflex", "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave", "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls", "registered", "copyright", "trademark", "acute", "dieresis", "notequal", "AE", "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", "summation", "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", "ae", "oslash", "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft", "guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "Lslash", "lslash", "Scaron", "scaron", "Zcaron", "zcaron", "brokenbar", "Eth", "eth", "Yacute", "yacute", "Thorn", "thorn", "minus", "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", "onequarter", "threequarters", "franc", "Gbreve", "gbreve", "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute", "Ccaron", "ccaron", "dcroat"];
function recoverGlyphName(name, glyphsUnicodeMap) {
if (glyphsUnicodeMap[name] !== undefined) {
const unicode = getUnicodeForGlyph(name, glyphsUnicodeMap);
for (const key in glyphsUnicodeMap) {
if (glyphsUnicodeMap[key] === unicode) {
info("Unable to recover a standard glyph name for: " + name);
function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) {
const charCodeToGlyphId = Object.create(null);
let glyphId, charCode, baseEncoding;
const isSymbolicFont = !!(properties.flags & FontFlags.Symbolic);
if (properties.isInternalFont) {
baseEncoding = builtInEncoding;
for (charCode = 0; charCode < baseEncoding.length; charCode++) {
glyphId = glyphNames.indexOf(baseEncoding[charCode]);
charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0;
} else if (properties.baseEncodingName) {
baseEncoding = getEncoding(properties.baseEncodingName);
for (charCode = 0; charCode < baseEncoding.length; charCode++) {
glyphId = glyphNames.indexOf(baseEncoding[charCode]);
charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0;
} else if (isSymbolicFont) {
for (charCode in builtInEncoding) {
charCodeToGlyphId[charCode] = builtInEncoding[charCode];
baseEncoding = StandardEncoding;
for (charCode = 0; charCode < baseEncoding.length; charCode++) {
glyphId = glyphNames.indexOf(baseEncoding[charCode]);
charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0;
const differences = properties.differences;
for (charCode in differences) {
const glyphName = differences[charCode];
glyphId = glyphNames.indexOf(glyphName);
glyphsUnicodeMap = getGlyphsUnicode();
const standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap);
if (standardGlyphName !== glyphName) {
glyphId = glyphNames.indexOf(standardGlyphName);
charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0;
return charCodeToGlyphId;
function normalizeFontName(name) {
return name.replaceAll(/[,_]/g, "-").replaceAll(/\s/g, "");
;// CONCATENATED MODULE: ./src/core/standard_fonts.js
const getStdFontMap = getLookupTableFactory(function (t) {
t["Times-Roman"] = "Times-Roman";
t.Helvetica = "Helvetica";
t["Times-Bold"] = "Times-Bold";
t["Helvetica-Bold"] = "Helvetica-Bold";
t["Courier-Bold"] = "Courier-Bold";
t.ZapfDingbats = "ZapfDingbats";
t["Times-Italic"] = "Times-Italic";
t["Helvetica-Oblique"] = "Helvetica-Oblique";
t["Courier-Oblique"] = "Courier-Oblique";
t["Times-BoldItalic"] = "Times-BoldItalic";
t["Helvetica-BoldOblique"] = "Helvetica-BoldOblique";
t["Courier-BoldOblique"] = "Courier-BoldOblique";
t.ArialNarrow = "Helvetica";
t["ArialNarrow-Bold"] = "Helvetica-Bold";
t["ArialNarrow-BoldItalic"] = "Helvetica-BoldOblique";
t["ArialNarrow-Italic"] = "Helvetica-Oblique";
t.ArialBlack = "Helvetica";
t["ArialBlack-Bold"] = "Helvetica-Bold";
t["ArialBlack-BoldItalic"] = "Helvetica-BoldOblique";
t["ArialBlack-Italic"] = "Helvetica-Oblique";
t["Arial-Black"] = "Helvetica";
t["Arial-Black-Bold"] = "Helvetica-Bold";
t["Arial-Black-BoldItalic"] = "Helvetica-BoldOblique";
t["Arial-Black-Italic"] = "Helvetica-Oblique";
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["Arial-BoldItalicMT-BoldItalic"] = "Helvetica-BoldOblique";
t["Arial-BoldMT-Bold"] = "Helvetica-Bold";
t["Arial-ItalicMT-Italic"] = "Helvetica-Oblique";
t.ArialUnicodeMS = "Helvetica";
t["ArialUnicodeMS-Bold"] = "Helvetica-Bold";
t["ArialUnicodeMS-BoldItalic"] = "Helvetica-BoldOblique";
t["ArialUnicodeMS-Italic"] = "Helvetica-Oblique";
t["Courier-BoldItalic"] = "Courier-BoldOblique";
t["Courier-Italic"] = "Courier-Oblique";
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-BoldItalic"] = "Helvetica-BoldOblique";
t["Helvetica-Italic"] = "Helvetica-Oblique";
t["Symbol-Bold"] = "Symbol";
t["Symbol-BoldItalic"] = "Symbol";
t["Symbol-Italic"] = "Symbol";
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-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-Bold"] = "Times-Bold";
t["TimesNewRomanPSMT-BoldItalic"] = "Times-BoldItalic";
t["TimesNewRomanPSMT-Italic"] = "Times-Italic";
const getFontNameToFileMap = getLookupTableFactory(function (t) {
t.Courier = "FoxitFixed.pfb";
t["Courier-Bold"] = "FoxitFixedBold.pfb";
t["Courier-BoldOblique"] = "FoxitFixedBoldItalic.pfb";
t["Courier-Oblique"] = "FoxitFixedItalic.pfb";
t.Helvetica = "LiberationSans-Regular.ttf";
t["Helvetica-Bold"] = "LiberationSans-Bold.ttf";
t["Helvetica-BoldOblique"] = "LiberationSans-BoldItalic.ttf";
t["Helvetica-Oblique"] = "LiberationSans-Italic.ttf";
t["Times-Roman"] = "FoxitSerif.pfb";
t["Times-Bold"] = "FoxitSerifBold.pfb";
t["Times-BoldItalic"] = "FoxitSerifBoldItalic.pfb";
t["Times-Italic"] = "FoxitSerifItalic.pfb";
t.Symbol = "FoxitSymbol.pfb";
t.ZapfDingbats = "FoxitDingbats.pfb";
t["LiberationSans-Regular"] = "LiberationSans-Regular.ttf";
t["LiberationSans-Bold"] = "LiberationSans-Bold.ttf";
t["LiberationSans-Italic"] = "LiberationSans-Italic.ttf";
t["LiberationSans-BoldItalic"] = "LiberationSans-BoldItalic.ttf";
const getNonStdFontMap = getLookupTableFactory(function (t) {
t["Calibri-Bold"] = "Helvetica-Bold";
t["Calibri-BoldItalic"] = "Helvetica-BoldOblique";
t["Calibri-Italic"] = "Helvetica-Oblique";
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-Bold"] = "Comic Sans MS-Bold";
t["ComicSansMS-BoldItalic"] = "Comic Sans MS-BoldItalic";
t["ComicSansMS-Italic"] = "Comic Sans MS-Italic";
t["ItcSymbol-Bold"] = "Helvetica-Bold";
t["ItcSymbol-BoldItalic"] = "Helvetica-BoldOblique";
t["ItcSymbol-Book"] = "Helvetica";
t["ItcSymbol-BookItalic"] = "Helvetica-Oblique";
t["ItcSymbol-Medium"] = "Helvetica";
t["ItcSymbol-MediumItalic"] = "Helvetica-Oblique";