Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/embedpre.../assets/pdf/build
File: pdf.worker.js
const $getAttributeIt = Symbol();
[43500] Fix | Delete
const $getAttributes = Symbol();
[43501] Fix | Delete
const $getAvailableSpace = Symbol();
[43502] Fix | Delete
const $getChildrenByClass = Symbol();
[43503] Fix | Delete
const $getChildrenByName = Symbol();
[43504] Fix | Delete
const $getChildrenByNameIt = Symbol();
[43505] Fix | Delete
const $getDataValue = Symbol();
[43506] Fix | Delete
const $getExtra = Symbol();
[43507] Fix | Delete
const $getRealChildrenByNameIt = Symbol();
[43508] Fix | Delete
const $getChildren = Symbol();
[43509] Fix | Delete
const $getContainedChildren = Symbol();
[43510] Fix | Delete
const $getNextPage = Symbol();
[43511] Fix | Delete
const $getSubformParent = Symbol();
[43512] Fix | Delete
const $getParent = Symbol();
[43513] Fix | Delete
const $getTemplateRoot = Symbol();
[43514] Fix | Delete
const $globalData = Symbol();
[43515] Fix | Delete
const $hasSettableValue = Symbol();
[43516] Fix | Delete
const $ids = Symbol();
[43517] Fix | Delete
const $indexOf = Symbol();
[43518] Fix | Delete
const $insertAt = Symbol();
[43519] Fix | Delete
const $isCDATAXml = Symbol();
[43520] Fix | Delete
const $isBindable = Symbol();
[43521] Fix | Delete
const $isDataValue = Symbol();
[43522] Fix | Delete
const $isDescendent = Symbol();
[43523] Fix | Delete
const $isNsAgnostic = Symbol();
[43524] Fix | Delete
const $isSplittable = Symbol();
[43525] Fix | Delete
const $isThereMoreWidth = Symbol();
[43526] Fix | Delete
const $isTransparent = Symbol();
[43527] Fix | Delete
const $isUsable = Symbol();
[43528] Fix | Delete
const $lastAttribute = Symbol();
[43529] Fix | Delete
const $namespaceId = Symbol("namespaceId");
[43530] Fix | Delete
const $nodeName = Symbol("nodeName");
[43531] Fix | Delete
const $nsAttributes = Symbol();
[43532] Fix | Delete
const $onChild = Symbol();
[43533] Fix | Delete
const $onChildCheck = Symbol();
[43534] Fix | Delete
const $onText = Symbol();
[43535] Fix | Delete
const $pushGlyphs = Symbol();
[43536] Fix | Delete
const $popPara = Symbol();
[43537] Fix | Delete
const $pushPara = Symbol();
[43538] Fix | Delete
const $removeChild = Symbol();
[43539] Fix | Delete
const $root = Symbol("root");
[43540] Fix | Delete
const $resolvePrototypes = Symbol();
[43541] Fix | Delete
const $searchNode = Symbol();
[43542] Fix | Delete
const $setId = Symbol();
[43543] Fix | Delete
const $setSetAttributes = Symbol();
[43544] Fix | Delete
const $setValue = Symbol();
[43545] Fix | Delete
const $tabIndex = Symbol();
[43546] Fix | Delete
const $text = Symbol();
[43547] Fix | Delete
const $toPages = Symbol();
[43548] Fix | Delete
const $toHTML = Symbol();
[43549] Fix | Delete
const $toString = Symbol();
[43550] Fix | Delete
const $toStyle = Symbol();
[43551] Fix | Delete
const $uid = Symbol("uid");
[43552] Fix | Delete
[43553] Fix | Delete
;// CONCATENATED MODULE: ./src/core/xfa/namespaces.js
[43554] Fix | Delete
const $buildXFAObject = Symbol();
[43555] Fix | Delete
const NamespaceIds = {
[43556] Fix | Delete
config: {
[43557] Fix | Delete
id: 0,
[43558] Fix | Delete
check: ns => ns.startsWith("http://www.xfa.org/schema/xci/")
[43559] Fix | Delete
},
[43560] Fix | Delete
connectionSet: {
[43561] Fix | Delete
id: 1,
[43562] Fix | Delete
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-connection-set/")
[43563] Fix | Delete
},
[43564] Fix | Delete
datasets: {
[43565] Fix | Delete
id: 2,
[43566] Fix | Delete
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-data/")
[43567] Fix | Delete
},
[43568] Fix | Delete
form: {
[43569] Fix | Delete
id: 3,
[43570] Fix | Delete
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-form/")
[43571] Fix | Delete
},
[43572] Fix | Delete
localeSet: {
[43573] Fix | Delete
id: 4,
[43574] Fix | Delete
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-locale-set/")
[43575] Fix | Delete
},
[43576] Fix | Delete
pdf: {
[43577] Fix | Delete
id: 5,
[43578] Fix | Delete
check: ns => ns === "http://ns.adobe.com/xdp/pdf/"
[43579] Fix | Delete
},
[43580] Fix | Delete
signature: {
[43581] Fix | Delete
id: 6,
[43582] Fix | Delete
check: ns => ns === "http://www.w3.org/2000/09/xmldsig#"
[43583] Fix | Delete
},
[43584] Fix | Delete
sourceSet: {
[43585] Fix | Delete
id: 7,
[43586] Fix | Delete
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-source-set/")
[43587] Fix | Delete
},
[43588] Fix | Delete
stylesheet: {
[43589] Fix | Delete
id: 8,
[43590] Fix | Delete
check: ns => ns === "http://www.w3.org/1999/XSL/Transform"
[43591] Fix | Delete
},
[43592] Fix | Delete
template: {
[43593] Fix | Delete
id: 9,
[43594] Fix | Delete
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-template/")
[43595] Fix | Delete
},
[43596] Fix | Delete
xdc: {
[43597] Fix | Delete
id: 10,
[43598] Fix | Delete
check: ns => ns.startsWith("http://www.xfa.org/schema/xdc/")
[43599] Fix | Delete
},
[43600] Fix | Delete
xdp: {
[43601] Fix | Delete
id: 11,
[43602] Fix | Delete
check: ns => ns === "http://ns.adobe.com/xdp/"
[43603] Fix | Delete
},
[43604] Fix | Delete
xfdf: {
[43605] Fix | Delete
id: 12,
[43606] Fix | Delete
check: ns => ns === "http://ns.adobe.com/xfdf/"
[43607] Fix | Delete
},
[43608] Fix | Delete
xhtml: {
[43609] Fix | Delete
id: 13,
[43610] Fix | Delete
check: ns => ns === "http://www.w3.org/1999/xhtml"
[43611] Fix | Delete
},
[43612] Fix | Delete
xmpmeta: {
[43613] Fix | Delete
id: 14,
[43614] Fix | Delete
check: ns => ns === "http://ns.adobe.com/xmpmeta/"
[43615] Fix | Delete
}
[43616] Fix | Delete
};
[43617] Fix | Delete
[43618] Fix | Delete
;// CONCATENATED MODULE: ./src/core/xfa/utils.js
[43619] Fix | Delete
[43620] Fix | Delete
[43621] Fix | Delete
[43622] Fix | Delete
[43623] Fix | Delete
[43624] Fix | Delete
const dimConverters = {
[43625] Fix | Delete
pt: x => x,
[43626] Fix | Delete
cm: x => x / 2.54 * 72,
[43627] Fix | Delete
mm: x => x / (10 * 2.54) * 72,
[43628] Fix | Delete
in: x => x * 72,
[43629] Fix | Delete
px: x => x
[43630] Fix | Delete
};
[43631] Fix | Delete
const measurementPattern = /([+-]?\d+\.?\d*)(.*)/;
[43632] Fix | Delete
function stripQuotes(str) {
[43633] Fix | Delete
if (str.startsWith("'") || str.startsWith('"')) {
[43634] Fix | Delete
return str.slice(1, -1);
[43635] Fix | Delete
}
[43636] Fix | Delete
return str;
[43637] Fix | Delete
}
[43638] Fix | Delete
function getInteger({
[43639] Fix | Delete
data,
[43640] Fix | Delete
defaultValue,
[43641] Fix | Delete
validate
[43642] Fix | Delete
}) {
[43643] Fix | Delete
if (!data) {
[43644] Fix | Delete
return defaultValue;
[43645] Fix | Delete
}
[43646] Fix | Delete
data = data.trim();
[43647] Fix | Delete
const n = parseInt(data, 10);
[43648] Fix | Delete
if (!isNaN(n) && validate(n)) {
[43649] Fix | Delete
return n;
[43650] Fix | Delete
}
[43651] Fix | Delete
return defaultValue;
[43652] Fix | Delete
}
[43653] Fix | Delete
function getFloat({
[43654] Fix | Delete
data,
[43655] Fix | Delete
defaultValue,
[43656] Fix | Delete
validate
[43657] Fix | Delete
}) {
[43658] Fix | Delete
if (!data) {
[43659] Fix | Delete
return defaultValue;
[43660] Fix | Delete
}
[43661] Fix | Delete
data = data.trim();
[43662] Fix | Delete
const n = parseFloat(data);
[43663] Fix | Delete
if (!isNaN(n) && validate(n)) {
[43664] Fix | Delete
return n;
[43665] Fix | Delete
}
[43666] Fix | Delete
return defaultValue;
[43667] Fix | Delete
}
[43668] Fix | Delete
function getKeyword({
[43669] Fix | Delete
data,
[43670] Fix | Delete
defaultValue,
[43671] Fix | Delete
validate
[43672] Fix | Delete
}) {
[43673] Fix | Delete
if (!data) {
[43674] Fix | Delete
return defaultValue;
[43675] Fix | Delete
}
[43676] Fix | Delete
data = data.trim();
[43677] Fix | Delete
if (validate(data)) {
[43678] Fix | Delete
return data;
[43679] Fix | Delete
}
[43680] Fix | Delete
return defaultValue;
[43681] Fix | Delete
}
[43682] Fix | Delete
function getStringOption(data, options) {
[43683] Fix | Delete
return getKeyword({
[43684] Fix | Delete
data,
[43685] Fix | Delete
defaultValue: options[0],
[43686] Fix | Delete
validate: k => options.includes(k)
[43687] Fix | Delete
});
[43688] Fix | Delete
}
[43689] Fix | Delete
function getMeasurement(str, def = "0") {
[43690] Fix | Delete
def ||= "0";
[43691] Fix | Delete
if (!str) {
[43692] Fix | Delete
return getMeasurement(def);
[43693] Fix | Delete
}
[43694] Fix | Delete
const match = str.trim().match(measurementPattern);
[43695] Fix | Delete
if (!match) {
[43696] Fix | Delete
return getMeasurement(def);
[43697] Fix | Delete
}
[43698] Fix | Delete
const [, valueStr, unit] = match;
[43699] Fix | Delete
const value = parseFloat(valueStr);
[43700] Fix | Delete
if (isNaN(value)) {
[43701] Fix | Delete
return getMeasurement(def);
[43702] Fix | Delete
}
[43703] Fix | Delete
if (value === 0) {
[43704] Fix | Delete
return 0;
[43705] Fix | Delete
}
[43706] Fix | Delete
const conv = dimConverters[unit];
[43707] Fix | Delete
if (conv) {
[43708] Fix | Delete
return conv(value);
[43709] Fix | Delete
}
[43710] Fix | Delete
return value;
[43711] Fix | Delete
}
[43712] Fix | Delete
function getRatio(data) {
[43713] Fix | Delete
if (!data) {
[43714] Fix | Delete
return {
[43715] Fix | Delete
num: 1,
[43716] Fix | Delete
den: 1
[43717] Fix | Delete
};
[43718] Fix | Delete
}
[43719] Fix | Delete
const ratio = data.trim().split(/\s*:\s*/).map(x => parseFloat(x)).filter(x => !isNaN(x));
[43720] Fix | Delete
if (ratio.length === 1) {
[43721] Fix | Delete
ratio.push(1);
[43722] Fix | Delete
}
[43723] Fix | Delete
if (ratio.length === 0) {
[43724] Fix | Delete
return {
[43725] Fix | Delete
num: 1,
[43726] Fix | Delete
den: 1
[43727] Fix | Delete
};
[43728] Fix | Delete
}
[43729] Fix | Delete
const [num, den] = ratio;
[43730] Fix | Delete
return {
[43731] Fix | Delete
num,
[43732] Fix | Delete
den
[43733] Fix | Delete
};
[43734] Fix | Delete
}
[43735] Fix | Delete
function getRelevant(data) {
[43736] Fix | Delete
if (!data) {
[43737] Fix | Delete
return [];
[43738] Fix | Delete
}
[43739] Fix | Delete
return data.trim().split(/\s+/).map(e => ({
[43740] Fix | Delete
excluded: e[0] === "-",
[43741] Fix | Delete
viewname: e.substring(1)
[43742] Fix | Delete
}));
[43743] Fix | Delete
}
[43744] Fix | Delete
function getColor(data, def = [0, 0, 0]) {
[43745] Fix | Delete
let [r, g, b] = def;
[43746] Fix | Delete
if (!data) {
[43747] Fix | Delete
return {
[43748] Fix | Delete
r,
[43749] Fix | Delete
g,
[43750] Fix | Delete
b
[43751] Fix | Delete
};
[43752] Fix | Delete
}
[43753] Fix | Delete
const color = data.trim().split(/\s*,\s*/).map(c => Math.min(Math.max(0, parseInt(c.trim(), 10)), 255)).map(c => isNaN(c) ? 0 : c);
[43754] Fix | Delete
if (color.length < 3) {
[43755] Fix | Delete
return {
[43756] Fix | Delete
r,
[43757] Fix | Delete
g,
[43758] Fix | Delete
b
[43759] Fix | Delete
};
[43760] Fix | Delete
}
[43761] Fix | Delete
[r, g, b] = color;
[43762] Fix | Delete
return {
[43763] Fix | Delete
r,
[43764] Fix | Delete
g,
[43765] Fix | Delete
b
[43766] Fix | Delete
};
[43767] Fix | Delete
}
[43768] Fix | Delete
function getBBox(data) {
[43769] Fix | Delete
const def = -1;
[43770] Fix | Delete
if (!data) {
[43771] Fix | Delete
return {
[43772] Fix | Delete
x: def,
[43773] Fix | Delete
y: def,
[43774] Fix | Delete
width: def,
[43775] Fix | Delete
height: def
[43776] Fix | Delete
};
[43777] Fix | Delete
}
[43778] Fix | Delete
const bbox = data.trim().split(/\s*,\s*/).map(m => getMeasurement(m, "-1"));
[43779] Fix | Delete
if (bbox.length < 4 || bbox[2] < 0 || bbox[3] < 0) {
[43780] Fix | Delete
return {
[43781] Fix | Delete
x: def,
[43782] Fix | Delete
y: def,
[43783] Fix | Delete
width: def,
[43784] Fix | Delete
height: def
[43785] Fix | Delete
};
[43786] Fix | Delete
}
[43787] Fix | Delete
const [x, y, width, height] = bbox;
[43788] Fix | Delete
return {
[43789] Fix | Delete
x,
[43790] Fix | Delete
y,
[43791] Fix | Delete
width,
[43792] Fix | Delete
height
[43793] Fix | Delete
};
[43794] Fix | Delete
}
[43795] Fix | Delete
class HTMLResult {
[43796] Fix | Delete
static get FAILURE() {
[43797] Fix | Delete
return shadow(this, "FAILURE", new HTMLResult(false, null, null, null));
[43798] Fix | Delete
}
[43799] Fix | Delete
static get EMPTY() {
[43800] Fix | Delete
return shadow(this, "EMPTY", new HTMLResult(true, null, null, null));
[43801] Fix | Delete
}
[43802] Fix | Delete
constructor(success, html, bbox, breakNode) {
[43803] Fix | Delete
this.success = success;
[43804] Fix | Delete
this.html = html;
[43805] Fix | Delete
this.bbox = bbox;
[43806] Fix | Delete
this.breakNode = breakNode;
[43807] Fix | Delete
}
[43808] Fix | Delete
isBreak() {
[43809] Fix | Delete
return !!this.breakNode;
[43810] Fix | Delete
}
[43811] Fix | Delete
static breakNode(node) {
[43812] Fix | Delete
return new HTMLResult(false, null, null, node);
[43813] Fix | Delete
}
[43814] Fix | Delete
static success(html, bbox = null) {
[43815] Fix | Delete
return new HTMLResult(true, html, bbox, null);
[43816] Fix | Delete
}
[43817] Fix | Delete
}
[43818] Fix | Delete
[43819] Fix | Delete
;// CONCATENATED MODULE: ./src/core/xfa/fonts.js
[43820] Fix | Delete
[43821] Fix | Delete
[43822] Fix | Delete
[43823] Fix | Delete
[43824] Fix | Delete
[43825] Fix | Delete
[43826] Fix | Delete
[43827] Fix | Delete
[43828] Fix | Delete
[43829] Fix | Delete
[43830] Fix | Delete
[43831] Fix | Delete
[43832] Fix | Delete
[43833] Fix | Delete
class FontFinder {
[43834] Fix | Delete
constructor(pdfFonts) {
[43835] Fix | Delete
this.fonts = new Map();
[43836] Fix | Delete
this.cache = new Map();
[43837] Fix | Delete
this.warned = new Set();
[43838] Fix | Delete
this.defaultFont = null;
[43839] Fix | Delete
this.add(pdfFonts);
[43840] Fix | Delete
}
[43841] Fix | Delete
add(pdfFonts, reallyMissingFonts = null) {
[43842] Fix | Delete
for (const pdfFont of pdfFonts) {
[43843] Fix | Delete
this.addPdfFont(pdfFont);
[43844] Fix | Delete
}
[43845] Fix | Delete
for (const pdfFont of this.fonts.values()) {
[43846] Fix | Delete
if (!pdfFont.regular) {
[43847] Fix | Delete
pdfFont.regular = pdfFont.italic || pdfFont.bold || pdfFont.bolditalic;
[43848] Fix | Delete
}
[43849] Fix | Delete
}
[43850] Fix | Delete
if (!reallyMissingFonts || reallyMissingFonts.size === 0) {
[43851] Fix | Delete
return;
[43852] Fix | Delete
}
[43853] Fix | Delete
const myriad = this.fonts.get("PdfJS-Fallback-PdfJS-XFA");
[43854] Fix | Delete
for (const missing of reallyMissingFonts) {
[43855] Fix | Delete
this.fonts.set(missing, myriad);
[43856] Fix | Delete
}
[43857] Fix | Delete
}
[43858] Fix | Delete
addPdfFont(pdfFont) {
[43859] Fix | Delete
const cssFontInfo = pdfFont.cssFontInfo;
[43860] Fix | Delete
const name = cssFontInfo.fontFamily;
[43861] Fix | Delete
let font = this.fonts.get(name);
[43862] Fix | Delete
if (!font) {
[43863] Fix | Delete
font = Object.create(null);
[43864] Fix | Delete
this.fonts.set(name, font);
[43865] Fix | Delete
if (!this.defaultFont) {
[43866] Fix | Delete
this.defaultFont = font;
[43867] Fix | Delete
}
[43868] Fix | Delete
}
[43869] Fix | Delete
let property = "";
[43870] Fix | Delete
const fontWeight = parseFloat(cssFontInfo.fontWeight);
[43871] Fix | Delete
if (parseFloat(cssFontInfo.italicAngle) !== 0) {
[43872] Fix | Delete
property = fontWeight >= 700 ? "bolditalic" : "italic";
[43873] Fix | Delete
} else if (fontWeight >= 700) {
[43874] Fix | Delete
property = "bold";
[43875] Fix | Delete
}
[43876] Fix | Delete
if (!property) {
[43877] Fix | Delete
if (pdfFont.name.includes("Bold") || pdfFont.psName?.includes("Bold")) {
[43878] Fix | Delete
property = "bold";
[43879] Fix | Delete
}
[43880] Fix | Delete
if (pdfFont.name.includes("Italic") || pdfFont.name.endsWith("It") || pdfFont.psName?.includes("Italic") || pdfFont.psName?.endsWith("It")) {
[43881] Fix | Delete
property += "italic";
[43882] Fix | Delete
}
[43883] Fix | Delete
}
[43884] Fix | Delete
if (!property) {
[43885] Fix | Delete
property = "regular";
[43886] Fix | Delete
}
[43887] Fix | Delete
font[property] = pdfFont;
[43888] Fix | Delete
}
[43889] Fix | Delete
getDefault() {
[43890] Fix | Delete
return this.defaultFont;
[43891] Fix | Delete
}
[43892] Fix | Delete
find(fontName, mustWarn = true) {
[43893] Fix | Delete
let font = this.fonts.get(fontName) || this.cache.get(fontName);
[43894] Fix | Delete
if (font) {
[43895] Fix | Delete
return font;
[43896] Fix | Delete
}
[43897] Fix | Delete
const pattern = /,|-|_| |bolditalic|bold|italic|regular|it/gi;
[43898] Fix | Delete
let name = fontName.replaceAll(pattern, "");
[43899] Fix | Delete
font = this.fonts.get(name);
[43900] Fix | Delete
if (font) {
[43901] Fix | Delete
this.cache.set(fontName, font);
[43902] Fix | Delete
return font;
[43903] Fix | Delete
}
[43904] Fix | Delete
name = name.toLowerCase();
[43905] Fix | Delete
const maybe = [];
[43906] Fix | Delete
for (const [family, pdfFont] of this.fonts.entries()) {
[43907] Fix | Delete
if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
[43908] Fix | Delete
maybe.push(pdfFont);
[43909] Fix | Delete
}
[43910] Fix | Delete
}
[43911] Fix | Delete
if (maybe.length === 0) {
[43912] Fix | Delete
for (const [, pdfFont] of this.fonts.entries()) {
[43913] Fix | Delete
if (pdfFont.regular.name?.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
[43914] Fix | Delete
maybe.push(pdfFont);
[43915] Fix | Delete
}
[43916] Fix | Delete
}
[43917] Fix | Delete
}
[43918] Fix | Delete
if (maybe.length === 0) {
[43919] Fix | Delete
name = name.replaceAll(/psmt|mt/gi, "");
[43920] Fix | Delete
for (const [family, pdfFont] of this.fonts.entries()) {
[43921] Fix | Delete
if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
[43922] Fix | Delete
maybe.push(pdfFont);
[43923] Fix | Delete
}
[43924] Fix | Delete
}
[43925] Fix | Delete
}
[43926] Fix | Delete
if (maybe.length === 0) {
[43927] Fix | Delete
for (const pdfFont of this.fonts.values()) {
[43928] Fix | Delete
if (pdfFont.regular.name?.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
[43929] Fix | Delete
maybe.push(pdfFont);
[43930] Fix | Delete
}
[43931] Fix | Delete
}
[43932] Fix | Delete
}
[43933] Fix | Delete
if (maybe.length >= 1) {
[43934] Fix | Delete
if (maybe.length !== 1 && mustWarn) {
[43935] Fix | Delete
warn(`XFA - Too many choices to guess the correct font: ${fontName}`);
[43936] Fix | Delete
}
[43937] Fix | Delete
this.cache.set(fontName, maybe[0]);
[43938] Fix | Delete
return maybe[0];
[43939] Fix | Delete
}
[43940] Fix | Delete
if (mustWarn && !this.warned.has(fontName)) {
[43941] Fix | Delete
this.warned.add(fontName);
[43942] Fix | Delete
warn(`XFA - Cannot find the font: ${fontName}`);
[43943] Fix | Delete
}
[43944] Fix | Delete
return null;
[43945] Fix | Delete
}
[43946] Fix | Delete
}
[43947] Fix | Delete
function selectFont(xfaFont, typeface) {
[43948] Fix | Delete
if (xfaFont.posture === "italic") {
[43949] Fix | Delete
if (xfaFont.weight === "bold") {
[43950] Fix | Delete
return typeface.bolditalic;
[43951] Fix | Delete
}
[43952] Fix | Delete
return typeface.italic;
[43953] Fix | Delete
} else if (xfaFont.weight === "bold") {
[43954] Fix | Delete
return typeface.bold;
[43955] Fix | Delete
}
[43956] Fix | Delete
return typeface.regular;
[43957] Fix | Delete
}
[43958] Fix | Delete
function fonts_getMetrics(xfaFont, real = false) {
[43959] Fix | Delete
let pdfFont = null;
[43960] Fix | Delete
if (xfaFont) {
[43961] Fix | Delete
const name = stripQuotes(xfaFont.typeface);
[43962] Fix | Delete
const typeface = xfaFont[$globalData].fontFinder.find(name);
[43963] Fix | Delete
pdfFont = selectFont(xfaFont, typeface);
[43964] Fix | Delete
}
[43965] Fix | Delete
if (!pdfFont) {
[43966] Fix | Delete
return {
[43967] Fix | Delete
lineHeight: 12,
[43968] Fix | Delete
lineGap: 2,
[43969] Fix | Delete
lineNoGap: 10
[43970] Fix | Delete
};
[43971] Fix | Delete
}
[43972] Fix | Delete
const size = xfaFont.size || 10;
[43973] Fix | Delete
const lineHeight = pdfFont.lineHeight ? Math.max(real ? 0 : 1.2, pdfFont.lineHeight) : 1.2;
[43974] Fix | Delete
const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap;
[43975] Fix | Delete
return {
[43976] Fix | Delete
lineHeight: lineHeight * size,
[43977] Fix | Delete
lineGap: lineGap * size,
[43978] Fix | Delete
lineNoGap: Math.max(1, lineHeight - lineGap) * size
[43979] Fix | Delete
};
[43980] Fix | Delete
}
[43981] Fix | Delete
[43982] Fix | Delete
;// CONCATENATED MODULE: ./src/core/xfa/text.js
[43983] Fix | Delete
[43984] Fix | Delete
[43985] Fix | Delete
[43986] Fix | Delete
[43987] Fix | Delete
const WIDTH_FACTOR = 1.02;
[43988] Fix | Delete
class FontInfo {
[43989] Fix | Delete
constructor(xfaFont, margin, lineHeight, fontFinder) {
[43990] Fix | Delete
this.lineHeight = lineHeight;
[43991] Fix | Delete
this.paraMargin = margin || {
[43992] Fix | Delete
top: 0,
[43993] Fix | Delete
bottom: 0,
[43994] Fix | Delete
left: 0,
[43995] Fix | Delete
right: 0
[43996] Fix | Delete
};
[43997] Fix | Delete
if (!xfaFont) {
[43998] Fix | Delete
[this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder);
[43999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function