: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const getSupplementalGlyphMapForArialBlack = getLookupTableFactory(function (t) {
const getSupplementalGlyphMapForCalibri = getLookupTableFactory(function (t) {
function getStandardFontName(name) {
const fontName = normalizeFontName(name);
const stdFontMap = getStdFontMap();
return stdFontMap[fontName];
function isKnownFontName(name) {
const fontName = normalizeFontName(name);
return !!(getStdFontMap()[fontName] || getNonStdFontMap()[fontName] || getSerifFonts()[fontName] || getSymbolsFonts()[fontName]);
;// CONCATENATED MODULE: ./src/core/to_unicode_map.js
for (const charCode in this._map) {
callback(charCode, this._map[charCode].charCodeAt(0));
return this._map[i] !== undefined;
if (map.length <= 0x10000) {
return map.indexOf(value);
for (const charCode in map) {
if (map[charCode] === value) {
for (const charCode in map) {
this._map[charCode] = map[charCode];
class IdentityToUnicodeMap {
constructor(firstChar, lastChar) {
this.firstChar = firstChar;
this.lastChar = lastChar;
return this.lastChar + 1 - this.firstChar;
for (let i = this.firstChar, ii = this.lastChar; i <= ii; i++) {
return this.firstChar <= i && i <= this.lastChar;
if (this.firstChar <= i && i <= this.lastChar) {
return String.fromCharCode(i);
return Number.isInteger(v) && v >= this.firstChar && v <= this.lastChar ? v : -1;
unreachable("Should not call amend()");
;// CONCATENATED MODULE: ./src/core/cff_font.js
constructor(file, properties) {
this.properties = properties;
const parser = new CFFParser(file, properties, SEAC_ANALYSIS_ENABLED);
this.cff = parser.parse();
this.cff.duplicateFirstGlyph();
const compiler = new CFFCompiler(this.cff);
this.seacs = this.cff.seacs;
this.data = compiler.compile();
warn("Failed to compile font " + properties.loadedName);
this._createBuiltInEncoding();
return this.cff.charStrings.count;
return this.cff.charset.charset;
const properties = this.properties;
const charsets = cff.charset.charset;
if (properties.composite) {
if (cidToGidMap?.length > 0) {
invCidToGidMap = Object.create(null);
for (let i = 0, ii = cidToGidMap.length; i < ii; i++) {
const gid = cidToGidMap[i];
charCodeToGlyphId = Object.create(null);
for (glyphId = 0; glyphId < charsets.length; glyphId++) {
const cid = charsets[glyphId];
charCode = cMap.charCodeOf(cid);
if (invCidToGidMap?.[charCode] !== undefined) {
charCode = invCidToGidMap[charCode];
charCodeToGlyphId[charCode] = glyphId;
for (glyphId = 0; glyphId < cff.charStrings.count; glyphId++) {
charCode = cMap.charCodeOf(glyphId);
charCodeToGlyphId[charCode] = glyphId;
return charCodeToGlyphId;
let encoding = cff.encoding ? cff.encoding.encoding : null;
if (properties.isInternalFont) {
encoding = properties.defaultEncoding;
charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets);
return charCodeToGlyphId;
return this.cff.hasGlyphId(id);
_createBuiltInEncoding() {
if (!charset || !encoding) {
const charsets = charset.charset,
encodings = encoding.encoding;
for (const charCode in encodings) {
const glyphId = encodings[charCode];
const glyphName = charsets[glyphId];
map[charCode] = glyphName;
this.properties.builtInEncoding = map;
;// CONCATENATED MODULE: ./src/core/font_renderer.js
function getUint32(data, offset) {
return (data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]) >>> 0;
function getUint16(data, offset) {
return data[offset] << 8 | data[offset + 1];
function getInt16(data, offset) {
return (data[offset] << 24 | data[offset + 1] << 16) >> 16;
function getInt8(data, offset) {
return data[offset] << 24 >> 24;
function getFloat214(data, offset) {
return getInt16(data, offset) / 16384;
function getSubroutineBias(subrs) {
const numSubrs = subrs.length;
} else if (numSubrs < 33900) {
function parseCmap(data, start, end) {
const offset = getUint16(data, start + 2) === 1 ? getUint32(data, start + 8) : getUint32(data, start + 16);
const format = getUint16(data, start + offset);
getUint16(data, start + offset + 2);
const segCount = getUint16(data, start + offset + 6) >> 1;
for (i = 0; i < segCount; i++, p += 2) {
for (i = 0; i < segCount; i++, p += 2) {
ranges[i].start = getUint16(data, p);
for (i = 0; i < segCount; i++, p += 2) {
ranges[i].idDelta = getUint16(data, p);
for (i = 0; i < segCount; i++, p += 2) {
let idOffset = getUint16(data, p);
for (let j = 0, jj = ranges[i].end - ranges[i].start + 1; j < jj; j++) {
ranges[i].ids[j] = getUint16(data, p + idOffset);
} else if (format === 12) {
const groups = getUint32(data, start + offset + 12);
for (i = 0; i < groups; i++) {
start = getUint32(data, p);
end: getUint32(data, p + 4),
idDelta: getUint32(data, p + 8) - start
throw new FormatError(`unsupported cmap: ${format}`);
function parseCff(data, start, end, seacAnalysisEnabled) {
const parser = new CFFParser(new Stream(data, start, end - start), properties, seacAnalysisEnabled);
const cff = parser.parse();