| 1 |
/** |
| 2 |
* @licstart The following is the entire license notice for the |
| 3 |
* JavaScript code in this page |
| 4 |
* |
| 5 |
* Copyright 2024 Mozilla Foundation |
| 6 |
* |
| 7 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 |
* you may not use this file except in compliance with the License. |
| 9 |
* You may obtain a copy of the License at |
| 10 |
* |
| 11 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 12 |
* |
| 13 |
* Unless required by applicable law or agreed to in writing, software |
| 14 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 15 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 |
* See the License for the specific language governing permissions and |
| 17 |
* limitations under the License. |
| 18 |
* |
| 19 |
* @licend The above is the entire license notice for the |
| 20 |
* JavaScript code in this page |
| 21 |
*/ |
| 22 |
|
| 23 |
/******/ // The require scope |
| 24 |
/******/ var __webpack_require__ = {}; |
| 25 |
/******/ |
| 26 |
/************************************************************************/ |
| 27 |
/******/ /* webpack/runtime/define property getters */ |
| 28 |
/******/ (() => { |
| 29 |
/******/ // define getter functions for harmony exports |
| 30 |
/******/ __webpack_require__.d = (exports, definition) => { |
| 31 |
/******/ for(var key in definition) { |
| 32 |
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| 33 |
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| 34 |
/******/ } |
| 35 |
/******/ } |
| 36 |
/******/ }; |
| 37 |
/******/ })(); |
| 38 |
/******/ |
| 39 |
/******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| 40 |
/******/ (() => { |
| 41 |
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| 42 |
/******/ })(); |
| 43 |
/******/ |
| 44 |
/************************************************************************/ |
| 45 |
var __webpack_exports__ = globalThis.pdfjsWorker = {}; |
| 46 |
|
| 47 |
// EXPORTS |
| 48 |
__webpack_require__.d(__webpack_exports__, { |
| 49 |
WorkerMessageHandler: () => (/* reexport */ WorkerMessageHandler) |
| 50 |
}); |
| 51 |
|
| 52 |
;// ./src/shared/util.js |
| 53 |
const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"); |
| 54 |
const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; |
| 55 |
const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; |
| 56 |
const MAX_IMAGE_SIZE_TO_CACHE = 10e6; |
| 57 |
const LINE_FACTOR = 1.35; |
| 58 |
const LINE_DESCENT_FACTOR = 0.35; |
| 59 |
const BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR; |
| 60 |
const RenderingIntentFlag = { |
| 61 |
ANY: 0x01, |
| 62 |
DISPLAY: 0x02, |
| 63 |
PRINT: 0x04, |
| 64 |
SAVE: 0x08, |
| 65 |
ANNOTATIONS_FORMS: 0x10, |
| 66 |
ANNOTATIONS_STORAGE: 0x20, |
| 67 |
ANNOTATIONS_DISABLE: 0x40, |
| 68 |
IS_EDITING: 0x80, |
| 69 |
OPLIST: 0x100 |
| 70 |
}; |
| 71 |
const AnnotationMode = { |
| 72 |
DISABLE: 0, |
| 73 |
ENABLE: 1, |
| 74 |
ENABLE_FORMS: 2, |
| 75 |
ENABLE_STORAGE: 3 |
| 76 |
}; |
| 77 |
const AnnotationEditorPrefix = "pdfjs_internal_editor_"; |
| 78 |
const AnnotationEditorType = { |
| 79 |
DISABLE: -1, |
| 80 |
NONE: 0, |
| 81 |
FREETEXT: 3, |
| 82 |
HIGHLIGHT: 9, |
| 83 |
STAMP: 13, |
| 84 |
INK: 15 |
| 85 |
}; |
| 86 |
const AnnotationEditorParamsType = { |
| 87 |
RESIZE: 1, |
| 88 |
CREATE: 2, |
| 89 |
FREETEXT_SIZE: 11, |
| 90 |
FREETEXT_COLOR: 12, |
| 91 |
FREETEXT_OPACITY: 13, |
| 92 |
INK_COLOR: 21, |
| 93 |
INK_THICKNESS: 22, |
| 94 |
INK_OPACITY: 23, |
| 95 |
HIGHLIGHT_COLOR: 31, |
| 96 |
HIGHLIGHT_DEFAULT_COLOR: 32, |
| 97 |
HIGHLIGHT_THICKNESS: 33, |
| 98 |
HIGHLIGHT_FREE: 34, |
| 99 |
HIGHLIGHT_SHOW_ALL: 35 |
| 100 |
}; |
| 101 |
const PermissionFlag = { |
| 102 |
PRINT: 0x04, |
| 103 |
MODIFY_CONTENTS: 0x08, |
| 104 |
COPY: 0x10, |
| 105 |
MODIFY_ANNOTATIONS: 0x20, |
| 106 |
FILL_INTERACTIVE_FORMS: 0x100, |
| 107 |
COPY_FOR_ACCESSIBILITY: 0x200, |
| 108 |
ASSEMBLE: 0x400, |
| 109 |
PRINT_HIGH_QUALITY: 0x800 |
| 110 |
}; |
| 111 |
const TextRenderingMode = { |
| 112 |
FILL: 0, |
| 113 |
STROKE: 1, |
| 114 |
FILL_STROKE: 2, |
| 115 |
INVISIBLE: 3, |
| 116 |
FILL_ADD_TO_PATH: 4, |
| 117 |
STROKE_ADD_TO_PATH: 5, |
| 118 |
FILL_STROKE_ADD_TO_PATH: 6, |
| 119 |
ADD_TO_PATH: 7, |
| 120 |
FILL_STROKE_MASK: 3, |
| 121 |
ADD_TO_PATH_FLAG: 4 |
| 122 |
}; |
| 123 |
const ImageKind = { |
| 124 |
GRAYSCALE_1BPP: 1, |
| 125 |
RGB_24BPP: 2, |
| 126 |
RGBA_32BPP: 3 |
| 127 |
}; |
| 128 |
const AnnotationType = { |
| 129 |
TEXT: 1, |
| 130 |
LINK: 2, |
| 131 |
FREETEXT: 3, |
| 132 |
LINE: 4, |
| 133 |
SQUARE: 5, |
| 134 |
CIRCLE: 6, |
| 135 |
POLYGON: 7, |
| 136 |
POLYLINE: 8, |
| 137 |
HIGHLIGHT: 9, |
| 138 |
UNDERLINE: 10, |
| 139 |
SQUIGGLY: 11, |
| 140 |
STRIKEOUT: 12, |
| 141 |
STAMP: 13, |
| 142 |
CARET: 14, |
| 143 |
INK: 15, |
| 144 |
POPUP: 16, |
| 145 |
FILEATTACHMENT: 17, |
| 146 |
SOUND: 18, |
| 147 |
MOVIE: 19, |
| 148 |
WIDGET: 20, |
| 149 |
SCREEN: 21, |
| 150 |
PRINTERMARK: 22, |
| 151 |
TRAPNET: 23, |
| 152 |
WATERMARK: 24, |
| 153 |
THREED: 25, |
| 154 |
REDACT: 26 |
| 155 |
}; |
| 156 |
const AnnotationReplyType = { |
| 157 |
GROUP: "Group", |
| 158 |
REPLY: "R" |
| 159 |
}; |
| 160 |
const AnnotationFlag = { |
| 161 |
INVISIBLE: 0x01, |
| 162 |
HIDDEN: 0x02, |
| 163 |
PRINT: 0x04, |
| 164 |
NOZOOM: 0x08, |
| 165 |
NOROTATE: 0x10, |
| 166 |
NOVIEW: 0x20, |
| 167 |
READONLY: 0x40, |
| 168 |
LOCKED: 0x80, |
| 169 |
TOGGLENOVIEW: 0x100, |
| 170 |
LOCKEDCONTENTS: 0x200 |
| 171 |
}; |
| 172 |
const AnnotationFieldFlag = { |
| 173 |
READONLY: 0x0000001, |
| 174 |
REQUIRED: 0x0000002, |
| 175 |
NOEXPORT: 0x0000004, |
| 176 |
MULTILINE: 0x0001000, |
| 177 |
PASSWORD: 0x0002000, |
| 178 |
NOTOGGLETOOFF: 0x0004000, |
| 179 |
RADIO: 0x0008000, |
| 180 |
PUSHBUTTON: 0x0010000, |
| 181 |
COMBO: 0x0020000, |
| 182 |
EDIT: 0x0040000, |
| 183 |
SORT: 0x0080000, |
| 184 |
FILESELECT: 0x0100000, |
| 185 |
MULTISELECT: 0x0200000, |
| 186 |
DONOTSPELLCHECK: 0x0400000, |
| 187 |
DONOTSCROLL: 0x0800000, |
| 188 |
COMB: 0x1000000, |
| 189 |
RICHTEXT: 0x2000000, |
| 190 |
RADIOSINUNISON: 0x2000000, |
| 191 |
COMMITONSELCHANGE: 0x4000000 |
| 192 |
}; |
| 193 |
const AnnotationBorderStyleType = { |
| 194 |
SOLID: 1, |
| 195 |
DASHED: 2, |
| 196 |
BEVELED: 3, |
| 197 |
INSET: 4, |
| 198 |
UNDERLINE: 5 |
| 199 |
}; |
| 200 |
const AnnotationActionEventType = { |
| 201 |
E: "Mouse Enter", |
| 202 |
X: "Mouse Exit", |
| 203 |
D: "Mouse Down", |
| 204 |
U: "Mouse Up", |
| 205 |
Fo: "Focus", |
| 206 |
Bl: "Blur", |
| 207 |
PO: "PageOpen", |
| 208 |
PC: "PageClose", |
| 209 |
PV: "PageVisible", |
| 210 |
PI: "PageInvisible", |
| 211 |
K: "Keystroke", |
| 212 |
F: "Format", |
| 213 |
V: "Validate", |
| 214 |
C: "Calculate" |
| 215 |
}; |
| 216 |
const DocumentActionEventType = { |
| 217 |
WC: "WillClose", |
| 218 |
WS: "WillSave", |
| 219 |
DS: "DidSave", |
| 220 |
WP: "WillPrint", |
| 221 |
DP: "DidPrint" |
| 222 |
}; |
| 223 |
const PageActionEventType = { |
| 224 |
O: "PageOpen", |
| 225 |
C: "PageClose" |
| 226 |
}; |
| 227 |
const VerbosityLevel = { |
| 228 |
ERRORS: 0, |
| 229 |
WARNINGS: 1, |
| 230 |
INFOS: 5 |
| 231 |
}; |
| 232 |
const CMapCompressionType = { |
| 233 |
NONE: 0, |
| 234 |
BINARY: 1 |
| 235 |
}; |
| 236 |
const OPS = { |
| 237 |
dependency: 1, |
| 238 |
setLineWidth: 2, |
| 239 |
setLineCap: 3, |
| 240 |
setLineJoin: 4, |
| 241 |
setMiterLimit: 5, |
| 242 |
setDash: 6, |
| 243 |
setRenderingIntent: 7, |
| 244 |
setFlatness: 8, |
| 245 |
setGState: 9, |
| 246 |
save: 10, |
| 247 |
restore: 11, |
| 248 |
transform: 12, |
| 249 |
moveTo: 13, |
| 250 |
lineTo: 14, |
| 251 |
curveTo: 15, |
| 252 |
curveTo2: 16, |
| 253 |
curveTo3: 17, |
| 254 |
closePath: 18, |
| 255 |
rectangle: 19, |
| 256 |
stroke: 20, |
| 257 |
closeStroke: 21, |
| 258 |
fill: 22, |
| 259 |
eoFill: 23, |
| 260 |
fillStroke: 24, |
| 261 |
eoFillStroke: 25, |
| 262 |
closeFillStroke: 26, |
| 263 |
closeEOFillStroke: 27, |
| 264 |
endPath: 28, |
| 265 |
clip: 29, |
| 266 |
eoClip: 30, |
| 267 |
beginText: 31, |
| 268 |
endText: 32, |
| 269 |
setCharSpacing: 33, |
| 270 |
setWordSpacing: 34, |
| 271 |
setHScale: 35, |
| 272 |
setLeading: 36, |
| 273 |
setFont: 37, |
| 274 |
setTextRenderingMode: 38, |
| 275 |
setTextRise: 39, |
| 276 |
moveText: 40, |
| 277 |
setLeadingMoveText: 41, |
| 278 |
setTextMatrix: 42, |
| 279 |
nextLine: 43, |
| 280 |
showText: 44, |
| 281 |
showSpacedText: 45, |
| 282 |
nextLineShowText: 46, |
| 283 |
nextLineSetSpacingShowText: 47, |
| 284 |
setCharWidth: 48, |
| 285 |
setCharWidthAndBounds: 49, |
| 286 |
setStrokeColorSpace: 50, |
| 287 |
setFillColorSpace: 51, |
| 288 |
setStrokeColor: 52, |
| 289 |
setStrokeColorN: 53, |
| 290 |
setFillColor: 54, |
| 291 |
setFillColorN: 55, |
| 292 |
setStrokeGray: 56, |
| 293 |
setFillGray: 57, |
| 294 |
setStrokeRGBColor: 58, |
| 295 |
setFillRGBColor: 59, |
| 296 |
setStrokeCMYKColor: 60, |
| 297 |
setFillCMYKColor: 61, |
| 298 |
shadingFill: 62, |
| 299 |
beginInlineImage: 63, |
| 300 |
beginImageData: 64, |
| 301 |
endInlineImage: 65, |
| 302 |
paintXObject: 66, |
| 303 |
markPoint: 67, |
| 304 |
markPointProps: 68, |
| 305 |
beginMarkedContent: 69, |
| 306 |
beginMarkedContentProps: 70, |
| 307 |
endMarkedContent: 71, |
| 308 |
beginCompat: 72, |
| 309 |
endCompat: 73, |
| 310 |
paintFormXObjectBegin: 74, |
| 311 |
paintFormXObjectEnd: 75, |
| 312 |
beginGroup: 76, |
| 313 |
endGroup: 77, |
| 314 |
beginAnnotation: 80, |
| 315 |
endAnnotation: 81, |
| 316 |
paintImageMaskXObject: 83, |
| 317 |
paintImageMaskXObjectGroup: 84, |
| 318 |
paintImageXObject: 85, |
| 319 |
paintInlineImageXObject: 86, |
| 320 |
paintInlineImageXObjectGroup: 87, |
| 321 |
paintImageXObjectRepeat: 88, |
| 322 |
paintImageMaskXObjectRepeat: 89, |
| 323 |
paintSolidColorImageMask: 90, |
| 324 |
constructPath: 91, |
| 325 |
setStrokeTransparent: 92, |
| 326 |
setFillTransparent: 93 |
| 327 |
}; |
| 328 |
const PasswordResponses = { |
| 329 |
NEED_PASSWORD: 1, |
| 330 |
INCORRECT_PASSWORD: 2 |
| 331 |
}; |
| 332 |
let verbosity = VerbosityLevel.WARNINGS; |
| 333 |
function setVerbosityLevel(level) { |
| 334 |
if (Number.isInteger(level)) { |
| 335 |
verbosity = level; |
| 336 |
} |
| 337 |
} |
| 338 |
function getVerbosityLevel() { |
| 339 |
return verbosity; |
| 340 |
} |
| 341 |
function info(msg) { |
| 342 |
if (verbosity >= VerbosityLevel.INFOS) { |
| 343 |
console.log(`Info: ${msg}`); |
| 344 |
} |
| 345 |
} |
| 346 |
function warn(msg) { |
| 347 |
if (verbosity >= VerbosityLevel.WARNINGS) { |
| 348 |
console.log(`Warning: ${msg}`); |
| 349 |
} |
| 350 |
} |
| 351 |
function unreachable(msg) { |
| 352 |
throw new Error(msg); |
| 353 |
} |
| 354 |
function assert(cond, msg) { |
| 355 |
if (!cond) { |
| 356 |
unreachable(msg); |
| 357 |
} |
| 358 |
} |
| 359 |
function _isValidProtocol(url) { |
| 360 |
switch (url?.protocol) { |
| 361 |
case "http:": |
| 362 |
case "https:": |
| 363 |
case "ftp:": |
| 364 |
case "mailto:": |
| 365 |
case "tel:": |
| 366 |
return true; |
| 367 |
default: |
| 368 |
return false; |
| 369 |
} |
| 370 |
} |
| 371 |
function createValidAbsoluteUrl(url, baseUrl = null, options = null) { |
| 372 |
if (!url) { |
| 373 |
return null; |
| 374 |
} |
| 375 |
try { |
| 376 |
if (options && typeof url === "string") { |
| 377 |
if (options.addDefaultProtocol && url.startsWith("www.")) { |
| 378 |
const dots = url.match(/\./g); |
| 379 |
if (dots?.length >= 2) { |
| 380 |
url = `http://${url}`; |
| 381 |
} |
| 382 |
} |
| 383 |
if (options.tryConvertEncoding) { |
| 384 |
try { |
| 385 |
url = stringToUTF8String(url); |
| 386 |
} catch {} |
| 387 |
} |
| 388 |
} |
| 389 |
const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url); |
| 390 |
if (_isValidProtocol(absoluteUrl)) { |
| 391 |
return absoluteUrl; |
| 392 |
} |
| 393 |
} catch {} |
| 394 |
return null; |
| 395 |
} |
| 396 |
function shadow(obj, prop, value, nonSerializable = false) { |
| 397 |
Object.defineProperty(obj, prop, { |
| 398 |
value, |
| 399 |
enumerable: !nonSerializable, |
| 400 |
configurable: true, |
| 401 |
writable: false |
| 402 |
}); |
| 403 |
return value; |
| 404 |
} |
| 405 |
const BaseException = function BaseExceptionClosure() { |
| 406 |
function BaseException(message, name) { |
| 407 |
this.message = message; |
| 408 |
this.name = name; |
| 409 |
} |
| 410 |
BaseException.prototype = new Error(); |
| 411 |
BaseException.constructor = BaseException; |
| 412 |
return BaseException; |
| 413 |
}(); |
| 414 |
class PasswordException extends BaseException { |
| 415 |
constructor(msg, code) { |
| 416 |
super(msg, "PasswordException"); |
| 417 |
this.code = code; |
| 418 |
} |
| 419 |
} |
| 420 |
class UnknownErrorException extends BaseException { |
| 421 |
constructor(msg, details) { |
| 422 |
super(msg, "UnknownErrorException"); |
| 423 |
this.details = details; |
| 424 |
} |
| 425 |
} |
| 426 |
class InvalidPDFException extends BaseException { |
| 427 |
constructor(msg) { |
| 428 |
super(msg, "InvalidPDFException"); |
| 429 |
} |
| 430 |
} |
| 431 |
class MissingPDFException extends BaseException { |
| 432 |
constructor(msg) { |
| 433 |
super(msg, "MissingPDFException"); |
| 434 |
} |
| 435 |
} |
| 436 |
class UnexpectedResponseException extends BaseException { |
| 437 |
constructor(msg, status) { |
| 438 |
super(msg, "UnexpectedResponseException"); |
| 439 |
this.status = status; |
| 440 |
} |
| 441 |
} |
| 442 |
class FormatError extends BaseException { |
| 443 |
constructor(msg) { |
| 444 |
super(msg, "FormatError"); |
| 445 |
} |
| 446 |
} |
| 447 |
class AbortException extends BaseException { |
| 448 |
constructor(msg) { |
| 449 |
super(msg, "AbortException"); |
| 450 |
} |
| 451 |
} |
| 452 |
function bytesToString(bytes) { |
| 453 |
if (typeof bytes !== "object" || bytes?.length === undefined) { |
| 454 |
unreachable("Invalid argument for bytesToString"); |
| 455 |
} |
| 456 |
const length = bytes.length; |
| 457 |
const MAX_ARGUMENT_COUNT = 8192; |
| 458 |
if (length < MAX_ARGUMENT_COUNT) { |
| 459 |
return String.fromCharCode.apply(null, bytes); |
| 460 |
} |
| 461 |
const strBuf = []; |
| 462 |
for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) { |
| 463 |
const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); |
| 464 |
const chunk = bytes.subarray(i, chunkEnd); |
| 465 |
strBuf.push(String.fromCharCode.apply(null, chunk)); |
| 466 |
} |
| 467 |
return strBuf.join(""); |
| 468 |
} |
| 469 |
function stringToBytes(str) { |
| 470 |
if (typeof str !== "string") { |
| 471 |
unreachable("Invalid argument for stringToBytes"); |
| 472 |
} |
| 473 |
const length = str.length; |
| 474 |
const bytes = new Uint8Array(length); |
| 475 |
for (let i = 0; i < length; ++i) { |
| 476 |
bytes[i] = str.charCodeAt(i) & 0xff; |
| 477 |
} |
| 478 |
return bytes; |
| 479 |
} |
| 480 |
function string32(value) { |
| 481 |
return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); |
| 482 |
} |
| 483 |
function objectSize(obj) { |
| 484 |
return Object.keys(obj).length; |
| 485 |
} |
| 486 |
function objectFromMap(map) { |
| 487 |
const obj = Object.create(null); |
| 488 |
for (const [key, value] of map) { |
| 489 |
obj[key] = value; |
| 490 |
} |
| 491 |
return obj; |
| 492 |
} |
| 493 |
function isLittleEndian() { |
| 494 |
const buffer8 = new Uint8Array(4); |
| 495 |
buffer8[0] = 1; |
| 496 |
const view32 = new Uint32Array(buffer8.buffer, 0, 1); |
| 497 |
return view32[0] === 1; |
| 498 |
} |
| 499 |
function isEvalSupported() { |
| 500 |
try { |
| 501 |
new Function(""); |
| 502 |
return true; |
| 503 |
} catch { |
| 504 |
return false; |
| 505 |
} |
| 506 |
} |
| 507 |
class FeatureTest { |
| 508 |
static get isLittleEndian() { |
| 509 |
return shadow(this, "isLittleEndian", isLittleEndian()); |
| 510 |
} |
| 511 |
static get isEvalSupported() { |
| 512 |
return shadow(this, "isEvalSupported", isEvalSupported()); |
| 513 |
} |
| 514 |
static get isOffscreenCanvasSupported() { |
| 515 |
return shadow(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas !== "undefined"); |
| 516 |
} |
| 517 |
static get platform() { |
| 518 |
if (typeof navigator !== "undefined" && typeof navigator?.platform === "string") { |
| 519 |
return shadow(this, "platform", { |
| 520 |
isMac: navigator.platform.includes("Mac"), |
| 521 |
isWindows: navigator.platform.includes("Win"), |
| 522 |
isFirefox: typeof navigator?.userAgent === "string" && navigator.userAgent.includes("Firefox") |
| 523 |
}); |
| 524 |
} |
| 525 |
return shadow(this, "platform", { |
| 526 |
isMac: false, |
| 527 |
isWindows: false, |
| 528 |
isFirefox: false |
| 529 |
}); |
| 530 |
} |
| 531 |
static get isCSSRoundSupported() { |
| 532 |
return shadow(this, "isCSSRoundSupported", globalThis.CSS?.supports?.("width: round(1.5px, 1px)")); |
| 533 |
} |
| 534 |
} |
| 535 |
const hexNumbers = Array.from(Array(256).keys(), n => n.toString(16).padStart(2, "0")); |
| 536 |
class Util { |
| 537 |
static makeHexColor(r, g, b) { |
| 538 |
return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`; |
| 539 |
} |
| 540 |
static scaleMinMax(transform, minMax) { |
| 541 |
let temp; |
| 542 |
if (transform[0]) { |
| 543 |
if (transform[0] < 0) { |
| 544 |
temp = minMax[0]; |
| 545 |
minMax[0] = minMax[2]; |
| 546 |
minMax[2] = temp; |
| 547 |
} |
| 548 |
minMax[0] *= transform[0]; |
| 549 |
minMax[2] *= transform[0]; |
| 550 |
if (transform[3] < 0) { |
| 551 |
temp = minMax[1]; |
| 552 |
minMax[1] = minMax[3]; |
| 553 |
minMax[3] = temp; |
| 554 |
} |
| 555 |
minMax[1] *= transform[3]; |
| 556 |
minMax[3] *= transform[3]; |
| 557 |
} else { |
| 558 |
temp = minMax[0]; |
| 559 |
minMax[0] = minMax[1]; |
| 560 |
minMax[1] = temp; |
| 561 |
temp = minMax[2]; |
| 562 |
minMax[2] = minMax[3]; |
| 563 |
minMax[3] = temp; |
| 564 |
if (transform[1] < 0) { |
| 565 |
temp = minMax[1]; |
| 566 |
minMax[1] = minMax[3]; |
| 567 |
minMax[3] = temp; |
| 568 |
} |
| 569 |
minMax[1] *= transform[1]; |
| 570 |
minMax[3] *= transform[1]; |
| 571 |
if (transform[2] < 0) { |
| 572 |
temp = minMax[0]; |
| 573 |
minMax[0] = minMax[2]; |
| 574 |
minMax[2] = temp; |
| 575 |
} |
| 576 |
minMax[0] *= transform[2]; |
| 577 |
minMax[2] *= transform[2]; |
| 578 |
} |
| 579 |
minMax[0] += transform[4]; |
| 580 |
minMax[1] += transform[5]; |
| 581 |
minMax[2] += transform[4]; |
| 582 |
minMax[3] += transform[5]; |
| 583 |
} |
| 584 |
static transform(m1, m2) { |
| 585 |
return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]]; |
| 586 |
} |
| 587 |
static applyTransform(p, m) { |
| 588 |
const xt = p[0] * m[0] + p[1] * m[2] + m[4]; |
| 589 |
const yt = p[0] * m[1] + p[1] * m[3] + m[5]; |
| 590 |
return [xt, yt]; |
| 591 |
} |
| 592 |
static applyInverseTransform(p, m) { |
| 593 |
const d = m[0] * m[3] - m[1] * m[2]; |
| 594 |
const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; |
| 595 |
const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; |
| 596 |
return [xt, yt]; |
| 597 |
} |
| 598 |
static getAxialAlignedBoundingBox(r, m) { |
| 599 |
const p1 = this.applyTransform(r, m); |
| 600 |
const p2 = this.applyTransform(r.slice(2, 4), m); |
| 601 |
const p3 = this.applyTransform([r[0], r[3]], m); |
| 602 |
const p4 = this.applyTransform([r[2], r[1]], m); |
| 603 |
return [Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1])]; |
| 604 |
} |
| 605 |
static inverseTransform(m) { |
| 606 |
const d = m[0] * m[3] - m[1] * m[2]; |
| 607 |
return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; |
| 608 |
} |
| 609 |
static singularValueDecompose2dScale(m) { |
| 610 |
const transpose = [m[0], m[2], m[1], m[3]]; |
| 611 |
const a = m[0] * transpose[0] + m[1] * transpose[2]; |
| 612 |
const b = m[0] * transpose[1] + m[1] * transpose[3]; |
| 613 |
const c = m[2] * transpose[0] + m[3] * transpose[2]; |
| 614 |
const d = m[2] * transpose[1] + m[3] * transpose[3]; |
| 615 |
const first = (a + d) / 2; |
| 616 |
const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2; |
| 617 |
const sx = first + second || 1; |
| 618 |
const sy = first - second || 1; |
| 619 |
return [Math.sqrt(sx), Math.sqrt(sy)]; |
| 620 |
} |
| 621 |
static normalizeRect(rect) { |
| 622 |
const r = rect.slice(0); |
| 623 |
if (rect[0] > rect[2]) { |
| 624 |
r[0] = rect[2]; |
| 625 |
r[2] = rect[0]; |
| 626 |
} |
| 627 |
if (rect[1] > rect[3]) { |
| 628 |
r[1] = rect[3]; |
| 629 |
r[3] = rect[1]; |
| 630 |
} |
| 631 |
return r; |
| 632 |
} |
| 633 |
static intersect(rect1, rect2) { |
| 634 |
const xLow = Math.max(Math.min(rect1[0], rect1[2]), Math.min(rect2[0], rect2[2])); |
| 635 |
const xHigh = Math.min(Math.max(rect1[0], rect1[2]), Math.max(rect2[0], rect2[2])); |
| 636 |
if (xLow > xHigh) { |
| 637 |
return null; |
| 638 |
} |
| 639 |
const yLow = Math.max(Math.min(rect1[1], rect1[3]), Math.min(rect2[1], rect2[3])); |
| 640 |
const yHigh = Math.min(Math.max(rect1[1], rect1[3]), Math.max(rect2[1], rect2[3])); |
| 641 |
if (yLow > yHigh) { |
| 642 |
return null; |
| 643 |
} |
| 644 |
return [xLow, yLow, xHigh, yHigh]; |
| 645 |
} |
| 646 |
static #getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, t, minMax) { |
| 647 |
if (t <= 0 || t >= 1) { |
| 648 |
return; |
| 649 |
} |
| 650 |
const mt = 1 - t; |
| 651 |
const tt = t * t; |
| 652 |
const ttt = tt * t; |
| 653 |
const x = mt * (mt * (mt * x0 + 3 * t * x1) + 3 * tt * x2) + ttt * x3; |
| 654 |
const y = mt * (mt * (mt * y0 + 3 * t * y1) + 3 * tt * y2) + ttt * y3; |
| 655 |
minMax[0] = Math.min(minMax[0], x); |
| 656 |
minMax[1] = Math.min(minMax[1], y); |
| 657 |
minMax[2] = Math.max(minMax[2], x); |
| 658 |
minMax[3] = Math.max(minMax[3], y); |
| 659 |
} |
| 660 |
static #getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, a, b, c, minMax) { |
| 661 |
if (Math.abs(a) < 1e-12) { |
| 662 |
if (Math.abs(b) >= 1e-12) { |
| 663 |
this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, -c / b, minMax); |
| 664 |
} |
| 665 |
return; |
| 666 |
} |
| 667 |
const delta = b ** 2 - 4 * c * a; |
| 668 |
if (delta < 0) { |
| 669 |
return; |
| 670 |
} |
| 671 |
const sqrtDelta = Math.sqrt(delta); |
| 672 |
const a2 = 2 * a; |
| 673 |
this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b + sqrtDelta) / a2, minMax); |
| 674 |
this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b - sqrtDelta) / a2, minMax); |
| 675 |
} |
| 676 |
static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax) { |
| 677 |
if (minMax) { |
| 678 |
minMax[0] = Math.min(minMax[0], x0, x3); |
| 679 |
minMax[1] = Math.min(minMax[1], y0, y3); |
| 680 |
minMax[2] = Math.max(minMax[2], x0, x3); |
| 681 |
minMax[3] = Math.max(minMax[3], y0, y3); |
| 682 |
} else { |
| 683 |
minMax = [Math.min(x0, x3), Math.min(y0, y3), Math.max(x0, x3), Math.max(y0, y3)]; |
| 684 |
} |
| 685 |
this.#getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, 3 * (-x0 + 3 * (x1 - x2) + x3), 6 * (x0 - 2 * x1 + x2), 3 * (x1 - x0), minMax); |
| 686 |
this.#getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, 3 * (-y0 + 3 * (y1 - y2) + y3), 6 * (y0 - 2 * y1 + y2), 3 * (y1 - y0), minMax); |
| 687 |
return minMax; |
| 688 |
} |
| 689 |
} |
| 690 |
const PDFStringTranslateTable = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8, 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018, 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d, 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac]; |
| 691 |
function stringToPDFString(str) { |
| 692 |
if (str[0] >= "\xEF") { |
| 693 |
let encoding; |
| 694 |
if (str[0] === "\xFE" && str[1] === "\xFF") { |
| 695 |
encoding = "utf-16be"; |
| 696 |
if (str.length % 2 === 1) { |
| 697 |
str = str.slice(0, -1); |
| 698 |
} |
| 699 |
} else if (str[0] === "\xFF" && str[1] === "\xFE") { |
| 700 |
encoding = "utf-16le"; |
| 701 |
if (str.length % 2 === 1) { |
| 702 |
str = str.slice(0, -1); |
| 703 |
} |
| 704 |
} else if (str[0] === "\xEF" && str[1] === "\xBB" && str[2] === "\xBF") { |
| 705 |
encoding = "utf-8"; |
| 706 |
} |
| 707 |
if (encoding) { |
| 708 |
try { |
| 709 |
const decoder = new TextDecoder(encoding, { |
| 710 |
fatal: true |
| 711 |
}); |
| 712 |
const buffer = stringToBytes(str); |
| 713 |
const decoded = decoder.decode(buffer); |
| 714 |
if (!decoded.includes("\x1b")) { |
| 715 |
return decoded; |
| 716 |
} |
| 717 |
return decoded.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g, ""); |
| 718 |
} catch (ex) { |
| 719 |
warn(`stringToPDFString: "${ex}".`); |
| 720 |
} |
| 721 |
} |
| 722 |
} |
| 723 |
const strBuf = []; |
| 724 |
for (let i = 0, ii = str.length; i < ii; i++) { |
| 725 |
const charCode = str.charCodeAt(i); |
| 726 |
if (charCode === 0x1b) { |
| 727 |
while (++i < ii && str.charCodeAt(i) !== 0x1b) {} |
| 728 |
continue; |
| 729 |
} |
| 730 |
const code = PDFStringTranslateTable[charCode]; |
| 731 |
strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); |
| 732 |
} |
| 733 |
return strBuf.join(""); |
| 734 |
} |
| 735 |
function stringToUTF8String(str) { |
| 736 |
return decodeURIComponent(escape(str)); |
| 737 |
} |
| 738 |
function utf8StringToString(str) { |
| 739 |
return unescape(encodeURIComponent(str)); |
| 740 |
} |
| 741 |
function isArrayEqual(arr1, arr2) { |
| 742 |
if (arr1.length !== arr2.length) { |
| 743 |
return false; |
| 744 |
} |
| 745 |
for (let i = 0, ii = arr1.length; i < ii; i++) { |
| 746 |
if (arr1[i] !== arr2[i]) { |
| 747 |
return false; |
| 748 |
} |
| 749 |
} |
| 750 |
return true; |
| 751 |
} |
| 752 |
function getModificationDate(date = new Date()) { |
| 753 |
const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), date.getUTCDate().toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")]; |
| 754 |
return buffer.join(""); |
| 755 |
} |
| 756 |
let NormalizeRegex = null; |
| 757 |
let NormalizationMap = null; |
| 758 |
function normalizeUnicode(str) { |
| 759 |
if (!NormalizeRegex) { |
| 760 |
NormalizeRegex = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu; |
| 761 |
NormalizationMap = new Map([["ſt", "ſt"]]); |
| 762 |
} |
| 763 |
return str.replaceAll(NormalizeRegex, (_, p1, p2) => p1 ? p1.normalize("NFKC") : NormalizationMap.get(p2)); |
| 764 |
} |
| 765 |
function getUuid() { |
| 766 |
if (typeof crypto !== "undefined" && typeof crypto?.randomUUID === "function") { |
| 767 |
return crypto.randomUUID(); |
| 768 |
} |
| 769 |
const buf = new Uint8Array(32); |
| 770 |
if (typeof crypto !== "undefined" && typeof crypto?.getRandomValues === "function") { |
| 771 |
crypto.getRandomValues(buf); |
| 772 |
} else { |
| 773 |
for (let i = 0; i < 32; i++) { |
| 774 |
buf[i] = Math.floor(Math.random() * 255); |
| 775 |
} |
| 776 |
} |
| 777 |
return bytesToString(buf); |
| 778 |
} |
| 779 |
const AnnotationPrefix = "pdfjs_internal_id_"; |
| 780 |
const FontRenderOps = { |
| 781 |
BEZIER_CURVE_TO: 0, |
| 782 |
MOVE_TO: 1, |
| 783 |
LINE_TO: 2, |
| 784 |
QUADRATIC_CURVE_TO: 3, |
| 785 |
RESTORE: 4, |
| 786 |
SAVE: 5, |
| 787 |
SCALE: 6, |
| 788 |
TRANSFORM: 7, |
| 789 |
TRANSLATE: 8 |
| 790 |
}; |
| 791 |
|
| 792 |
;// ./src/core/primitives.js |
| 793 |
|
| 794 |
const CIRCULAR_REF = Symbol("CIRCULAR_REF"); |
| 795 |
const EOF = Symbol("EOF"); |
| 796 |
let CmdCache = Object.create(null); |
| 797 |
let NameCache = Object.create(null); |
| 798 |
let RefCache = Object.create(null); |
| 799 |
function clearPrimitiveCaches() { |
| 800 |
CmdCache = Object.create(null); |
| 801 |
NameCache = Object.create(null); |
| 802 |
RefCache = Object.create(null); |
| 803 |
} |
| 804 |
class Name { |
| 805 |
constructor(name) { |
| 806 |
this.name = name; |
| 807 |
} |
| 808 |
static get(name) { |
| 809 |
return NameCache[name] ||= new Name(name); |
| 810 |
} |
| 811 |
} |
| 812 |
class Cmd { |
| 813 |
constructor(cmd) { |
| 814 |
this.cmd = cmd; |
| 815 |
} |
| 816 |
static get(cmd) { |
| 817 |
return CmdCache[cmd] ||= new Cmd(cmd); |
| 818 |
} |
| 819 |
} |
| 820 |
const nonSerializable = function nonSerializableClosure() { |
| 821 |
return nonSerializable; |
| 822 |
}; |
| 823 |
class Dict { |
| 824 |
constructor(xref = null) { |
| 825 |
this._map = Object.create(null); |
| 826 |
this.xref = xref; |
| 827 |
this.objId = null; |
| 828 |
this.suppressEncryption = false; |
| 829 |
this.__nonSerializable__ = nonSerializable; |
| 830 |
} |
| 831 |
assignXref(newXref) { |
| 832 |
this.xref = newXref; |
| 833 |
} |
| 834 |
get size() { |
| 835 |
return Object.keys(this._map).length; |
| 836 |
} |
| 837 |
get(key1, key2, key3) { |
| 838 |
let value = this._map[key1]; |
| 839 |
if (value === undefined && key2 !== undefined) { |
| 840 |
value = this._map[key2]; |
| 841 |
if (value === undefined && key3 !== undefined) { |
| 842 |
value = this._map[key3]; |
| 843 |
} |
| 844 |
} |
| 845 |
if (value instanceof Ref && this.xref) { |
| 846 |
return this.xref.fetch(value, this.suppressEncryption); |
| 847 |
} |
| 848 |
return value; |
| 849 |
} |
| 850 |
async getAsync(key1, key2, key3) { |
| 851 |
let value = this._map[key1]; |
| 852 |
if (value === undefined && key2 !== undefined) { |
| 853 |
value = this._map[key2]; |
| 854 |
if (value === undefined && key3 !== undefined) { |
| 855 |
value = this._map[key3]; |
| 856 |
} |
| 857 |
} |
| 858 |
if (value instanceof Ref && this.xref) { |
| 859 |
return this.xref.fetchAsync(value, this.suppressEncryption); |
| 860 |
} |
| 861 |
return value; |
| 862 |
} |
| 863 |
getArray(key1, key2, key3) { |
| 864 |
let value = this._map[key1]; |
| 865 |
if (value === undefined && key2 !== undefined) { |
| 866 |
value = this._map[key2]; |
| 867 |
if (value === undefined && key3 !== undefined) { |
| 868 |
value = this._map[key3]; |
| 869 |
} |
| 870 |
} |
| 871 |
if (value instanceof Ref && this.xref) { |
| 872 |
value = this.xref.fetch(value, this.suppressEncryption); |
| 873 |
} |
| 874 |
if (Array.isArray(value)) { |
| 875 |
value = value.slice(); |
| 876 |
for (let i = 0, ii = value.length; i < ii; i++) { |
| 877 |
if (value[i] instanceof Ref && this.xref) { |
| 878 |
value[i] = this.xref.fetch(value[i], this.suppressEncryption); |
| 879 |
} |
| 880 |
} |
| 881 |
} |
| 882 |
return value; |
| 883 |
} |
| 884 |
getRaw(key) { |
| 885 |
return this._map[key]; |
| 886 |
} |
| 887 |
getKeys() { |
| 888 |
return Object.keys(this._map); |
| 889 |
} |
| 890 |
getRawValues() { |
| 891 |
return Object.values(this._map); |
| 892 |
} |
| 893 |
set(key, value) { |
| 894 |
this._map[key] = value; |
| 895 |
} |
| 896 |
has(key) { |
| 897 |
return this._map[key] !== undefined; |
| 898 |
} |
| 899 |
forEach(callback) { |
| 900 |
for (const key in this._map) { |
| 901 |
callback(key, this.get(key)); |
| 902 |
} |
| 903 |
} |
| 904 |
static get empty() { |
| 905 |
const emptyDict = new Dict(null); |
| 906 |
emptyDict.set = (key, value) => { |
| 907 |
unreachable("Should not call `set` on the empty dictionary."); |
| 908 |
}; |
| 909 |
return shadow(this, "empty", emptyDict); |
| 910 |
} |
| 911 |
static merge({ |
| 912 |
xref, |
| 913 |
dictArray, |
| 914 |
mergeSubDicts = false |
| 915 |
}) { |
| 916 |
const mergedDict = new Dict(xref), |
| 917 |
properties = new Map(); |
| 918 |
for (const dict of dictArray) { |
| 919 |
if (!(dict instanceof Dict)) { |
| 920 |
continue; |
| 921 |
} |
| 922 |
for (const [key, value] of Object.entries(dict._map)) { |
| 923 |
let property = properties.get(key); |
| 924 |
if (property === undefined) { |
| 925 |
property = []; |
| 926 |
properties.set(key, property); |
| 927 |
} else if (!mergeSubDicts || !(value instanceof Dict)) { |
| 928 |
continue; |
| 929 |
} |
| 930 |
property.push(value); |
| 931 |
} |
| 932 |
} |
| 933 |
for (const [name, values] of properties) { |
| 934 |
if (values.length === 1 || !(values[0] instanceof Dict)) { |
| 935 |
mergedDict._map[name] = values[0]; |
| 936 |
continue; |
| 937 |
} |
| 938 |
const subDict = new Dict(xref); |
| 939 |
for (const dict of values) { |
| 940 |
for (const [key, value] of Object.entries(dict._map)) { |
| 941 |
if (subDict._map[key] === undefined) { |
| 942 |
subDict._map[key] = value; |
| 943 |
} |
| 944 |
} |
| 945 |
} |
| 946 |
if (subDict.size > 0) { |
| 947 |
mergedDict._map[name] = subDict; |
| 948 |
} |
| 949 |
} |
| 950 |
properties.clear(); |
| 951 |
return mergedDict.size > 0 ? mergedDict : Dict.empty; |
| 952 |
} |
| 953 |
clone() { |
| 954 |
const dict = new Dict(this.xref); |
| 955 |
for (const key of this.getKeys()) { |
| 956 |
dict.set(key, this.getRaw(key)); |
| 957 |
} |
| 958 |
return dict; |
| 959 |
} |
| 960 |
delete(key) { |
| 961 |
delete this._map[key]; |
| 962 |
} |
| 963 |
} |
| 964 |
class Ref { |
| 965 |
constructor(num, gen) { |
| 966 |
this.num = num; |
| 967 |
this.gen = gen; |
| 968 |
} |
| 969 |
toString() { |
| 970 |
if (this.gen === 0) { |
| 971 |
return `${this.num}R`; |
| 972 |
} |
| 973 |
return `${this.num}R${this.gen}`; |
| 974 |
} |
| 975 |
static fromString(str) { |
| 976 |
const ref = RefCache[str]; |
| 977 |
if (ref) { |
| 978 |
return ref; |
| 979 |
} |
| 980 |
const m = /^(\d+)R(\d*)$/.exec(str); |
| 981 |
if (!m || m[1] === "0") { |
| 982 |
return null; |
| 983 |
} |
| 984 |
return RefCache[str] = new Ref(parseInt(m[1]), !m[2] ? 0 : parseInt(m[2])); |
| 985 |
} |
| 986 |
static get(num, gen) { |
| 987 |
const key = gen === 0 ? `${num}R` : `${num}R${gen}`; |
| 988 |
return RefCache[key] ||= new Ref(num, gen); |
| 989 |
} |
| 990 |
} |
| 991 |
class RefSet { |
| 992 |
constructor(parent = null) { |
| 993 |
this._set = new Set(parent?._set); |
| 994 |
} |
| 995 |
has(ref) { |
| 996 |
return this._set.has(ref.toString()); |
| 997 |
} |
| 998 |
put(ref) { |
| 999 |
this._set.add(ref.toString()); |
| 1000 |
} |
| 1001 |
remove(ref) { |
| 1002 |
this._set.delete(ref.toString()); |
| 1003 |
} |
| 1004 |
[Symbol.iterator]() { |
| 1005 |
return this._set.values(); |
| 1006 |
} |
| 1007 |
clear() { |
| 1008 |
this._set.clear(); |
| 1009 |
} |
| 1010 |
} |
| 1011 |
class RefSetCache { |
| 1012 |
constructor() { |
| 1013 |
this._map = new Map(); |
| 1014 |
} |
| 1015 |
get size() { |
| 1016 |
return this._map.size; |
| 1017 |
} |
| 1018 |
get(ref) { |
| 1019 |
return this._map.get(ref.toString()); |
| 1020 |
} |
| 1021 |
has(ref) { |
| 1022 |
return this._map.has(ref.toString()); |
| 1023 |
} |
| 1024 |
put(ref, obj) { |
| 1025 |
this._map.set(ref.toString(), obj); |
| 1026 |
} |
| 1027 |
putAlias(ref, aliasRef) { |
| 1028 |
this._map.set(ref.toString(), this.get(aliasRef)); |
| 1029 |
} |
| 1030 |
[Symbol.iterator]() { |
| 1031 |
return this._map.values(); |
| 1032 |
} |
| 1033 |
clear() { |
| 1034 |
this._map.clear(); |
| 1035 |
} |
| 1036 |
*items() { |
| 1037 |
for (const [ref, value] of this._map) { |
| 1038 |
yield [Ref.fromString(ref), value]; |
| 1039 |
} |
| 1040 |
} |
| 1041 |
} |
| 1042 |
function isName(v, name) { |
| 1043 |
return v instanceof Name && (name === undefined || v.name === name); |
| 1044 |
} |
| 1045 |
function isCmd(v, cmd) { |
| 1046 |
return v instanceof Cmd && (cmd === undefined || v.cmd === cmd); |
| 1047 |
} |
| 1048 |
function isDict(v, type) { |
| 1049 |
return v instanceof Dict && (type === undefined || isName(v.get("Type"), type)); |
| 1050 |
} |
| 1051 |
function isRefsEqual(v1, v2) { |
| 1052 |
return v1.num === v2.num && v1.gen === v2.gen; |
| 1053 |
} |
| 1054 |
|
| 1055 |
;// ./src/core/base_stream.js |
| 1056 |
|
| 1057 |
class BaseStream { |
| 1058 |
get length() { |
| 1059 |
unreachable("Abstract getter `length` accessed"); |
| 1060 |
} |
| 1061 |
get isEmpty() { |
| 1062 |
unreachable("Abstract getter `isEmpty` accessed"); |
| 1063 |
} |
| 1064 |
get isDataLoaded() { |
| 1065 |
return shadow(this, "isDataLoaded", true); |
| 1066 |
} |
| 1067 |
getByte() { |
| 1068 |
unreachable("Abstract method `getByte` called"); |
| 1069 |
} |
| 1070 |
getBytes(length) { |
| 1071 |
unreachable("Abstract method `getBytes` called"); |
| 1072 |
} |
| 1073 |
async getImageData(length, decoderOptions) { |
| 1074 |
return this.getBytes(length, decoderOptions); |
| 1075 |
} |
| 1076 |
async asyncGetBytes() { |
| 1077 |
unreachable("Abstract method `asyncGetBytes` called"); |
| 1078 |
} |
| 1079 |
get isAsync() { |
| 1080 |
return false; |
| 1081 |
} |
| 1082 |
get canAsyncDecodeImageFromBuffer() { |
| 1083 |
return false; |
| 1084 |
} |
| 1085 |
peekByte() { |
| 1086 |
const peekedByte = this.getByte(); |
| 1087 |
if (peekedByte !== -1) { |
| 1088 |
this.pos--; |
| 1089 |
} |
| 1090 |
return peekedByte; |
| 1091 |
} |
| 1092 |
peekBytes(length) { |
| 1093 |
const bytes = this.getBytes(length); |
| 1094 |
this.pos -= bytes.length; |
| 1095 |
return bytes; |
| 1096 |
} |
| 1097 |
getUint16() { |
| 1098 |
const b0 = this.getByte(); |
| 1099 |
const b1 = this.getByte(); |
| 1100 |
if (b0 === -1 || b1 === -1) { |
| 1101 |
return -1; |
| 1102 |
} |
| 1103 |
return (b0 << 8) + b1; |
| 1104 |
} |
| 1105 |
getInt32() { |
| 1106 |
const b0 = this.getByte(); |
| 1107 |
const b1 = this.getByte(); |
| 1108 |
const b2 = this.getByte(); |
| 1109 |
const b3 = this.getByte(); |
| 1110 |
return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; |
| 1111 |
} |
| 1112 |
getByteRange(begin, end) { |
| 1113 |
unreachable("Abstract method `getByteRange` called"); |
| 1114 |
} |
| 1115 |
getString(length) { |
| 1116 |
return bytesToString(this.getBytes(length)); |
| 1117 |
} |
| 1118 |
skip(n) { |
| 1119 |
this.pos += n || 1; |
| 1120 |
} |
| 1121 |
reset() { |
| 1122 |
unreachable("Abstract method `reset` called"); |
| 1123 |
} |
| 1124 |
moveStart() { |
| 1125 |
unreachable("Abstract method `moveStart` called"); |
| 1126 |
} |
| 1127 |
makeSubStream(start, length, dict = null) { |
| 1128 |
unreachable("Abstract method `makeSubStream` called"); |
| 1129 |
} |
| 1130 |
getBaseStreams() { |
| 1131 |
return null; |
| 1132 |
} |
| 1133 |
} |
| 1134 |
|
| 1135 |
;// ./src/core/core_utils.js |
| 1136 |
|
| 1137 |
|
| 1138 |
|
| 1139 |
const PDF_VERSION_REGEXP = /^[1-9]\.\d$/; |
| 1140 |
function getLookupTableFactory(initializer) { |
| 1141 |
let lookup; |
| 1142 |
return function () { |
| 1143 |
if (initializer) { |
| 1144 |
lookup = Object.create(null); |
| 1145 |
initializer(lookup); |
| 1146 |
initializer = null; |
| 1147 |
} |
| 1148 |
return lookup; |
| 1149 |
}; |
| 1150 |
} |
| 1151 |
class MissingDataException extends BaseException { |
| 1152 |
constructor(begin, end) { |
| 1153 |
super(`Missing data [${begin}, ${end})`, "MissingDataException"); |
| 1154 |
this.begin = begin; |
| 1155 |
this.end = end; |
| 1156 |
} |
| 1157 |
} |
| 1158 |
class ParserEOFException extends BaseException { |
| 1159 |
constructor(msg) { |
| 1160 |
super(msg, "ParserEOFException"); |
| 1161 |
} |
| 1162 |
} |
| 1163 |
class XRefEntryException extends BaseException { |
| 1164 |
constructor(msg) { |
| 1165 |
super(msg, "XRefEntryException"); |
| 1166 |
} |
| 1167 |
} |
| 1168 |
class XRefParseException extends BaseException { |
| 1169 |
constructor(msg) { |
| 1170 |
super(msg, "XRefParseException"); |
| 1171 |
} |
| 1172 |
} |
| 1173 |
function arrayBuffersToBytes(arr) { |
| 1174 |
const length = arr.length; |
| 1175 |
if (length === 0) { |
| 1176 |
return new Uint8Array(0); |
| 1177 |
} |
| 1178 |
if (length === 1) { |
| 1179 |
return new Uint8Array(arr[0]); |
| 1180 |
} |
| 1181 |
let dataLength = 0; |
| 1182 |
for (let i = 0; i < length; i++) { |
| 1183 |
dataLength += arr[i].byteLength; |
| 1184 |
} |
| 1185 |
const data = new Uint8Array(dataLength); |
| 1186 |
let pos = 0; |
| 1187 |
for (let i = 0; i < length; i++) { |
| 1188 |
const item = new Uint8Array(arr[i]); |
| 1189 |
data.set(item, pos); |
| 1190 |
pos += item.byteLength; |
| 1191 |
} |
| 1192 |
return data; |
| 1193 |
} |
| 1194 |
function getInheritableProperty({ |
| 1195 |
dict, |
| 1196 |
key, |
| 1197 |
getArray = false, |
| 1198 |
stopWhenFound = true |
| 1199 |
}) { |
| 1200 |
let values; |
| 1201 |
const visited = new RefSet(); |
| 1202 |
while (dict instanceof Dict && !(dict.objId && visited.has(dict.objId))) { |
| 1203 |
if (dict.objId) { |
| 1204 |
visited.put(dict.objId); |
| 1205 |
} |
| 1206 |
const value = getArray ? dict.getArray(key) : dict.get(key); |
| 1207 |
if (value !== undefined) { |
| 1208 |
if (stopWhenFound) { |
| 1209 |
return value; |
| 1210 |
} |
| 1211 |
(values ||= []).push(value); |
| 1212 |
} |
| 1213 |
dict = dict.get("Parent"); |
| 1214 |
} |
| 1215 |
return values; |
| 1216 |
} |
| 1217 |
const ROMAN_NUMBER_MAP = ["", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM", "", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC", "", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"]; |
| 1218 |
function toRomanNumerals(number, lowerCase = false) { |
| 1219 |
assert(Number.isInteger(number) && number > 0, "The number should be a positive integer."); |
| 1220 |
const romanBuf = []; |
| 1221 |
let pos; |
| 1222 |
while (number >= 1000) { |
| 1223 |
number -= 1000; |
| 1224 |
romanBuf.push("M"); |
| 1225 |
} |
| 1226 |
pos = number / 100 | 0; |
| 1227 |
number %= 100; |
| 1228 |
romanBuf.push(ROMAN_NUMBER_MAP[pos]); |
| 1229 |
pos = number / 10 | 0; |
| 1230 |
number %= 10; |
| 1231 |
romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]); |
| 1232 |
romanBuf.push(ROMAN_NUMBER_MAP[20 + number]); |
| 1233 |
const romanStr = romanBuf.join(""); |
| 1234 |
return lowerCase ? romanStr.toLowerCase() : romanStr; |
| 1235 |
} |
| 1236 |
function log2(x) { |
| 1237 |
if (x <= 0) { |
| 1238 |
return 0; |
| 1239 |
} |
| 1240 |
return Math.ceil(Math.log2(x)); |
| 1241 |
} |
| 1242 |
function readInt8(data, offset) { |
| 1243 |
return data[offset] << 24 >> 24; |
| 1244 |
} |
| 1245 |
function readUint16(data, offset) { |
| 1246 |
return data[offset] << 8 | data[offset + 1]; |
| 1247 |
} |
| 1248 |
function readUint32(data, offset) { |
| 1249 |
return (data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]) >>> 0; |
| 1250 |
} |
| 1251 |
function isWhiteSpace(ch) { |
| 1252 |
return ch === 0x20 || ch === 0x09 || ch === 0x0d || ch === 0x0a; |
| 1253 |
} |
| 1254 |
function isBooleanArray(arr, len) { |
| 1255 |
return Array.isArray(arr) && (len === null || arr.length === len) && arr.every(x => typeof x === "boolean"); |
| 1256 |
} |
| 1257 |
function isNumberArray(arr, len) { |
| 1258 |
if (Array.isArray(arr)) { |
| 1259 |
return (len === null || arr.length === len) && arr.every(x => typeof x === "number"); |
| 1260 |
} |
| 1261 |
return ArrayBuffer.isView(arr) && (arr.length === 0 || typeof arr[0] === "number") && (len === null || arr.length === len); |
| 1262 |
} |
| 1263 |
function lookupMatrix(arr, fallback) { |
| 1264 |
return isNumberArray(arr, 6) ? arr : fallback; |
| 1265 |
} |
| 1266 |
function lookupRect(arr, fallback) { |
| 1267 |
return isNumberArray(arr, 4) ? arr : fallback; |
| 1268 |
} |
| 1269 |
function lookupNormalRect(arr, fallback) { |
| 1270 |
return isNumberArray(arr, 4) ? Util.normalizeRect(arr) : fallback; |
| 1271 |
} |
| 1272 |
function parseXFAPath(path) { |
| 1273 |
const positionPattern = /(.+)\[(\d+)\]$/; |
| 1274 |
return path.split(".").map(component => { |
| 1275 |
const m = component.match(positionPattern); |
| 1276 |
if (m) { |
| 1277 |
return { |
| 1278 |
name: m[1], |
| 1279 |
pos: parseInt(m[2], 10) |
| 1280 |
}; |
| 1281 |
} |
| 1282 |
return { |
| 1283 |
name: component, |
| 1284 |
pos: 0 |
| 1285 |
}; |
| 1286 |
}); |
| 1287 |
} |
| 1288 |
function escapePDFName(str) { |
| 1289 |
const buffer = []; |
| 1290 |
let start = 0; |
| 1291 |
for (let i = 0, ii = str.length; i < ii; i++) { |
| 1292 |
const char = str.charCodeAt(i); |
| 1293 |
if (char < 0x21 || char > 0x7e || char === 0x23 || char === 0x28 || char === 0x29 || char === 0x3c || char === 0x3e || char === 0x5b || char === 0x5d || char === 0x7b || char === 0x7d || char === 0x2f || char === 0x25) { |
| 1294 |
if (start < i) { |
| 1295 |
buffer.push(str.substring(start, i)); |
| 1296 |
} |
| 1297 |
buffer.push(`#${char.toString(16)}`); |
| 1298 |
start = i + 1; |
| 1299 |
} |
| 1300 |
} |
| 1301 |
if (buffer.length === 0) { |
| 1302 |
return str; |
| 1303 |
} |
| 1304 |
if (start < str.length) { |
| 1305 |
buffer.push(str.substring(start, str.length)); |
| 1306 |
} |
| 1307 |
return buffer.join(""); |
| 1308 |
} |
| 1309 |
function escapeString(str) { |
| 1310 |
return str.replaceAll(/([()\\\n\r])/g, match => { |
| 1311 |
if (match === "\n") { |
| 1312 |
return "\\n"; |
| 1313 |
} else if (match === "\r") { |
| 1314 |
return "\\r"; |
| 1315 |
} |
| 1316 |
return `\\${match}`; |
| 1317 |
}); |
| 1318 |
} |
| 1319 |
function _collectJS(entry, xref, list, parents) { |
| 1320 |
if (!entry) { |
| 1321 |
return; |
| 1322 |
} |
| 1323 |
let parent = null; |
| 1324 |
if (entry instanceof Ref) { |
| 1325 |
if (parents.has(entry)) { |
| 1326 |
return; |
| 1327 |
} |
| 1328 |
parent = entry; |
| 1329 |
parents.put(parent); |
| 1330 |
entry = xref.fetch(entry); |
| 1331 |
} |
| 1332 |
if (Array.isArray(entry)) { |
| 1333 |
for (const element of entry) { |
| 1334 |
_collectJS(element, xref, list, parents); |
| 1335 |
} |
| 1336 |
} else if (entry instanceof Dict) { |
| 1337 |
if (isName(entry.get("S"), "JavaScript")) { |
| 1338 |
const js = entry.get("JS"); |
| 1339 |
let code; |
| 1340 |
if (js instanceof BaseStream) { |
| 1341 |
code = js.getString(); |
| 1342 |
} else if (typeof js === "string") { |
| 1343 |
code = js; |
| 1344 |
} |
| 1345 |
code &&= stringToPDFString(code).replaceAll("\x00", ""); |
| 1346 |
if (code) { |
| 1347 |
list.push(code); |
| 1348 |
} |
| 1349 |
} |
| 1350 |
_collectJS(entry.getRaw("Next"), xref, list, parents); |
| 1351 |
} |
| 1352 |
if (parent) { |
| 1353 |
parents.remove(parent); |
| 1354 |
} |
| 1355 |
} |
| 1356 |
function collectActions(xref, dict, eventType) { |
| 1357 |
const actions = Object.create(null); |
| 1358 |
const additionalActionsDicts = getInheritableProperty({ |
| 1359 |
dict, |
| 1360 |
key: "AA", |
| 1361 |
stopWhenFound: false |
| 1362 |
}); |
| 1363 |
if (additionalActionsDicts) { |
| 1364 |
for (let i = additionalActionsDicts.length - 1; i >= 0; i--) { |
| 1365 |
const additionalActions = additionalActionsDicts[i]; |
| 1366 |
if (!(additionalActions instanceof Dict)) { |
| 1367 |
continue; |
| 1368 |
} |
| 1369 |
for (const key of additionalActions.getKeys()) { |
| 1370 |
const action = eventType[key]; |
| 1371 |
if (!action) { |
| 1372 |
continue; |
| 1373 |
} |
| 1374 |
const actionDict = additionalActions.getRaw(key); |
| 1375 |
const parents = new RefSet(); |
| 1376 |
const list = []; |
| 1377 |
_collectJS(actionDict, xref, list, parents); |
| 1378 |
if (list.length > 0) { |
| 1379 |
actions[action] = list; |
| 1380 |
} |
| 1381 |
} |
| 1382 |
} |
| 1383 |
} |
| 1384 |
if (dict.has("A")) { |
| 1385 |
const actionDict = dict.get("A"); |
| 1386 |
const parents = new RefSet(); |
| 1387 |
const list = []; |
| 1388 |
_collectJS(actionDict, xref, list, parents); |
| 1389 |
if (list.length > 0) { |
| 1390 |
actions.Action = list; |
| 1391 |
} |
| 1392 |
} |
| 1393 |
return objectSize(actions) > 0 ? actions : null; |
| 1394 |
} |
| 1395 |
const XMLEntities = { |
| 1396 |
0x3c: "<", |
| 1397 |
0x3e: ">", |
| 1398 |
0x26: "&", |
| 1399 |
0x22: """, |
| 1400 |
0x27: "'" |
| 1401 |
}; |
| 1402 |
function* codePointIter(str) { |
| 1403 |
for (let i = 0, ii = str.length; i < ii; i++) { |
| 1404 |
const char = str.codePointAt(i); |
| 1405 |
if (char > 0xd7ff && (char < 0xe000 || char > 0xfffd)) { |
| 1406 |
i++; |
| 1407 |
} |
| 1408 |
yield char; |
| 1409 |
} |
| 1410 |
} |
| 1411 |
function encodeToXmlString(str) { |
| 1412 |
const buffer = []; |
| 1413 |
let start = 0; |
| 1414 |
for (let i = 0, ii = str.length; i < ii; i++) { |
| 1415 |
const char = str.codePointAt(i); |
| 1416 |
if (0x20 <= char && char <= 0x7e) { |
| 1417 |
const entity = XMLEntities[char]; |
| 1418 |
if (entity) { |
| 1419 |
if (start < i) { |
| 1420 |
buffer.push(str.substring(start, i)); |
| 1421 |
} |
| 1422 |
buffer.push(entity); |
| 1423 |
start = i + 1; |
| 1424 |
} |
| 1425 |
} else { |
| 1426 |
if (start < i) { |
| 1427 |
buffer.push(str.substring(start, i)); |
| 1428 |
} |
| 1429 |
buffer.push(`&#x${char.toString(16).toUpperCase()};`); |
| 1430 |
if (char > 0xd7ff && (char < 0xe000 || char > 0xfffd)) { |
| 1431 |
i++; |
| 1432 |
} |
| 1433 |
start = i + 1; |
| 1434 |
} |
| 1435 |
} |
| 1436 |
if (buffer.length === 0) { |
| 1437 |
return str; |
| 1438 |
} |
| 1439 |
if (start < str.length) { |
| 1440 |
buffer.push(str.substring(start, str.length)); |
| 1441 |
} |
| 1442 |
return buffer.join(""); |
| 1443 |
} |
| 1444 |
function validateFontName(fontFamily, mustWarn = false) { |
| 1445 |
const m = /^("|').*("|')$/.exec(fontFamily); |
| 1446 |
if (m && m[1] === m[2]) { |
| 1447 |
const re = new RegExp(`[^\\\\]${m[1]}`); |
| 1448 |
if (re.test(fontFamily.slice(1, -1))) { |
| 1449 |
if (mustWarn) { |
| 1450 |
warn(`FontFamily contains unescaped ${m[1]}: ${fontFamily}.`); |
| 1451 |
} |
| 1452 |
return false; |
| 1453 |
} |
| 1454 |
} else { |
| 1455 |
for (const ident of fontFamily.split(/[ \t]+/)) { |
| 1456 |
if (/^(\d|(-(\d|-)))/.test(ident) || !/^[\w-\\]+$/.test(ident)) { |
| 1457 |
if (mustWarn) { |
| 1458 |
warn(`FontFamily contains invalid <custom-ident>: ${fontFamily}.`); |
| 1459 |
} |
| 1460 |
return false; |
| 1461 |
} |
| 1462 |
} |
| 1463 |
} |
| 1464 |
return true; |
| 1465 |
} |
| 1466 |
function validateCSSFont(cssFontInfo) { |
| 1467 |
const DEFAULT_CSS_FONT_OBLIQUE = "14"; |
| 1468 |
const DEFAULT_CSS_FONT_WEIGHT = "400"; |
| 1469 |
const CSS_FONT_WEIGHT_VALUES = new Set(["100", "200", "300", "400", "500", "600", "700", "800", "900", "1000", "normal", "bold", "bolder", "lighter"]); |
| 1470 |
const { |
| 1471 |
fontFamily, |
| 1472 |
fontWeight, |
| 1473 |
italicAngle |
| 1474 |
} = cssFontInfo; |
| 1475 |
if (!validateFontName(fontFamily, true)) { |
| 1476 |
return false; |
| 1477 |
} |
| 1478 |
const weight = fontWeight ? fontWeight.toString() : ""; |
| 1479 |
cssFontInfo.fontWeight = CSS_FONT_WEIGHT_VALUES.has(weight) ? weight : DEFAULT_CSS_FONT_WEIGHT; |
| 1480 |
const angle = parseFloat(italicAngle); |
| 1481 |
cssFontInfo.italicAngle = isNaN(angle) || angle < -90 || angle > 90 ? DEFAULT_CSS_FONT_OBLIQUE : italicAngle.toString(); |
| 1482 |
return true; |
| 1483 |
} |
| 1484 |
function recoverJsURL(str) { |
| 1485 |
const URL_OPEN_METHODS = ["app.launchURL", "window.open", "xfa.host.gotoURL"]; |
| 1486 |
const regex = new RegExp("^\\s*(" + URL_OPEN_METHODS.join("|").replaceAll(".", "\\.") + ")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))", "i"); |
| 1487 |
const jsUrl = regex.exec(str); |
| 1488 |
if (jsUrl?.[2]) { |
| 1489 |
const url = jsUrl[2]; |
| 1490 |
let newWindow = false; |
| 1491 |
if (jsUrl[3] === "true" && jsUrl[1] === "app.launchURL") { |
| 1492 |
newWindow = true; |
| 1493 |
} |
| 1494 |
return { |
| 1495 |
url, |
| 1496 |
newWindow |
| 1497 |
}; |
| 1498 |
} |
| 1499 |
return null; |
| 1500 |
} |
| 1501 |
function numberToString(value) { |
| 1502 |
if (Number.isInteger(value)) { |
| 1503 |
return value.toString(); |
| 1504 |
} |
| 1505 |
const roundedValue = Math.round(value * 100); |
| 1506 |
if (roundedValue % 100 === 0) { |
| 1507 |
return (roundedValue / 100).toString(); |
| 1508 |
} |
| 1509 |
if (roundedValue % 10 === 0) { |
| 1510 |
return value.toFixed(1); |
| 1511 |
} |
| 1512 |
return value.toFixed(2); |
| 1513 |
} |
| 1514 |
function getNewAnnotationsMap(annotationStorage) { |
| 1515 |
if (!annotationStorage) { |
| 1516 |
return null; |
| 1517 |
} |
| 1518 |
const newAnnotationsByPage = new Map(); |
| 1519 |
for (const [key, value] of annotationStorage) { |
| 1520 |
if (!key.startsWith(AnnotationEditorPrefix)) { |
| 1521 |
continue; |
| 1522 |
} |
| 1523 |
let annotations = newAnnotationsByPage.get(value.pageIndex); |
| 1524 |
if (!annotations) { |
| 1525 |
annotations = []; |
| 1526 |
newAnnotationsByPage.set(value.pageIndex, annotations); |
| 1527 |
} |
| 1528 |
annotations.push(value); |
| 1529 |
} |
| 1530 |
return newAnnotationsByPage.size > 0 ? newAnnotationsByPage : null; |
| 1531 |
} |
| 1532 |
function stringToAsciiOrUTF16BE(str) { |
| 1533 |
return isAscii(str) ? str : stringToUTF16String(str, true); |
| 1534 |
} |
| 1535 |
function isAscii(str) { |
| 1536 |
return /^[\x00-\x7F]*$/.test(str); |
| 1537 |
} |
| 1538 |
function stringToUTF16HexString(str) { |
| 1539 |
const buf = []; |
| 1540 |
for (let i = 0, ii = str.length; i < ii; i++) { |
| 1541 |
const char = str.charCodeAt(i); |
| 1542 |
buf.push((char >> 8 & 0xff).toString(16).padStart(2, "0"), (char & 0xff).toString(16).padStart(2, "0")); |
| 1543 |
} |
| 1544 |
return buf.join(""); |
| 1545 |
} |
| 1546 |
function stringToUTF16String(str, bigEndian = false) { |
| 1547 |
const buf = []; |
| 1548 |
if (bigEndian) { |
| 1549 |
buf.push("\xFE\xFF"); |
| 1550 |
} |
| 1551 |
for (let i = 0, ii = str.length; i < ii; i++) { |
| 1552 |
const char = str.charCodeAt(i); |
| 1553 |
buf.push(String.fromCharCode(char >> 8 & 0xff), String.fromCharCode(char & 0xff)); |
| 1554 |
} |
| 1555 |
return buf.join(""); |
| 1556 |
} |
| 1557 |
function getRotationMatrix(rotation, width, height) { |
| 1558 |
switch (rotation) { |
| 1559 |
case 90: |
| 1560 |
return [0, 1, -1, 0, width, 0]; |
| 1561 |
case 180: |
| 1562 |
return [-1, 0, 0, -1, width, height]; |
| 1563 |
case 270: |
| 1564 |
return [0, -1, 1, 0, 0, height]; |
| 1565 |
default: |
| 1566 |
throw new Error("Invalid rotation"); |
| 1567 |
} |
| 1568 |
} |
| 1569 |
function getSizeInBytes(x) { |
| 1570 |
return Math.ceil(Math.ceil(Math.log2(1 + x)) / 8); |
| 1571 |
} |
| 1572 |
|
| 1573 |
;// ./src/core/stream.js |
| 1574 |
|
| 1575 |
|
| 1576 |
class Stream extends BaseStream { |
| 1577 |
constructor(arrayBuffer, start, length, dict) { |
| 1578 |
super(); |
| 1579 |
this.bytes = arrayBuffer instanceof Uint8Array ? arrayBuffer : new Uint8Array(arrayBuffer); |
| 1580 |
this.start = start || 0; |
| 1581 |
this.pos = this.start; |
| 1582 |
this.end = start + length || this.bytes.length; |
| 1583 |
this.dict = dict; |
| 1584 |
} |
| 1585 |
get length() { |
| 1586 |
return this.end - this.start; |
| 1587 |
} |
| 1588 |
get isEmpty() { |
| 1589 |
return this.length === 0; |
| 1590 |
} |
| 1591 |
getByte() { |
| 1592 |
if (this.pos >= this.end) { |
| 1593 |
return -1; |
| 1594 |
} |
| 1595 |
return this.bytes[this.pos++]; |
| 1596 |
} |
| 1597 |
getBytes(length) { |
| 1598 |
const bytes = this.bytes; |
| 1599 |
const pos = this.pos; |
| 1600 |
const strEnd = this.end; |
| 1601 |
if (!length) { |
| 1602 |
return bytes.subarray(pos, strEnd); |
| 1603 |
} |
| 1604 |
let end = pos + length; |
| 1605 |
if (end > strEnd) { |
| 1606 |
end = strEnd; |
| 1607 |
} |
| 1608 |
this.pos = end; |
| 1609 |
return bytes.subarray(pos, end); |
| 1610 |
} |
| 1611 |
getByteRange(begin, end) { |
| 1612 |
if (begin < 0) { |
| 1613 |
begin = 0; |
| 1614 |
} |
| 1615 |
if (end > this.end) { |
| 1616 |
end = this.end; |
| 1617 |
} |
| 1618 |
return this.bytes.subarray(begin, end); |
| 1619 |
} |
| 1620 |
reset() { |
| 1621 |
this.pos = this.start; |
| 1622 |
} |
| 1623 |
moveStart() { |
| 1624 |
this.start = this.pos; |
| 1625 |
} |
| 1626 |
makeSubStream(start, length, dict = null) { |
| 1627 |
return new Stream(this.bytes.buffer, start, length, dict); |
| 1628 |
} |
| 1629 |
} |
| 1630 |
class StringStream extends Stream { |
| 1631 |
constructor(str) { |
| 1632 |
super(stringToBytes(str)); |
| 1633 |
} |
| 1634 |
} |
| 1635 |
class NullStream extends Stream { |
| 1636 |
constructor() { |
| 1637 |
super(new Uint8Array(0)); |
| 1638 |
} |
| 1639 |
} |
| 1640 |
|
| 1641 |
;// ./src/core/chunked_stream.js |
| 1642 |
|
| 1643 |
|
| 1644 |
|
| 1645 |
class ChunkedStream extends Stream { |
| 1646 |
constructor(length, chunkSize, manager) { |
| 1647 |
super(new Uint8Array(length), 0, length, null); |
| 1648 |
this.chunkSize = chunkSize; |
| 1649 |
this._loadedChunks = new Set(); |
| 1650 |
this.numChunks = Math.ceil(length / chunkSize); |
| 1651 |
this.manager = manager; |
| 1652 |
this.progressiveDataLength = 0; |
| 1653 |
this.lastSuccessfulEnsureByteChunk = -1; |
| 1654 |
} |
| 1655 |
getMissingChunks() { |
| 1656 |
const chunks = []; |
| 1657 |
for (let chunk = 0, n = this.numChunks; chunk < n; ++chunk) { |
| 1658 |
if (!this._loadedChunks.has(chunk)) { |
| 1659 |
chunks.push(chunk); |
| 1660 |
} |
| 1661 |
} |
| 1662 |
return chunks; |
| 1663 |
} |
| 1664 |
get numChunksLoaded() { |
| 1665 |
return this._loadedChunks.size; |
| 1666 |
} |
| 1667 |
get isDataLoaded() { |
| 1668 |
return this.numChunksLoaded === this.numChunks; |
| 1669 |
} |
| 1670 |
onReceiveData(begin, chunk) { |
| 1671 |
const chunkSize = this.chunkSize; |
| 1672 |
if (begin % chunkSize !== 0) { |
| 1673 |
throw new Error(`Bad begin offset: ${begin}`); |
| 1674 |
} |
| 1675 |
const end = begin + chunk.byteLength; |
| 1676 |
if (end % chunkSize !== 0 && end !== this.bytes.length) { |
| 1677 |
throw new Error(`Bad end offset: ${end}`); |
| 1678 |
} |
| 1679 |
this.bytes.set(new Uint8Array(chunk), begin); |
| 1680 |
const beginChunk = Math.floor(begin / chunkSize); |
| 1681 |
const endChunk = Math.floor((end - 1) / chunkSize) + 1; |
| 1682 |
for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { |
| 1683 |
this._loadedChunks.add(curChunk); |
| 1684 |
} |
| 1685 |
} |
| 1686 |
onReceiveProgressiveData(data) { |
| 1687 |
let position = this.progressiveDataLength; |
| 1688 |
const beginChunk = Math.floor(position / this.chunkSize); |
| 1689 |
this.bytes.set(new Uint8Array(data), position); |
| 1690 |
position += data.byteLength; |
| 1691 |
this.progressiveDataLength = position; |
| 1692 |
const endChunk = position >= this.end ? this.numChunks : Math.floor(position / this.chunkSize); |
| 1693 |
for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { |
| 1694 |
this._loadedChunks.add(curChunk); |
| 1695 |
} |
| 1696 |
} |
| 1697 |
ensureByte(pos) { |
| 1698 |
if (pos < this.progressiveDataLength) { |
| 1699 |
return; |
| 1700 |
} |
| 1701 |
const chunk = Math.floor(pos / this.chunkSize); |
| 1702 |
if (chunk > this.numChunks) { |
| 1703 |
return; |
| 1704 |
} |
| 1705 |
if (chunk === this.lastSuccessfulEnsureByteChunk) { |
| 1706 |
return; |
| 1707 |
} |
| 1708 |
if (!this._loadedChunks.has(chunk)) { |
| 1709 |
throw new MissingDataException(pos, pos + 1); |
| 1710 |
} |
| 1711 |
this.lastSuccessfulEnsureByteChunk = chunk; |
| 1712 |
} |
| 1713 |
ensureRange(begin, end) { |
| 1714 |
if (begin >= end) { |
| 1715 |
return; |
| 1716 |
} |
| 1717 |
if (end <= this.progressiveDataLength) { |
| 1718 |
return; |
| 1719 |
} |
| 1720 |
const beginChunk = Math.floor(begin / this.chunkSize); |
| 1721 |
if (beginChunk > this.numChunks) { |
| 1722 |
return; |
| 1723 |
} |
| 1724 |
const endChunk = Math.min(Math.floor((end - 1) / this.chunkSize) + 1, this.numChunks); |
| 1725 |
for (let chunk = beginChunk; chunk < endChunk; ++chunk) { |
| 1726 |
if (!this._loadedChunks.has(chunk)) { |
| 1727 |
throw new MissingDataException(begin, end); |
| 1728 |
} |
| 1729 |
} |
| 1730 |
} |
| 1731 |
nextEmptyChunk(beginChunk) { |
| 1732 |
const numChunks = this.numChunks; |
| 1733 |
for (let i = 0; i < numChunks; ++i) { |
| 1734 |
const chunk = (beginChunk + i) % numChunks; |
| 1735 |
if (!this._loadedChunks.has(chunk)) { |
| 1736 |
return chunk; |
| 1737 |
} |
| 1738 |
} |
| 1739 |
return null; |
| 1740 |
} |
| 1741 |
hasChunk(chunk) { |
| 1742 |
return this._loadedChunks.has(chunk); |
| 1743 |
} |
| 1744 |
getByte() { |
| 1745 |
const pos = this.pos; |
| 1746 |
if (pos >= this.end) { |
| 1747 |
return -1; |
| 1748 |
} |
| 1749 |
if (pos >= this.progressiveDataLength) { |
| 1750 |
this.ensureByte(pos); |
| 1751 |
} |
| 1752 |
return this.bytes[this.pos++]; |
| 1753 |
} |
| 1754 |
getBytes(length) { |
| 1755 |
const bytes = this.bytes; |
| 1756 |
const pos = this.pos; |
| 1757 |
const strEnd = this.end; |
| 1758 |
if (!length) { |
| 1759 |
if (strEnd > this.progressiveDataLength) { |
| 1760 |
this.ensureRange(pos, strEnd); |
| 1761 |
} |
| 1762 |
return bytes.subarray(pos, strEnd); |
| 1763 |
} |
| 1764 |
let end = pos + length; |
| 1765 |
if (end > strEnd) { |
| 1766 |
end = strEnd; |
| 1767 |
} |
| 1768 |
if (end > this.progressiveDataLength) { |
| 1769 |
this.ensureRange(pos, end); |
| 1770 |
} |
| 1771 |
this.pos = end; |
| 1772 |
return bytes.subarray(pos, end); |
| 1773 |
} |
| 1774 |
getByteRange(begin, end) { |
| 1775 |
if (begin < 0) { |
| 1776 |
begin = 0; |
| 1777 |
} |
| 1778 |
if (end > this.end) { |
| 1779 |
end = this.end; |
| 1780 |
} |
| 1781 |
if (end > this.progressiveDataLength) { |
| 1782 |
this.ensureRange(begin, end); |
| 1783 |
} |
| 1784 |
return this.bytes.subarray(begin, end); |
| 1785 |
} |
| 1786 |
makeSubStream(start, length, dict = null) { |
| 1787 |
if (length) { |
| 1788 |
if (start + length > this.progressiveDataLength) { |
| 1789 |
this.ensureRange(start, start + length); |
| 1790 |
} |
| 1791 |
} else if (start >= this.progressiveDataLength) { |
| 1792 |
this.ensureByte(start); |
| 1793 |
} |
| 1794 |
function ChunkedStreamSubstream() {} |
| 1795 |
ChunkedStreamSubstream.prototype = Object.create(this); |
| 1796 |
ChunkedStreamSubstream.prototype.getMissingChunks = function () { |
| 1797 |
const chunkSize = this.chunkSize; |
| 1798 |
const beginChunk = Math.floor(this.start / chunkSize); |
| 1799 |
const endChunk = Math.floor((this.end - 1) / chunkSize) + 1; |
| 1800 |
const missingChunks = []; |
| 1801 |
for (let chunk = beginChunk; chunk < endChunk; ++chunk) { |
| 1802 |
if (!this._loadedChunks.has(chunk)) { |
| 1803 |
missingChunks.push(chunk); |
| 1804 |
} |
| 1805 |
} |
| 1806 |
return missingChunks; |
| 1807 |
}; |
| 1808 |
Object.defineProperty(ChunkedStreamSubstream.prototype, "isDataLoaded", { |
| 1809 |
get() { |
| 1810 |
if (this.numChunksLoaded === this.numChunks) { |
| 1811 |
return true; |
| 1812 |
} |
| 1813 |
return this.getMissingChunks().length === 0; |
| 1814 |
}, |
| 1815 |
configurable: true |
| 1816 |
}); |
| 1817 |
const subStream = new ChunkedStreamSubstream(); |
| 1818 |
subStream.pos = subStream.start = start; |
| 1819 |
subStream.end = start + length || this.end; |
| 1820 |
subStream.dict = dict; |
| 1821 |
return subStream; |
| 1822 |
} |
| 1823 |
getBaseStreams() { |
| 1824 |
return [this]; |
| 1825 |
} |
| 1826 |
} |
| 1827 |
class ChunkedStreamManager { |
| 1828 |
constructor(pdfNetworkStream, args) { |
| 1829 |
this.length = args.length; |
| 1830 |
this.chunkSize = args.rangeChunkSize; |
| 1831 |
this.stream = new ChunkedStream(this.length, this.chunkSize, this); |
| 1832 |
this.pdfNetworkStream = pdfNetworkStream; |
| 1833 |
this.disableAutoFetch = args.disableAutoFetch; |
| 1834 |
this.msgHandler = args.msgHandler; |
| 1835 |
this.currRequestId = 0; |
| 1836 |
this._chunksNeededByRequest = new Map(); |
| 1837 |
this._requestsByChunk = new Map(); |
| 1838 |
this._promisesByRequest = new Map(); |
| 1839 |
this.progressiveDataLength = 0; |
| 1840 |
this.aborted = false; |
| 1841 |
this._loadedStreamCapability = Promise.withResolvers(); |
| 1842 |
} |
| 1843 |
sendRequest(begin, end) { |
| 1844 |
const rangeReader = this.pdfNetworkStream.getRangeReader(begin, end); |
| 1845 |
if (!rangeReader.isStreamingSupported) { |
| 1846 |
rangeReader.onProgress = this.onProgress.bind(this); |
| 1847 |
} |
| 1848 |
let chunks = [], |
| 1849 |
loaded = 0; |
| 1850 |
return new Promise((resolve, reject) => { |
| 1851 |
const readChunk = ({ |
| 1852 |
value, |
| 1853 |
done |
| 1854 |
}) => { |
| 1855 |
try { |
| 1856 |
if (done) { |
| 1857 |
const chunkData = arrayBuffersToBytes(chunks); |
| 1858 |
chunks = null; |
| 1859 |
resolve(chunkData); |
| 1860 |
return; |
| 1861 |
} |
| 1862 |
loaded += value.byteLength; |
| 1863 |
if (rangeReader.isStreamingSupported) { |
| 1864 |
this.onProgress({ |
| 1865 |
loaded |
| 1866 |
}); |
| 1867 |
} |
| 1868 |
chunks.push(value); |
| 1869 |
rangeReader.read().then(readChunk, reject); |
| 1870 |
} catch (e) { |
| 1871 |
reject(e); |
| 1872 |
} |
| 1873 |
}; |
| 1874 |
rangeReader.read().then(readChunk, reject); |
| 1875 |
}).then(data => { |
| 1876 |
if (this.aborted) { |
| 1877 |
return; |
| 1878 |
} |
| 1879 |
this.onReceiveData({ |
| 1880 |
chunk: data, |
| 1881 |
begin |
| 1882 |
}); |
| 1883 |
}); |
| 1884 |
} |
| 1885 |
requestAllChunks(noFetch = false) { |
| 1886 |
if (!noFetch) { |
| 1887 |
const missingChunks = this.stream.getMissingChunks(); |
| 1888 |
this._requestChunks(missingChunks); |
| 1889 |
} |
| 1890 |
return this._loadedStreamCapability.promise; |
| 1891 |
} |
| 1892 |
_requestChunks(chunks) { |
| 1893 |
const requestId = this.currRequestId++; |
| 1894 |
const chunksNeeded = new Set(); |
| 1895 |
this._chunksNeededByRequest.set(requestId, chunksNeeded); |
| 1896 |
for (const chunk of chunks) { |
| 1897 |
if (!this.stream.hasChunk(chunk)) { |
| 1898 |
chunksNeeded.add(chunk); |
| 1899 |
} |
| 1900 |
} |
| 1901 |
if (chunksNeeded.size === 0) { |
| 1902 |
return Promise.resolve(); |
| 1903 |
} |
| 1904 |
const capability = Promise.withResolvers(); |
| 1905 |
this._promisesByRequest.set(requestId, capability); |
| 1906 |
const chunksToRequest = []; |
| 1907 |
for (const chunk of chunksNeeded) { |
| 1908 |
let requestIds = this._requestsByChunk.get(chunk); |
| 1909 |
if (!requestIds) { |
| 1910 |
requestIds = []; |
| 1911 |
this._requestsByChunk.set(chunk, requestIds); |
| 1912 |
chunksToRequest.push(chunk); |
| 1913 |
} |
| 1914 |
requestIds.push(requestId); |
| 1915 |
} |
| 1916 |
if (chunksToRequest.length > 0) { |
| 1917 |
const groupedChunksToRequest = this.groupChunks(chunksToRequest); |
| 1918 |
for (const groupedChunk of groupedChunksToRequest) { |
| 1919 |
const begin = groupedChunk.beginChunk * this.chunkSize; |
| 1920 |
const end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length); |
| 1921 |
this.sendRequest(begin, end).catch(capability.reject); |
| 1922 |
} |
| 1923 |
} |
| 1924 |
return capability.promise.catch(reason => { |
| 1925 |
if (this.aborted) { |
| 1926 |
return; |
| 1927 |
} |
| 1928 |
throw reason; |
| 1929 |
}); |
| 1930 |
} |
| 1931 |
getStream() { |
| 1932 |
return this.stream; |
| 1933 |
} |
| 1934 |
requestRange(begin, end) { |
| 1935 |
end = Math.min(end, this.length); |
| 1936 |
const beginChunk = this.getBeginChunk(begin); |
| 1937 |
const endChunk = this.getEndChunk(end); |
| 1938 |
const chunks = []; |
| 1939 |
for (let chunk = beginChunk; chunk < endChunk; ++chunk) { |
| 1940 |
chunks.push(chunk); |
| 1941 |
} |
| 1942 |
return this._requestChunks(chunks); |
| 1943 |
} |
| 1944 |
requestRanges(ranges = []) { |
| 1945 |
const chunksToRequest = []; |
| 1946 |
for (const range of ranges) { |
| 1947 |
const beginChunk = this.getBeginChunk(range.begin); |
| 1948 |
const endChunk = this.getEndChunk(range.end); |
| 1949 |
for (let chunk = beginChunk; chunk < endChunk; ++chunk) { |
| 1950 |
if (!chunksToRequest.includes(chunk)) { |
| 1951 |
chunksToRequest.push(chunk); |
| 1952 |
} |
| 1953 |
} |
| 1954 |
} |
| 1955 |
chunksToRequest.sort(function (a, b) { |
| 1956 |
return a - b; |
| 1957 |
}); |
| 1958 |
return this._requestChunks(chunksToRequest); |
| 1959 |
} |
| 1960 |
groupChunks(chunks) { |
| 1961 |
const groupedChunks = []; |
| 1962 |
let beginChunk = -1; |
| 1963 |
let prevChunk = -1; |
| 1964 |
for (let i = 0, ii = chunks.length; i < ii; ++i) { |
| 1965 |
const chunk = chunks[i]; |
| 1966 |
if (beginChunk < 0) { |
| 1967 |
beginChunk = chunk; |
| 1968 |
} |
| 1969 |
if (prevChunk >= 0 && prevChunk + 1 !== chunk) { |
| 1970 |
groupedChunks.push({ |
| 1971 |
beginChunk, |
| 1972 |
endChunk: prevChunk + 1 |
| 1973 |
}); |
| 1974 |
beginChunk = chunk; |
| 1975 |
} |
| 1976 |
if (i + 1 === chunks.length) { |
| 1977 |
groupedChunks.push({ |
| 1978 |
beginChunk, |
| 1979 |
endChunk: chunk + 1 |
| 1980 |
}); |
| 1981 |
} |
| 1982 |
prevChunk = chunk; |
| 1983 |
} |
| 1984 |
return groupedChunks; |
| 1985 |
} |
| 1986 |
onProgress(args) { |
| 1987 |
this.msgHandler.send("DocProgress", { |
| 1988 |
loaded: this.stream.numChunksLoaded * this.chunkSize + args.loaded, |
| 1989 |
total: this.length |
| 1990 |
}); |
| 1991 |
} |
| 1992 |
onReceiveData(args) { |
| 1993 |
const chunk = args.chunk; |
| 1994 |
const isProgressive = args.begin === undefined; |
| 1995 |
const begin = isProgressive ? this.progressiveDataLength : args.begin; |
| 1996 |
const end = begin + chunk.byteLength; |
| 1997 |
const beginChunk = Math.floor(begin / this.chunkSize); |
| 1998 |
const endChunk = end < this.length ? Math.floor(end / this.chunkSize) : Math.ceil(end / this.chunkSize); |
| 1999 |
if (isProgressive) { |
| 2000 |
this.stream.onReceiveProgressiveData(chunk); |
| 2001 |
this.progressiveDataLength = end; |
| 2002 |
} else { |
| 2003 |
this.stream.onReceiveData(begin, chunk); |
| 2004 |
} |
| 2005 |
if (this.stream.isDataLoaded) { |
| 2006 |
this._loadedStreamCapability.resolve(this.stream); |
| 2007 |
} |
| 2008 |
const loadedRequests = []; |
| 2009 |
for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { |
| 2010 |
const requestIds = this._requestsByChunk.get(curChunk); |
| 2011 |
if (!requestIds) { |
| 2012 |
continue; |
| 2013 |
} |
| 2014 |
this._requestsByChunk.delete(curChunk); |
| 2015 |
for (const requestId of requestIds) { |
| 2016 |
const chunksNeeded = this._chunksNeededByRequest.get(requestId); |
| 2017 |
if (chunksNeeded.has(curChunk)) { |
| 2018 |
chunksNeeded.delete(curChunk); |
| 2019 |
} |
| 2020 |
if (chunksNeeded.size > 0) { |
| 2021 |
continue; |
| 2022 |
} |
| 2023 |
loadedRequests.push(requestId); |
| 2024 |
} |
| 2025 |
} |
| 2026 |
if (!this.disableAutoFetch && this._requestsByChunk.size === 0) { |
| 2027 |
let nextEmptyChunk; |
| 2028 |
if (this.stream.numChunksLoaded === 1) { |
| 2029 |
const lastChunk = this.stream.numChunks - 1; |
| 2030 |
if (!this.stream.hasChunk(lastChunk)) { |
| 2031 |
nextEmptyChunk = lastChunk; |
| 2032 |
} |
| 2033 |
} else { |
| 2034 |
nextEmptyChunk = this.stream.nextEmptyChunk(endChunk); |
| 2035 |
} |
| 2036 |
if (Number.isInteger(nextEmptyChunk)) { |
| 2037 |
this._requestChunks([nextEmptyChunk]); |
| 2038 |
} |
| 2039 |
} |
| 2040 |
for (const requestId of loadedRequests) { |
| 2041 |
const capability = this._promisesByRequest.get(requestId); |
| 2042 |
this._promisesByRequest.delete(requestId); |
| 2043 |
capability.resolve(); |
| 2044 |
} |
| 2045 |
this.msgHandler.send("DocProgress", { |
| 2046 |
loaded: this.stream.numChunksLoaded * this.chunkSize, |
| 2047 |
total: this.length |
| 2048 |
}); |
| 2049 |
} |
| 2050 |
onError(err) { |
| 2051 |
this._loadedStreamCapability.reject(err); |
| 2052 |
} |
| 2053 |
getBeginChunk(begin) { |
| 2054 |
return Math.floor(begin / this.chunkSize); |
| 2055 |
} |
| 2056 |
getEndChunk(end) { |
| 2057 |
return Math.floor((end - 1) / this.chunkSize) + 1; |
| 2058 |
} |
| 2059 |
abort(reason) { |
| 2060 |
this.aborted = true; |
| 2061 |
this.pdfNetworkStream?.cancelAllRequests(reason); |
| 2062 |
for (const capability of this._promisesByRequest.values()) { |
| 2063 |
capability.reject(reason); |
| 2064 |
} |
| 2065 |
} |
| 2066 |
} |
| 2067 |
|
| 2068 |
;// ./src/core/colorspace.js |
| 2069 |
|
| 2070 |
|
| 2071 |
|
| 2072 |
|
| 2073 |
function resizeRgbImage(src, dest, w1, h1, w2, h2, alpha01) { |
| 2074 |
const COMPONENTS = 3; |
| 2075 |
alpha01 = alpha01 !== 1 ? 0 : alpha01; |
| 2076 |
const xRatio = w1 / w2; |
| 2077 |
const yRatio = h1 / h2; |
| 2078 |
let newIndex = 0, |
| 2079 |
oldIndex; |
| 2080 |
const xScaled = new Uint16Array(w2); |
| 2081 |
const w1Scanline = w1 * COMPONENTS; |
| 2082 |
for (let i = 0; i < w2; i++) { |
| 2083 |
xScaled[i] = Math.floor(i * xRatio) * COMPONENTS; |
| 2084 |
} |
| 2085 |
for (let i = 0; i < h2; i++) { |
| 2086 |
const py = Math.floor(i * yRatio) * w1Scanline; |
| 2087 |
for (let j = 0; j < w2; j++) { |
| 2088 |
oldIndex = py + xScaled[j]; |
| 2089 |
dest[newIndex++] = src[oldIndex++]; |
| 2090 |
dest[newIndex++] = src[oldIndex++]; |
| 2091 |
dest[newIndex++] = src[oldIndex++]; |
| 2092 |
newIndex += alpha01; |
| 2093 |
} |
| 2094 |
} |
| 2095 |
} |
| 2096 |
class ColorSpace { |
| 2097 |
constructor(name, numComps) { |
| 2098 |
this.name = name; |
| 2099 |
this.numComps = numComps; |
| 2100 |
} |
| 2101 |
getRgb(src, srcOffset) { |
| 2102 |
const rgb = new Uint8ClampedArray(3); |
| 2103 |
this.getRgbItem(src, srcOffset, rgb, 0); |
| 2104 |
return rgb; |
| 2105 |
} |
| 2106 |
getRgbItem(src, srcOffset, dest, destOffset) { |
| 2107 |
unreachable("Should not call ColorSpace.getRgbItem"); |
| 2108 |
} |
| 2109 |
getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { |
| 2110 |
unreachable("Should not call ColorSpace.getRgbBuffer"); |
| 2111 |
} |
| 2112 |
getOutputLength(inputLength, alpha01) { |
| 2113 |
unreachable("Should not call ColorSpace.getOutputLength"); |
| 2114 |
} |
| 2115 |
isPassthrough(bits) { |
| 2116 |
return false; |
| 2117 |
} |
| 2118 |
isDefaultDecode(decodeMap, bpc) { |
| 2119 |
return ColorSpace.isDefaultDecode(decodeMap, this.numComps); |
| 2120 |
} |
| 2121 |
fillRgb(dest, originalWidth, originalHeight, width, height, actualHeight, bpc, comps, alpha01) { |
| 2122 |
const count = originalWidth * originalHeight; |
| 2123 |
let rgbBuf = null; |
| 2124 |
const numComponentColors = 1 << bpc; |
| 2125 |
const needsResizing = originalHeight !== height || originalWidth !== width; |
| 2126 |
if (this.isPassthrough(bpc)) { |
| 2127 |
rgbBuf = comps; |
| 2128 |
} else if (this.numComps === 1 && count > numComponentColors && this.name !== "DeviceGray" && this.name !== "DeviceRGB") { |
| 2129 |
const allColors = bpc <= 8 ? new Uint8Array(numComponentColors) : new Uint16Array(numComponentColors); |
| 2130 |
for (let i = 0; i < numComponentColors; i++) { |
| 2131 |
allColors[i] = i; |
| 2132 |
} |
| 2133 |
const colorMap = new Uint8ClampedArray(numComponentColors * 3); |
| 2134 |
this.getRgbBuffer(allColors, 0, numComponentColors, colorMap, 0, bpc, 0); |
| 2135 |
if (!needsResizing) { |
| 2136 |
let destPos = 0; |
| 2137 |
for (let i = 0; i < count; ++i) { |
| 2138 |
const key = comps[i] * 3; |
| 2139 |
dest[destPos++] = colorMap[key]; |
| 2140 |
dest[destPos++] = colorMap[key + 1]; |
| 2141 |
dest[destPos++] = colorMap[key + 2]; |
| 2142 |
destPos += alpha01; |
| 2143 |
} |
| 2144 |
} else { |
| 2145 |
rgbBuf = new Uint8Array(count * 3); |
| 2146 |
let rgbPos = 0; |
| 2147 |
for (let i = 0; i < count; ++i) { |
| 2148 |
const key = comps[i] * 3; |
| 2149 |
rgbBuf[rgbPos++] = colorMap[key]; |
| 2150 |
rgbBuf[rgbPos++] = colorMap[key + 1]; |
| 2151 |
rgbBuf[rgbPos++] = colorMap[key + 2]; |
| 2152 |
} |
| 2153 |
} |
| 2154 |
} else if (!needsResizing) { |
| 2155 |
this.getRgbBuffer(comps, 0, width * actualHeight, dest, 0, bpc, alpha01); |
| 2156 |
} else { |
| 2157 |
rgbBuf = new Uint8ClampedArray(count * 3); |
| 2158 |
this.getRgbBuffer(comps, 0, count, rgbBuf, 0, bpc, 0); |
| 2159 |
} |
| 2160 |
if (rgbBuf) { |
| 2161 |
if (needsResizing) { |
| 2162 |
resizeRgbImage(rgbBuf, dest, originalWidth, originalHeight, width, height, alpha01); |
| 2163 |
} else { |
| 2164 |
let destPos = 0, |
| 2165 |
rgbPos = 0; |
| 2166 |
for (let i = 0, ii = width * actualHeight; i < ii; i++) { |
| 2167 |
dest[destPos++] = rgbBuf[rgbPos++]; |
| 2168 |
dest[destPos++] = rgbBuf[rgbPos++]; |
| 2169 |
dest[destPos++] = rgbBuf[rgbPos++]; |
| 2170 |
destPos += alpha01; |
| 2171 |
} |
| 2172 |
} |
| 2173 |
} |
| 2174 |
} |
| 2175 |
get usesZeroToOneRange() { |
| 2176 |
return shadow(this, "usesZeroToOneRange", true); |
| 2177 |
} |
| 2178 |
static _cache(cacheKey, xref, localColorSpaceCache, parsedColorSpace) { |
| 2179 |
if (!localColorSpaceCache) { |
| 2180 |
throw new Error('ColorSpace._cache - expected "localColorSpaceCache" argument.'); |
| 2181 |
} |
| 2182 |
if (!parsedColorSpace) { |
| 2183 |
throw new Error('ColorSpace._cache - expected "parsedColorSpace" argument.'); |
| 2184 |
} |
| 2185 |
let csName, csRef; |
| 2186 |
if (cacheKey instanceof Ref) { |
| 2187 |
csRef = cacheKey; |
| 2188 |
cacheKey = xref.fetch(cacheKey); |
| 2189 |
} |
| 2190 |
if (cacheKey instanceof Name) { |
| 2191 |
csName = cacheKey.name; |
| 2192 |
} |
| 2193 |
if (csName || csRef) { |
| 2194 |
localColorSpaceCache.set(csName, csRef, parsedColorSpace); |
| 2195 |
} |
| 2196 |
} |
| 2197 |
static getCached(cacheKey, xref, localColorSpaceCache) { |
| 2198 |
if (!localColorSpaceCache) { |
| 2199 |
throw new Error('ColorSpace.getCached - expected "localColorSpaceCache" argument.'); |
| 2200 |
} |
| 2201 |
if (cacheKey instanceof Ref) { |
| 2202 |
const localColorSpace = localColorSpaceCache.getByRef(cacheKey); |
| 2203 |
if (localColorSpace) { |
| 2204 |
return localColorSpace; |
| 2205 |
} |
| 2206 |
try { |
| 2207 |
cacheKey = xref.fetch(cacheKey); |
| 2208 |
} catch (ex) { |
| 2209 |
if (ex instanceof MissingDataException) { |
| 2210 |
throw ex; |
| 2211 |
} |
| 2212 |
} |
| 2213 |
} |
| 2214 |
if (cacheKey instanceof Name) { |
| 2215 |
const localColorSpace = localColorSpaceCache.getByName(cacheKey.name); |
| 2216 |
if (localColorSpace) { |
| 2217 |
return localColorSpace; |
| 2218 |
} |
| 2219 |
} |
| 2220 |
return null; |
| 2221 |
} |
| 2222 |
static async parseAsync({ |
| 2223 |
cs, |
| 2224 |
xref, |
| 2225 |
resources = null, |
| 2226 |
pdfFunctionFactory, |
| 2227 |
localColorSpaceCache |
| 2228 |
}) { |
| 2229 |
const parsedColorSpace = this._parse(cs, xref, resources, pdfFunctionFactory); |
| 2230 |
this._cache(cs, xref, localColorSpaceCache, parsedColorSpace); |
| 2231 |
return parsedColorSpace; |
| 2232 |
} |
| 2233 |
static parse({ |
| 2234 |
cs, |
| 2235 |
xref, |
| 2236 |
resources = null, |
| 2237 |
pdfFunctionFactory, |
| 2238 |
localColorSpaceCache |
| 2239 |
}) { |
| 2240 |
const cachedColorSpace = this.getCached(cs, xref, localColorSpaceCache); |
| 2241 |
if (cachedColorSpace) { |
| 2242 |
return cachedColorSpace; |
| 2243 |
} |
| 2244 |
const parsedColorSpace = this._parse(cs, xref, resources, pdfFunctionFactory); |
| 2245 |
this._cache(cs, xref, localColorSpaceCache, parsedColorSpace); |
| 2246 |
return parsedColorSpace; |
| 2247 |
} |
| 2248 |
static _parse(cs, xref, resources = null, pdfFunctionFactory) { |
| 2249 |
cs = xref.fetchIfRef(cs); |
| 2250 |
if (cs instanceof Name) { |
| 2251 |
switch (cs.name) { |
| 2252 |
case "G": |
| 2253 |
case "DeviceGray": |
| 2254 |
return this.singletons.gray; |
| 2255 |
case "RGB": |
| 2256 |
case "DeviceRGB": |
| 2257 |
return this.singletons.rgb; |
| 2258 |
case "DeviceRGBA": |
| 2259 |
return this.singletons.rgba; |
| 2260 |
case "CMYK": |
| 2261 |
case "DeviceCMYK": |
| 2262 |
return this.singletons.cmyk; |
| 2263 |
case "Pattern": |
| 2264 |
return new PatternCS(null); |
| 2265 |
default: |
| 2266 |
if (resources instanceof Dict) { |
| 2267 |
const colorSpaces = resources.get("ColorSpace"); |
| 2268 |
if (colorSpaces instanceof Dict) { |
| 2269 |
const resourcesCS = colorSpaces.get(cs.name); |
| 2270 |
if (resourcesCS) { |
| 2271 |
if (resourcesCS instanceof Name) { |
| 2272 |
return this._parse(resourcesCS, xref, resources, pdfFunctionFactory); |
| 2273 |
} |
| 2274 |
cs = resourcesCS; |
| 2275 |
break; |
| 2276 |
} |
| 2277 |
} |
| 2278 |
} |
| 2279 |
warn(`Unrecognized ColorSpace: ${cs.name}`); |
| 2280 |
return this.singletons.gray; |
| 2281 |
} |
| 2282 |
} |
| 2283 |
if (Array.isArray(cs)) { |
| 2284 |
const mode = xref.fetchIfRef(cs[0]).name; |
| 2285 |
let params, numComps, baseCS, whitePoint, blackPoint, gamma; |
| 2286 |
switch (mode) { |
| 2287 |
case "G": |
| 2288 |
case "DeviceGray": |
| 2289 |
return this.singletons.gray; |
| 2290 |
case "RGB": |
| 2291 |
case "DeviceRGB": |
| 2292 |
return this.singletons.rgb; |
| 2293 |
case "CMYK": |
| 2294 |
case "DeviceCMYK": |
| 2295 |
return this.singletons.cmyk; |
| 2296 |
case "CalGray": |
| 2297 |
params = xref.fetchIfRef(cs[1]); |
| 2298 |
whitePoint = params.getArray("WhitePoint"); |
| 2299 |
blackPoint = params.getArray("BlackPoint"); |
| 2300 |
gamma = params.get("Gamma"); |
| 2301 |
return new CalGrayCS(whitePoint, blackPoint, gamma); |
| 2302 |
case "CalRGB": |
| 2303 |
params = xref.fetchIfRef(cs[1]); |
| 2304 |
whitePoint = params.getArray("WhitePoint"); |
| 2305 |
blackPoint = params.getArray("BlackPoint"); |
| 2306 |
gamma = params.getArray("Gamma"); |
| 2307 |
const matrix = params.getArray("Matrix"); |
| 2308 |
return new CalRGBCS(whitePoint, blackPoint, gamma, matrix); |
| 2309 |
case "ICCBased": |
| 2310 |
const stream = xref.fetchIfRef(cs[1]); |
| 2311 |
const dict = stream.dict; |
| 2312 |
numComps = dict.get("N"); |
| 2313 |
const alt = dict.get("Alternate"); |
| 2314 |
if (alt) { |
| 2315 |
const altCS = this._parse(alt, xref, resources, pdfFunctionFactory); |
| 2316 |
if (altCS.numComps === numComps) { |
| 2317 |
return altCS; |
| 2318 |
} |
| 2319 |
warn("ICCBased color space: Ignoring incorrect /Alternate entry."); |
| 2320 |
} |
| 2321 |
if (numComps === 1) { |
| 2322 |
return this.singletons.gray; |
| 2323 |
} else if (numComps === 3) { |
| 2324 |
return this.singletons.rgb; |
| 2325 |
} else if (numComps === 4) { |
| 2326 |
return this.singletons.cmyk; |
| 2327 |
} |
| 2328 |
break; |
| 2329 |
case "Pattern": |
| 2330 |
baseCS = cs[1] || null; |
| 2331 |
if (baseCS) { |
| 2332 |
baseCS = this._parse(baseCS, xref, resources, pdfFunctionFactory); |
| 2333 |
} |
| 2334 |
return new PatternCS(baseCS); |
| 2335 |
case "I": |
| 2336 |
case "Indexed": |
| 2337 |
baseCS = this._parse(cs[1], xref, resources, pdfFunctionFactory); |
| 2338 |
const hiVal = xref.fetchIfRef(cs[2]) + 1; |
| 2339 |
const lookup = xref.fetchIfRef(cs[3]); |
| 2340 |
return new IndexedCS(baseCS, hiVal, lookup); |
| 2341 |
case "Separation": |
| 2342 |
case "DeviceN": |
| 2343 |
const name = xref.fetchIfRef(cs[1]); |
| 2344 |
numComps = Array.isArray(name) ? name.length : 1; |
| 2345 |
baseCS = this._parse(cs[2], xref, resources, pdfFunctionFactory); |
| 2346 |
const tintFn = pdfFunctionFactory.create(cs[3]); |
| 2347 |
return new AlternateCS(numComps, baseCS, tintFn); |
| 2348 |
case "Lab": |
| 2349 |
params = xref.fetchIfRef(cs[1]); |
| 2350 |
whitePoint = params.getArray("WhitePoint"); |
| 2351 |
blackPoint = params.getArray("BlackPoint"); |
| 2352 |
const range = params.getArray("Range"); |
| 2353 |
return new LabCS(whitePoint, blackPoint, range); |
| 2354 |
default: |
| 2355 |
warn(`Unimplemented ColorSpace object: ${mode}`); |
| 2356 |
return this.singletons.gray; |
| 2357 |
} |
| 2358 |
} |
| 2359 |
warn(`Unrecognized ColorSpace object: ${cs}`); |
| 2360 |
return this.singletons.gray; |
| 2361 |
} |
| 2362 |
static isDefaultDecode(decode, numComps) { |
| 2363 |
if (!Array.isArray(decode)) { |
| 2364 |
return true; |
| 2365 |
} |
| 2366 |
if (numComps * 2 !== decode.length) { |
| 2367 |
warn("The decode map is not the correct length"); |
| 2368 |
return true; |
| 2369 |
} |
| 2370 |
for (let i = 0, ii = decode.length; i < ii; i += 2) { |
| 2371 |
if (decode[i] !== 0 || decode[i + 1] !== 1) { |
| 2372 |
return false; |
| 2373 |
} |
| 2374 |
} |
| 2375 |
return true; |
| 2376 |
} |
| 2377 |
static get singletons() { |
| 2378 |
return shadow(this, "singletons", { |
| 2379 |
get gray() { |
| 2380 |
return shadow(this, "gray", new DeviceGrayCS()); |
| 2381 |
}, |
| 2382 |
get rgb() { |
| 2383 |
return shadow(this, "rgb", new DeviceRgbCS()); |
| 2384 |
}, |
| 2385 |
get rgba() { |
| 2386 |
return shadow(this, "rgba", new DeviceRgbaCS()); |
| 2387 |
}, |
| 2388 |
get cmyk() { |
| 2389 |
return shadow(this, "cmyk", new DeviceCmykCS()); |
| 2390 |
} |
| 2391 |
}); |
| 2392 |
} |
| 2393 |
} |
| 2394 |
class AlternateCS extends ColorSpace { |
| 2395 |
constructor(numComps, base, tintFn) { |
| 2396 |
super("Alternate", numComps); |
| 2397 |
this.base = base; |
| 2398 |
this.tintFn = tintFn; |
| 2399 |
this.tmpBuf = new Float32Array(base.numComps); |
| 2400 |
} |
| 2401 |
getRgbItem(src, srcOffset, dest, destOffset) { |
| 2402 |
const tmpBuf = this.tmpBuf; |
| 2403 |
this.tintFn(src, srcOffset, tmpBuf, 0); |
| 2404 |
this.base.getRgbItem(tmpBuf, 0, dest, destOffset); |
| 2405 |
} |
| 2406 |
getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { |
| 2407 |
const tintFn = this.tintFn; |
| 2408 |
const base = this.base; |
| 2409 |
const scale = 1 / ((1 << bits) - 1); |
| 2410 |
const baseNumComps = base.numComps; |
| 2411 |
const usesZeroToOneRange = base.usesZeroToOneRange; |
| 2412 |
const isPassthrough = (base.isPassthrough(8) || !usesZeroToOneRange) && alpha01 === 0; |
| 2413 |
let pos = isPassthrough ? destOffset : 0; |
| 2414 |
const baseBuf = isPassthrough ? dest : new Uint8ClampedArray(baseNumComps * count); |
| 2415 |
const numComps = this.numComps; |
| 2416 |
const scaled = new Float32Array(numComps); |
| 2417 |
const tinted = new Float32Array(baseNumComps); |
| 2418 |
let i, j; |
| 2419 |
for (i = 0; i < count; i++) { |
| 2420 |
for (j = 0; j < numComps; j++) { |
| 2421 |
scaled[j] = src[srcOffset++] * scale; |
| 2422 |
} |
| 2423 |
tintFn(scaled, 0, tinted, 0); |
| 2424 |
if (usesZeroToOneRange) { |
| 2425 |
for (j = 0; j < baseNumComps; j++) { |
| 2426 |
baseBuf[pos++] = tinted[j] * 255; |
| 2427 |
} |
| 2428 |
} else { |
| 2429 |
base.getRgbItem(tinted, 0, baseBuf, pos); |
| 2430 |
pos += baseNumComps; |
| 2431 |
} |
| 2432 |
} |
| 2433 |
if (!isPassthrough) { |
| 2434 |
base.getRgbBuffer(baseBuf, 0, count, dest, destOffset, 8, alpha01); |
| 2435 |
} |
| 2436 |
} |
| 2437 |
getOutputLength(inputLength, alpha01) { |
| 2438 |
return this.base.getOutputLength(inputLength * this.base.numComps / this.numComps, alpha01); |
| 2439 |
} |
| 2440 |
} |
| 2441 |
class PatternCS extends ColorSpace { |
| 2442 |
constructor(baseCS) { |
| 2443 |
super("Pattern", null); |
| 2444 |
this.base = baseCS; |
| 2445 |
} |
| 2446 |
isDefaultDecode(decodeMap, bpc) { |
| 2447 |
unreachable("Should not call PatternCS.isDefaultDecode"); |
| 2448 |
} |
| 2449 |
} |
| 2450 |
class IndexedCS extends ColorSpace { |
| 2451 |
constructor(base, highVal, lookup) { |
| 2452 |
super("Indexed", 1); |
| 2453 |
this.base = base; |
| 2454 |
this.highVal = highVal; |
| 2455 |
const length = base.numComps * highVal; |
| 2456 |
this.lookup = new Uint8Array(length); |
| 2457 |
if (lookup instanceof BaseStream) { |
| 2458 |
const bytes = lookup.getBytes(length); |
| 2459 |
this.lookup.set(bytes); |
| 2460 |
} else if (typeof lookup === "string") { |
| 2461 |
for (let i = 0; i < length; ++i) { |
| 2462 |
this.lookup[i] = lookup.charCodeAt(i) & 0xff; |
| 2463 |
} |
| 2464 |
} else { |
| 2465 |
throw new FormatError(`IndexedCS - unrecognized lookup table: ${lookup}`); |
| 2466 |
} |
| 2467 |
} |
| 2468 |
getRgbItem(src, srcOffset, dest, destOffset) { |
| 2469 |
const numComps = this.base.numComps; |
| 2470 |
const start = src[srcOffset] * numComps; |
| 2471 |
this.base.getRgbBuffer(this.lookup, start, 1, dest, destOffset, 8, 0); |
| 2472 |
} |
| 2473 |
getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { |
| 2474 |
const base = this.base; |
| 2475 |
const numComps = base.numComps; |
| 2476 |
const outputDelta = base.getOutputLength(numComps, alpha01); |
| 2477 |
const lookup = this.lookup; |
| 2478 |
for (let i = 0; i < count; ++i) { |
| 2479 |
const lookupPos = src[srcOffset++] * numComps; |
| 2480 |
base.getRgbBuffer(lookup, lookupPos, 1, dest, destOffset, 8, alpha01); |
| 2481 |
destOffset += outputDelta; |
| 2482 |
} |
| 2483 |
} |
| 2484 |
getOutputLength(inputLength, alpha01) { |
| 2485 |
return this.base.getOutputLength(inputLength * this.base.numComps, alpha01); |
| 2486 |
} |
| 2487 |
isDefaultDecode(decodeMap, bpc) { |
| 2488 |
if (!Array.isArray(decodeMap)) { |
| 2489 |
return true; |
| 2490 |
} |
| 2491 |
if (decodeMap.length !== 2) { |
| 2492 |
warn("Decode map length is not correct"); |
| 2493 |
return true; |
| 2494 |
} |
| 2495 |
if (!Number.isInteger(bpc) || bpc < 1) { |
| 2496 |
warn("Bits per component is not correct"); |
| 2497 |
return true; |
| 2498 |
} |
| 2499 |
return decodeMap[0] === 0 && decodeMap[1] === (1 << bpc) - 1; |
| 2500 |
} |
| 2501 |
} |
| 2502 |
class DeviceGrayCS extends ColorSpace { |
| 2503 |
constructor() { |
| 2504 |
super("DeviceGray", 1); |
| 2505 |
} |
| 2506 |
getRgbItem(src, srcOffset, dest, destOffset) { |
| 2507 |
const c = src[srcOffset] * 255; |
| 2508 |
dest[destOffset] = dest[destOffset + 1] = dest[destOffset + 2] = c; |
| 2509 |
} |
| 2510 |
getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { |
| 2511 |
const scale = 255 / ((1 << bits) - 1); |
| 2512 |
let j = srcOffset, |
| 2513 |
q = destOffset; |
| 2514 |
for (let i = 0; i < count; ++i) { |
| 2515 |
const c = scale * src[j++]; |
| 2516 |
dest[q++] = c; |
| 2517 |
dest[q++] = c; |
| 2518 |
dest[q++] = c; |
| 2519 |
q += alpha01; |
| 2520 |
} |
| 2521 |
} |
| 2522 |
getOutputLength(inputLength, alpha01) { |
| 2523 |
return inputLength * (3 + alpha01); |
| 2524 |
} |
| 2525 |
} |
| 2526 |
class DeviceRgbCS extends ColorSpace { |
| 2527 |
constructor() { |
| 2528 |
super("DeviceRGB", 3); |
| 2529 |
} |
| 2530 |
getRgbItem(src, srcOffset, dest, destOffset) { |
| 2531 |
dest[destOffset] = src[srcOffset] * 255; |
| 2532 |
dest[destOffset + 1] = src[srcOffset + 1] * 255; |
| 2533 |
dest[destOffset + 2] = src[srcOffset + 2] * 255; |
| 2534 |
} |
| 2535 |
getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { |
| 2536 |
if (bits === 8 && alpha01 === 0) { |
| 2537 |
dest.set(src.subarray(srcOffset, srcOffset + count * 3), destOffset); |
| 2538 |
return; |
| 2539 |
} |
| 2540 |
const scale = 255 / ((1 << bits) - 1); |
| 2541 |
let j = srcOffset, |
| 2542 |
q = destOffset; |
| 2543 |
for (let i = 0; i < count; ++i) { |
| 2544 |
dest[q++] = scale * src[j++]; |
| 2545 |
dest[q++] = scale * src[j++]; |
| 2546 |
dest[q++] = scale * src[j++]; |
| 2547 |
q += alpha01; |
| 2548 |
} |
| 2549 |
} |
| 2550 |
getOutputLength(inputLength, alpha01) { |
| 2551 |
return inputLength * (3 + alpha01) / 3 | 0; |
| 2552 |
} |
| 2553 |
isPassthrough(bits) { |
| 2554 |
return bits === 8; |
| 2555 |
} |
| 2556 |
} |
| 2557 |
class DeviceRgbaCS extends ColorSpace { |
| 2558 |
constructor() { |
| 2559 |
super("DeviceRGBA", 4); |
| 2560 |
} |
| 2561 |
getOutputLength(inputLength, _alpha01) { |
| 2562 |
return inputLength * 4; |
| 2563 |
} |
| 2564 |
isPassthrough(bits) { |
| 2565 |
return bits === 8; |
| 2566 |
} |
| 2567 |
} |
| 2568 |
class DeviceCmykCS extends ColorSpace { |
| 2569 |
constructor() { |
| 2570 |
super("DeviceCMYK", 4); |
| 2571 |
} |
| 2572 |
#toRgb(src, srcOffset, srcScale, dest, destOffset) { |
| 2573 |
const c = src[srcOffset] * srcScale; |
| 2574 |
const m = src[srcOffset + 1] * srcScale; |
| 2575 |
const y = src[srcOffset + 2] * srcScale; |
| 2576 |
const k = src[srcOffset + 3] * srcScale; |
| 2577 |
dest[destOffset] = 255 + c * (-4.387332384609988 * c + 54.48615194189176 * m + 18.82290502165302 * y + 212.25662451639585 * k + -285.2331026137004) + m * (1.7149763477362134 * m - 5.6096736904047315 * y + -17.873870861415444 * k - 5.497006427196366) + y * (-2.5217340131683033 * y - 21.248923337353073 * k + 17.5119270841813) + k * (-21.86122147463605 * k - 189.48180835922747); |
| 2578 |
dest[destOffset + 1] = 255 + c * (8.841041422036149 * c + 60.118027045597366 * m + 6.871425592049007 * y + 31.159100130055922 * k + -79.2970844816548) + m * (-15.310361306967817 * m + 17.575251261109482 * y + 131.35250912493976 * k - 190.9453302588951) + y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) + k * (-20.737325471181034 * k - 187.80453709719578); |
| 2579 |
dest[destOffset + 2] = 255 + c * (0.8842522430003296 * c + 8.078677503112928 * m + 30.89978309703729 * y - 0.23883238689178934 * k + -14.183576799673286) + m * (10.49593273432072 * m + 63.02378494754052 * y + 50.606957656360734 * k - 112.23884253719248) + y * (0.03296041114873217 * y + 115.60384449646641 * k + -193.58209356861505) + k * (-22.33816807309886 * k - 180.12613974708367); |
| 2580 |
} |
| 2581 |
getRgbItem(src, srcOffset, dest, destOffset) { |
| 2582 |
this.#toRgb(src, srcOffset, 1, dest, destOffset); |
| 2583 |
} |
| 2584 |
getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { |
| 2585 |
const scale = 1 / ((1 << bits) - 1); |
| 2586 |
for (let i = 0; i < count; i++) { |
| 2587 |
this.#toRgb(src, srcOffset, scale, dest, destOffset); |
| 2588 |
srcOffset += 4; |
| 2589 |
destOffset += 3 + alpha01; |
| 2590 |
} |
| 2591 |
} |
| 2592 |
getOutputLength(inputLength, alpha01) { |
| 2593 |
return inputLength / 4 * (3 + alpha01) | 0; |
| 2594 |
} |
| 2595 |
} |
| 2596 |
class CalGrayCS extends ColorSpace { |
| 2597 |
constructor(whitePoint, blackPoint, gamma) { |
| 2598 |
super("CalGray", 1); |
| 2599 |
if (!whitePoint) { |
| 2600 |
throw new FormatError("WhitePoint missing - required for color space CalGray"); |
| 2601 |
} |
| 2602 |
[this.XW, this.YW, this.ZW] = whitePoint; |
| 2603 |
[this.XB, this.YB, this.ZB] = blackPoint || [0, 0, 0]; |
| 2604 |
this.G = gamma || 1; |
| 2605 |
if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { |
| 2606 |
throw new FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`); |
| 2607 |
} |
| 2608 |
if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { |
| 2609 |
info(`Invalid BlackPoint for ${this.name}, falling back to default.`); |
| 2610 |
this.XB = this.YB = this.ZB = 0; |
| 2611 |
} |
| 2612 |
if (this.XB !== 0 || this.YB !== 0 || this.ZB !== 0) { |
| 2613 |
warn(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ` + `ZB: ${this.ZB}, only default values are supported.`); |
| 2614 |
} |
| 2615 |
if (this.G < 1) { |
| 2616 |
info(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`); |
| 2617 |
this.G = 1; |
| 2618 |
} |
| 2619 |
} |
| 2620 |
#toRgb(src, srcOffset, dest, destOffset, scale) { |
| 2621 |
const A = src[srcOffset] * scale; |
| 2622 |
const AG = A ** this.G; |
| 2623 |
const L = this.YW * AG; |
| 2624 |
const val = Math.max(295.8 * L ** 0.3333333333333333 - 40.8, 0); |
| 2625 |
dest[destOffset] = val; |
| 2626 |
dest[destOffset + 1] = val; |
| 2627 |
dest[destOffset + 2] = val; |
| 2628 |
} |
| 2629 |
getRgbItem(src, srcOffset, dest, destOffset) { |
| 2630 |
this.#toRgb(src, srcOffset, dest, destOffset, 1); |
| 2631 |
} |
| 2632 |
getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { |
| 2633 |
const scale = 1 / ((1 << bits) - 1); |
| 2634 |
for (let i = 0; i < count; ++i) { |
| 2635 |
this.#toRgb(src, srcOffset, dest, destOffset, scale); |
| 2636 |
srcOffset += 1; |
| 2637 |
destOffset += 3 + alpha01; |
| 2638 |
} |
| 2639 |
} |
| 2640 |
getOutputLength(inputLength, alpha01) { |
| 2641 |
return inputLength * (3 + alpha01); |
| 2642 |
} |
| 2643 |
} |
| 2644 |
class CalRGBCS extends ColorSpace { |
| 2645 |
static #BRADFORD_SCALE_MATRIX = new Float32Array([0.8951, 0.2664, -0.1614, -0.7502, 1.7135, 0.0367, 0.0389, -0.0685, 1.0296]); |
| 2646 |
static #BRADFORD_SCALE_INVERSE_MATRIX = new Float32Array([0.9869929, -0.1470543, 0.1599627, 0.4323053, 0.5183603, 0.0492912, -0.0085287, 0.0400428, 0.9684867]); |
| 2647 |
static #SRGB_D65_XYZ_TO_RGB_MATRIX = new Float32Array([3.2404542, -1.5371385, -0.4985314, -0.9692660, 1.8760108, 0.0415560, 0.0556434, -0.2040259, 1.0572252]); |
| 2648 |
static #FLAT_WHITEPOINT_MATRIX = new Float32Array([1, 1, 1]); |
| 2649 |
static #tempNormalizeMatrix = new Float32Array(3); |
| 2650 |
static #tempConvertMatrix1 = new Float32Array(3); |
| 2651 |
static #tempConvertMatrix2 = new Float32Array(3); |
| 2652 |
static #DECODE_L_CONSTANT = ((8 + 16) / 116) ** 3 / 8.0; |
| 2653 |
constructor(whitePoint, blackPoint, gamma, matrix) { |
| 2654 |
super("CalRGB", 3); |
| 2655 |
if (!whitePoint) { |
| 2656 |
throw new FormatError("WhitePoint missing - required for color space CalRGB"); |
| 2657 |
} |
| 2658 |
const [XW, YW, ZW] = this.whitePoint = whitePoint; |
| 2659 |
const [XB, YB, ZB] = this.blackPoint = blackPoint || new Float32Array(3); |
| 2660 |
[this.GR, this.GG, this.GB] = gamma || new Float32Array([1, 1, 1]); |
| 2661 |
[this.MXA, this.MYA, this.MZA, this.MXB, this.MYB, this.MZB, this.MXC, this.MYC, this.MZC] = matrix || new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]); |
| 2662 |
if (XW < 0 || ZW < 0 || YW !== 1) { |
| 2663 |
throw new FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`); |
| 2664 |
} |
| 2665 |
if (XB < 0 || YB < 0 || ZB < 0) { |
| 2666 |
info(`Invalid BlackPoint for ${this.name} [${XB}, ${YB}, ${ZB}], ` + "falling back to default."); |
| 2667 |
this.blackPoint = new Float32Array(3); |
| 2668 |
} |
| 2669 |
if (this.GR < 0 || this.GG < 0 || this.GB < 0) { |
| 2670 |
info(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ` + `${this.name}, falling back to default.`); |
| 2671 |
this.GR = this.GG = this.GB = 1; |
| 2672 |
} |
| 2673 |
} |
| 2674 |
#matrixProduct(a, b, result) { |
| 2675 |
result[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; |
| 2676 |
result[1] = a[3] * b[0] + a[4] * b[1] + a[5] * b[2]; |
| 2677 |
result[2] = a[6] * b[0] + a[7] * b[1] + a[8] * b[2]; |
| 2678 |
} |
| 2679 |
#toFlat(sourceWhitePoint, LMS, result) { |
| 2680 |
result[0] = LMS[0] * 1 / sourceWhitePoint[0]; |
| 2681 |
result[1] = LMS[1] * 1 / sourceWhitePoint[1]; |
| 2682 |
result[2] = LMS[2] * 1 / sourceWhitePoint[2]; |
| 2683 |
} |
| 2684 |
#toD65(sourceWhitePoint, LMS, result) { |
| 2685 |
const D65X = 0.95047; |
| 2686 |
const D65Y = 1; |
| 2687 |
const D65Z = 1.08883; |
| 2688 |
result[0] = LMS[0] * D65X / sourceWhitePoint[0]; |
| 2689 |
result[1] = LMS[1] * D65Y / sourceWhitePoint[1]; |
| 2690 |
result[2] = LMS[2] * D65Z / sourceWhitePoint[2]; |
| 2691 |
} |
| 2692 |
#sRGBTransferFunction(color) { |
| 2693 |
if (color <= 0.0031308) { |
| 2694 |
return this.#adjustToRange(0, 1, 12.92 * color); |
| 2695 |
} |
| 2696 |
if (color >= 0.99554525) { |
| 2697 |
return 1; |
| 2698 |
} |
| 2699 |
return this.#adjustToRange(0, 1, (1 + 0.055) * color ** (1 / 2.4) - 0.055); |
| 2700 |
} |
| 2701 |
#adjustToRange(min, max, value) { |
| 2702 |
return Math.max(min, Math.min(max, value)); |
| 2703 |
} |
| 2704 |
#decodeL(L) { |
| 2705 |
if (L < 0) { |
| 2706 |
return -this.#decodeL(-L); |
| 2707 |
} |
| 2708 |
if (L > 8.0) { |
| 2709 |
return ((L + 16) / 116) ** 3; |
| 2710 |
} |
| 2711 |
return L * CalRGBCS.#DECODE_L_CONSTANT; |
| 2712 |
} |
| 2713 |
#compensateBlackPoint(sourceBlackPoint, XYZ_Flat, result) { |
| 2714 |
if (sourceBlackPoint[0] === 0 && sourceBlackPoint[1] === 0 && sourceBlackPoint[2] === 0) { |
| 2715 |
result[0] = XYZ_Flat[0]; |
| 2716 |
result[1] = XYZ_Flat[1]; |
| 2717 |
result[2] = XYZ_Flat[2]; |
| 2718 |
return; |
| 2719 |
} |
| 2720 |
const zeroDecodeL = this.#decodeL(0); |
| 2721 |
const X_DST = zeroDecodeL; |
| 2722 |
const X_SRC = this.#decodeL(sourceBlackPoint[0]); |
| 2723 |
const Y_DST = zeroDecodeL; |
| 2724 |
const Y_SRC = this.#decodeL(sourceBlackPoint[1]); |
| 2725 |
const Z_DST = zeroDecodeL; |
| 2726 |
const Z_SRC = this.#decodeL(sourceBlackPoint[2]); |
| 2727 |
const X_Scale = (1 - X_DST) / (1 - X_SRC); |
| 2728 |
const X_Offset = 1 - X_Scale; |
| 2729 |
const Y_Scale = (1 - Y_DST) / (1 - Y_SRC); |
| 2730 |
const Y_Offset = 1 - Y_Scale; |
| 2731 |
const Z_Scale = (1 - Z_DST) / (1 - Z_SRC); |
| 2732 |
const Z_Offset = 1 - Z_Scale; |
| 2733 |
result[0] = XYZ_Flat[0] * X_Scale + X_Offset; |
| 2734 |
result[1] = XYZ_Flat[1] * Y_Scale + Y_Offset; |
| 2735 |
result[2] = XYZ_Flat[2] * Z_Scale + Z_Offset; |
| 2736 |
} |
| 2737 |
#normalizeWhitePointToFlat(sourceWhitePoint, XYZ_In, result) { |
| 2738 |
if (sourceWhitePoint[0] === 1 && sourceWhitePoint[2] === 1) { |
| 2739 |
result[0] = XYZ_In[0]; |
| 2740 |
result[1] = XYZ_In[1]; |
| 2741 |
result[2] = XYZ_In[2]; |
| 2742 |
return; |
| 2743 |
} |
| 2744 |
const LMS = result; |
| 2745 |
this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_MATRIX, XYZ_In, LMS); |
| 2746 |
const LMS_Flat = CalRGBCS.#tempNormalizeMatrix; |
| 2747 |
this.#toFlat(sourceWhitePoint, LMS, LMS_Flat); |
| 2748 |
this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_INVERSE_MATRIX, LMS_Flat, result); |
| 2749 |
} |
| 2750 |
#normalizeWhitePointToD65(sourceWhitePoint, XYZ_In, result) { |
| 2751 |
const LMS = result; |
| 2752 |
this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_MATRIX, XYZ_In, LMS); |
| 2753 |
const LMS_D65 = CalRGBCS.#tempNormalizeMatrix; |
| 2754 |
this.#toD65(sourceWhitePoint, LMS, LMS_D65); |
| 2755 |
this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_INVERSE_MATRIX, LMS_D65, result); |
| 2756 |
} |
| 2757 |
#toRgb(src, srcOffset, dest, destOffset, scale) { |
| 2758 |
const A = this.#adjustToRange(0, 1, src[srcOffset] * scale); |
| 2759 |
const B = this.#adjustToRange(0, 1, src[srcOffset + 1] * scale); |
| 2760 |
const C = this.#adjustToRange(0, 1, src[srcOffset + 2] * scale); |
| 2761 |
const AGR = A === 1 ? 1 : A ** this.GR; |
| 2762 |
const BGG = B === 1 ? 1 : B ** this.GG; |
| 2763 |
const CGB = C === 1 ? 1 : C ** this.GB; |
| 2764 |
const X = this.MXA * AGR + this.MXB * BGG + this.MXC * CGB; |
| 2765 |
const Y = this.MYA * AGR + this.MYB * BGG + this.MYC * CGB; |
| 2766 |
const Z = this.MZA * AGR + this.MZB * BGG + this.MZC * CGB; |
| 2767 |
const XYZ = CalRGBCS.#tempConvertMatrix1; |
| 2768 |
XYZ[0] = X; |
| 2769 |
XYZ[1] = Y; |
| 2770 |
XYZ[2] = Z; |
| 2771 |
const XYZ_Flat = CalRGBCS.#tempConvertMatrix2; |
| 2772 |
this.#normalizeWhitePointToFlat(this.whitePoint, XYZ, XYZ_Flat); |
| 2773 |
const XYZ_Black = CalRGBCS.#tempConvertMatrix1; |
| 2774 |
this.#compensateBlackPoint(this.blackPoint, XYZ_Flat, XYZ_Black); |
| 2775 |
const XYZ_D65 = CalRGBCS.#tempConvertMatrix2; |
| 2776 |
this.#normalizeWhitePointToD65(CalRGBCS.#FLAT_WHITEPOINT_MATRIX, XYZ_Black, XYZ_D65); |
| 2777 |
const SRGB = CalRGBCS.#tempConvertMatrix1; |
| 2778 |
this.#matrixProduct(CalRGBCS.#SRGB_D65_XYZ_TO_RGB_MATRIX, XYZ_D65, SRGB); |
| 2779 |
dest[destOffset] = this.#sRGBTransferFunction(SRGB[0]) * 255; |
| 2780 |
dest[destOffset + 1] = this.#sRGBTransferFunction(SRGB[1]) * 255; |
| 2781 |
dest[destOffset + 2] = this.#sRGBTransferFunction(SRGB[2]) * 255; |
| 2782 |
} |
| 2783 |
getRgbItem(src, srcOffset, dest, destOffset) { |
| 2784 |
this.#toRgb(src, srcOffset, dest, destOffset, 1); |
| 2785 |
} |
| 2786 |
getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { |
| 2787 |
const scale = 1 / ((1 << bits) - 1); |
| 2788 |
for (let i = 0; i < count; ++i) { |
| 2789 |
this.#toRgb(src, srcOffset, dest, destOffset, scale); |
| 2790 |
srcOffset += 3; |
| 2791 |
destOffset += 3 + alpha01; |
| 2792 |
} |
| 2793 |
} |
| 2794 |
getOutputLength(inputLength, alpha01) { |
| 2795 |
return inputLength * (3 + alpha01) / 3 | 0; |
| 2796 |
} |
| 2797 |
} |
| 2798 |
class LabCS extends ColorSpace { |
| 2799 |
constructor(whitePoint, blackPoint, range) { |
| 2800 |
super("Lab", 3); |
| 2801 |
if (!whitePoint) { |
| 2802 |
throw new FormatError("WhitePoint missing - required for color space Lab"); |
| 2803 |
} |
| 2804 |
[this.XW, this.YW, this.ZW] = whitePoint; |
| 2805 |
[this.amin, this.amax, this.bmin, this.bmax] = range || [-100, 100, -100, 100]; |
| 2806 |
[this.XB, this.YB, this.ZB] = blackPoint || [0, 0, 0]; |
| 2807 |
if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { |
| 2808 |
throw new FormatError("Invalid WhitePoint components, no fallback available"); |
| 2809 |
} |
| 2810 |
if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { |
| 2811 |
info("Invalid BlackPoint, falling back to default"); |
| 2812 |
this.XB = this.YB = this.ZB = 0; |
| 2813 |
} |
| 2814 |
if (this.amin > this.amax || this.bmin > this.bmax) { |
| 2815 |
info("Invalid Range, falling back to defaults"); |
| 2816 |
this.amin = -100; |
| 2817 |
this.amax = 100; |
| 2818 |
this.bmin = -100; |
| 2819 |
this.bmax = 100; |
| 2820 |
} |
| 2821 |
} |
| 2822 |
#fn_g(x) { |
| 2823 |
return x >= 6 / 29 ? x ** 3 : 108 / 841 * (x - 4 / 29); |
| 2824 |
} |
| 2825 |
#decode(value, high1, low2, high2) { |
| 2826 |
return low2 + value * (high2 - low2) / high1; |
| 2827 |
} |
| 2828 |
#toRgb(src, srcOffset, maxVal, dest, destOffset) { |
| 2829 |
let Ls = src[srcOffset]; |
| 2830 |
let as = src[srcOffset + 1]; |
| 2831 |
let bs = src[srcOffset + 2]; |
| 2832 |
if (maxVal !== false) { |
| 2833 |
Ls = this.#decode(Ls, maxVal, 0, 100); |
| 2834 |
as = this.#decode(as, maxVal, this.amin, this.amax); |
| 2835 |
bs = this.#decode(bs, maxVal, this.bmin, this.bmax); |
| 2836 |
} |
| 2837 |
if (as > this.amax) { |
| 2838 |
as = this.amax; |
| 2839 |
} else if (as < this.amin) { |
| 2840 |
as = this.amin; |
| 2841 |
} |
| 2842 |
if (bs > this.bmax) { |
| 2843 |
bs = this.bmax; |
| 2844 |
} else if (bs < this.bmin) { |
| 2845 |
bs = this.bmin; |
| 2846 |
} |
| 2847 |
const M = (Ls + 16) / 116; |
| 2848 |
const L = M + as / 500; |
| 2849 |
const N = M - bs / 200; |
| 2850 |
const X = this.XW * this.#fn_g(L); |
| 2851 |
const Y = this.YW * this.#fn_g(M); |
| 2852 |
const Z = this.ZW * this.#fn_g(N); |
| 2853 |
let r, g, b; |
| 2854 |
if (this.ZW < 1) { |
| 2855 |
r = X * 3.1339 + Y * -1.617 + Z * -0.4906; |
| 2856 |
g = X * -0.9785 + Y * 1.916 + Z * 0.0333; |
| 2857 |
b = X * 0.072 + Y * -0.229 + Z * 1.4057; |
| 2858 |
} else { |
| 2859 |
r = X * 3.2406 + Y * -1.5372 + Z * -0.4986; |
| 2860 |
g = X * -0.9689 + Y * 1.8758 + Z * 0.0415; |
| 2861 |
b = X * 0.0557 + Y * -0.204 + Z * 1.057; |
| 2862 |
} |
| 2863 |
dest[destOffset] = Math.sqrt(r) * 255; |
| 2864 |
dest[destOffset + 1] = Math.sqrt(g) * 255; |
| 2865 |
dest[destOffset + 2] = Math.sqrt(b) * 255; |
| 2866 |
} |
| 2867 |
getRgbItem(src, srcOffset, dest, destOffset) { |
| 2868 |
this.#toRgb(src, srcOffset, false, dest, destOffset); |
| 2869 |
} |
| 2870 |
getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { |
| 2871 |
const maxVal = (1 << bits) - 1; |
| 2872 |
for (let i = 0; i < count; i++) { |
| 2873 |
this.#toRgb(src, srcOffset, maxVal, dest, destOffset); |
| 2874 |
srcOffset += 3; |
| 2875 |
destOffset += 3 + alpha01; |
| 2876 |
} |
| 2877 |
} |
| 2878 |
getOutputLength(inputLength, alpha01) { |
| 2879 |
return inputLength * (3 + alpha01) / 3 | 0; |
| 2880 |
} |
| 2881 |
isDefaultDecode(decodeMap, bpc) { |
| 2882 |
return true; |
| 2883 |
} |
| 2884 |
get usesZeroToOneRange() { |
| 2885 |
return shadow(this, "usesZeroToOneRange", false); |
| 2886 |
} |
| 2887 |
} |
| 2888 |
|
| 2889 |
;// ./src/core/binary_cmap.js |
| 2890 |
|
| 2891 |
function hexToInt(a, size) { |
| 2892 |
let n = 0; |
| 2893 |
for (let i = 0; i <= size; i++) { |
| 2894 |
n = n << 8 | a[i]; |
| 2895 |
} |
| 2896 |
return n >>> 0; |
| 2897 |
} |
| 2898 |
function hexToStr(a, size) { |
| 2899 |
if (size === 1) { |
| 2900 |
return String.fromCharCode(a[0], a[1]); |
| 2901 |
} |
| 2902 |
if (size === 3) { |
| 2903 |
return String.fromCharCode(a[0], a[1], a[2], a[3]); |
| 2904 |
} |
| 2905 |
return String.fromCharCode(...a.subarray(0, size + 1)); |
| 2906 |
} |
| 2907 |
function addHex(a, b, size) { |
| 2908 |
let c = 0; |
| 2909 |
for (let i = size; i >= 0; i--) { |
| 2910 |
c += a[i] + b[i]; |
| 2911 |
a[i] = c & 255; |
| 2912 |
c >>= 8; |
| 2913 |
} |
| 2914 |
} |
| 2915 |
function incHex(a, size) { |
| 2916 |
let c = 1; |
| 2917 |
for (let i = size; i >= 0 && c > 0; i--) { |
| 2918 |
c += a[i]; |
| 2919 |
a[i] = c & 255; |
| 2920 |
c >>= 8; |
| 2921 |
} |
| 2922 |
} |
| 2923 |
const MAX_NUM_SIZE = 16; |
| 2924 |
const MAX_ENCODED_NUM_SIZE = 19; |
| 2925 |
class BinaryCMapStream { |
| 2926 |
constructor(data) { |
| 2927 |
this.buffer = data; |
| 2928 |
this.pos = 0; |
| 2929 |
this.end = data.length; |
| 2930 |
this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE); |
| 2931 |
} |
| 2932 |
readByte() { |
| 2933 |
if (this.pos >= this.end) { |
| 2934 |
return -1; |
| 2935 |
} |
| 2936 |
return this.buffer[this.pos++]; |
| 2937 |
} |
| 2938 |
readNumber() { |
| 2939 |
let n = 0; |
| 2940 |
let last; |
| 2941 |
do { |
| 2942 |
const b = this.readByte(); |
| 2943 |
if (b < 0) { |
| 2944 |
throw new FormatError("unexpected EOF in bcmap"); |
| 2945 |
} |
| 2946 |
last = !(b & 0x80); |
| 2947 |
n = n << 7 | b & 0x7f; |
| 2948 |
} while (!last); |
| 2949 |
return n; |
| 2950 |
} |
| 2951 |
readSigned() { |
| 2952 |
const n = this.readNumber(); |
| 2953 |
return n & 1 ? ~(n >>> 1) : n >>> 1; |
| 2954 |
} |
| 2955 |
readHex(num, size) { |
| 2956 |
num.set(this.buffer.subarray(this.pos, this.pos + size + 1)); |
| 2957 |
this.pos += size + 1; |
| 2958 |
} |
| 2959 |
readHexNumber(num, size) { |
| 2960 |
let last; |
| 2961 |
const stack = this.tmpBuf; |
| 2962 |
let sp = 0; |
| 2963 |
do { |
| 2964 |
const b = this.readByte(); |
| 2965 |
if (b < 0) { |
| 2966 |
throw new FormatError("unexpected EOF in bcmap"); |
| 2967 |
} |
| 2968 |
last = !(b & 0x80); |
| 2969 |
stack[sp++] = b & 0x7f; |
| 2970 |
} while (!last); |
| 2971 |
let i = size, |
| 2972 |
buffer = 0, |
| 2973 |
bufferSize = 0; |
| 2974 |
while (i >= 0) { |
| 2975 |
while (bufferSize < 8 && stack.length > 0) { |
| 2976 |
buffer |= stack[--sp] << bufferSize; |
| 2977 |
bufferSize += 7; |
| 2978 |
} |
| 2979 |
num[i] = buffer & 255; |
| 2980 |
i--; |
| 2981 |
buffer >>= 8; |
| 2982 |
bufferSize -= 8; |
| 2983 |
} |
| 2984 |
} |
| 2985 |
readHexSigned(num, size) { |
| 2986 |
this.readHexNumber(num, size); |
| 2987 |
const sign = num[size] & 1 ? 255 : 0; |
| 2988 |
let c = 0; |
| 2989 |
for (let i = 0; i <= size; i++) { |
| 2990 |
c = (c & 1) << 8 | num[i]; |
| 2991 |
num[i] = c >> 1 ^ sign; |
| 2992 |
} |
| 2993 |
} |
| 2994 |
readString() { |
| 2995 |
const len = this.readNumber(), |
| 2996 |
buf = new Array(len); |
| 2997 |
for (let i = 0; i < len; i++) { |
| 2998 |
buf[i] = this.readNumber(); |
| 2999 |
} |
| 3000 |
return String.fromCharCode(...buf); |
| 3001 |
} |
| 3002 |
} |
| 3003 |
class BinaryCMapReader { |
| 3004 |
async process(data, cMap, extend) { |
| 3005 |
const stream = new BinaryCMapStream(data); |
| 3006 |
const header = stream.readByte(); |
| 3007 |
cMap.vertical = !!(header & 1); |
| 3008 |
let useCMap = null; |
| 3009 |
const start = new Uint8Array(MAX_NUM_SIZE); |
| 3010 |
const end = new Uint8Array(MAX_NUM_SIZE); |
| 3011 |
const char = new Uint8Array(MAX_NUM_SIZE); |
| 3012 |
const charCode = new Uint8Array(MAX_NUM_SIZE); |
| 3013 |
const tmp = new Uint8Array(MAX_NUM_SIZE); |
| 3014 |
let code; |
| 3015 |
let b; |
| 3016 |
while ((b = stream.readByte()) >= 0) { |
| 3017 |
const type = b >> 5; |
| 3018 |
if (type === 7) { |
| 3019 |
switch (b & 0x1f) { |
| 3020 |
case 0: |
| 3021 |
stream.readString(); |
| 3022 |
break; |
| 3023 |
case 1: |
| 3024 |
useCMap = stream.readString(); |
| 3025 |
break; |
| 3026 |
} |
| 3027 |
continue; |
| 3028 |
} |
| 3029 |
const sequence = !!(b & 0x10); |
| 3030 |
const dataSize = b & 15; |
| 3031 |
if (dataSize + 1 > MAX_NUM_SIZE) { |
| 3032 |
throw new Error("BinaryCMapReader.process: Invalid dataSize."); |
| 3033 |
} |
| 3034 |
const ucs2DataSize = 1; |
| 3035 |
const subitemsCount = stream.readNumber(); |
| 3036 |
switch (type) { |
| 3037 |
case 0: |
| 3038 |
stream.readHex(start, dataSize); |
| 3039 |
stream.readHexNumber(end, dataSize); |
| 3040 |
addHex(end, start, dataSize); |
| 3041 |
cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize)); |
| 3042 |
for (let i = 1; i < subitemsCount; i++) { |
| 3043 |
incHex(end, dataSize); |
| 3044 |
stream.readHexNumber(start, dataSize); |
| 3045 |
addHex(start, end, dataSize); |
| 3046 |
stream.readHexNumber(end, dataSize); |
| 3047 |
addHex(end, start, dataSize); |
| 3048 |
cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize)); |
| 3049 |
} |
| 3050 |
break; |
| 3051 |
case 1: |
| 3052 |
stream.readHex(start, dataSize); |
| 3053 |
stream.readHexNumber(end, dataSize); |
| 3054 |
addHex(end, start, dataSize); |
| 3055 |
stream.readNumber(); |
| 3056 |
for (let i = 1; i < subitemsCount; i++) { |
| 3057 |
incHex(end, dataSize); |
| 3058 |
stream.readHexNumber(start, dataSize); |
| 3059 |
addHex(start, end, dataSize); |
| 3060 |
stream.readHexNumber(end, dataSize); |
| 3061 |
addHex(end, start, dataSize); |
| 3062 |
stream.readNumber(); |
| 3063 |
} |
| 3064 |
break; |
| 3065 |
case 2: |
| 3066 |
stream.readHex(char, dataSize); |
| 3067 |
code = stream.readNumber(); |
| 3068 |
cMap.mapOne(hexToInt(char, dataSize), code); |
| 3069 |
for (let i = 1; i < subitemsCount; i++) { |
| 3070 |
incHex(char, dataSize); |
| 3071 |
if (!sequence) { |
| 3072 |
stream.readHexNumber(tmp, dataSize); |
| 3073 |
addHex(char, tmp, dataSize); |
| 3074 |
} |
| 3075 |
code = stream.readSigned() + (code + 1); |
| 3076 |
cMap.mapOne(hexToInt(char, dataSize), code); |
| 3077 |
} |
| 3078 |
break; |
| 3079 |
case 3: |
| 3080 |
stream.readHex(start, dataSize); |
| 3081 |
stream.readHexNumber(end, dataSize); |
| 3082 |
addHex(end, start, dataSize); |
| 3083 |
code = stream.readNumber(); |
| 3084 |
cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code); |
| 3085 |
for (let i = 1; i < subitemsCount; i++) { |
| 3086 |
incHex(end, dataSize); |
| 3087 |
if (!sequence) { |
| 3088 |
stream.readHexNumber(start, dataSize); |
| 3089 |
addHex(start, end, dataSize); |
| 3090 |
} else { |
| 3091 |
start.set(end); |
| 3092 |
} |
| 3093 |
stream.readHexNumber(end, dataSize); |
| 3094 |
addHex(end, start, dataSize); |
| 3095 |
code = stream.readNumber(); |
| 3096 |
cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code); |
| 3097 |
} |
| 3098 |
break; |
| 3099 |
case 4: |
| 3100 |
stream.readHex(char, ucs2DataSize); |
| 3101 |
stream.readHex(charCode, dataSize); |
| 3102 |
cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize)); |
| 3103 |
for (let i = 1; i < subitemsCount; i++) { |
| 3104 |
incHex(char, ucs2DataSize); |
| 3105 |
if (!sequence) { |
| 3106 |
stream.readHexNumber(tmp, ucs2DataSize); |
| 3107 |
addHex(char, tmp, ucs2DataSize); |
| 3108 |
} |
| 3109 |
incHex(charCode, dataSize); |
| 3110 |
stream.readHexSigned(tmp, dataSize); |
| 3111 |
addHex(charCode, tmp, dataSize); |
| 3112 |
cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize)); |
| 3113 |
} |
| 3114 |
break; |
| 3115 |
case 5: |
| 3116 |
stream.readHex(start, ucs2DataSize); |
| 3117 |
stream.readHexNumber(end, ucs2DataSize); |
| 3118 |
addHex(end, start, ucs2DataSize); |
| 3119 |
stream.readHex(charCode, dataSize); |
| 3120 |
cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize)); |
| 3121 |
for (let i = 1; i < subitemsCount; i++) { |
| 3122 |
incHex(end, ucs2DataSize); |
| 3123 |
if (!sequence) { |
| 3124 |
stream.readHexNumber(start, ucs2DataSize); |
| 3125 |
addHex(start, end, ucs2DataSize); |
| 3126 |
} else { |
| 3127 |
start.set(end); |
| 3128 |
} |
| 3129 |
stream.readHexNumber(end, ucs2DataSize); |
| 3130 |
addHex(end, start, ucs2DataSize); |
| 3131 |
stream.readHex(charCode, dataSize); |
| 3132 |
cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize)); |
| 3133 |
} |
| 3134 |
break; |
| 3135 |
default: |
| 3136 |
throw new Error(`BinaryCMapReader.process - unknown type: ${type}`); |
| 3137 |
} |
| 3138 |
} |
| 3139 |
if (useCMap) { |
| 3140 |
return extend(useCMap); |
| 3141 |
} |
| 3142 |
return cMap; |
| 3143 |
} |
| 3144 |
} |
| 3145 |
|
| 3146 |
;// ./src/core/decode_stream.js |
| 3147 |
|
| 3148 |
|
| 3149 |
const emptyBuffer = new Uint8Array(0); |
| 3150 |
class DecodeStream extends BaseStream { |
| 3151 |
constructor(maybeMinBufferLength) { |
| 3152 |
super(); |
| 3153 |
this._rawMinBufferLength = maybeMinBufferLength || 0; |
| 3154 |
this.pos = 0; |
| 3155 |
this.bufferLength = 0; |
| 3156 |
this.eof = false; |
| 3157 |
this.buffer = emptyBuffer; |
| 3158 |
this.minBufferLength = 512; |
| 3159 |
if (maybeMinBufferLength) { |
| 3160 |
while (this.minBufferLength < maybeMinBufferLength) { |
| 3161 |
this.minBufferLength *= 2; |
| 3162 |
} |
| 3163 |
} |
| 3164 |
} |
| 3165 |
get isEmpty() { |
| 3166 |
while (!this.eof && this.bufferLength === 0) { |
| 3167 |
this.readBlock(); |
| 3168 |
} |
| 3169 |
return this.bufferLength === 0; |
| 3170 |
} |
| 3171 |
ensureBuffer(requested) { |
| 3172 |
const buffer = this.buffer; |
| 3173 |
if (requested <= buffer.byteLength) { |
| 3174 |
return buffer; |
| 3175 |
} |
| 3176 |
let size = this.minBufferLength; |
| 3177 |
while (size < requested) { |
| 3178 |
size *= 2; |
| 3179 |
} |
| 3180 |
const buffer2 = new Uint8Array(size); |
| 3181 |
buffer2.set(buffer); |
| 3182 |
return this.buffer = buffer2; |
| 3183 |
} |
| 3184 |
getByte() { |
| 3185 |
const pos = this.pos; |
| 3186 |
while (this.bufferLength <= pos) { |
| 3187 |
if (this.eof) { |
| 3188 |
return -1; |
| 3189 |
} |
| 3190 |
this.readBlock(); |
| 3191 |
} |
| 3192 |
return this.buffer[this.pos++]; |
| 3193 |
} |
| 3194 |
getBytes(length, decoderOptions = null) { |
| 3195 |
const pos = this.pos; |
| 3196 |
let end; |
| 3197 |
if (length) { |
| 3198 |
this.ensureBuffer(pos + length); |
| 3199 |
end = pos + length; |
| 3200 |
while (!this.eof && this.bufferLength < end) { |
| 3201 |
this.readBlock(decoderOptions); |
| 3202 |
} |
| 3203 |
const bufEnd = this.bufferLength; |
| 3204 |
if (end > bufEnd) { |
| 3205 |
end = bufEnd; |
| 3206 |
} |
| 3207 |
} else { |
| 3208 |
while (!this.eof) { |
| 3209 |
this.readBlock(decoderOptions); |
| 3210 |
} |
| 3211 |
end = this.bufferLength; |
| 3212 |
} |
| 3213 |
this.pos = end; |
| 3214 |
return this.buffer.subarray(pos, end); |
| 3215 |
} |
| 3216 |
async getImageData(length, decoderOptions = null) { |
| 3217 |
if (!this.canAsyncDecodeImageFromBuffer) { |
| 3218 |
return this.getBytes(length, decoderOptions); |
| 3219 |
} |
| 3220 |
const data = await this.stream.asyncGetBytes(); |
| 3221 |
return this.decodeImage(data, decoderOptions); |
| 3222 |
} |
| 3223 |
reset() { |
| 3224 |
this.pos = 0; |
| 3225 |
} |
| 3226 |
makeSubStream(start, length, dict = null) { |
| 3227 |
if (length === undefined) { |
| 3228 |
while (!this.eof) { |
| 3229 |
this.readBlock(); |
| 3230 |
} |
| 3231 |
} else { |
| 3232 |
const end = start + length; |
| 3233 |
while (this.bufferLength <= end && !this.eof) { |
| 3234 |
this.readBlock(); |
| 3235 |
} |
| 3236 |
} |
| 3237 |
return new Stream(this.buffer, start, length, dict); |
| 3238 |
} |
| 3239 |
getBaseStreams() { |
| 3240 |
return this.str ? this.str.getBaseStreams() : null; |
| 3241 |
} |
| 3242 |
} |
| 3243 |
class StreamsSequenceStream extends DecodeStream { |
| 3244 |
constructor(streams, onError = null) { |
| 3245 |
let maybeLength = 0; |
| 3246 |
for (const stream of streams) { |
| 3247 |
maybeLength += stream instanceof DecodeStream ? stream._rawMinBufferLength : stream.length; |
| 3248 |
} |
| 3249 |
super(maybeLength); |
| 3250 |
this.streams = streams; |
| 3251 |
this._onError = onError; |
| 3252 |
} |
| 3253 |
readBlock() { |
| 3254 |
const streams = this.streams; |
| 3255 |
if (streams.length === 0) { |
| 3256 |
this.eof = true; |
| 3257 |
return; |
| 3258 |
} |
| 3259 |
const stream = streams.shift(); |
| 3260 |
let chunk; |
| 3261 |
try { |
| 3262 |
chunk = stream.getBytes(); |
| 3263 |
} catch (reason) { |
| 3264 |
if (this._onError) { |
| 3265 |
this._onError(reason, stream.dict?.objId); |
| 3266 |
return; |
| 3267 |
} |
| 3268 |
throw reason; |
| 3269 |
} |
| 3270 |
const bufferLength = this.bufferLength; |
| 3271 |
const newLength = bufferLength + chunk.length; |
| 3272 |
const buffer = this.ensureBuffer(newLength); |
| 3273 |
buffer.set(chunk, bufferLength); |
| 3274 |
this.bufferLength = newLength; |
| 3275 |
} |
| 3276 |
getBaseStreams() { |
| 3277 |
const baseStreamsBuf = []; |
| 3278 |
for (const stream of this.streams) { |
| 3279 |
const baseStreams = stream.getBaseStreams(); |
| 3280 |
if (baseStreams) { |
| 3281 |
baseStreamsBuf.push(...baseStreams); |
| 3282 |
} |
| 3283 |
} |
| 3284 |
return baseStreamsBuf.length > 0 ? baseStreamsBuf : null; |
| 3285 |
} |
| 3286 |
} |
| 3287 |
|
| 3288 |
;// ./src/core/ascii_85_stream.js |
| 3289 |
|
| 3290 |
|
| 3291 |
class Ascii85Stream extends DecodeStream { |
| 3292 |
constructor(str, maybeLength) { |
| 3293 |
if (maybeLength) { |
| 3294 |
maybeLength *= 0.8; |
| 3295 |
} |
| 3296 |
super(maybeLength); |
| 3297 |
this.str = str; |
| 3298 |
this.dict = str.dict; |
| 3299 |
this.input = new Uint8Array(5); |
| 3300 |
} |
| 3301 |
readBlock() { |
| 3302 |
const TILDA_CHAR = 0x7e; |
| 3303 |
const Z_LOWER_CHAR = 0x7a; |
| 3304 |
const EOF = -1; |
| 3305 |
const str = this.str; |
| 3306 |
let c = str.getByte(); |
| 3307 |
while (isWhiteSpace(c)) { |
| 3308 |
c = str.getByte(); |
| 3309 |
} |
| 3310 |
if (c === EOF || c === TILDA_CHAR) { |
| 3311 |
this.eof = true; |
| 3312 |
return; |
| 3313 |
} |
| 3314 |
const bufferLength = this.bufferLength; |
| 3315 |
let buffer, i; |
| 3316 |
if (c === Z_LOWER_CHAR) { |
| 3317 |
buffer = this.ensureBuffer(bufferLength + 4); |
| 3318 |
for (i = 0; i < 4; ++i) { |
| 3319 |
buffer[bufferLength + i] = 0; |
| 3320 |
} |
| 3321 |
this.bufferLength += 4; |
| 3322 |
} else { |
| 3323 |
const input = this.input; |
| 3324 |
input[0] = c; |
| 3325 |
for (i = 1; i < 5; ++i) { |
| 3326 |
c = str.getByte(); |
| 3327 |
while (isWhiteSpace(c)) { |
| 3328 |
c = str.getByte(); |
| 3329 |
} |
| 3330 |
input[i] = c; |
| 3331 |
if (c === EOF || c === TILDA_CHAR) { |
| 3332 |
break; |
| 3333 |
} |
| 3334 |
} |
| 3335 |
buffer = this.ensureBuffer(bufferLength + i - 1); |
| 3336 |
this.bufferLength += i - 1; |
| 3337 |
if (i < 5) { |
| 3338 |
for (; i < 5; ++i) { |
| 3339 |
input[i] = 0x21 + 84; |
| 3340 |
} |
| 3341 |
this.eof = true; |
| 3342 |
} |
| 3343 |
let t = 0; |
| 3344 |
for (i = 0; i < 5; ++i) { |
| 3345 |
t = t * 85 + (input[i] - 0x21); |
| 3346 |
} |
| 3347 |
for (i = 3; i >= 0; --i) { |
| 3348 |
buffer[bufferLength + i] = t & 0xff; |
| 3349 |
t >>= 8; |
| 3350 |
} |
| 3351 |
} |
| 3352 |
} |
| 3353 |
} |
| 3354 |
|
| 3355 |
;// ./src/core/ascii_hex_stream.js |
| 3356 |
|
| 3357 |
class AsciiHexStream extends DecodeStream { |
| 3358 |
constructor(str, maybeLength) { |
| 3359 |
if (maybeLength) { |
| 3360 |
maybeLength *= 0.5; |
| 3361 |
} |
| 3362 |
super(maybeLength); |
| 3363 |
this.str = str; |
| 3364 |
this.dict = str.dict; |
| 3365 |
this.firstDigit = -1; |
| 3366 |
} |
| 3367 |
readBlock() { |
| 3368 |
const UPSTREAM_BLOCK_SIZE = 8000; |
| 3369 |
const bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE); |
| 3370 |
if (!bytes.length) { |
| 3371 |
this.eof = true; |
| 3372 |
return; |
| 3373 |
} |
| 3374 |
const maxDecodeLength = bytes.length + 1 >> 1; |
| 3375 |
const buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength); |
| 3376 |
let bufferLength = this.bufferLength; |
| 3377 |
let firstDigit = this.firstDigit; |
| 3378 |
for (const ch of bytes) { |
| 3379 |
let digit; |
| 3380 |
if (ch >= 0x30 && ch <= 0x39) { |
| 3381 |
digit = ch & 0x0f; |
| 3382 |
} else if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) { |
| 3383 |
digit = (ch & 0x0f) + 9; |
| 3384 |
} else if (ch === 0x3e) { |
| 3385 |
this.eof = true; |
| 3386 |
break; |
| 3387 |
} else { |
| 3388 |
continue; |
| 3389 |
} |
| 3390 |
if (firstDigit < 0) { |
| 3391 |
firstDigit = digit; |
| 3392 |
} else { |
| 3393 |
buffer[bufferLength++] = firstDigit << 4 | digit; |
| 3394 |
firstDigit = -1; |
| 3395 |
} |
| 3396 |
} |
| 3397 |
if (firstDigit >= 0 && this.eof) { |
| 3398 |
buffer[bufferLength++] = firstDigit << 4; |
| 3399 |
firstDigit = -1; |
| 3400 |
} |
| 3401 |
this.firstDigit = firstDigit; |
| 3402 |
this.bufferLength = bufferLength; |
| 3403 |
} |
| 3404 |
} |
| 3405 |
|
| 3406 |
;// ./src/core/ccitt.js |
| 3407 |
|
| 3408 |
const ccittEOL = -2; |
| 3409 |
const ccittEOF = -1; |
| 3410 |
const twoDimPass = 0; |
| 3411 |
const twoDimHoriz = 1; |
| 3412 |
const twoDimVert0 = 2; |
| 3413 |
const twoDimVertR1 = 3; |
| 3414 |
const twoDimVertL1 = 4; |
| 3415 |
const twoDimVertR2 = 5; |
| 3416 |
const twoDimVertL2 = 6; |
| 3417 |
const twoDimVertR3 = 7; |
| 3418 |
const twoDimVertL3 = 8; |
| 3419 |
const twoDimTable = [[-1, -1], [-1, -1], [7, twoDimVertL3], [7, twoDimVertR3], [6, twoDimVertL2], [6, twoDimVertL2], [6, twoDimVertR2], [6, twoDimVertR2], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0]]; |
| 3420 |
const whiteTable1 = [[-1, -1], [12, ccittEOL], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [11, 1792], [11, 1792], [12, 1984], [12, 2048], [12, 2112], [12, 2176], [12, 2240], [12, 2304], [11, 1856], [11, 1856], [11, 1920], [11, 1920], [12, 2368], [12, 2432], [12, 2496], [12, 2560]]; |
| 3421 |
const whiteTable2 = [[-1, -1], [-1, -1], [-1, -1], [-1, -1], [8, 29], [8, 29], [8, 30], [8, 30], [8, 45], [8, 45], [8, 46], [8, 46], [7, 22], [7, 22], [7, 22], [7, 22], [7, 23], [7, 23], [7, 23], [7, 23], [8, 47], [8, 47], [8, 48], [8, 48], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [7, 20], [7, 20], [7, 20], [7, 20], [8, 33], [8, 33], [8, 34], [8, 34], [8, 35], [8, 35], [8, 36], [8, 36], [8, 37], [8, 37], [8, 38], [8, 38], [7, 19], [7, 19], [7, 19], [7, 19], [8, 31], [8, 31], [8, 32], [8, 32], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [8, 53], [8, 53], [8, 54], [8, 54], [7, 26], [7, 26], [7, 26], [7, 26], [8, 39], [8, 39], [8, 40], [8, 40], [8, 41], [8, 41], [8, 42], [8, 42], [8, 43], [8, 43], [8, 44], [8, 44], [7, 21], [7, 21], [7, 21], [7, 21], [7, 28], [7, 28], [7, 28], [7, 28], [8, 61], [8, 61], [8, 62], [8, 62], [8, 63], [8, 63], [8, 0], [8, 0], [8, 320], [8, 320], [8, 384], [8, 384], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [7, 27], [7, 27], [7, 27], [7, 27], [8, 59], [8, 59], [8, 60], [8, 60], [9, 1472], [9, 1536], [9, 1600], [9, 1728], [7, 18], [7, 18], [7, 18], [7, 18], [7, 24], [7, 24], [7, 24], [7, 24], [8, 49], [8, 49], [8, 50], [8, 50], [8, 51], [8, 51], [8, 52], [8, 52], [7, 25], [7, 25], [7, 25], [7, 25], [8, 55], [8, 55], [8, 56], [8, 56], [8, 57], [8, 57], [8, 58], [8, 58], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [8, 448], [8, 448], [8, 512], [8, 512], [9, 704], [9, 768], [8, 640], [8, 640], [8, 576], [8, 576], [9, 832], [9, 896], [9, 960], [9, 1024], [9, 1088], [9, 1152], [9, 1216], [9, 1280], [9, 1344], [9, 1408], [7, 256], [7, 256], [7, 256], [7, 256], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7]]; |
| 3422 |
const blackTable1 = [[-1, -1], [-1, -1], [12, ccittEOL], [12, ccittEOL], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [11, 1792], [11, 1792], [11, 1792], [11, 1792], [12, 1984], [12, 1984], [12, 2048], [12, 2048], [12, 2112], [12, 2112], [12, 2176], [12, 2176], [12, 2240], [12, 2240], [12, 2304], [12, 2304], [11, 1856], [11, 1856], [11, 1856], [11, 1856], [11, 1920], [11, 1920], [11, 1920], [11, 1920], [12, 2368], [12, 2368], [12, 2432], [12, 2432], [12, 2496], [12, 2496], [12, 2560], [12, 2560], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [12, 52], [12, 52], [13, 640], [13, 704], [13, 768], [13, 832], [12, 55], [12, 55], [12, 56], [12, 56], [13, 1280], [13, 1344], [13, 1408], [13, 1472], [12, 59], [12, 59], [12, 60], [12, 60], [13, 1536], [13, 1600], [11, 24], [11, 24], [11, 24], [11, 24], [11, 25], [11, 25], [11, 25], [11, 25], [13, 1664], [13, 1728], [12, 320], [12, 320], [12, 384], [12, 384], [12, 448], [12, 448], [13, 512], [13, 576], [12, 53], [12, 53], [12, 54], [12, 54], [13, 896], [13, 960], [13, 1024], [13, 1088], [13, 1152], [13, 1216], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64]]; |
| 3423 |
const blackTable2 = [[8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [11, 23], [11, 23], [12, 50], [12, 51], [12, 44], [12, 45], [12, 46], [12, 47], [12, 57], [12, 58], [12, 61], [12, 256], [10, 16], [10, 16], [10, 16], [10, 16], [10, 17], [10, 17], [10, 17], [10, 17], [12, 48], [12, 49], [12, 62], [12, 63], [12, 30], [12, 31], [12, 32], [12, 33], [12, 40], [12, 41], [11, 22], [11, 22], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [12, 128], [12, 192], [12, 26], [12, 27], [12, 28], [12, 29], [11, 19], [11, 19], [11, 20], [11, 20], [12, 34], [12, 35], [12, 36], [12, 37], [12, 38], [12, 39], [11, 21], [11, 21], [12, 42], [12, 43], [10, 0], [10, 0], [10, 0], [10, 0], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12]]; |
| 3424 |
const blackTable3 = [[-1, -1], [-1, -1], [-1, -1], [-1, -1], [6, 9], [6, 8], [5, 7], [5, 7], [4, 6], [4, 6], [4, 6], [4, 6], [4, 5], [4, 5], [4, 5], [4, 5], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2]]; |
| 3425 |
class CCITTFaxDecoder { |
| 3426 |
constructor(source, options = {}) { |
| 3427 |
if (!source || typeof source.next !== "function") { |
| 3428 |
throw new Error('CCITTFaxDecoder - invalid "source" parameter.'); |
| 3429 |
} |
| 3430 |
this.source = source; |
| 3431 |
this.eof = false; |
| 3432 |
this.encoding = options.K || 0; |
| 3433 |
this.eoline = options.EndOfLine || false; |
| 3434 |
this.byteAlign = options.EncodedByteAlign || false; |
| 3435 |
this.columns = options.Columns || 1728; |
| 3436 |
this.rows = options.Rows || 0; |
| 3437 |
this.eoblock = options.EndOfBlock ?? true; |
| 3438 |
this.black = options.BlackIs1 || false; |
| 3439 |
this.codingLine = new Uint32Array(this.columns + 1); |
| 3440 |
this.refLine = new Uint32Array(this.columns + 2); |
| 3441 |
this.codingLine[0] = this.columns; |
| 3442 |
this.codingPos = 0; |
| 3443 |
this.row = 0; |
| 3444 |
this.nextLine2D = this.encoding < 0; |
| 3445 |
this.inputBits = 0; |
| 3446 |
this.inputBuf = 0; |
| 3447 |
this.outputBits = 0; |
| 3448 |
this.rowsDone = false; |
| 3449 |
let code1; |
| 3450 |
while ((code1 = this._lookBits(12)) === 0) { |
| 3451 |
this._eatBits(1); |
| 3452 |
} |
| 3453 |
if (code1 === 1) { |
| 3454 |
this._eatBits(12); |
| 3455 |
} |
| 3456 |
if (this.encoding > 0) { |
| 3457 |
this.nextLine2D = !this._lookBits(1); |
| 3458 |
this._eatBits(1); |
| 3459 |
} |
| 3460 |
} |
| 3461 |
readNextChar() { |
| 3462 |
if (this.eof) { |
| 3463 |
return -1; |
| 3464 |
} |
| 3465 |
const refLine = this.refLine; |
| 3466 |
const codingLine = this.codingLine; |
| 3467 |
const columns = this.columns; |
| 3468 |
let refPos, blackPixels, bits, i; |
| 3469 |
if (this.outputBits === 0) { |
| 3470 |
if (this.rowsDone) { |
| 3471 |
this.eof = true; |
| 3472 |
} |
| 3473 |
if (this.eof) { |
| 3474 |
return -1; |
| 3475 |
} |
| 3476 |
this.err = false; |
| 3477 |
let code1, code2, code3; |
| 3478 |
if (this.nextLine2D) { |
| 3479 |
for (i = 0; codingLine[i] < columns; ++i) { |
| 3480 |
refLine[i] = codingLine[i]; |
| 3481 |
} |
| 3482 |
refLine[i++] = columns; |
| 3483 |
refLine[i] = columns; |
| 3484 |
codingLine[0] = 0; |
| 3485 |
this.codingPos = 0; |
| 3486 |
refPos = 0; |
| 3487 |
blackPixels = 0; |
| 3488 |
while (codingLine[this.codingPos] < columns) { |
| 3489 |
code1 = this._getTwoDimCode(); |
| 3490 |
switch (code1) { |
| 3491 |
case twoDimPass: |
| 3492 |
this._addPixels(refLine[refPos + 1], blackPixels); |
| 3493 |
if (refLine[refPos + 1] < columns) { |
| 3494 |
refPos += 2; |
| 3495 |
} |
| 3496 |
break; |
| 3497 |
case twoDimHoriz: |
| 3498 |
code1 = code2 = 0; |
| 3499 |
if (blackPixels) { |
| 3500 |
do { |
| 3501 |
code1 += code3 = this._getBlackCode(); |
| 3502 |
} while (code3 >= 64); |
| 3503 |
do { |
| 3504 |
code2 += code3 = this._getWhiteCode(); |
| 3505 |
} while (code3 >= 64); |
| 3506 |
} else { |
| 3507 |
do { |
| 3508 |
code1 += code3 = this._getWhiteCode(); |
| 3509 |
} while (code3 >= 64); |
| 3510 |
do { |
| 3511 |
code2 += code3 = this._getBlackCode(); |
| 3512 |
} while (code3 >= 64); |
| 3513 |
} |
| 3514 |
this._addPixels(codingLine[this.codingPos] + code1, blackPixels); |
| 3515 |
if (codingLine[this.codingPos] < columns) { |
| 3516 |
this._addPixels(codingLine[this.codingPos] + code2, blackPixels ^ 1); |
| 3517 |
} |
| 3518 |
while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { |
| 3519 |
refPos += 2; |
| 3520 |
} |
| 3521 |
break; |
| 3522 |
case twoDimVertR3: |
| 3523 |
this._addPixels(refLine[refPos] + 3, blackPixels); |
| 3524 |
blackPixels ^= 1; |
| 3525 |
if (codingLine[this.codingPos] < columns) { |
| 3526 |
++refPos; |
| 3527 |
while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { |
| 3528 |
refPos += 2; |
| 3529 |
} |
| 3530 |
} |
| 3531 |
break; |
| 3532 |
case twoDimVertR2: |
| 3533 |
this._addPixels(refLine[refPos] + 2, blackPixels); |
| 3534 |
blackPixels ^= 1; |
| 3535 |
if (codingLine[this.codingPos] < columns) { |
| 3536 |
++refPos; |
| 3537 |
while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { |
| 3538 |
refPos += 2; |
| 3539 |
} |
| 3540 |
} |
| 3541 |
break; |
| 3542 |
case twoDimVertR1: |
| 3543 |
this._addPixels(refLine[refPos] + 1, blackPixels); |
| 3544 |
blackPixels ^= 1; |
| 3545 |
if (codingLine[this.codingPos] < columns) { |
| 3546 |
++refPos; |
| 3547 |
while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { |
| 3548 |
refPos += 2; |
| 3549 |
} |
| 3550 |
} |
| 3551 |
break; |
| 3552 |
case twoDimVert0: |
| 3553 |
this._addPixels(refLine[refPos], blackPixels); |
| 3554 |
blackPixels ^= 1; |
| 3555 |
if (codingLine[this.codingPos] < columns) { |
| 3556 |
++refPos; |
| 3557 |
while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { |
| 3558 |
refPos += 2; |
| 3559 |
} |
| 3560 |
} |
| 3561 |
break; |
| 3562 |
case twoDimVertL3: |
| 3563 |
this._addPixelsNeg(refLine[refPos] - 3, blackPixels); |
| 3564 |
blackPixels ^= 1; |
| 3565 |
if (codingLine[this.codingPos] < columns) { |
| 3566 |
if (refPos > 0) { |
| 3567 |
--refPos; |
| 3568 |
} else { |
| 3569 |
++refPos; |
| 3570 |
} |
| 3571 |
while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { |
| 3572 |
refPos += 2; |
| 3573 |
} |
| 3574 |
} |
| 3575 |
break; |
| 3576 |
case twoDimVertL2: |
| 3577 |
this._addPixelsNeg(refLine[refPos] - 2, blackPixels); |
| 3578 |
blackPixels ^= 1; |
| 3579 |
if (codingLine[this.codingPos] < columns) { |
| 3580 |
if (refPos > 0) { |
| 3581 |
--refPos; |
| 3582 |
} else { |
| 3583 |
++refPos; |
| 3584 |
} |
| 3585 |
while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { |
| 3586 |
refPos += 2; |
| 3587 |
} |
| 3588 |
} |
| 3589 |
break; |
| 3590 |
case twoDimVertL1: |
| 3591 |
this._addPixelsNeg(refLine[refPos] - 1, blackPixels); |
| 3592 |
blackPixels ^= 1; |
| 3593 |
if (codingLine[this.codingPos] < columns) { |
| 3594 |
if (refPos > 0) { |
| 3595 |
--refPos; |
| 3596 |
} else { |
| 3597 |
++refPos; |
| 3598 |
} |
| 3599 |
while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { |
| 3600 |
refPos += 2; |
| 3601 |
} |
| 3602 |
} |
| 3603 |
break; |
| 3604 |
case ccittEOF: |
| 3605 |
this._addPixels(columns, 0); |
| 3606 |
this.eof = true; |
| 3607 |
break; |
| 3608 |
default: |
| 3609 |
info("bad 2d code"); |
| 3610 |
this._addPixels(columns, 0); |
| 3611 |
this.err = true; |
| 3612 |
} |
| 3613 |
} |
| 3614 |
} else { |
| 3615 |
codingLine[0] = 0; |
| 3616 |
this.codingPos = 0; |
| 3617 |
blackPixels = 0; |
| 3618 |
while (codingLine[this.codingPos] < columns) { |
| 3619 |
code1 = 0; |
| 3620 |
if (blackPixels) { |
| 3621 |
do { |
| 3622 |
code1 += code3 = this._getBlackCode(); |
| 3623 |
} while (code3 >= 64); |
| 3624 |
} else { |
| 3625 |
do { |
| 3626 |
code1 += code3 = this._getWhiteCode(); |
| 3627 |
} while (code3 >= 64); |
| 3628 |
} |
| 3629 |
this._addPixels(codingLine[this.codingPos] + code1, blackPixels); |
| 3630 |
blackPixels ^= 1; |
| 3631 |
} |
| 3632 |
} |
| 3633 |
let gotEOL = false; |
| 3634 |
if (this.byteAlign) { |
| 3635 |
this.inputBits &= ~7; |
| 3636 |
} |
| 3637 |
if (!this.eoblock && this.row === this.rows - 1) { |
| 3638 |
this.rowsDone = true; |
| 3639 |
} else { |
| 3640 |
code1 = this._lookBits(12); |
| 3641 |
if (this.eoline) { |
| 3642 |
while (code1 !== ccittEOF && code1 !== 1) { |
| 3643 |
this._eatBits(1); |
| 3644 |
code1 = this._lookBits(12); |
| 3645 |
} |
| 3646 |
} else { |
| 3647 |
while (code1 === 0) { |
| 3648 |
this._eatBits(1); |
| 3649 |
code1 = this._lookBits(12); |
| 3650 |
} |
| 3651 |
} |
| 3652 |
if (code1 === 1) { |
| 3653 |
this._eatBits(12); |
| 3654 |
gotEOL = true; |
| 3655 |
} else if (code1 === ccittEOF) { |
| 3656 |
this.eof = true; |
| 3657 |
} |
| 3658 |
} |
| 3659 |
if (!this.eof && this.encoding > 0 && !this.rowsDone) { |
| 3660 |
this.nextLine2D = !this._lookBits(1); |
| 3661 |
this._eatBits(1); |
| 3662 |
} |
| 3663 |
if (this.eoblock && gotEOL && this.byteAlign) { |
| 3664 |
code1 = this._lookBits(12); |
| 3665 |
if (code1 === 1) { |
| 3666 |
this._eatBits(12); |
| 3667 |
if (this.encoding > 0) { |
| 3668 |
this._lookBits(1); |
| 3669 |
this._eatBits(1); |
| 3670 |
} |
| 3671 |
if (this.encoding >= 0) { |
| 3672 |
for (i = 0; i < 4; ++i) { |
| 3673 |
code1 = this._lookBits(12); |
| 3674 |
if (code1 !== 1) { |
| 3675 |
info("bad rtc code: " + code1); |
| 3676 |
} |
| 3677 |
this._eatBits(12); |
| 3678 |
if (this.encoding > 0) { |
| 3679 |
this._lookBits(1); |
| 3680 |
this._eatBits(1); |
| 3681 |
} |
| 3682 |
} |
| 3683 |
} |
| 3684 |
this.eof = true; |
| 3685 |
} |
| 3686 |
} else if (this.err && this.eoline) { |
| 3687 |
while (true) { |
| 3688 |
code1 = this._lookBits(13); |
| 3689 |
if (code1 === ccittEOF) { |
| 3690 |
this.eof = true; |
| 3691 |
return -1; |
| 3692 |
} |
| 3693 |
if (code1 >> 1 === 1) { |
| 3694 |
break; |
| 3695 |
} |
| 3696 |
this._eatBits(1); |
| 3697 |
} |
| 3698 |
this._eatBits(12); |
| 3699 |
if (this.encoding > 0) { |
| 3700 |
this._eatBits(1); |
| 3701 |
this.nextLine2D = !(code1 & 1); |
| 3702 |
} |
| 3703 |
} |
| 3704 |
this.outputBits = codingLine[0] > 0 ? codingLine[this.codingPos = 0] : codingLine[this.codingPos = 1]; |
| 3705 |
this.row++; |
| 3706 |
} |
| 3707 |
let c; |
| 3708 |
if (this.outputBits >= 8) { |
| 3709 |
c = this.codingPos & 1 ? 0 : 0xff; |
| 3710 |
this.outputBits -= 8; |
| 3711 |
if (this.outputBits === 0 && codingLine[this.codingPos] < columns) { |
| 3712 |
this.codingPos++; |
| 3713 |
this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1]; |
| 3714 |
} |
| 3715 |
} else { |
| 3716 |
bits = 8; |
| 3717 |
c = 0; |
| 3718 |
do { |
| 3719 |
if (typeof this.outputBits !== "number") { |
| 3720 |
throw new FormatError('Invalid /CCITTFaxDecode data, "outputBits" must be a number.'); |
| 3721 |
} |
| 3722 |
if (this.outputBits > bits) { |
| 3723 |
c <<= bits; |
| 3724 |
if (!(this.codingPos & 1)) { |
| 3725 |
c |= 0xff >> 8 - bits; |
| 3726 |
} |
| 3727 |
this.outputBits -= bits; |
| 3728 |
bits = 0; |
| 3729 |
} else { |
| 3730 |
c <<= this.outputBits; |
| 3731 |
if (!(this.codingPos & 1)) { |
| 3732 |
c |= 0xff >> 8 - this.outputBits; |
| 3733 |
} |
| 3734 |
bits -= this.outputBits; |
| 3735 |
this.outputBits = 0; |
| 3736 |
if (codingLine[this.codingPos] < columns) { |
| 3737 |
this.codingPos++; |
| 3738 |
this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1]; |
| 3739 |
} else if (bits > 0) { |
| 3740 |
c <<= bits; |
| 3741 |
bits = 0; |
| 3742 |
} |
| 3743 |
} |
| 3744 |
} while (bits); |
| 3745 |
} |
| 3746 |
if (this.black) { |
| 3747 |
c ^= 0xff; |
| 3748 |
} |
| 3749 |
return c; |
| 3750 |
} |
| 3751 |
_addPixels(a1, blackPixels) { |
| 3752 |
const codingLine = this.codingLine; |
| 3753 |
let codingPos = this.codingPos; |
| 3754 |
if (a1 > codingLine[codingPos]) { |
| 3755 |
if (a1 > this.columns) { |
| 3756 |
info("row is wrong length"); |
| 3757 |
this.err = true; |
| 3758 |
a1 = this.columns; |
| 3759 |
} |
| 3760 |
if (codingPos & 1 ^ blackPixels) { |
| 3761 |
++codingPos; |
| 3762 |
} |
| 3763 |
codingLine[codingPos] = a1; |
| 3764 |
} |
| 3765 |
this.codingPos = codingPos; |
| 3766 |
} |
| 3767 |
_addPixelsNeg(a1, blackPixels) { |
| 3768 |
const codingLine = this.codingLine; |
| 3769 |
let codingPos = this.codingPos; |
| 3770 |
if (a1 > codingLine[codingPos]) { |
| 3771 |
if (a1 > this.columns) { |
| 3772 |
info("row is wrong length"); |
| 3773 |
this.err = true; |
| 3774 |
a1 = this.columns; |
| 3775 |
} |
| 3776 |
if (codingPos & 1 ^ blackPixels) { |
| 3777 |
++codingPos; |
| 3778 |
} |
| 3779 |
codingLine[codingPos] = a1; |
| 3780 |
} else if (a1 < codingLine[codingPos]) { |
| 3781 |
if (a1 < 0) { |
| 3782 |
info("invalid code"); |
| 3783 |
this.err = true; |
| 3784 |
a1 = 0; |
| 3785 |
} |
| 3786 |
while (codingPos > 0 && a1 < codingLine[codingPos - 1]) { |
| 3787 |
--codingPos; |
| 3788 |
} |
| 3789 |
codingLine[codingPos] = a1; |
| 3790 |
} |
| 3791 |
this.codingPos = codingPos; |
| 3792 |
} |
| 3793 |
_findTableCode(start, end, table, limit) { |
| 3794 |
const limitValue = limit || 0; |
| 3795 |
for (let i = start; i <= end; ++i) { |
| 3796 |
let code = this._lookBits(i); |
| 3797 |
if (code === ccittEOF) { |
| 3798 |
return [true, 1, false]; |
| 3799 |
} |
| 3800 |
if (i < end) { |
| 3801 |
code <<= end - i; |
| 3802 |
} |
| 3803 |
if (!limitValue || code >= limitValue) { |
| 3804 |
const p = table[code - limitValue]; |
| 3805 |
if (p[0] === i) { |
| 3806 |
this._eatBits(i); |
| 3807 |
return [true, p[1], true]; |
| 3808 |
} |
| 3809 |
} |
| 3810 |
} |
| 3811 |
return [false, 0, false]; |
| 3812 |
} |
| 3813 |
_getTwoDimCode() { |
| 3814 |
let code = 0; |
| 3815 |
let p; |
| 3816 |
if (this.eoblock) { |
| 3817 |
code = this._lookBits(7); |
| 3818 |
p = twoDimTable[code]; |
| 3819 |
if (p?.[0] > 0) { |
| 3820 |
this._eatBits(p[0]); |
| 3821 |
return p[1]; |
| 3822 |
} |
| 3823 |
} else { |
| 3824 |
const result = this._findTableCode(1, 7, twoDimTable); |
| 3825 |
if (result[0] && result[2]) { |
| 3826 |
return result[1]; |
| 3827 |
} |
| 3828 |
} |
| 3829 |
info("Bad two dim code"); |
| 3830 |
return ccittEOF; |
| 3831 |
} |
| 3832 |
_getWhiteCode() { |
| 3833 |
let code = 0; |
| 3834 |
let p; |
| 3835 |
if (this.eoblock) { |
| 3836 |
code = this._lookBits(12); |
| 3837 |
if (code === ccittEOF) { |
| 3838 |
return 1; |
| 3839 |
} |
| 3840 |
p = code >> 5 === 0 ? whiteTable1[code] : whiteTable2[code >> 3]; |
| 3841 |
if (p[0] > 0) { |
| 3842 |
this._eatBits(p[0]); |
| 3843 |
return p[1]; |
| 3844 |
} |
| 3845 |
} else { |
| 3846 |
let result = this._findTableCode(1, 9, whiteTable2); |
| 3847 |
if (result[0]) { |
| 3848 |
return result[1]; |
| 3849 |
} |
| 3850 |
result = this._findTableCode(11, 12, whiteTable1); |
| 3851 |
if (result[0]) { |
| 3852 |
return result[1]; |
| 3853 |
} |
| 3854 |
} |
| 3855 |
info("bad white code"); |
| 3856 |
this._eatBits(1); |
| 3857 |
return 1; |
| 3858 |
} |
| 3859 |
_getBlackCode() { |
| 3860 |
let code, p; |
| 3861 |
if (this.eoblock) { |
| 3862 |
code = this._lookBits(13); |
| 3863 |
if (code === ccittEOF) { |
| 3864 |
return 1; |
| 3865 |
} |
| 3866 |
if (code >> 7 === 0) { |
| 3867 |
p = blackTable1[code]; |
| 3868 |
} else if (code >> 9 === 0 && code >> 7 !== 0) { |
| 3869 |
p = blackTable2[(code >> 1) - 64]; |
| 3870 |
} else { |
| 3871 |
p = blackTable3[code >> 7]; |
| 3872 |
} |
| 3873 |
if (p[0] > 0) { |
| 3874 |
this._eatBits(p[0]); |
| 3875 |
return p[1]; |
| 3876 |
} |
| 3877 |
} else { |
| 3878 |
let result = this._findTableCode(2, 6, blackTable3); |
| 3879 |
if (result[0]) { |
| 3880 |
return result[1]; |
| 3881 |
} |
| 3882 |
result = this._findTableCode(7, 12, blackTable2, 64); |
| 3883 |
if (result[0]) { |
| 3884 |
return result[1]; |
| 3885 |
} |
| 3886 |
result = this._findTableCode(10, 13, blackTable1); |
| 3887 |
if (result[0]) { |
| 3888 |
return result[1]; |
| 3889 |
} |
| 3890 |
} |
| 3891 |
info("bad black code"); |
| 3892 |
this._eatBits(1); |
| 3893 |
return 1; |
| 3894 |
} |
| 3895 |
_lookBits(n) { |
| 3896 |
let c; |
| 3897 |
while (this.inputBits < n) { |
| 3898 |
if ((c = this.source.next()) === -1) { |
| 3899 |
if (this.inputBits === 0) { |
| 3900 |
return ccittEOF; |
| 3901 |
} |
| 3902 |
return this.inputBuf << n - this.inputBits & 0xffff >> 16 - n; |
| 3903 |
} |
| 3904 |
this.inputBuf = this.inputBuf << 8 | c; |
| 3905 |
this.inputBits += 8; |
| 3906 |
} |
| 3907 |
return this.inputBuf >> this.inputBits - n & 0xffff >> 16 - n; |
| 3908 |
} |
| 3909 |
_eatBits(n) { |
| 3910 |
if ((this.inputBits -= n) < 0) { |
| 3911 |
this.inputBits = 0; |
| 3912 |
} |
| 3913 |
} |
| 3914 |
} |
| 3915 |
|
| 3916 |
;// ./src/core/ccitt_stream.js |
| 3917 |
|
| 3918 |
|
| 3919 |
|
| 3920 |
class CCITTFaxStream extends DecodeStream { |
| 3921 |
constructor(str, maybeLength, params) { |
| 3922 |
super(maybeLength); |
| 3923 |
this.str = str; |
| 3924 |
this.dict = str.dict; |
| 3925 |
if (!(params instanceof Dict)) { |
| 3926 |
params = Dict.empty; |
| 3927 |
} |
| 3928 |
const source = { |
| 3929 |
next() { |
| 3930 |
return str.getByte(); |
| 3931 |
} |
| 3932 |
}; |
| 3933 |
this.ccittFaxDecoder = new CCITTFaxDecoder(source, { |
| 3934 |
K: params.get("K"), |
| 3935 |
EndOfLine: params.get("EndOfLine"), |
| 3936 |
EncodedByteAlign: params.get("EncodedByteAlign"), |
| 3937 |
Columns: params.get("Columns"), |
| 3938 |
Rows: params.get("Rows"), |
| 3939 |
EndOfBlock: params.get("EndOfBlock"), |
| 3940 |
BlackIs1: params.get("BlackIs1") |
| 3941 |
}); |
| 3942 |
} |
| 3943 |
readBlock() { |
| 3944 |
while (!this.eof) { |
| 3945 |
const c = this.ccittFaxDecoder.readNextChar(); |
| 3946 |
if (c === -1) { |
| 3947 |
this.eof = true; |
| 3948 |
return; |
| 3949 |
} |
| 3950 |
this.ensureBuffer(this.bufferLength + 1); |
| 3951 |
this.buffer[this.bufferLength++] = c; |
| 3952 |
} |
| 3953 |
} |
| 3954 |
} |
| 3955 |
|
| 3956 |
;// ./src/core/flate_stream.js |
| 3957 |
|
| 3958 |
|
| 3959 |
|
| 3960 |
const codeLenCodeMap = new Int32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); |
| 3961 |
const lengthDecode = new Int32Array([0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a, 0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f, 0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073, 0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102]); |
| 3962 |
const distDecode = new Int32Array([0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d, 0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1, 0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01, 0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001]); |
| 3963 |
const fixedLitCodeTab = [new Int32Array([0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0, 0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0, 0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0, 0x7010c, 0x80068, 0x80028, 0x900b0, 0x80008, 0x80088, 0x80048, 0x900f0, 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c8, 0x7010a, 0x80064, 0x80024, 0x900a8, 0x80004, 0x80084, 0x80044, 0x900e8, 0x70106, 0x8005c, 0x8001c, 0x90098, 0x70116, 0x8007c, 0x8003c, 0x900d8, 0x7010e, 0x8006c, 0x8002c, 0x900b8, 0x8000c, 0x8008c, 0x8004c, 0x900f8, 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c4, 0x70109, 0x80062, 0x80022, 0x900a4, 0x80002, 0x80082, 0x80042, 0x900e4, 0x70105, 0x8005a, 0x8001a, 0x90094, 0x70115, 0x8007a, 0x8003a, 0x900d4, 0x7010d, 0x8006a, 0x8002a, 0x900b4, 0x8000a, 0x8008a, 0x8004a, 0x900f4, 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cc, 0x7010b, 0x80066, 0x80026, 0x900ac, 0x80006, 0x80086, 0x80046, 0x900ec, 0x70107, 0x8005e, 0x8001e, 0x9009c, 0x70117, 0x8007e, 0x8003e, 0x900dc, 0x7010f, 0x8006e, 0x8002e, 0x900bc, 0x8000e, 0x8008e, 0x8004e, 0x900fc, 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c2, 0x70108, 0x80061, 0x80021, 0x900a2, 0x80001, 0x80081, 0x80041, 0x900e2, 0x70104, 0x80059, 0x80019, 0x90092, 0x70114, 0x80079, 0x80039, 0x900d2, 0x7010c, 0x80069, 0x80029, 0x900b2, 0x80009, 0x80089, 0x80049, 0x900f2, 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900ca, 0x7010a, 0x80065, 0x80025, 0x900aa, 0x80005, 0x80085, 0x80045, 0x900ea, 0x70106, 0x8005d, 0x8001d, 0x9009a, 0x70116, 0x8007d, 0x8003d, 0x900da, 0x7010e, 0x8006d, 0x8002d, 0x900ba, 0x8000d, 0x8008d, 0x8004d, 0x900fa, 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c6, 0x70109, 0x80063, 0x80023, 0x900a6, 0x80003, 0x80083, 0x80043, 0x900e6, 0x70105, 0x8005b, 0x8001b, 0x90096, 0x70115, 0x8007b, 0x8003b, 0x900d6, 0x7010d, 0x8006b, 0x8002b, 0x900b6, 0x8000b, 0x8008b, 0x8004b, 0x900f6, 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900ce, 0x7010b, 0x80067, 0x80027, 0x900ae, 0x80007, 0x80087, 0x80047, 0x900ee, 0x70107, 0x8005f, 0x8001f, 0x9009e, 0x70117, 0x8007f, 0x8003f, 0x900de, 0x7010f, 0x8006f, 0x8002f, 0x900be, 0x8000f, 0x8008f, 0x8004f, 0x900fe, 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c1, 0x70108, 0x80060, 0x80020, 0x900a1, 0x80000, 0x80080, 0x80040, 0x900e1, 0x70104, 0x80058, 0x80018, 0x90091, 0x70114, 0x80078, 0x80038, 0x900d1, 0x7010c, 0x80068, 0x80028, 0x900b1, 0x80008, 0x80088, 0x80048, 0x900f1, 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c9, 0x7010a, 0x80064, 0x80024, 0x900a9, 0x80004, 0x80084, 0x80044, 0x900e9, 0x70106, 0x8005c, 0x8001c, 0x90099, 0x70116, 0x8007c, 0x8003c, 0x900d9, 0x7010e, 0x8006c, 0x8002c, 0x900b9, 0x8000c, 0x8008c, 0x8004c, 0x900f9, 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c5, 0x70109, 0x80062, 0x80022, 0x900a5, 0x80002, 0x80082, 0x80042, 0x900e5, 0x70105, 0x8005a, 0x8001a, 0x90095, 0x70115, 0x8007a, 0x8003a, 0x900d5, 0x7010d, 0x8006a, 0x8002a, 0x900b5, 0x8000a, 0x8008a, 0x8004a, 0x900f5, 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cd, 0x7010b, 0x80066, 0x80026, 0x900ad, 0x80006, 0x80086, 0x80046, 0x900ed, 0x70107, 0x8005e, 0x8001e, 0x9009d, 0x70117, 0x8007e, 0x8003e, 0x900dd, 0x7010f, 0x8006e, 0x8002e, 0x900bd, 0x8000e, 0x8008e, 0x8004e, 0x900fd, 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c3, 0x70108, 0x80061, 0x80021, 0x900a3, 0x80001, 0x80081, 0x80041, 0x900e3, 0x70104, 0x80059, 0x80019, 0x90093, 0x70114, 0x80079, 0x80039, 0x900d3, 0x7010c, 0x80069, 0x80029, 0x900b3, 0x80009, 0x80089, 0x80049, 0x900f3, 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900cb, 0x7010a, 0x80065, 0x80025, 0x900ab, 0x80005, 0x80085, 0x80045, 0x900eb, 0x70106, 0x8005d, 0x8001d, 0x9009b, 0x70116, 0x8007d, 0x8003d, 0x900db, 0x7010e, 0x8006d, 0x8002d, 0x900bb, 0x8000d, 0x8008d, 0x8004d, 0x900fb, 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c7, 0x70109, 0x80063, 0x80023, 0x900a7, 0x80003, 0x80083, 0x80043, 0x900e7, 0x70105, 0x8005b, 0x8001b, 0x90097, 0x70115, 0x8007b, 0x8003b, 0x900d7, 0x7010d, 0x8006b, 0x8002b, 0x900b7, 0x8000b, 0x8008b, 0x8004b, 0x900f7, 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900cf, 0x7010b, 0x80067, 0x80027, 0x900af, 0x80007, 0x80087, 0x80047, 0x900ef, 0x70107, 0x8005f, 0x8001f, 0x9009f, 0x70117, 0x8007f, 0x8003f, 0x900df, 0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff]), 9]; |
| 3964 |
const fixedDistCodeTab = [new Int32Array([0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c, 0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000, 0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d, 0x50003, 0x50013, 0x5000b, 0x5001b, 0x50007, 0x50017, 0x5000f, 0x00000]), 5]; |
| 3965 |
class FlateStream extends DecodeStream { |
| 3966 |
constructor(str, maybeLength) { |
| 3967 |
super(maybeLength); |
| 3968 |
this.str = str; |
| 3969 |
this.dict = str.dict; |
| 3970 |
const cmf = str.getByte(); |
| 3971 |
const flg = str.getByte(); |
| 3972 |
if (cmf === -1 || flg === -1) { |
| 3973 |
throw new FormatError(`Invalid header in flate stream: ${cmf}, ${flg}`); |
| 3974 |
} |
| 3975 |
if ((cmf & 0x0f) !== 0x08) { |
| 3976 |
throw new FormatError(`Unknown compression method in flate stream: ${cmf}, ${flg}`); |
| 3977 |
} |
| 3978 |
if (((cmf << 8) + flg) % 31 !== 0) { |
| 3979 |
throw new FormatError(`Bad FCHECK in flate stream: ${cmf}, ${flg}`); |
| 3980 |
} |
| 3981 |
if (flg & 0x20) { |
| 3982 |
throw new FormatError(`FDICT bit set in flate stream: ${cmf}, ${flg}`); |
| 3983 |
} |
| 3984 |
this.codeSize = 0; |
| 3985 |
this.codeBuf = 0; |
| 3986 |
} |
| 3987 |
async getImageData(length, _decoderOptions) { |
| 3988 |
const data = await this.asyncGetBytes(); |
| 3989 |
return data?.subarray(0, length) || this.getBytes(length); |
| 3990 |
} |
| 3991 |
async asyncGetBytes() { |
| 3992 |
this.str.reset(); |
| 3993 |
const bytes = this.str.getBytes(); |
| 3994 |
try { |
| 3995 |
const { |
| 3996 |
readable, |
| 3997 |
writable |
| 3998 |
} = new DecompressionStream("deflate"); |
| 3999 |
const writer = writable.getWriter(); |
| 4000 |
writer.write(bytes); |
| 4001 |
writer.close(); |
| 4002 |
const chunks = []; |
| 4003 |
let totalLength = 0; |
| 4004 |
for await (const chunk of readable) { |
| 4005 |
chunks.push(chunk); |
| 4006 |
totalLength += chunk.byteLength; |
| 4007 |
} |
| 4008 |
const data = new Uint8Array(totalLength); |
| 4009 |
let offset = 0; |
| 4010 |
for (const chunk of chunks) { |
| 4011 |
data.set(chunk, offset); |
| 4012 |
offset += chunk.byteLength; |
| 4013 |
} |
| 4014 |
return data; |
| 4015 |
} catch { |
| 4016 |
this.str = new Stream(bytes, 2, bytes.length, this.str.dict); |
| 4017 |
this.reset(); |
| 4018 |
return null; |
| 4019 |
} |
| 4020 |
} |
| 4021 |
get isAsync() { |
| 4022 |
return true; |
| 4023 |
} |
| 4024 |
getBits(bits) { |
| 4025 |
const str = this.str; |
| 4026 |
let codeSize = this.codeSize; |
| 4027 |
let codeBuf = this.codeBuf; |
| 4028 |
let b; |
| 4029 |
while (codeSize < bits) { |
| 4030 |
if ((b = str.getByte()) === -1) { |
| 4031 |
throw new FormatError("Bad encoding in flate stream"); |
| 4032 |
} |
| 4033 |
codeBuf |= b << codeSize; |
| 4034 |
codeSize += 8; |
| 4035 |
} |
| 4036 |
b = codeBuf & (1 << bits) - 1; |
| 4037 |
this.codeBuf = codeBuf >> bits; |
| 4038 |
this.codeSize = codeSize -= bits; |
| 4039 |
return b; |
| 4040 |
} |
| 4041 |
getCode(table) { |
| 4042 |
const str = this.str; |
| 4043 |
const codes = table[0]; |
| 4044 |
const maxLen = table[1]; |
| 4045 |
let codeSize = this.codeSize; |
| 4046 |
let codeBuf = this.codeBuf; |
| 4047 |
let b; |
| 4048 |
while (codeSize < maxLen) { |
| 4049 |
if ((b = str.getByte()) === -1) { |
| 4050 |
break; |
| 4051 |
} |
| 4052 |
codeBuf |= b << codeSize; |
| 4053 |
codeSize += 8; |
| 4054 |
} |
| 4055 |
const code = codes[codeBuf & (1 << maxLen) - 1]; |
| 4056 |
const codeLen = code >> 16; |
| 4057 |
const codeVal = code & 0xffff; |
| 4058 |
if (codeLen < 1 || codeSize < codeLen) { |
| 4059 |
throw new FormatError("Bad encoding in flate stream"); |
| 4060 |
} |
| 4061 |
this.codeBuf = codeBuf >> codeLen; |
| 4062 |
this.codeSize = codeSize - codeLen; |
| 4063 |
return codeVal; |
| 4064 |
} |
| 4065 |
generateHuffmanTable(lengths) { |
| 4066 |
const n = lengths.length; |
| 4067 |
let maxLen = 0; |
| 4068 |
let i; |
| 4069 |
for (i = 0; i < n; ++i) { |
| 4070 |
if (lengths[i] > maxLen) { |
| 4071 |
maxLen = lengths[i]; |
| 4072 |
} |
| 4073 |
} |
| 4074 |
const size = 1 << maxLen; |
| 4075 |
const codes = new Int32Array(size); |
| 4076 |
for (let len = 1, code = 0, skip = 2; len <= maxLen; ++len, code <<= 1, skip <<= 1) { |
| 4077 |
for (let val = 0; val < n; ++val) { |
| 4078 |
if (lengths[val] === len) { |
| 4079 |
let code2 = 0; |
| 4080 |
let t = code; |
| 4081 |
for (i = 0; i < len; ++i) { |
| 4082 |
code2 = code2 << 1 | t & 1; |
| 4083 |
t >>= 1; |
| 4084 |
} |
| 4085 |
for (i = code2; i < size; i += skip) { |
| 4086 |
codes[i] = len << 16 | val; |
| 4087 |
} |
| 4088 |
++code; |
| 4089 |
} |
| 4090 |
} |
| 4091 |
} |
| 4092 |
return [codes, maxLen]; |
| 4093 |
} |
| 4094 |
#endsStreamOnError(err) { |
| 4095 |
info(err); |
| 4096 |
this.eof = true; |
| 4097 |
} |
| 4098 |
readBlock() { |
| 4099 |
let buffer, hdr, len; |
| 4100 |
const str = this.str; |
| 4101 |
try { |
| 4102 |
hdr = this.getBits(3); |
| 4103 |
} catch (ex) { |
| 4104 |
this.#endsStreamOnError(ex.message); |
| 4105 |
return; |
| 4106 |
} |
| 4107 |
if (hdr & 1) { |
| 4108 |
this.eof = true; |
| 4109 |
} |
| 4110 |
hdr >>= 1; |
| 4111 |
if (hdr === 0) { |
| 4112 |
let b; |
| 4113 |
if ((b = str.getByte()) === -1) { |
| 4114 |
this.#endsStreamOnError("Bad block header in flate stream"); |
| 4115 |
return; |
| 4116 |
} |
| 4117 |
let blockLen = b; |
| 4118 |
if ((b = str.getByte()) === -1) { |
| 4119 |
this.#endsStreamOnError("Bad block header in flate stream"); |
| 4120 |
return; |
| 4121 |
} |
| 4122 |
blockLen |= b << 8; |
| 4123 |
if ((b = str.getByte()) === -1) { |
| 4124 |
this.#endsStreamOnError("Bad block header in flate stream"); |
| 4125 |
return; |
| 4126 |
} |
| 4127 |
let check = b; |
| 4128 |
if ((b = str.getByte()) === -1) { |
| 4129 |
this.#endsStreamOnError("Bad block header in flate stream"); |
| 4130 |
return; |
| 4131 |
} |
| 4132 |
check |= b << 8; |
| 4133 |
if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) { |
| 4134 |
throw new FormatError("Bad uncompressed block length in flate stream"); |
| 4135 |
} |
| 4136 |
this.codeBuf = 0; |
| 4137 |
this.codeSize = 0; |
| 4138 |
const bufferLength = this.bufferLength, |
| 4139 |
end = bufferLength + blockLen; |
| 4140 |
buffer = this.ensureBuffer(end); |
| 4141 |
this.bufferLength = end; |
| 4142 |
if (blockLen === 0) { |
| 4143 |
if (str.peekByte() === -1) { |
| 4144 |
this.eof = true; |
| 4145 |
} |
| 4146 |
} else { |
| 4147 |
const block = str.getBytes(blockLen); |
| 4148 |
buffer.set(block, bufferLength); |
| 4149 |
if (block.length < blockLen) { |
| 4150 |
this.eof = true; |
| 4151 |
} |
| 4152 |
} |
| 4153 |
return; |
| 4154 |
} |
| 4155 |
let litCodeTable; |
| 4156 |
let distCodeTable; |
| 4157 |
if (hdr === 1) { |
| 4158 |
litCodeTable = fixedLitCodeTab; |
| 4159 |
distCodeTable = fixedDistCodeTab; |
| 4160 |
} else if (hdr === 2) { |
| 4161 |
const numLitCodes = this.getBits(5) + 257; |
| 4162 |
const numDistCodes = this.getBits(5) + 1; |
| 4163 |
const numCodeLenCodes = this.getBits(4) + 4; |
| 4164 |
const codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length); |
| 4165 |
let i; |
| 4166 |
for (i = 0; i < numCodeLenCodes; ++i) { |
| 4167 |
codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3); |
| 4168 |
} |
| 4169 |
const codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths); |
| 4170 |
len = 0; |
| 4171 |
i = 0; |
| 4172 |
const codes = numLitCodes + numDistCodes; |
| 4173 |
const codeLengths = new Uint8Array(codes); |
| 4174 |
let bitsLength, bitsOffset, what; |
| 4175 |
while (i < codes) { |
| 4176 |
const code = this.getCode(codeLenCodeTab); |
| 4177 |
if (code === 16) { |
| 4178 |
bitsLength = 2; |
| 4179 |
bitsOffset = 3; |
| 4180 |
what = len; |
| 4181 |
} else if (code === 17) { |
| 4182 |
bitsLength = 3; |
| 4183 |
bitsOffset = 3; |
| 4184 |
what = len = 0; |
| 4185 |
} else if (code === 18) { |
| 4186 |
bitsLength = 7; |
| 4187 |
bitsOffset = 11; |
| 4188 |
what = len = 0; |
| 4189 |
} else { |
| 4190 |
codeLengths[i++] = len = code; |
| 4191 |
continue; |
| 4192 |
} |
| 4193 |
let repeatLength = this.getBits(bitsLength) + bitsOffset; |
| 4194 |
while (repeatLength-- > 0) { |
| 4195 |
codeLengths[i++] = what; |
| 4196 |
} |
| 4197 |
} |
| 4198 |
litCodeTable = this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes)); |
| 4199 |
distCodeTable = this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes)); |
| 4200 |
} else { |
| 4201 |
throw new FormatError("Unknown block type in flate stream"); |
| 4202 |
} |
| 4203 |
buffer = this.buffer; |
| 4204 |
let limit = buffer ? buffer.length : 0; |
| 4205 |
let pos = this.bufferLength; |
| 4206 |
while (true) { |
| 4207 |
let code1 = this.getCode(litCodeTable); |
| 4208 |
if (code1 < 256) { |
| 4209 |
if (pos + 1 >= limit) { |
| 4210 |
buffer = this.ensureBuffer(pos + 1); |
| 4211 |
limit = buffer.length; |
| 4212 |
} |
| 4213 |
buffer[pos++] = code1; |
| 4214 |
continue; |
| 4215 |
} |
| 4216 |
if (code1 === 256) { |
| 4217 |
this.bufferLength = pos; |
| 4218 |
return; |
| 4219 |
} |
| 4220 |
code1 -= 257; |
| 4221 |
code1 = lengthDecode[code1]; |
| 4222 |
let code2 = code1 >> 16; |
| 4223 |
if (code2 > 0) { |
| 4224 |
code2 = this.getBits(code2); |
| 4225 |
} |
| 4226 |
len = (code1 & 0xffff) + code2; |
| 4227 |
code1 = this.getCode(distCodeTable); |
| 4228 |
code1 = distDecode[code1]; |
| 4229 |
code2 = code1 >> 16; |
| 4230 |
if (code2 > 0) { |
| 4231 |
code2 = this.getBits(code2); |
| 4232 |
} |
| 4233 |
const dist = (code1 & 0xffff) + code2; |
| 4234 |
if (pos + len >= limit) { |
| 4235 |
buffer = this.ensureBuffer(pos + len); |
| 4236 |
limit = buffer.length; |
| 4237 |
} |
| 4238 |
for (let k = 0; k < len; ++k, ++pos) { |
| 4239 |
buffer[pos] = buffer[pos - dist]; |
| 4240 |
} |
| 4241 |
} |
| 4242 |
} |
| 4243 |
} |
| 4244 |
|
| 4245 |
;// ./src/core/arithmetic_decoder.js |
| 4246 |
const QeTable = [{ |
| 4247 |
qe: 0x5601, |
| 4248 |
nmps: 1, |
| 4249 |
nlps: 1, |
| 4250 |
switchFlag: 1 |
| 4251 |
}, { |
| 4252 |
qe: 0x3401, |
| 4253 |
nmps: 2, |
| 4254 |
nlps: 6, |
| 4255 |
switchFlag: 0 |
| 4256 |
}, { |
| 4257 |
qe: 0x1801, |
| 4258 |
nmps: 3, |
| 4259 |
nlps: 9, |
| 4260 |
switchFlag: 0 |
| 4261 |
}, { |
| 4262 |
qe: 0x0ac1, |
| 4263 |
nmps: 4, |
| 4264 |
nlps: 12, |
| 4265 |
switchFlag: 0 |
| 4266 |
}, { |
| 4267 |
qe: 0x0521, |
| 4268 |
nmps: 5, |
| 4269 |
nlps: 29, |
| 4270 |
switchFlag: 0 |
| 4271 |
}, { |
| 4272 |
qe: 0x0221, |
| 4273 |
nmps: 38, |
| 4274 |
nlps: 33, |
| 4275 |
switchFlag: 0 |
| 4276 |
}, { |
| 4277 |
qe: 0x5601, |
| 4278 |
nmps: 7, |
| 4279 |
nlps: 6, |
| 4280 |
switchFlag: 1 |
| 4281 |
}, { |
| 4282 |
qe: 0x5401, |
| 4283 |
nmps: 8, |
| 4284 |
nlps: 14, |
| 4285 |
switchFlag: 0 |
| 4286 |
}, { |
| 4287 |
qe: 0x4801, |
| 4288 |
nmps: 9, |
| 4289 |
nlps: 14, |
| 4290 |
switchFlag: 0 |
| 4291 |
}, { |
| 4292 |
qe: 0x3801, |
| 4293 |
nmps: 10, |
| 4294 |
nlps: 14, |
| 4295 |
switchFlag: 0 |
| 4296 |
}, { |
| 4297 |
qe: 0x3001, |
| 4298 |
nmps: 11, |
| 4299 |
nlps: 17, |
| 4300 |
switchFlag: 0 |
| 4301 |
}, { |
| 4302 |
qe: 0x2401, |
| 4303 |
nmps: 12, |
| 4304 |
nlps: 18, |
| 4305 |
switchFlag: 0 |
| 4306 |
}, { |
| 4307 |
qe: 0x1c01, |
| 4308 |
nmps: 13, |
| 4309 |
nlps: 20, |
| 4310 |
switchFlag: 0 |
| 4311 |
}, { |
| 4312 |
qe: 0x1601, |
| 4313 |
nmps: 29, |
| 4314 |
nlps: 21, |
| 4315 |
switchFlag: 0 |
| 4316 |
}, { |
| 4317 |
qe: 0x5601, |
| 4318 |
nmps: 15, |
| 4319 |
nlps: 14, |
| 4320 |
switchFlag: 1 |
| 4321 |
}, { |
| 4322 |
qe: 0x5401, |
| 4323 |
nmps: 16, |
| 4324 |
nlps: 14, |
| 4325 |
switchFlag: 0 |
| 4326 |
}, { |
| 4327 |
qe: 0x5101, |
| 4328 |
nmps: 17, |
| 4329 |
nlps: 15, |
| 4330 |
switchFlag: 0 |
| 4331 |
}, { |
| 4332 |
qe: 0x4801, |
| 4333 |
nmps: 18, |
| 4334 |
nlps: 16, |
| 4335 |
switchFlag: 0 |
| 4336 |
}, { |
| 4337 |
qe: 0x3801, |
| 4338 |
nmps: 19, |
| 4339 |
nlps: 17, |
| 4340 |
switchFlag: 0 |
| 4341 |
}, { |
| 4342 |
qe: 0x3401, |
| 4343 |
nmps: 20, |
| 4344 |
nlps: 18, |
| 4345 |
switchFlag: 0 |
| 4346 |
}, { |
| 4347 |
qe: 0x3001, |
| 4348 |
nmps: 21, |
| 4349 |
nlps: 19, |
| 4350 |
switchFlag: 0 |
| 4351 |
}, { |
| 4352 |
qe: 0x2801, |
| 4353 |
nmps: 22, |
| 4354 |
nlps: 19, |
| 4355 |
switchFlag: 0 |
| 4356 |
}, { |
| 4357 |
qe: 0x2401, |
| 4358 |
nmps: 23, |
| 4359 |
nlps: 20, |
| 4360 |
switchFlag: 0 |
| 4361 |
}, { |
| 4362 |
qe: 0x2201, |
| 4363 |
nmps: 24, |
| 4364 |
nlps: 21, |
| 4365 |
switchFlag: 0 |
| 4366 |
}, { |
| 4367 |
qe: 0x1c01, |
| 4368 |
nmps: 25, |
| 4369 |
nlps: 22, |
| 4370 |
switchFlag: 0 |
| 4371 |
}, { |
| 4372 |
qe: 0x1801, |
| 4373 |
nmps: 26, |
| 4374 |
nlps: 23, |
| 4375 |
switchFlag: 0 |
| 4376 |
}, { |
| 4377 |
qe: 0x1601, |
| 4378 |
nmps: 27, |
| 4379 |
nlps: 24, |
| 4380 |
switchFlag: 0 |
| 4381 |
}, { |
| 4382 |
qe: 0x1401, |
| 4383 |
nmps: 28, |
| 4384 |
nlps: 25, |
| 4385 |
switchFlag: 0 |
| 4386 |
}, { |
| 4387 |
qe: 0x1201, |
| 4388 |
nmps: 29, |
| 4389 |
nlps: 26, |
| 4390 |
switchFlag: 0 |
| 4391 |
}, { |
| 4392 |
qe: 0x1101, |
| 4393 |
nmps: 30, |
| 4394 |
nlps: 27, |
| 4395 |
switchFlag: 0 |
| 4396 |
}, { |
| 4397 |
qe: 0x0ac1, |
| 4398 |
nmps: 31, |
| 4399 |
nlps: 28, |
| 4400 |
switchFlag: 0 |
| 4401 |
}, { |
| 4402 |
qe: 0x09c1, |
| 4403 |
nmps: 32, |
| 4404 |
nlps: 29, |
| 4405 |
switchFlag: 0 |
| 4406 |
}, { |
| 4407 |
qe: 0x08a1, |
| 4408 |
nmps: 33, |
| 4409 |
nlps: 30, |
| 4410 |
switchFlag: 0 |
| 4411 |
}, { |
| 4412 |
qe: 0x0521, |
| 4413 |
nmps: 34, |
| 4414 |
nlps: 31, |
| 4415 |
switchFlag: 0 |
| 4416 |
}, { |
| 4417 |
qe: 0x0441, |
| 4418 |
nmps: 35, |
| 4419 |
nlps: 32, |
| 4420 |
switchFlag: 0 |
| 4421 |
}, { |
| 4422 |
qe: 0x02a1, |
| 4423 |
nmps: 36, |
| 4424 |
nlps: 33, |
| 4425 |
switchFlag: 0 |
| 4426 |
}, { |
| 4427 |
qe: 0x0221, |
| 4428 |
nmps: 37, |
| 4429 |
nlps: 34, |
| 4430 |
switchFlag: 0 |
| 4431 |
}, { |
| 4432 |
qe: 0x0141, |
| 4433 |
nmps: 38, |
| 4434 |
nlps: 35, |
| 4435 |
switchFlag: 0 |
| 4436 |
}, { |
| 4437 |
qe: 0x0111, |
| 4438 |
nmps: 39, |
| 4439 |
nlps: 36, |
| 4440 |
switchFlag: 0 |
| 4441 |
}, { |
| 4442 |
qe: 0x0085, |
| 4443 |
nmps: 40, |
| 4444 |
nlps: 37, |
| 4445 |
switchFlag: 0 |
| 4446 |
}, { |
| 4447 |
qe: 0x0049, |
| 4448 |
nmps: 41, |
| 4449 |
nlps: 38, |
| 4450 |
switchFlag: 0 |
| 4451 |
}, { |
| 4452 |
qe: 0x0025, |
| 4453 |
nmps: 42, |
| 4454 |
nlps: 39, |
| 4455 |
switchFlag: 0 |
| 4456 |
}, { |
| 4457 |
qe: 0x0015, |
| 4458 |
nmps: 43, |
| 4459 |
nlps: 40, |
| 4460 |
switchFlag: 0 |
| 4461 |
}, { |
| 4462 |
qe: 0x0009, |
| 4463 |
nmps: 44, |
| 4464 |
nlps: 41, |
| 4465 |
switchFlag: 0 |
| 4466 |
}, { |
| 4467 |
qe: 0x0005, |
| 4468 |
nmps: 45, |
| 4469 |
nlps: 42, |
| 4470 |
switchFlag: 0 |
| 4471 |
}, { |
| 4472 |
qe: 0x0001, |
| 4473 |
nmps: 45, |
| 4474 |
nlps: 43, |
| 4475 |
switchFlag: 0 |
| 4476 |
}, { |
| 4477 |
qe: 0x5601, |
| 4478 |
nmps: 46, |
| 4479 |
nlps: 46, |
| 4480 |
switchFlag: 0 |
| 4481 |
}]; |
| 4482 |
class ArithmeticDecoder { |
| 4483 |
constructor(data, start, end) { |
| 4484 |
this.data = data; |
| 4485 |
this.bp = start; |
| 4486 |
this.dataEnd = end; |
| 4487 |
this.chigh = data[start]; |
| 4488 |
this.clow = 0; |
| 4489 |
this.byteIn(); |
| 4490 |
this.chigh = this.chigh << 7 & 0xffff | this.clow >> 9 & 0x7f; |
| 4491 |
this.clow = this.clow << 7 & 0xffff; |
| 4492 |
this.ct -= 7; |
| 4493 |
this.a = 0x8000; |
| 4494 |
} |
| 4495 |
byteIn() { |
| 4496 |
const data = this.data; |
| 4497 |
let bp = this.bp; |
| 4498 |
if (data[bp] === 0xff) { |
| 4499 |
if (data[bp + 1] > 0x8f) { |
| 4500 |
this.clow += 0xff00; |
| 4501 |
this.ct = 8; |
| 4502 |
} else { |
| 4503 |
bp++; |
| 4504 |
this.clow += data[bp] << 9; |
| 4505 |
this.ct = 7; |
| 4506 |
this.bp = bp; |
| 4507 |
} |
| 4508 |
} else { |
| 4509 |
bp++; |
| 4510 |
this.clow += bp < this.dataEnd ? data[bp] << 8 : 0xff00; |
| 4511 |
this.ct = 8; |
| 4512 |
this.bp = bp; |
| 4513 |
} |
| 4514 |
if (this.clow > 0xffff) { |
| 4515 |
this.chigh += this.clow >> 16; |
| 4516 |
this.clow &= 0xffff; |
| 4517 |
} |
| 4518 |
} |
| 4519 |
readBit(contexts, pos) { |
| 4520 |
let cx_index = contexts[pos] >> 1, |
| 4521 |
cx_mps = contexts[pos] & 1; |
| 4522 |
const qeTableIcx = QeTable[cx_index]; |
| 4523 |
const qeIcx = qeTableIcx.qe; |
| 4524 |
let d; |
| 4525 |
let a = this.a - qeIcx; |
| 4526 |
if (this.chigh < qeIcx) { |
| 4527 |
if (a < qeIcx) { |
| 4528 |
a = qeIcx; |
| 4529 |
d = cx_mps; |
| 4530 |
cx_index = qeTableIcx.nmps; |
| 4531 |
} else { |
| 4532 |
a = qeIcx; |
| 4533 |
d = 1 ^ cx_mps; |
| 4534 |
if (qeTableIcx.switchFlag === 1) { |
| 4535 |
cx_mps = d; |
| 4536 |
} |
| 4537 |
cx_index = qeTableIcx.nlps; |
| 4538 |
} |
| 4539 |
} else { |
| 4540 |
this.chigh -= qeIcx; |
| 4541 |
if ((a & 0x8000) !== 0) { |
| 4542 |
this.a = a; |
| 4543 |
return cx_mps; |
| 4544 |
} |
| 4545 |
if (a < qeIcx) { |
| 4546 |
d = 1 ^ cx_mps; |
| 4547 |
if (qeTableIcx.switchFlag === 1) { |
| 4548 |
cx_mps = d; |
| 4549 |
} |
| 4550 |
cx_index = qeTableIcx.nlps; |
| 4551 |
} else { |
| 4552 |
d = cx_mps; |
| 4553 |
cx_index = qeTableIcx.nmps; |
| 4554 |
} |
| 4555 |
} |
| 4556 |
do { |
| 4557 |
if (this.ct === 0) { |
| 4558 |
this.byteIn(); |
| 4559 |
} |
| 4560 |
a <<= 1; |
| 4561 |
this.chigh = this.chigh << 1 & 0xffff | this.clow >> 15 & 1; |
| 4562 |
this.clow = this.clow << 1 & 0xffff; |
| 4563 |
this.ct--; |
| 4564 |
} while ((a & 0x8000) === 0); |
| 4565 |
this.a = a; |
| 4566 |
contexts[pos] = cx_index << 1 | cx_mps; |
| 4567 |
return d; |
| 4568 |
} |
| 4569 |
} |
| 4570 |
|
| 4571 |
;// ./src/core/jbig2.js |
| 4572 |
|
| 4573 |
|
| 4574 |
|
| 4575 |
|
| 4576 |
class Jbig2Error extends BaseException { |
| 4577 |
constructor(msg) { |
| 4578 |
super(msg, "Jbig2Error"); |
| 4579 |
} |
| 4580 |
} |
| 4581 |
class ContextCache { |
| 4582 |
getContexts(id) { |
| 4583 |
if (id in this) { |
| 4584 |
return this[id]; |
| 4585 |
} |
| 4586 |
return this[id] = new Int8Array(1 << 16); |
| 4587 |
} |
| 4588 |
} |
| 4589 |
class DecodingContext { |
| 4590 |
constructor(data, start, end) { |
| 4591 |
this.data = data; |
| 4592 |
this.start = start; |
| 4593 |
this.end = end; |
| 4594 |
} |
| 4595 |
get decoder() { |
| 4596 |
const decoder = new ArithmeticDecoder(this.data, this.start, this.end); |
| 4597 |
return shadow(this, "decoder", decoder); |
| 4598 |
} |
| 4599 |
get contextCache() { |
| 4600 |
const cache = new ContextCache(); |
| 4601 |
return shadow(this, "contextCache", cache); |
| 4602 |
} |
| 4603 |
} |
| 4604 |
const MAX_INT_32 = 2 ** 31 - 1; |
| 4605 |
const MIN_INT_32 = -(2 ** 31); |
| 4606 |
function decodeInteger(contextCache, procedure, decoder) { |
| 4607 |
const contexts = contextCache.getContexts(procedure); |
| 4608 |
let prev = 1; |
| 4609 |
function readBits(length) { |
| 4610 |
let v = 0; |
| 4611 |
for (let i = 0; i < length; i++) { |
| 4612 |
const bit = decoder.readBit(contexts, prev); |
| 4613 |
prev = prev < 256 ? prev << 1 | bit : (prev << 1 | bit) & 511 | 256; |
| 4614 |
v = v << 1 | bit; |
| 4615 |
} |
| 4616 |
return v >>> 0; |
| 4617 |
} |
| 4618 |
const sign = readBits(1); |
| 4619 |
const value = readBits(1) ? readBits(1) ? readBits(1) ? readBits(1) ? readBits(1) ? readBits(32) + 4436 : readBits(12) + 340 : readBits(8) + 84 : readBits(6) + 20 : readBits(4) + 4 : readBits(2); |
| 4620 |
let signedValue; |
| 4621 |
if (sign === 0) { |
| 4622 |
signedValue = value; |
| 4623 |
} else if (value > 0) { |
| 4624 |
signedValue = -value; |
| 4625 |
} |
| 4626 |
if (signedValue >= MIN_INT_32 && signedValue <= MAX_INT_32) { |
| 4627 |
return signedValue; |
| 4628 |
} |
| 4629 |
return null; |
| 4630 |
} |
| 4631 |
function decodeIAID(contextCache, decoder, codeLength) { |
| 4632 |
const contexts = contextCache.getContexts("IAID"); |
| 4633 |
let prev = 1; |
| 4634 |
for (let i = 0; i < codeLength; i++) { |
| 4635 |
const bit = decoder.readBit(contexts, prev); |
| 4636 |
prev = prev << 1 | bit; |
| 4637 |
} |
| 4638 |
if (codeLength < 31) { |
| 4639 |
return prev & (1 << codeLength) - 1; |
| 4640 |
} |
| 4641 |
return prev & 0x7fffffff; |
| 4642 |
} |
| 4643 |
const SegmentTypes = ["SymbolDictionary", null, null, null, "IntermediateTextRegion", null, "ImmediateTextRegion", "ImmediateLosslessTextRegion", null, null, null, null, null, null, null, null, "PatternDictionary", null, null, null, "IntermediateHalftoneRegion", null, "ImmediateHalftoneRegion", "ImmediateLosslessHalftoneRegion", null, null, null, null, null, null, null, null, null, null, null, null, "IntermediateGenericRegion", null, "ImmediateGenericRegion", "ImmediateLosslessGenericRegion", "IntermediateGenericRefinementRegion", null, "ImmediateGenericRefinementRegion", "ImmediateLosslessGenericRefinementRegion", null, null, null, null, "PageInformation", "EndOfPage", "EndOfStripe", "EndOfFile", "Profiles", "Tables", null, null, null, null, null, null, null, null, "Extension"]; |
| 4644 |
const CodingTemplates = [[{ |
| 4645 |
x: -1, |
| 4646 |
y: -2 |
| 4647 |
}, { |
| 4648 |
x: 0, |
| 4649 |
y: -2 |
| 4650 |
}, { |
| 4651 |
x: 1, |
| 4652 |
y: -2 |
| 4653 |
}, { |
| 4654 |
x: -2, |
| 4655 |
y: -1 |
| 4656 |
}, { |
| 4657 |
x: -1, |
| 4658 |
y: -1 |
| 4659 |
}, { |
| 4660 |
x: 0, |
| 4661 |
y: -1 |
| 4662 |
}, { |
| 4663 |
x: 1, |
| 4664 |
y: -1 |
| 4665 |
}, { |
| 4666 |
x: 2, |
| 4667 |
y: -1 |
| 4668 |
}, { |
| 4669 |
x: -4, |
| 4670 |
y: 0 |
| 4671 |
}, { |
| 4672 |
x: -3, |
| 4673 |
y: 0 |
| 4674 |
}, { |
| 4675 |
x: -2, |
| 4676 |
y: 0 |
| 4677 |
}, { |
| 4678 |
x: -1, |
| 4679 |
y: 0 |
| 4680 |
}], [{ |
| 4681 |
x: -1, |
| 4682 |
y: -2 |
| 4683 |
}, { |
| 4684 |
x: 0, |
| 4685 |
y: -2 |
| 4686 |
}, { |
| 4687 |
x: 1, |
| 4688 |
y: -2 |
| 4689 |
}, { |
| 4690 |
x: 2, |
| 4691 |
y: -2 |
| 4692 |
}, { |
| 4693 |
x: -2, |
| 4694 |
y: -1 |
| 4695 |
}, { |
| 4696 |
x: -1, |
| 4697 |
y: -1 |
| 4698 |
}, { |
| 4699 |
x: 0, |
| 4700 |
y: -1 |
| 4701 |
}, { |
| 4702 |
x: 1, |
| 4703 |
y: -1 |
| 4704 |
}, { |
| 4705 |
x: 2, |
| 4706 |
y: -1 |
| 4707 |
}, { |
| 4708 |
x: -3, |
| 4709 |
y: 0 |
| 4710 |
}, { |
| 4711 |
x: -2, |
| 4712 |
y: 0 |
| 4713 |
}, { |
| 4714 |
x: -1, |
| 4715 |
y: 0 |
| 4716 |
}], [{ |
| 4717 |
x: -1, |
| 4718 |
y: -2 |
| 4719 |
}, { |
| 4720 |
x: 0, |
| 4721 |
y: -2 |
| 4722 |
}, { |
| 4723 |
x: 1, |
| 4724 |
y: -2 |
| 4725 |
}, { |
| 4726 |
x: -2, |
| 4727 |
y: -1 |
| 4728 |
}, { |
| 4729 |
x: -1, |
| 4730 |
y: -1 |
| 4731 |
}, { |
| 4732 |
x: 0, |
| 4733 |
y: -1 |
| 4734 |
}, { |
| 4735 |
x: 1, |
| 4736 |
y: -1 |
| 4737 |
}, { |
| 4738 |
x: -2, |
| 4739 |
y: 0 |
| 4740 |
}, { |
| 4741 |
x: -1, |
| 4742 |
y: 0 |
| 4743 |
}], [{ |
| 4744 |
x: -3, |
| 4745 |
y: -1 |
| 4746 |
}, { |
| 4747 |
x: -2, |
| 4748 |
y: -1 |
| 4749 |
}, { |
| 4750 |
x: -1, |
| 4751 |
y: -1 |
| 4752 |
}, { |
| 4753 |
x: 0, |
| 4754 |
y: -1 |
| 4755 |
}, { |
| 4756 |
x: 1, |
| 4757 |
y: -1 |
| 4758 |
}, { |
| 4759 |
x: -4, |
| 4760 |
y: 0 |
| 4761 |
}, { |
| 4762 |
x: -3, |
| 4763 |
y: 0 |
| 4764 |
}, { |
| 4765 |
x: -2, |
| 4766 |
y: 0 |
| 4767 |
}, { |
| 4768 |
x: -1, |
| 4769 |
y: 0 |
| 4770 |
}]]; |
| 4771 |
const RefinementTemplates = [{ |
| 4772 |
coding: [{ |
| 4773 |
x: 0, |
| 4774 |
y: -1 |
| 4775 |
}, { |
| 4776 |
x: 1, |
| 4777 |
y: -1 |
| 4778 |
}, { |
| 4779 |
x: -1, |
| 4780 |
y: 0 |
| 4781 |
}], |
| 4782 |
reference: [{ |
| 4783 |
x: 0, |
| 4784 |
y: -1 |
| 4785 |
}, { |
| 4786 |
x: 1, |
| 4787 |
y: -1 |
| 4788 |
}, { |
| 4789 |
x: -1, |
| 4790 |
y: 0 |
| 4791 |
}, { |
| 4792 |
x: 0, |
| 4793 |
y: 0 |
| 4794 |
}, { |
| 4795 |
x: 1, |
| 4796 |
y: 0 |
| 4797 |
}, { |
| 4798 |
x: -1, |
| 4799 |
y: 1 |
| 4800 |
}, { |
| 4801 |
x: 0, |
| 4802 |
y: 1 |
| 4803 |
}, { |
| 4804 |
x: 1, |
| 4805 |
y: 1 |
| 4806 |
}] |
| 4807 |
}, { |
| 4808 |
coding: [{ |
| 4809 |
x: -1, |
| 4810 |
y: -1 |
| 4811 |
}, { |
| 4812 |
x: 0, |
| 4813 |
y: -1 |
| 4814 |
}, { |
| 4815 |
x: 1, |
| 4816 |
y: -1 |
| 4817 |
}, { |
| 4818 |
x: -1, |
| 4819 |
y: 0 |
| 4820 |
}], |
| 4821 |
reference: [{ |
| 4822 |
x: 0, |
| 4823 |
y: -1 |
| 4824 |
}, { |
| 4825 |
x: -1, |
| 4826 |
y: 0 |
| 4827 |
}, { |
| 4828 |
x: 0, |
| 4829 |
y: 0 |
| 4830 |
}, { |
| 4831 |
x: 1, |
| 4832 |
y: 0 |
| 4833 |
}, { |
| 4834 |
x: 0, |
| 4835 |
y: 1 |
| 4836 |
}, { |
| 4837 |
x: 1, |
| 4838 |
y: 1 |
| 4839 |
}] |
| 4840 |
}]; |
| 4841 |
const ReusedContexts = [0x9b25, 0x0795, 0x00e5, 0x0195]; |
| 4842 |
const RefinementReusedContexts = [0x0020, 0x0008]; |
| 4843 |
function decodeBitmapTemplate0(width, height, decodingContext) { |
| 4844 |
const decoder = decodingContext.decoder; |
| 4845 |
const contexts = decodingContext.contextCache.getContexts("GB"); |
| 4846 |
const bitmap = []; |
| 4847 |
let contextLabel, i, j, pixel, row, row1, row2; |
| 4848 |
const OLD_PIXEL_MASK = 0x7bf7; |
| 4849 |
for (i = 0; i < height; i++) { |
| 4850 |
row = bitmap[i] = new Uint8Array(width); |
| 4851 |
row1 = i < 1 ? row : bitmap[i - 1]; |
| 4852 |
row2 = i < 2 ? row : bitmap[i - 2]; |
| 4853 |
contextLabel = row2[0] << 13 | row2[1] << 12 | row2[2] << 11 | row1[0] << 7 | row1[1] << 6 | row1[2] << 5 | row1[3] << 4; |
| 4854 |
for (j = 0; j < width; j++) { |
| 4855 |
row[j] = pixel = decoder.readBit(contexts, contextLabel); |
| 4856 |
contextLabel = (contextLabel & OLD_PIXEL_MASK) << 1 | (j + 3 < width ? row2[j + 3] << 11 : 0) | (j + 4 < width ? row1[j + 4] << 4 : 0) | pixel; |
| 4857 |
} |
| 4858 |
} |
| 4859 |
return bitmap; |
| 4860 |
} |
| 4861 |
function decodeBitmap(mmr, width, height, templateIndex, prediction, skip, at, decodingContext) { |
| 4862 |
if (mmr) { |
| 4863 |
const input = new Reader(decodingContext.data, decodingContext.start, decodingContext.end); |
| 4864 |
return decodeMMRBitmap(input, width, height, false); |
| 4865 |
} |
| 4866 |
if (templateIndex === 0 && !skip && !prediction && at.length === 4 && at[0].x === 3 && at[0].y === -1 && at[1].x === -3 && at[1].y === -1 && at[2].x === 2 && at[2].y === -2 && at[3].x === -2 && at[3].y === -2) { |
| 4867 |
return decodeBitmapTemplate0(width, height, decodingContext); |
| 4868 |
} |
| 4869 |
const useskip = !!skip; |
| 4870 |
const template = CodingTemplates[templateIndex].concat(at); |
| 4871 |
template.sort(function (a, b) { |
| 4872 |
return a.y - b.y || a.x - b.x; |
| 4873 |
}); |
| 4874 |
const templateLength = template.length; |
| 4875 |
const templateX = new Int8Array(templateLength); |
| 4876 |
const templateY = new Int8Array(templateLength); |
| 4877 |
const changingTemplateEntries = []; |
| 4878 |
let reuseMask = 0, |
| 4879 |
minX = 0, |
| 4880 |
maxX = 0, |
| 4881 |
minY = 0; |
| 4882 |
let c, k; |
| 4883 |
for (k = 0; k < templateLength; k++) { |
| 4884 |
templateX[k] = template[k].x; |
| 4885 |
templateY[k] = template[k].y; |
| 4886 |
minX = Math.min(minX, template[k].x); |
| 4887 |
maxX = Math.max(maxX, template[k].x); |
| 4888 |
minY = Math.min(minY, template[k].y); |
| 4889 |
if (k < templateLength - 1 && template[k].y === template[k + 1].y && template[k].x === template[k + 1].x - 1) { |
| 4890 |
reuseMask |= 1 << templateLength - 1 - k; |
| 4891 |
} else { |
| 4892 |
changingTemplateEntries.push(k); |
| 4893 |
} |
| 4894 |
} |
| 4895 |
const changingEntriesLength = changingTemplateEntries.length; |
| 4896 |
const changingTemplateX = new Int8Array(changingEntriesLength); |
| 4897 |
const changingTemplateY = new Int8Array(changingEntriesLength); |
| 4898 |
const changingTemplateBit = new Uint16Array(changingEntriesLength); |
| 4899 |
for (c = 0; c < changingEntriesLength; c++) { |
| 4900 |
k = changingTemplateEntries[c]; |
| 4901 |
changingTemplateX[c] = template[k].x; |
| 4902 |
changingTemplateY[c] = template[k].y; |
| 4903 |
changingTemplateBit[c] = 1 << templateLength - 1 - k; |
| 4904 |
} |
| 4905 |
const sbb_left = -minX; |
| 4906 |
const sbb_top = -minY; |
| 4907 |
const sbb_right = width - maxX; |
| 4908 |
const pseudoPixelContext = ReusedContexts[templateIndex]; |
| 4909 |
let row = new Uint8Array(width); |
| 4910 |
const bitmap = []; |
| 4911 |
const decoder = decodingContext.decoder; |
| 4912 |
const contexts = decodingContext.contextCache.getContexts("GB"); |
| 4913 |
let ltp = 0, |
| 4914 |
j, |
| 4915 |
i0, |
| 4916 |
j0, |
| 4917 |
contextLabel = 0, |
| 4918 |
bit, |
| 4919 |
shift; |
| 4920 |
for (let i = 0; i < height; i++) { |
| 4921 |
if (prediction) { |
| 4922 |
const sltp = decoder.readBit(contexts, pseudoPixelContext); |
| 4923 |
ltp ^= sltp; |
| 4924 |
if (ltp) { |
| 4925 |
bitmap.push(row); |
| 4926 |
continue; |
| 4927 |
} |
| 4928 |
} |
| 4929 |
row = new Uint8Array(row); |
| 4930 |
bitmap.push(row); |
| 4931 |
for (j = 0; j < width; j++) { |
| 4932 |
if (useskip && skip[i][j]) { |
| 4933 |
row[j] = 0; |
| 4934 |
continue; |
| 4935 |
} |
| 4936 |
if (j >= sbb_left && j < sbb_right && i >= sbb_top) { |
| 4937 |
contextLabel = contextLabel << 1 & reuseMask; |
| 4938 |
for (k = 0; k < changingEntriesLength; k++) { |
| 4939 |
i0 = i + changingTemplateY[k]; |
| 4940 |
j0 = j + changingTemplateX[k]; |
| 4941 |
bit = bitmap[i0][j0]; |
| 4942 |
if (bit) { |
| 4943 |
bit = changingTemplateBit[k]; |
| 4944 |
contextLabel |= bit; |
| 4945 |
} |
| 4946 |
} |
| 4947 |
} else { |
| 4948 |
contextLabel = 0; |
| 4949 |
shift = templateLength - 1; |
| 4950 |
for (k = 0; k < templateLength; k++, shift--) { |
| 4951 |
j0 = j + templateX[k]; |
| 4952 |
if (j0 >= 0 && j0 < width) { |
| 4953 |
i0 = i + templateY[k]; |
| 4954 |
if (i0 >= 0) { |
| 4955 |
bit = bitmap[i0][j0]; |
| 4956 |
if (bit) { |
| 4957 |
contextLabel |= bit << shift; |
| 4958 |
} |
| 4959 |
} |
| 4960 |
} |
| 4961 |
} |
| 4962 |
} |
| 4963 |
const pixel = decoder.readBit(contexts, contextLabel); |
| 4964 |
row[j] = pixel; |
| 4965 |
} |
| 4966 |
} |
| 4967 |
return bitmap; |
| 4968 |
} |
| 4969 |
function decodeRefinement(width, height, templateIndex, referenceBitmap, offsetX, offsetY, prediction, at, decodingContext) { |
| 4970 |
let codingTemplate = RefinementTemplates[templateIndex].coding; |
| 4971 |
if (templateIndex === 0) { |
| 4972 |
codingTemplate = codingTemplate.concat([at[0]]); |
| 4973 |
} |
| 4974 |
const codingTemplateLength = codingTemplate.length; |
| 4975 |
const codingTemplateX = new Int32Array(codingTemplateLength); |
| 4976 |
const codingTemplateY = new Int32Array(codingTemplateLength); |
| 4977 |
let k; |
| 4978 |
for (k = 0; k < codingTemplateLength; k++) { |
| 4979 |
codingTemplateX[k] = codingTemplate[k].x; |
| 4980 |
codingTemplateY[k] = codingTemplate[k].y; |
| 4981 |
} |
| 4982 |
let referenceTemplate = RefinementTemplates[templateIndex].reference; |
| 4983 |
if (templateIndex === 0) { |
| 4984 |
referenceTemplate = referenceTemplate.concat([at[1]]); |
| 4985 |
} |
| 4986 |
const referenceTemplateLength = referenceTemplate.length; |
| 4987 |
const referenceTemplateX = new Int32Array(referenceTemplateLength); |
| 4988 |
const referenceTemplateY = new Int32Array(referenceTemplateLength); |
| 4989 |
for (k = 0; k < referenceTemplateLength; k++) { |
| 4990 |
referenceTemplateX[k] = referenceTemplate[k].x; |
| 4991 |
referenceTemplateY[k] = referenceTemplate[k].y; |
| 4992 |
} |
| 4993 |
const referenceWidth = referenceBitmap[0].length; |
| 4994 |
const referenceHeight = referenceBitmap.length; |
| 4995 |
const pseudoPixelContext = RefinementReusedContexts[templateIndex]; |
| 4996 |
const bitmap = []; |
| 4997 |
const decoder = decodingContext.decoder; |
| 4998 |
const contexts = decodingContext.contextCache.getContexts("GR"); |
| 4999 |
let ltp = 0; |
| 5000 |
for (let i = 0; i < height; i++) { |
| 5001 |
if (prediction) { |
| 5002 |
const sltp = decoder.readBit(contexts, pseudoPixelContext); |
| 5003 |
ltp ^= sltp; |
| 5004 |
if (ltp) { |
| 5005 |
throw new Jbig2Error("prediction is not supported"); |
| 5006 |
} |
| 5007 |
} |
| 5008 |
const row = new Uint8Array(width); |
| 5009 |
bitmap.push(row); |
| 5010 |
for (let j = 0; j < width; j++) { |
| 5011 |
let i0, j0; |
| 5012 |
let contextLabel = 0; |
| 5013 |
for (k = 0; k < codingTemplateLength; k++) { |
| 5014 |
i0 = i + codingTemplateY[k]; |
| 5015 |
j0 = j + codingTemplateX[k]; |
| 5016 |
if (i0 < 0 || j0 < 0 || j0 >= width) { |
| 5017 |
contextLabel <<= 1; |
| 5018 |
} else { |
| 5019 |
contextLabel = contextLabel << 1 | bitmap[i0][j0]; |
| 5020 |
} |
| 5021 |
} |
| 5022 |
for (k = 0; k < referenceTemplateLength; k++) { |
| 5023 |
i0 = i + referenceTemplateY[k] - offsetY; |
| 5024 |
j0 = j + referenceTemplateX[k] - offsetX; |
| 5025 |
if (i0 < 0 || i0 >= referenceHeight || j0 < 0 || j0 >= referenceWidth) { |
| 5026 |
contextLabel <<= 1; |
| 5027 |
} else { |
| 5028 |
contextLabel = contextLabel << 1 | referenceBitmap[i0][j0]; |
| 5029 |
} |
| 5030 |
} |
| 5031 |
const pixel = decoder.readBit(contexts, contextLabel); |
| 5032 |
row[j] = pixel; |
| 5033 |
} |
| 5034 |
} |
| 5035 |
return bitmap; |
| 5036 |
} |
| 5037 |
function decodeSymbolDictionary(huffman, refinement, symbols, numberOfNewSymbols, numberOfExportedSymbols, huffmanTables, templateIndex, at, refinementTemplateIndex, refinementAt, decodingContext, huffmanInput) { |
| 5038 |
if (huffman && refinement) { |
| 5039 |
throw new Jbig2Error("symbol refinement with Huffman is not supported"); |
| 5040 |
} |
| 5041 |
const newSymbols = []; |
| 5042 |
let currentHeight = 0; |
| 5043 |
let symbolCodeLength = log2(symbols.length + numberOfNewSymbols); |
| 5044 |
const decoder = decodingContext.decoder; |
| 5045 |
const contextCache = decodingContext.contextCache; |
| 5046 |
let tableB1, symbolWidths; |
| 5047 |
if (huffman) { |
| 5048 |
tableB1 = getStandardTable(1); |
| 5049 |
symbolWidths = []; |
| 5050 |
symbolCodeLength = Math.max(symbolCodeLength, 1); |
| 5051 |
} |
| 5052 |
while (newSymbols.length < numberOfNewSymbols) { |
| 5053 |
const deltaHeight = huffman ? huffmanTables.tableDeltaHeight.decode(huffmanInput) : decodeInteger(contextCache, "IADH", decoder); |
| 5054 |
currentHeight += deltaHeight; |
| 5055 |
let currentWidth = 0, |
| 5056 |
totalWidth = 0; |
| 5057 |
const firstSymbol = huffman ? symbolWidths.length : 0; |
| 5058 |
while (true) { |
| 5059 |
const deltaWidth = huffman ? huffmanTables.tableDeltaWidth.decode(huffmanInput) : decodeInteger(contextCache, "IADW", decoder); |
| 5060 |
if (deltaWidth === null) { |
| 5061 |
break; |
| 5062 |
} |
| 5063 |
currentWidth += deltaWidth; |
| 5064 |
totalWidth += currentWidth; |
| 5065 |
let bitmap; |
| 5066 |
if (refinement) { |
| 5067 |
const numberOfInstances = decodeInteger(contextCache, "IAAI", decoder); |
| 5068 |
if (numberOfInstances > 1) { |
| 5069 |
bitmap = decodeTextRegion(huffman, refinement, currentWidth, currentHeight, 0, numberOfInstances, 1, symbols.concat(newSymbols), symbolCodeLength, 0, 0, 1, 0, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext, 0, huffmanInput); |
| 5070 |
} else { |
| 5071 |
const symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); |
| 5072 |
const rdx = decodeInteger(contextCache, "IARDX", decoder); |
| 5073 |
const rdy = decodeInteger(contextCache, "IARDY", decoder); |
| 5074 |
const symbol = symbolId < symbols.length ? symbols[symbolId] : newSymbols[symbolId - symbols.length]; |
| 5075 |
bitmap = decodeRefinement(currentWidth, currentHeight, refinementTemplateIndex, symbol, rdx, rdy, false, refinementAt, decodingContext); |
| 5076 |
} |
| 5077 |
newSymbols.push(bitmap); |
| 5078 |
} else if (huffman) { |
| 5079 |
symbolWidths.push(currentWidth); |
| 5080 |
} else { |
| 5081 |
bitmap = decodeBitmap(false, currentWidth, currentHeight, templateIndex, false, null, at, decodingContext); |
| 5082 |
newSymbols.push(bitmap); |
| 5083 |
} |
| 5084 |
} |
| 5085 |
if (huffman && !refinement) { |
| 5086 |
const bitmapSize = huffmanTables.tableBitmapSize.decode(huffmanInput); |
| 5087 |
huffmanInput.byteAlign(); |
| 5088 |
let collectiveBitmap; |
| 5089 |
if (bitmapSize === 0) { |
| 5090 |
collectiveBitmap = readUncompressedBitmap(huffmanInput, totalWidth, currentHeight); |
| 5091 |
} else { |
| 5092 |
const originalEnd = huffmanInput.end; |
| 5093 |
const bitmapEnd = huffmanInput.position + bitmapSize; |
| 5094 |
huffmanInput.end = bitmapEnd; |
| 5095 |
collectiveBitmap = decodeMMRBitmap(huffmanInput, totalWidth, currentHeight, false); |
| 5096 |
huffmanInput.end = originalEnd; |
| 5097 |
huffmanInput.position = bitmapEnd; |
| 5098 |
} |
| 5099 |
const numberOfSymbolsDecoded = symbolWidths.length; |
| 5100 |
if (firstSymbol === numberOfSymbolsDecoded - 1) { |
| 5101 |
newSymbols.push(collectiveBitmap); |
| 5102 |
} else { |
| 5103 |
let i, |
| 5104 |
y, |
| 5105 |
xMin = 0, |
| 5106 |
xMax, |
| 5107 |
bitmapWidth, |
| 5108 |
symbolBitmap; |
| 5109 |
for (i = firstSymbol; i < numberOfSymbolsDecoded; i++) { |
| 5110 |
bitmapWidth = symbolWidths[i]; |
| 5111 |
xMax = xMin + bitmapWidth; |
| 5112 |
symbolBitmap = []; |
| 5113 |
for (y = 0; y < currentHeight; y++) { |
| 5114 |
symbolBitmap.push(collectiveBitmap[y].subarray(xMin, xMax)); |
| 5115 |
} |
| 5116 |
newSymbols.push(symbolBitmap); |
| 5117 |
xMin = xMax; |
| 5118 |
} |
| 5119 |
} |
| 5120 |
} |
| 5121 |
} |
| 5122 |
const exportedSymbols = [], |
| 5123 |
flags = []; |
| 5124 |
let currentFlag = false, |
| 5125 |
i, |
| 5126 |
ii; |
| 5127 |
const totalSymbolsLength = symbols.length + numberOfNewSymbols; |
| 5128 |
while (flags.length < totalSymbolsLength) { |
| 5129 |
let runLength = huffman ? tableB1.decode(huffmanInput) : decodeInteger(contextCache, "IAEX", decoder); |
| 5130 |
while (runLength--) { |
| 5131 |
flags.push(currentFlag); |
| 5132 |
} |
| 5133 |
currentFlag = !currentFlag; |
| 5134 |
} |
| 5135 |
for (i = 0, ii = symbols.length; i < ii; i++) { |
| 5136 |
if (flags[i]) { |
| 5137 |
exportedSymbols.push(symbols[i]); |
| 5138 |
} |
| 5139 |
} |
| 5140 |
for (let j = 0; j < numberOfNewSymbols; i++, j++) { |
| 5141 |
if (flags[i]) { |
| 5142 |
exportedSymbols.push(newSymbols[j]); |
| 5143 |
} |
| 5144 |
} |
| 5145 |
return exportedSymbols; |
| 5146 |
} |
| 5147 |
function decodeTextRegion(huffman, refinement, width, height, defaultPixelValue, numberOfSymbolInstances, stripSize, inputSymbols, symbolCodeLength, transposed, dsOffset, referenceCorner, combinationOperator, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext, logStripSize, huffmanInput) { |
| 5148 |
if (huffman && refinement) { |
| 5149 |
throw new Jbig2Error("refinement with Huffman is not supported"); |
| 5150 |
} |
| 5151 |
const bitmap = []; |
| 5152 |
let i, row; |
| 5153 |
for (i = 0; i < height; i++) { |
| 5154 |
row = new Uint8Array(width); |
| 5155 |
if (defaultPixelValue) { |
| 5156 |
for (let j = 0; j < width; j++) { |
| 5157 |
row[j] = defaultPixelValue; |
| 5158 |
} |
| 5159 |
} |
| 5160 |
bitmap.push(row); |
| 5161 |
} |
| 5162 |
const decoder = decodingContext.decoder; |
| 5163 |
const contextCache = decodingContext.contextCache; |
| 5164 |
let stripT = huffman ? -huffmanTables.tableDeltaT.decode(huffmanInput) : -decodeInteger(contextCache, "IADT", decoder); |
| 5165 |
let firstS = 0; |
| 5166 |
i = 0; |
| 5167 |
while (i < numberOfSymbolInstances) { |
| 5168 |
const deltaT = huffman ? huffmanTables.tableDeltaT.decode(huffmanInput) : decodeInteger(contextCache, "IADT", decoder); |
| 5169 |
stripT += deltaT; |
| 5170 |
const deltaFirstS = huffman ? huffmanTables.tableFirstS.decode(huffmanInput) : decodeInteger(contextCache, "IAFS", decoder); |
| 5171 |
firstS += deltaFirstS; |
| 5172 |
let currentS = firstS; |
| 5173 |
do { |
| 5174 |
let currentT = 0; |
| 5175 |
if (stripSize > 1) { |
| 5176 |
currentT = huffman ? huffmanInput.readBits(logStripSize) : decodeInteger(contextCache, "IAIT", decoder); |
| 5177 |
} |
| 5178 |
const t = stripSize * stripT + currentT; |
| 5179 |
const symbolId = huffman ? huffmanTables.symbolIDTable.decode(huffmanInput) : decodeIAID(contextCache, decoder, symbolCodeLength); |
| 5180 |
const applyRefinement = refinement && (huffman ? huffmanInput.readBit() : decodeInteger(contextCache, "IARI", decoder)); |
| 5181 |
let symbolBitmap = inputSymbols[symbolId]; |
| 5182 |
let symbolWidth = symbolBitmap[0].length; |
| 5183 |
let symbolHeight = symbolBitmap.length; |
| 5184 |
if (applyRefinement) { |
| 5185 |
const rdw = decodeInteger(contextCache, "IARDW", decoder); |
| 5186 |
const rdh = decodeInteger(contextCache, "IARDH", decoder); |
| 5187 |
const rdx = decodeInteger(contextCache, "IARDX", decoder); |
| 5188 |
const rdy = decodeInteger(contextCache, "IARDY", decoder); |
| 5189 |
symbolWidth += rdw; |
| 5190 |
symbolHeight += rdh; |
| 5191 |
symbolBitmap = decodeRefinement(symbolWidth, symbolHeight, refinementTemplateIndex, symbolBitmap, (rdw >> 1) + rdx, (rdh >> 1) + rdy, false, refinementAt, decodingContext); |
| 5192 |
} |
| 5193 |
let increment = 0; |
| 5194 |
if (!transposed) { |
| 5195 |
if (referenceCorner > 1) { |
| 5196 |
currentS += symbolWidth - 1; |
| 5197 |
} else { |
| 5198 |
increment = symbolWidth - 1; |
| 5199 |
} |
| 5200 |
} else if (!(referenceCorner & 1)) { |
| 5201 |
currentS += symbolHeight - 1; |
| 5202 |
} else { |
| 5203 |
increment = symbolHeight - 1; |
| 5204 |
} |
| 5205 |
const offsetT = t - (referenceCorner & 1 ? 0 : symbolHeight - 1); |
| 5206 |
const offsetS = currentS - (referenceCorner & 2 ? symbolWidth - 1 : 0); |
| 5207 |
let s2, t2, symbolRow; |
| 5208 |
if (transposed) { |
| 5209 |
for (s2 = 0; s2 < symbolHeight; s2++) { |
| 5210 |
row = bitmap[offsetS + s2]; |
| 5211 |
if (!row) { |
| 5212 |
continue; |
| 5213 |
} |
| 5214 |
symbolRow = symbolBitmap[s2]; |
| 5215 |
const maxWidth = Math.min(width - offsetT, symbolWidth); |
| 5216 |
switch (combinationOperator) { |
| 5217 |
case 0: |
| 5218 |
for (t2 = 0; t2 < maxWidth; t2++) { |
| 5219 |
row[offsetT + t2] |= symbolRow[t2]; |
| 5220 |
} |
| 5221 |
break; |
| 5222 |
case 2: |
| 5223 |
for (t2 = 0; t2 < maxWidth; t2++) { |
| 5224 |
row[offsetT + t2] ^= symbolRow[t2]; |
| 5225 |
} |
| 5226 |
break; |
| 5227 |
default: |
| 5228 |
throw new Jbig2Error(`operator ${combinationOperator} is not supported`); |
| 5229 |
} |
| 5230 |
} |
| 5231 |
} else { |
| 5232 |
for (t2 = 0; t2 < symbolHeight; t2++) { |
| 5233 |
row = bitmap[offsetT + t2]; |
| 5234 |
if (!row) { |
| 5235 |
continue; |
| 5236 |
} |
| 5237 |
symbolRow = symbolBitmap[t2]; |
| 5238 |
switch (combinationOperator) { |
| 5239 |
case 0: |
| 5240 |
for (s2 = 0; s2 < symbolWidth; s2++) { |
| 5241 |
row[offsetS + s2] |= symbolRow[s2]; |
| 5242 |
} |
| 5243 |
break; |
| 5244 |
case 2: |
| 5245 |
for (s2 = 0; s2 < symbolWidth; s2++) { |
| 5246 |
row[offsetS + s2] ^= symbolRow[s2]; |
| 5247 |
} |
| 5248 |
break; |
| 5249 |
default: |
| 5250 |
throw new Jbig2Error(`operator ${combinationOperator} is not supported`); |
| 5251 |
} |
| 5252 |
} |
| 5253 |
} |
| 5254 |
i++; |
| 5255 |
const deltaS = huffman ? huffmanTables.tableDeltaS.decode(huffmanInput) : decodeInteger(contextCache, "IADS", decoder); |
| 5256 |
if (deltaS === null) { |
| 5257 |
break; |
| 5258 |
} |
| 5259 |
currentS += increment + deltaS + dsOffset; |
| 5260 |
} while (true); |
| 5261 |
} |
| 5262 |
return bitmap; |
| 5263 |
} |
| 5264 |
function decodePatternDictionary(mmr, patternWidth, patternHeight, maxPatternIndex, template, decodingContext) { |
| 5265 |
const at = []; |
| 5266 |
if (!mmr) { |
| 5267 |
at.push({ |
| 5268 |
x: -patternWidth, |
| 5269 |
y: 0 |
| 5270 |
}); |
| 5271 |
if (template === 0) { |
| 5272 |
at.push({ |
| 5273 |
x: -3, |
| 5274 |
y: -1 |
| 5275 |
}, { |
| 5276 |
x: 2, |
| 5277 |
y: -2 |
| 5278 |
}, { |
| 5279 |
x: -2, |
| 5280 |
y: -2 |
| 5281 |
}); |
| 5282 |
} |
| 5283 |
} |
| 5284 |
const collectiveWidth = (maxPatternIndex + 1) * patternWidth; |
| 5285 |
const collectiveBitmap = decodeBitmap(mmr, collectiveWidth, patternHeight, template, false, null, at, decodingContext); |
| 5286 |
const patterns = []; |
| 5287 |
for (let i = 0; i <= maxPatternIndex; i++) { |
| 5288 |
const patternBitmap = []; |
| 5289 |
const xMin = patternWidth * i; |
| 5290 |
const xMax = xMin + patternWidth; |
| 5291 |
for (let y = 0; y < patternHeight; y++) { |
| 5292 |
patternBitmap.push(collectiveBitmap[y].subarray(xMin, xMax)); |
| 5293 |
} |
| 5294 |
patterns.push(patternBitmap); |
| 5295 |
} |
| 5296 |
return patterns; |
| 5297 |
} |
| 5298 |
function decodeHalftoneRegion(mmr, patterns, template, regionWidth, regionHeight, defaultPixelValue, enableSkip, combinationOperator, gridWidth, gridHeight, gridOffsetX, gridOffsetY, gridVectorX, gridVectorY, decodingContext) { |
| 5299 |
const skip = null; |
| 5300 |
if (enableSkip) { |
| 5301 |
throw new Jbig2Error("skip is not supported"); |
| 5302 |
} |
| 5303 |
if (combinationOperator !== 0) { |
| 5304 |
throw new Jbig2Error(`operator "${combinationOperator}" is not supported in halftone region`); |
| 5305 |
} |
| 5306 |
const regionBitmap = []; |
| 5307 |
let i, j, row; |
| 5308 |
for (i = 0; i < regionHeight; i++) { |
| 5309 |
row = new Uint8Array(regionWidth); |
| 5310 |
if (defaultPixelValue) { |
| 5311 |
for (j = 0; j < regionWidth; j++) { |
| 5312 |
row[j] = defaultPixelValue; |
| 5313 |
} |
| 5314 |
} |
| 5315 |
regionBitmap.push(row); |
| 5316 |
} |
| 5317 |
const numberOfPatterns = patterns.length; |
| 5318 |
const pattern0 = patterns[0]; |
| 5319 |
const patternWidth = pattern0[0].length, |
| 5320 |
patternHeight = pattern0.length; |
| 5321 |
const bitsPerValue = log2(numberOfPatterns); |
| 5322 |
const at = []; |
| 5323 |
if (!mmr) { |
| 5324 |
at.push({ |
| 5325 |
x: template <= 1 ? 3 : 2, |
| 5326 |
y: -1 |
| 5327 |
}); |
| 5328 |
if (template === 0) { |
| 5329 |
at.push({ |
| 5330 |
x: -3, |
| 5331 |
y: -1 |
| 5332 |
}, { |
| 5333 |
x: 2, |
| 5334 |
y: -2 |
| 5335 |
}, { |
| 5336 |
x: -2, |
| 5337 |
y: -2 |
| 5338 |
}); |
| 5339 |
} |
| 5340 |
} |
| 5341 |
const grayScaleBitPlanes = []; |
| 5342 |
let mmrInput, bitmap; |
| 5343 |
if (mmr) { |
| 5344 |
mmrInput = new Reader(decodingContext.data, decodingContext.start, decodingContext.end); |
| 5345 |
} |
| 5346 |
for (i = bitsPerValue - 1; i >= 0; i--) { |
| 5347 |
if (mmr) { |
| 5348 |
bitmap = decodeMMRBitmap(mmrInput, gridWidth, gridHeight, true); |
| 5349 |
} else { |
| 5350 |
bitmap = decodeBitmap(false, gridWidth, gridHeight, template, false, skip, at, decodingContext); |
| 5351 |
} |
| 5352 |
grayScaleBitPlanes[i] = bitmap; |
| 5353 |
} |
| 5354 |
let mg, ng, bit, patternIndex, patternBitmap, x, y, patternRow, regionRow; |
| 5355 |
for (mg = 0; mg < gridHeight; mg++) { |
| 5356 |
for (ng = 0; ng < gridWidth; ng++) { |
| 5357 |
bit = 0; |
| 5358 |
patternIndex = 0; |
| 5359 |
for (j = bitsPerValue - 1; j >= 0; j--) { |
| 5360 |
bit ^= grayScaleBitPlanes[j][mg][ng]; |
| 5361 |
patternIndex |= bit << j; |
| 5362 |
} |
| 5363 |
patternBitmap = patterns[patternIndex]; |
| 5364 |
x = gridOffsetX + mg * gridVectorY + ng * gridVectorX >> 8; |
| 5365 |
y = gridOffsetY + mg * gridVectorX - ng * gridVectorY >> 8; |
| 5366 |
if (x >= 0 && x + patternWidth <= regionWidth && y >= 0 && y + patternHeight <= regionHeight) { |
| 5367 |
for (i = 0; i < patternHeight; i++) { |
| 5368 |
regionRow = regionBitmap[y + i]; |
| 5369 |
patternRow = patternBitmap[i]; |
| 5370 |
for (j = 0; j < patternWidth; j++) { |
| 5371 |
regionRow[x + j] |= patternRow[j]; |
| 5372 |
} |
| 5373 |
} |
| 5374 |
} else { |
| 5375 |
let regionX, regionY; |
| 5376 |
for (i = 0; i < patternHeight; i++) { |
| 5377 |
regionY = y + i; |
| 5378 |
if (regionY < 0 || regionY >= regionHeight) { |
| 5379 |
continue; |
| 5380 |
} |
| 5381 |
regionRow = regionBitmap[regionY]; |
| 5382 |
patternRow = patternBitmap[i]; |
| 5383 |
for (j = 0; j < patternWidth; j++) { |
| 5384 |
regionX = x + j; |
| 5385 |
if (regionX >= 0 && regionX < regionWidth) { |
| 5386 |
regionRow[regionX] |= patternRow[j]; |
| 5387 |
} |
| 5388 |
} |
| 5389 |
} |
| 5390 |
} |
| 5391 |
} |
| 5392 |
} |
| 5393 |
return regionBitmap; |
| 5394 |
} |
| 5395 |
function readSegmentHeader(data, start) { |
| 5396 |
const segmentHeader = {}; |
| 5397 |
segmentHeader.number = readUint32(data, start); |
| 5398 |
const flags = data[start + 4]; |
| 5399 |
const segmentType = flags & 0x3f; |
| 5400 |
if (!SegmentTypes[segmentType]) { |
| 5401 |
throw new Jbig2Error("invalid segment type: " + segmentType); |
| 5402 |
} |
| 5403 |
segmentHeader.type = segmentType; |
| 5404 |
segmentHeader.typeName = SegmentTypes[segmentType]; |
| 5405 |
segmentHeader.deferredNonRetain = !!(flags & 0x80); |
| 5406 |
const pageAssociationFieldSize = !!(flags & 0x40); |
| 5407 |
const referredFlags = data[start + 5]; |
| 5408 |
let referredToCount = referredFlags >> 5 & 7; |
| 5409 |
const retainBits = [referredFlags & 31]; |
| 5410 |
let position = start + 6; |
| 5411 |
if (referredFlags === 7) { |
| 5412 |
referredToCount = readUint32(data, position - 1) & 0x1fffffff; |
| 5413 |
position += 3; |
| 5414 |
let bytes = referredToCount + 7 >> 3; |
| 5415 |
retainBits[0] = data[position++]; |
| 5416 |
while (--bytes > 0) { |
| 5417 |
retainBits.push(data[position++]); |
| 5418 |
} |
| 5419 |
} else if (referredFlags === 5 || referredFlags === 6) { |
| 5420 |
throw new Jbig2Error("invalid referred-to flags"); |
| 5421 |
} |
| 5422 |
segmentHeader.retainBits = retainBits; |
| 5423 |
let referredToSegmentNumberSize = 4; |
| 5424 |
if (segmentHeader.number <= 256) { |
| 5425 |
referredToSegmentNumberSize = 1; |
| 5426 |
} else if (segmentHeader.number <= 65536) { |
| 5427 |
referredToSegmentNumberSize = 2; |
| 5428 |
} |
| 5429 |
const referredTo = []; |
| 5430 |
let i, ii; |
| 5431 |
for (i = 0; i < referredToCount; i++) { |
| 5432 |
let number; |
| 5433 |
if (referredToSegmentNumberSize === 1) { |
| 5434 |
number = data[position]; |
| 5435 |
} else if (referredToSegmentNumberSize === 2) { |
| 5436 |
number = readUint16(data, position); |
| 5437 |
} else { |
| 5438 |
number = readUint32(data, position); |
| 5439 |
} |
| 5440 |
referredTo.push(number); |
| 5441 |
position += referredToSegmentNumberSize; |
| 5442 |
} |
| 5443 |
segmentHeader.referredTo = referredTo; |
| 5444 |
if (!pageAssociationFieldSize) { |
| 5445 |
segmentHeader.pageAssociation = data[position++]; |
| 5446 |
} else { |
| 5447 |
segmentHeader.pageAssociation = readUint32(data, position); |
| 5448 |
position += 4; |
| 5449 |
} |
| 5450 |
segmentHeader.length = readUint32(data, position); |
| 5451 |
position += 4; |
| 5452 |
if (segmentHeader.length === 0xffffffff) { |
| 5453 |
if (segmentType === 38) { |
| 5454 |
const genericRegionInfo = readRegionSegmentInformation(data, position); |
| 5455 |
const genericRegionSegmentFlags = data[position + RegionSegmentInformationFieldLength]; |
| 5456 |
const genericRegionMmr = !!(genericRegionSegmentFlags & 1); |
| 5457 |
const searchPatternLength = 6; |
| 5458 |
const searchPattern = new Uint8Array(searchPatternLength); |
| 5459 |
if (!genericRegionMmr) { |
| 5460 |
searchPattern[0] = 0xff; |
| 5461 |
searchPattern[1] = 0xac; |
| 5462 |
} |
| 5463 |
searchPattern[2] = genericRegionInfo.height >>> 24 & 0xff; |
| 5464 |
searchPattern[3] = genericRegionInfo.height >> 16 & 0xff; |
| 5465 |
searchPattern[4] = genericRegionInfo.height >> 8 & 0xff; |
| 5466 |
searchPattern[5] = genericRegionInfo.height & 0xff; |
| 5467 |
for (i = position, ii = data.length; i < ii; i++) { |
| 5468 |
let j = 0; |
| 5469 |
while (j < searchPatternLength && searchPattern[j] === data[i + j]) { |
| 5470 |
j++; |
| 5471 |
} |
| 5472 |
if (j === searchPatternLength) { |
| 5473 |
segmentHeader.length = i + searchPatternLength; |
| 5474 |
break; |
| 5475 |
} |
| 5476 |
} |
| 5477 |
if (segmentHeader.length === 0xffffffff) { |
| 5478 |
throw new Jbig2Error("segment end was not found"); |
| 5479 |
} |
| 5480 |
} else { |
| 5481 |
throw new Jbig2Error("invalid unknown segment length"); |
| 5482 |
} |
| 5483 |
} |
| 5484 |
segmentHeader.headerEnd = position; |
| 5485 |
return segmentHeader; |
| 5486 |
} |
| 5487 |
function readSegments(header, data, start, end) { |
| 5488 |
const segments = []; |
| 5489 |
let position = start; |
| 5490 |
while (position < end) { |
| 5491 |
const segmentHeader = readSegmentHeader(data, position); |
| 5492 |
position = segmentHeader.headerEnd; |
| 5493 |
const segment = { |
| 5494 |
header: segmentHeader, |
| 5495 |
data |
| 5496 |
}; |
| 5497 |
if (!header.randomAccess) { |
| 5498 |
segment.start = position; |
| 5499 |
position += segmentHeader.length; |
| 5500 |
segment.end = position; |
| 5501 |
} |
| 5502 |
segments.push(segment); |
| 5503 |
if (segmentHeader.type === 51) { |
| 5504 |
break; |
| 5505 |
} |
| 5506 |
} |
| 5507 |
if (header.randomAccess) { |
| 5508 |
for (let i = 0, ii = segments.length; i < ii; i++) { |
| 5509 |
segments[i].start = position; |
| 5510 |
position += segments[i].header.length; |
| 5511 |
segments[i].end = position; |
| 5512 |
} |
| 5513 |
} |
| 5514 |
return segments; |
| 5515 |
} |
| 5516 |
function readRegionSegmentInformation(data, start) { |
| 5517 |
return { |
| 5518 |
width: readUint32(data, start), |
| 5519 |
height: readUint32(data, start + 4), |
| 5520 |
x: readUint32(data, start + 8), |
| 5521 |
y: readUint32(data, start + 12), |
| 5522 |
combinationOperator: data[start + 16] & 7 |
| 5523 |
}; |
| 5524 |
} |
| 5525 |
const RegionSegmentInformationFieldLength = 17; |
| 5526 |
function processSegment(segment, visitor) { |
| 5527 |
const header = segment.header; |
| 5528 |
const data = segment.data, |
| 5529 |
end = segment.end; |
| 5530 |
let position = segment.start; |
| 5531 |
let args, at, i, atLength; |
| 5532 |
switch (header.type) { |
| 5533 |
case 0: |
| 5534 |
const dictionary = {}; |
| 5535 |
const dictionaryFlags = readUint16(data, position); |
| 5536 |
dictionary.huffman = !!(dictionaryFlags & 1); |
| 5537 |
dictionary.refinement = !!(dictionaryFlags & 2); |
| 5538 |
dictionary.huffmanDHSelector = dictionaryFlags >> 2 & 3; |
| 5539 |
dictionary.huffmanDWSelector = dictionaryFlags >> 4 & 3; |
| 5540 |
dictionary.bitmapSizeSelector = dictionaryFlags >> 6 & 1; |
| 5541 |
dictionary.aggregationInstancesSelector = dictionaryFlags >> 7 & 1; |
| 5542 |
dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256); |
| 5543 |
dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512); |
| 5544 |
dictionary.template = dictionaryFlags >> 10 & 3; |
| 5545 |
dictionary.refinementTemplate = dictionaryFlags >> 12 & 1; |
| 5546 |
position += 2; |
| 5547 |
if (!dictionary.huffman) { |
| 5548 |
atLength = dictionary.template === 0 ? 4 : 1; |
| 5549 |
at = []; |
| 5550 |
for (i = 0; i < atLength; i++) { |
| 5551 |
at.push({ |
| 5552 |
x: readInt8(data, position), |
| 5553 |
y: readInt8(data, position + 1) |
| 5554 |
}); |
| 5555 |
position += 2; |
| 5556 |
} |
| 5557 |
dictionary.at = at; |
| 5558 |
} |
| 5559 |
if (dictionary.refinement && !dictionary.refinementTemplate) { |
| 5560 |
at = []; |
| 5561 |
for (i = 0; i < 2; i++) { |
| 5562 |
at.push({ |
| 5563 |
x: readInt8(data, position), |
| 5564 |
y: readInt8(data, position + 1) |
| 5565 |
}); |
| 5566 |
position += 2; |
| 5567 |
} |
| 5568 |
dictionary.refinementAt = at; |
| 5569 |
} |
| 5570 |
dictionary.numberOfExportedSymbols = readUint32(data, position); |
| 5571 |
position += 4; |
| 5572 |
dictionary.numberOfNewSymbols = readUint32(data, position); |
| 5573 |
position += 4; |
| 5574 |
args = [dictionary, header.number, header.referredTo, data, position, end]; |
| 5575 |
break; |
| 5576 |
case 6: |
| 5577 |
case 7: |
| 5578 |
const textRegion = {}; |
| 5579 |
textRegion.info = readRegionSegmentInformation(data, position); |
| 5580 |
position += RegionSegmentInformationFieldLength; |
| 5581 |
const textRegionSegmentFlags = readUint16(data, position); |
| 5582 |
position += 2; |
| 5583 |
textRegion.huffman = !!(textRegionSegmentFlags & 1); |
| 5584 |
textRegion.refinement = !!(textRegionSegmentFlags & 2); |
| 5585 |
textRegion.logStripSize = textRegionSegmentFlags >> 2 & 3; |
| 5586 |
textRegion.stripSize = 1 << textRegion.logStripSize; |
| 5587 |
textRegion.referenceCorner = textRegionSegmentFlags >> 4 & 3; |
| 5588 |
textRegion.transposed = !!(textRegionSegmentFlags & 64); |
| 5589 |
textRegion.combinationOperator = textRegionSegmentFlags >> 7 & 3; |
| 5590 |
textRegion.defaultPixelValue = textRegionSegmentFlags >> 9 & 1; |
| 5591 |
textRegion.dsOffset = textRegionSegmentFlags << 17 >> 27; |
| 5592 |
textRegion.refinementTemplate = textRegionSegmentFlags >> 15 & 1; |
| 5593 |
if (textRegion.huffman) { |
| 5594 |
const textRegionHuffmanFlags = readUint16(data, position); |
| 5595 |
position += 2; |
| 5596 |
textRegion.huffmanFS = textRegionHuffmanFlags & 3; |
| 5597 |
textRegion.huffmanDS = textRegionHuffmanFlags >> 2 & 3; |
| 5598 |
textRegion.huffmanDT = textRegionHuffmanFlags >> 4 & 3; |
| 5599 |
textRegion.huffmanRefinementDW = textRegionHuffmanFlags >> 6 & 3; |
| 5600 |
textRegion.huffmanRefinementDH = textRegionHuffmanFlags >> 8 & 3; |
| 5601 |
textRegion.huffmanRefinementDX = textRegionHuffmanFlags >> 10 & 3; |
| 5602 |
textRegion.huffmanRefinementDY = textRegionHuffmanFlags >> 12 & 3; |
| 5603 |
textRegion.huffmanRefinementSizeSelector = !!(textRegionHuffmanFlags & 0x4000); |
| 5604 |
} |
| 5605 |
if (textRegion.refinement && !textRegion.refinementTemplate) { |
| 5606 |
at = []; |
| 5607 |
for (i = 0; i < 2; i++) { |
| 5608 |
at.push({ |
| 5609 |
x: readInt8(data, position), |
| 5610 |
y: readInt8(data, position + 1) |
| 5611 |
}); |
| 5612 |
position += 2; |
| 5613 |
} |
| 5614 |
textRegion.refinementAt = at; |
| 5615 |
} |
| 5616 |
textRegion.numberOfSymbolInstances = readUint32(data, position); |
| 5617 |
position += 4; |
| 5618 |
args = [textRegion, header.referredTo, data, position, end]; |
| 5619 |
break; |
| 5620 |
case 16: |
| 5621 |
const patternDictionary = {}; |
| 5622 |
const patternDictionaryFlags = data[position++]; |
| 5623 |
patternDictionary.mmr = !!(patternDictionaryFlags & 1); |
| 5624 |
patternDictionary.template = patternDictionaryFlags >> 1 & 3; |
| 5625 |
patternDictionary.patternWidth = data[position++]; |
| 5626 |
patternDictionary.patternHeight = data[position++]; |
| 5627 |
patternDictionary.maxPatternIndex = readUint32(data, position); |
| 5628 |
position += 4; |
| 5629 |
args = [patternDictionary, header.number, data, position, end]; |
| 5630 |
break; |
| 5631 |
case 22: |
| 5632 |
case 23: |
| 5633 |
const halftoneRegion = {}; |
| 5634 |
halftoneRegion.info = readRegionSegmentInformation(data, position); |
| 5635 |
position += RegionSegmentInformationFieldLength; |
| 5636 |
const halftoneRegionFlags = data[position++]; |
| 5637 |
halftoneRegion.mmr = !!(halftoneRegionFlags & 1); |
| 5638 |
halftoneRegion.template = halftoneRegionFlags >> 1 & 3; |
| 5639 |
halftoneRegion.enableSkip = !!(halftoneRegionFlags & 8); |
| 5640 |
halftoneRegion.combinationOperator = halftoneRegionFlags >> 4 & 7; |
| 5641 |
halftoneRegion.defaultPixelValue = halftoneRegionFlags >> 7 & 1; |
| 5642 |
halftoneRegion.gridWidth = readUint32(data, position); |
| 5643 |
position += 4; |
| 5644 |
halftoneRegion.gridHeight = readUint32(data, position); |
| 5645 |
position += 4; |
| 5646 |
halftoneRegion.gridOffsetX = readUint32(data, position) & 0xffffffff; |
| 5647 |
position += 4; |
| 5648 |
halftoneRegion.gridOffsetY = readUint32(data, position) & 0xffffffff; |
| 5649 |
position += 4; |
| 5650 |
halftoneRegion.gridVectorX = readUint16(data, position); |
| 5651 |
position += 2; |
| 5652 |
halftoneRegion.gridVectorY = readUint16(data, position); |
| 5653 |
position += 2; |
| 5654 |
args = [halftoneRegion, header.referredTo, data, position, end]; |
| 5655 |
break; |
| 5656 |
case 38: |
| 5657 |
case 39: |
| 5658 |
const genericRegion = {}; |
| 5659 |
genericRegion.info = readRegionSegmentInformation(data, position); |
| 5660 |
position += RegionSegmentInformationFieldLength; |
| 5661 |
const genericRegionSegmentFlags = data[position++]; |
| 5662 |
genericRegion.mmr = !!(genericRegionSegmentFlags & 1); |
| 5663 |
genericRegion.template = genericRegionSegmentFlags >> 1 & 3; |
| 5664 |
genericRegion.prediction = !!(genericRegionSegmentFlags & 8); |
| 5665 |
if (!genericRegion.mmr) { |
| 5666 |
atLength = genericRegion.template === 0 ? 4 : 1; |
| 5667 |
at = []; |
| 5668 |
for (i = 0; i < atLength; i++) { |
| 5669 |
at.push({ |
| 5670 |
x: readInt8(data, position), |
| 5671 |
y: readInt8(data, position + 1) |
| 5672 |
}); |
| 5673 |
position += 2; |
| 5674 |
} |
| 5675 |
genericRegion.at = at; |
| 5676 |
} |
| 5677 |
args = [genericRegion, data, position, end]; |
| 5678 |
break; |
| 5679 |
case 48: |
| 5680 |
const pageInfo = { |
| 5681 |
width: readUint32(data, position), |
| 5682 |
height: readUint32(data, position + 4), |
| 5683 |
resolutionX: readUint32(data, position + 8), |
| 5684 |
resolutionY: readUint32(data, position + 12) |
| 5685 |
}; |
| 5686 |
if (pageInfo.height === 0xffffffff) { |
| 5687 |
delete pageInfo.height; |
| 5688 |
} |
| 5689 |
const pageSegmentFlags = data[position + 16]; |
| 5690 |
readUint16(data, position + 17); |
| 5691 |
pageInfo.lossless = !!(pageSegmentFlags & 1); |
| 5692 |
pageInfo.refinement = !!(pageSegmentFlags & 2); |
| 5693 |
pageInfo.defaultPixelValue = pageSegmentFlags >> 2 & 1; |
| 5694 |
pageInfo.combinationOperator = pageSegmentFlags >> 3 & 3; |
| 5695 |
pageInfo.requiresBuffer = !!(pageSegmentFlags & 32); |
| 5696 |
pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64); |
| 5697 |
args = [pageInfo]; |
| 5698 |
break; |
| 5699 |
case 49: |
| 5700 |
break; |
| 5701 |
case 50: |
| 5702 |
break; |
| 5703 |
case 51: |
| 5704 |
break; |
| 5705 |
case 53: |
| 5706 |
args = [header.number, data, position, end]; |
| 5707 |
break; |
| 5708 |
case 62: |
| 5709 |
break; |
| 5710 |
default: |
| 5711 |
throw new Jbig2Error(`segment type ${header.typeName}(${header.type}) is not implemented`); |
| 5712 |
} |
| 5713 |
const callbackName = "on" + header.typeName; |
| 5714 |
if (callbackName in visitor) { |
| 5715 |
visitor[callbackName].apply(visitor, args); |
| 5716 |
} |
| 5717 |
} |
| 5718 |
function processSegments(segments, visitor) { |
| 5719 |
for (let i = 0, ii = segments.length; i < ii; i++) { |
| 5720 |
processSegment(segments[i], visitor); |
| 5721 |
} |
| 5722 |
} |
| 5723 |
function parseJbig2Chunks(chunks) { |
| 5724 |
const visitor = new SimpleSegmentVisitor(); |
| 5725 |
for (let i = 0, ii = chunks.length; i < ii; i++) { |
| 5726 |
const chunk = chunks[i]; |
| 5727 |
const segments = readSegments({}, chunk.data, chunk.start, chunk.end); |
| 5728 |
processSegments(segments, visitor); |
| 5729 |
} |
| 5730 |
return visitor.buffer; |
| 5731 |
} |
| 5732 |
function parseJbig2(data) { |
| 5733 |
throw new Error("Not implemented: parseJbig2"); |
| 5734 |
} |
| 5735 |
class SimpleSegmentVisitor { |
| 5736 |
onPageInformation(info) { |
| 5737 |
this.currentPageInfo = info; |
| 5738 |
const rowSize = info.width + 7 >> 3; |
| 5739 |
const buffer = new Uint8ClampedArray(rowSize * info.height); |
| 5740 |
if (info.defaultPixelValue) { |
| 5741 |
buffer.fill(0xff); |
| 5742 |
} |
| 5743 |
this.buffer = buffer; |
| 5744 |
} |
| 5745 |
drawBitmap(regionInfo, bitmap) { |
| 5746 |
const pageInfo = this.currentPageInfo; |
| 5747 |
const width = regionInfo.width, |
| 5748 |
height = regionInfo.height; |
| 5749 |
const rowSize = pageInfo.width + 7 >> 3; |
| 5750 |
const combinationOperator = pageInfo.combinationOperatorOverride ? regionInfo.combinationOperator : pageInfo.combinationOperator; |
| 5751 |
const buffer = this.buffer; |
| 5752 |
const mask0 = 128 >> (regionInfo.x & 7); |
| 5753 |
let offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3); |
| 5754 |
let i, j, mask, offset; |
| 5755 |
switch (combinationOperator) { |
| 5756 |
case 0: |
| 5757 |
for (i = 0; i < height; i++) { |
| 5758 |
mask = mask0; |
| 5759 |
offset = offset0; |
| 5760 |
for (j = 0; j < width; j++) { |
| 5761 |
if (bitmap[i][j]) { |
| 5762 |
buffer[offset] |= mask; |
| 5763 |
} |
| 5764 |
mask >>= 1; |
| 5765 |
if (!mask) { |
| 5766 |
mask = 128; |
| 5767 |
offset++; |
| 5768 |
} |
| 5769 |
} |
| 5770 |
offset0 += rowSize; |
| 5771 |
} |
| 5772 |
break; |
| 5773 |
case 2: |
| 5774 |
for (i = 0; i < height; i++) { |
| 5775 |
mask = mask0; |
| 5776 |
offset = offset0; |
| 5777 |
for (j = 0; j < width; j++) { |
| 5778 |
if (bitmap[i][j]) { |
| 5779 |
buffer[offset] ^= mask; |
| 5780 |
} |
| 5781 |
mask >>= 1; |
| 5782 |
if (!mask) { |
| 5783 |
mask = 128; |
| 5784 |
offset++; |
| 5785 |
} |
| 5786 |
} |
| 5787 |
offset0 += rowSize; |
| 5788 |
} |
| 5789 |
break; |
| 5790 |
default: |
| 5791 |
throw new Jbig2Error(`operator ${combinationOperator} is not supported`); |
| 5792 |
} |
| 5793 |
} |
| 5794 |
onImmediateGenericRegion(region, data, start, end) { |
| 5795 |
const regionInfo = region.info; |
| 5796 |
const decodingContext = new DecodingContext(data, start, end); |
| 5797 |
const bitmap = decodeBitmap(region.mmr, regionInfo.width, regionInfo.height, region.template, region.prediction, null, region.at, decodingContext); |
| 5798 |
this.drawBitmap(regionInfo, bitmap); |
| 5799 |
} |
| 5800 |
onImmediateLosslessGenericRegion() { |
| 5801 |
this.onImmediateGenericRegion(...arguments); |
| 5802 |
} |
| 5803 |
onSymbolDictionary(dictionary, currentSegment, referredSegments, data, start, end) { |
| 5804 |
let huffmanTables, huffmanInput; |
| 5805 |
if (dictionary.huffman) { |
| 5806 |
huffmanTables = getSymbolDictionaryHuffmanTables(dictionary, referredSegments, this.customTables); |
| 5807 |
huffmanInput = new Reader(data, start, end); |
| 5808 |
} |
| 5809 |
let symbols = this.symbols; |
| 5810 |
if (!symbols) { |
| 5811 |
this.symbols = symbols = {}; |
| 5812 |
} |
| 5813 |
const inputSymbols = []; |
| 5814 |
for (const referredSegment of referredSegments) { |
| 5815 |
const referredSymbols = symbols[referredSegment]; |
| 5816 |
if (referredSymbols) { |
| 5817 |
inputSymbols.push(...referredSymbols); |
| 5818 |
} |
| 5819 |
} |
| 5820 |
const decodingContext = new DecodingContext(data, start, end); |
| 5821 |
symbols[currentSegment] = decodeSymbolDictionary(dictionary.huffman, dictionary.refinement, inputSymbols, dictionary.numberOfNewSymbols, dictionary.numberOfExportedSymbols, huffmanTables, dictionary.template, dictionary.at, dictionary.refinementTemplate, dictionary.refinementAt, decodingContext, huffmanInput); |
| 5822 |
} |
| 5823 |
onImmediateTextRegion(region, referredSegments, data, start, end) { |
| 5824 |
const regionInfo = region.info; |
| 5825 |
let huffmanTables, huffmanInput; |
| 5826 |
const symbols = this.symbols; |
| 5827 |
const inputSymbols = []; |
| 5828 |
for (const referredSegment of referredSegments) { |
| 5829 |
const referredSymbols = symbols[referredSegment]; |
| 5830 |
if (referredSymbols) { |
| 5831 |
inputSymbols.push(...referredSymbols); |
| 5832 |
} |
| 5833 |
} |
| 5834 |
const symbolCodeLength = log2(inputSymbols.length); |
| 5835 |
if (region.huffman) { |
| 5836 |
huffmanInput = new Reader(data, start, end); |
| 5837 |
huffmanTables = getTextRegionHuffmanTables(region, referredSegments, this.customTables, inputSymbols.length, huffmanInput); |
| 5838 |
} |
| 5839 |
const decodingContext = new DecodingContext(data, start, end); |
| 5840 |
const bitmap = decodeTextRegion(region.huffman, region.refinement, regionInfo.width, regionInfo.height, region.defaultPixelValue, region.numberOfSymbolInstances, region.stripSize, inputSymbols, symbolCodeLength, region.transposed, region.dsOffset, region.referenceCorner, region.combinationOperator, huffmanTables, region.refinementTemplate, region.refinementAt, decodingContext, region.logStripSize, huffmanInput); |
| 5841 |
this.drawBitmap(regionInfo, bitmap); |
| 5842 |
} |
| 5843 |
onImmediateLosslessTextRegion() { |
| 5844 |
this.onImmediateTextRegion(...arguments); |
| 5845 |
} |
| 5846 |
onPatternDictionary(dictionary, currentSegment, data, start, end) { |
| 5847 |
let patterns = this.patterns; |
| 5848 |
if (!patterns) { |
| 5849 |
this.patterns = patterns = {}; |
| 5850 |
} |
| 5851 |
const decodingContext = new DecodingContext(data, start, end); |
| 5852 |
patterns[currentSegment] = decodePatternDictionary(dictionary.mmr, dictionary.patternWidth, dictionary.patternHeight, dictionary.maxPatternIndex, dictionary.template, decodingContext); |
| 5853 |
} |
| 5854 |
onImmediateHalftoneRegion(region, referredSegments, data, start, end) { |
| 5855 |
const patterns = this.patterns[referredSegments[0]]; |
| 5856 |
const regionInfo = region.info; |
| 5857 |
const decodingContext = new DecodingContext(data, start, end); |
| 5858 |
const bitmap = decodeHalftoneRegion(region.mmr, patterns, region.template, regionInfo.width, regionInfo.height, region.defaultPixelValue, region.enableSkip, region.combinationOperator, region.gridWidth, region.gridHeight, region.gridOffsetX, region.gridOffsetY, region.gridVectorX, region.gridVectorY, decodingContext); |
| 5859 |
this.drawBitmap(regionInfo, bitmap); |
| 5860 |
} |
| 5861 |
onImmediateLosslessHalftoneRegion() { |
| 5862 |
this.onImmediateHalftoneRegion(...arguments); |
| 5863 |
} |
| 5864 |
onTables(currentSegment, data, start, end) { |
| 5865 |
let customTables = this.customTables; |
| 5866 |
if (!customTables) { |
| 5867 |
this.customTables = customTables = {}; |
| 5868 |
} |
| 5869 |
customTables[currentSegment] = decodeTablesSegment(data, start, end); |
| 5870 |
} |
| 5871 |
} |
| 5872 |
class HuffmanLine { |
| 5873 |
constructor(lineData) { |
| 5874 |
if (lineData.length === 2) { |
| 5875 |
this.isOOB = true; |
| 5876 |
this.rangeLow = 0; |
| 5877 |
this.prefixLength = lineData[0]; |
| 5878 |
this.rangeLength = 0; |
| 5879 |
this.prefixCode = lineData[1]; |
| 5880 |
this.isLowerRange = false; |
| 5881 |
} else { |
| 5882 |
this.isOOB = false; |
| 5883 |
this.rangeLow = lineData[0]; |
| 5884 |
this.prefixLength = lineData[1]; |
| 5885 |
this.rangeLength = lineData[2]; |
| 5886 |
this.prefixCode = lineData[3]; |
| 5887 |
this.isLowerRange = lineData[4] === "lower"; |
| 5888 |
} |
| 5889 |
} |
| 5890 |
} |
| 5891 |
class HuffmanTreeNode { |
| 5892 |
constructor(line) { |
| 5893 |
this.children = []; |
| 5894 |
if (line) { |
| 5895 |
this.isLeaf = true; |
| 5896 |
this.rangeLength = line.rangeLength; |
| 5897 |
this.rangeLow = line.rangeLow; |
| 5898 |
this.isLowerRange = line.isLowerRange; |
| 5899 |
this.isOOB = line.isOOB; |
| 5900 |
} else { |
| 5901 |
this.isLeaf = false; |
| 5902 |
} |
| 5903 |
} |
| 5904 |
buildTree(line, shift) { |
| 5905 |
const bit = line.prefixCode >> shift & 1; |
| 5906 |
if (shift <= 0) { |
| 5907 |
this.children[bit] = new HuffmanTreeNode(line); |
| 5908 |
} else { |
| 5909 |
let node = this.children[bit]; |
| 5910 |
if (!node) { |
| 5911 |
this.children[bit] = node = new HuffmanTreeNode(null); |
| 5912 |
} |
| 5913 |
node.buildTree(line, shift - 1); |
| 5914 |
} |
| 5915 |
} |
| 5916 |
decodeNode(reader) { |
| 5917 |
if (this.isLeaf) { |
| 5918 |
if (this.isOOB) { |
| 5919 |
return null; |
| 5920 |
} |
| 5921 |
const htOffset = reader.readBits(this.rangeLength); |
| 5922 |
return this.rangeLow + (this.isLowerRange ? -htOffset : htOffset); |
| 5923 |
} |
| 5924 |
const node = this.children[reader.readBit()]; |
| 5925 |
if (!node) { |
| 5926 |
throw new Jbig2Error("invalid Huffman data"); |
| 5927 |
} |
| 5928 |
return node.decodeNode(reader); |
| 5929 |
} |
| 5930 |
} |
| 5931 |
class HuffmanTable { |
| 5932 |
constructor(lines, prefixCodesDone) { |
| 5933 |
if (!prefixCodesDone) { |
| 5934 |
this.assignPrefixCodes(lines); |
| 5935 |
} |
| 5936 |
this.rootNode = new HuffmanTreeNode(null); |
| 5937 |
for (let i = 0, ii = lines.length; i < ii; i++) { |
| 5938 |
const line = lines[i]; |
| 5939 |
if (line.prefixLength > 0) { |
| 5940 |
this.rootNode.buildTree(line, line.prefixLength - 1); |
| 5941 |
} |
| 5942 |
} |
| 5943 |
} |
| 5944 |
decode(reader) { |
| 5945 |
return this.rootNode.decodeNode(reader); |
| 5946 |
} |
| 5947 |
assignPrefixCodes(lines) { |
| 5948 |
const linesLength = lines.length; |
| 5949 |
let prefixLengthMax = 0; |
| 5950 |
for (let i = 0; i < linesLength; i++) { |
| 5951 |
prefixLengthMax = Math.max(prefixLengthMax, lines[i].prefixLength); |
| 5952 |
} |
| 5953 |
const histogram = new Uint32Array(prefixLengthMax + 1); |
| 5954 |
for (let i = 0; i < linesLength; i++) { |
| 5955 |
histogram[lines[i].prefixLength]++; |
| 5956 |
} |
| 5957 |
let currentLength = 1, |
| 5958 |
firstCode = 0, |
| 5959 |
currentCode, |
| 5960 |
currentTemp, |
| 5961 |
line; |
| 5962 |
histogram[0] = 0; |
| 5963 |
while (currentLength <= prefixLengthMax) { |
| 5964 |
firstCode = firstCode + histogram[currentLength - 1] << 1; |
| 5965 |
currentCode = firstCode; |
| 5966 |
currentTemp = 0; |
| 5967 |
while (currentTemp < linesLength) { |
| 5968 |
line = lines[currentTemp]; |
| 5969 |
if (line.prefixLength === currentLength) { |
| 5970 |
line.prefixCode = currentCode; |
| 5971 |
currentCode++; |
| 5972 |
} |
| 5973 |
currentTemp++; |
| 5974 |
} |
| 5975 |
currentLength++; |
| 5976 |
} |
| 5977 |
} |
| 5978 |
} |
| 5979 |
function decodeTablesSegment(data, start, end) { |
| 5980 |
const flags = data[start]; |
| 5981 |
const lowestValue = readUint32(data, start + 1) & 0xffffffff; |
| 5982 |
const highestValue = readUint32(data, start + 5) & 0xffffffff; |
| 5983 |
const reader = new Reader(data, start + 9, end); |
| 5984 |
const prefixSizeBits = (flags >> 1 & 7) + 1; |
| 5985 |
const rangeSizeBits = (flags >> 4 & 7) + 1; |
| 5986 |
const lines = []; |
| 5987 |
let prefixLength, |
| 5988 |
rangeLength, |
| 5989 |
currentRangeLow = lowestValue; |
| 5990 |
do { |
| 5991 |
prefixLength = reader.readBits(prefixSizeBits); |
| 5992 |
rangeLength = reader.readBits(rangeSizeBits); |
| 5993 |
lines.push(new HuffmanLine([currentRangeLow, prefixLength, rangeLength, 0])); |
| 5994 |
currentRangeLow += 1 << rangeLength; |
| 5995 |
} while (currentRangeLow < highestValue); |
| 5996 |
prefixLength = reader.readBits(prefixSizeBits); |
| 5997 |
lines.push(new HuffmanLine([lowestValue - 1, prefixLength, 32, 0, "lower"])); |
| 5998 |
prefixLength = reader.readBits(prefixSizeBits); |
| 5999 |
lines.push(new HuffmanLine([highestValue, prefixLength, 32, 0])); |
| 6000 |
if (flags & 1) { |
| 6001 |
prefixLength = reader.readBits(prefixSizeBits); |
| 6002 |
lines.push(new HuffmanLine([prefixLength, 0])); |
| 6003 |
} |
| 6004 |
return new HuffmanTable(lines, false); |
| 6005 |
} |
| 6006 |
const standardTablesCache = {}; |
| 6007 |
function getStandardTable(number) { |
| 6008 |
let table = standardTablesCache[number]; |
| 6009 |
if (table) { |
| 6010 |
return table; |
| 6011 |
} |
| 6012 |
let lines; |
| 6013 |
switch (number) { |
| 6014 |
case 1: |
| 6015 |
lines = [[0, 1, 4, 0x0], [16, 2, 8, 0x2], [272, 3, 16, 0x6], [65808, 3, 32, 0x7]]; |
| 6016 |
break; |
| 6017 |
case 2: |
| 6018 |
lines = [[0, 1, 0, 0x0], [1, 2, 0, 0x2], [2, 3, 0, 0x6], [3, 4, 3, 0xe], [11, 5, 6, 0x1e], [75, 6, 32, 0x3e], [6, 0x3f]]; |
| 6019 |
break; |
| 6020 |
case 3: |
| 6021 |
lines = [[-256, 8, 8, 0xfe], [0, 1, 0, 0x0], [1, 2, 0, 0x2], [2, 3, 0, 0x6], [3, 4, 3, 0xe], [11, 5, 6, 0x1e], [-257, 8, 32, 0xff, "lower"], [75, 7, 32, 0x7e], [6, 0x3e]]; |
| 6022 |
break; |
| 6023 |
case 4: |
| 6024 |
lines = [[1, 1, 0, 0x0], [2, 2, 0, 0x2], [3, 3, 0, 0x6], [4, 4, 3, 0xe], [12, 5, 6, 0x1e], [76, 5, 32, 0x1f]]; |
| 6025 |
break; |
| 6026 |
case 5: |
| 6027 |
lines = [[-255, 7, 8, 0x7e], [1, 1, 0, 0x0], [2, 2, 0, 0x2], [3, 3, 0, 0x6], [4, 4, 3, 0xe], [12, 5, 6, 0x1e], [-256, 7, 32, 0x7f, "lower"], [76, 6, 32, 0x3e]]; |
| 6028 |
break; |
| 6029 |
case 6: |
| 6030 |
lines = [[-2048, 5, 10, 0x1c], [-1024, 4, 9, 0x8], [-512, 4, 8, 0x9], [-256, 4, 7, 0xa], [-128, 5, 6, 0x1d], [-64, 5, 5, 0x1e], [-32, 4, 5, 0xb], [0, 2, 7, 0x0], [128, 3, 7, 0x2], [256, 3, 8, 0x3], [512, 4, 9, 0xc], [1024, 4, 10, 0xd], [-2049, 6, 32, 0x3e, "lower"], [2048, 6, 32, 0x3f]]; |
| 6031 |
break; |
| 6032 |
case 7: |
| 6033 |
lines = [[-1024, 4, 9, 0x8], [-512, 3, 8, 0x0], [-256, 4, 7, 0x9], [-128, 5, 6, 0x1a], [-64, 5, 5, 0x1b], [-32, 4, 5, 0xa], [0, 4, 5, 0xb], [32, 5, 5, 0x1c], [64, 5, 6, 0x1d], [128, 4, 7, 0xc], [256, 3, 8, 0x1], [512, 3, 9, 0x2], [1024, 3, 10, 0x3], [-1025, 5, 32, 0x1e, "lower"], [2048, 5, 32, 0x1f]]; |
| 6034 |
break; |
| 6035 |
case 8: |
| 6036 |
lines = [[-15, 8, 3, 0xfc], [-7, 9, 1, 0x1fc], [-5, 8, 1, 0xfd], [-3, 9, 0, 0x1fd], [-2, 7, 0, 0x7c], [-1, 4, 0, 0xa], [0, 2, 1, 0x0], [2, 5, 0, 0x1a], [3, 6, 0, 0x3a], [4, 3, 4, 0x4], [20, 6, 1, 0x3b], [22, 4, 4, 0xb], [38, 4, 5, 0xc], [70, 5, 6, 0x1b], [134, 5, 7, 0x1c], [262, 6, 7, 0x3c], [390, 7, 8, 0x7d], [646, 6, 10, 0x3d], [-16, 9, 32, 0x1fe, "lower"], [1670, 9, 32, 0x1ff], [2, 0x1]]; |
| 6037 |
break; |
| 6038 |
case 9: |
| 6039 |
lines = [[-31, 8, 4, 0xfc], [-15, 9, 2, 0x1fc], [-11, 8, 2, 0xfd], [-7, 9, 1, 0x1fd], [-5, 7, 1, 0x7c], [-3, 4, 1, 0xa], [-1, 3, 1, 0x2], [1, 3, 1, 0x3], [3, 5, 1, 0x1a], [5, 6, 1, 0x3a], [7, 3, 5, 0x4], [39, 6, 2, 0x3b], [43, 4, 5, 0xb], [75, 4, 6, 0xc], [139, 5, 7, 0x1b], [267, 5, 8, 0x1c], [523, 6, 8, 0x3c], [779, 7, 9, 0x7d], [1291, 6, 11, 0x3d], [-32, 9, 32, 0x1fe, "lower"], [3339, 9, 32, 0x1ff], [2, 0x0]]; |
| 6040 |
break; |
| 6041 |
case 10: |
| 6042 |
lines = [[-21, 7, 4, 0x7a], [-5, 8, 0, 0xfc], [-4, 7, 0, 0x7b], [-3, 5, 0, 0x18], [-2, 2, 2, 0x0], [2, 5, 0, 0x19], [3, 6, 0, 0x36], [4, 7, 0, 0x7c], [5, 8, 0, 0xfd], [6, 2, 6, 0x1], [70, 5, 5, 0x1a], [102, 6, 5, 0x37], [134, 6, 6, 0x38], [198, 6, 7, 0x39], [326, 6, 8, 0x3a], [582, 6, 9, 0x3b], [1094, 6, 10, 0x3c], [2118, 7, 11, 0x7d], [-22, 8, 32, 0xfe, "lower"], [4166, 8, 32, 0xff], [2, 0x2]]; |
| 6043 |
break; |
| 6044 |
case 11: |
| 6045 |
lines = [[1, 1, 0, 0x0], [2, 2, 1, 0x2], [4, 4, 0, 0xc], [5, 4, 1, 0xd], [7, 5, 1, 0x1c], [9, 5, 2, 0x1d], [13, 6, 2, 0x3c], [17, 7, 2, 0x7a], [21, 7, 3, 0x7b], [29, 7, 4, 0x7c], [45, 7, 5, 0x7d], [77, 7, 6, 0x7e], [141, 7, 32, 0x7f]]; |
| 6046 |
break; |
| 6047 |
case 12: |
| 6048 |
lines = [[1, 1, 0, 0x0], [2, 2, 0, 0x2], [3, 3, 1, 0x6], [5, 5, 0, 0x1c], [6, 5, 1, 0x1d], [8, 6, 1, 0x3c], [10, 7, 0, 0x7a], [11, 7, 1, 0x7b], [13, 7, 2, 0x7c], [17, 7, 3, 0x7d], [25, 7, 4, 0x7e], [41, 8, 5, 0xfe], [73, 8, 32, 0xff]]; |
| 6049 |
break; |
| 6050 |
case 13: |
| 6051 |
lines = [[1, 1, 0, 0x0], [2, 3, 0, 0x4], [3, 4, 0, 0xc], [4, 5, 0, 0x1c], [5, 4, 1, 0xd], [7, 3, 3, 0x5], [15, 6, 1, 0x3a], [17, 6, 2, 0x3b], [21, 6, 3, 0x3c], [29, 6, 4, 0x3d], [45, 6, 5, 0x3e], [77, 7, 6, 0x7e], [141, 7, 32, 0x7f]]; |
| 6052 |
break; |
| 6053 |
case 14: |
| 6054 |
lines = [[-2, 3, 0, 0x4], [-1, 3, 0, 0x5], [0, 1, 0, 0x0], [1, 3, 0, 0x6], [2, 3, 0, 0x7]]; |
| 6055 |
break; |
| 6056 |
case 15: |
| 6057 |
lines = [[-24, 7, 4, 0x7c], [-8, 6, 2, 0x3c], [-4, 5, 1, 0x1c], [-2, 4, 0, 0xc], [-1, 3, 0, 0x4], [0, 1, 0, 0x0], [1, 3, 0, 0x5], [2, 4, 0, 0xd], [3, 5, 1, 0x1d], [5, 6, 2, 0x3d], [9, 7, 4, 0x7d], [-25, 7, 32, 0x7e, "lower"], [25, 7, 32, 0x7f]]; |
| 6058 |
break; |
| 6059 |
default: |
| 6060 |
throw new Jbig2Error(`standard table B.${number} does not exist`); |
| 6061 |
} |
| 6062 |
for (let i = 0, ii = lines.length; i < ii; i++) { |
| 6063 |
lines[i] = new HuffmanLine(lines[i]); |
| 6064 |
} |
| 6065 |
table = new HuffmanTable(lines, true); |
| 6066 |
standardTablesCache[number] = table; |
| 6067 |
return table; |
| 6068 |
} |
| 6069 |
class Reader { |
| 6070 |
constructor(data, start, end) { |
| 6071 |
this.data = data; |
| 6072 |
this.start = start; |
| 6073 |
this.end = end; |
| 6074 |
this.position = start; |
| 6075 |
this.shift = -1; |
| 6076 |
this.currentByte = 0; |
| 6077 |
} |
| 6078 |
readBit() { |
| 6079 |
if (this.shift < 0) { |
| 6080 |
if (this.position >= this.end) { |
| 6081 |
throw new Jbig2Error("end of data while reading bit"); |
| 6082 |
} |
| 6083 |
this.currentByte = this.data[this.position++]; |
| 6084 |
this.shift = 7; |
| 6085 |
} |
| 6086 |
const bit = this.currentByte >> this.shift & 1; |
| 6087 |
this.shift--; |
| 6088 |
return bit; |
| 6089 |
} |
| 6090 |
readBits(numBits) { |
| 6091 |
let result = 0, |
| 6092 |
i; |
| 6093 |
for (i = numBits - 1; i >= 0; i--) { |
| 6094 |
result |= this.readBit() << i; |
| 6095 |
} |
| 6096 |
return result; |
| 6097 |
} |
| 6098 |
byteAlign() { |
| 6099 |
this.shift = -1; |
| 6100 |
} |
| 6101 |
next() { |
| 6102 |
if (this.position >= this.end) { |
| 6103 |
return -1; |
| 6104 |
} |
| 6105 |
return this.data[this.position++]; |
| 6106 |
} |
| 6107 |
} |
| 6108 |
function getCustomHuffmanTable(index, referredTo, customTables) { |
| 6109 |
let currentIndex = 0; |
| 6110 |
for (let i = 0, ii = referredTo.length; i < ii; i++) { |
| 6111 |
const table = customTables[referredTo[i]]; |
| 6112 |
if (table) { |
| 6113 |
if (index === currentIndex) { |
| 6114 |
return table; |
| 6115 |
} |
| 6116 |
currentIndex++; |
| 6117 |
} |
| 6118 |
} |
| 6119 |
throw new Jbig2Error("can't find custom Huffman table"); |
| 6120 |
} |
| 6121 |
function getTextRegionHuffmanTables(textRegion, referredTo, customTables, numberOfSymbols, reader) { |
| 6122 |
const codes = []; |
| 6123 |
for (let i = 0; i <= 34; i++) { |
| 6124 |
const codeLength = reader.readBits(4); |
| 6125 |
codes.push(new HuffmanLine([i, codeLength, 0, 0])); |
| 6126 |
} |
| 6127 |
const runCodesTable = new HuffmanTable(codes, false); |
| 6128 |
codes.length = 0; |
| 6129 |
for (let i = 0; i < numberOfSymbols;) { |
| 6130 |
const codeLength = runCodesTable.decode(reader); |
| 6131 |
if (codeLength >= 32) { |
| 6132 |
let repeatedLength, numberOfRepeats, j; |
| 6133 |
switch (codeLength) { |
| 6134 |
case 32: |
| 6135 |
if (i === 0) { |
| 6136 |
throw new Jbig2Error("no previous value in symbol ID table"); |
| 6137 |
} |
| 6138 |
numberOfRepeats = reader.readBits(2) + 3; |
| 6139 |
repeatedLength = codes[i - 1].prefixLength; |
| 6140 |
break; |
| 6141 |
case 33: |
| 6142 |
numberOfRepeats = reader.readBits(3) + 3; |
| 6143 |
repeatedLength = 0; |
| 6144 |
break; |
| 6145 |
case 34: |
| 6146 |
numberOfRepeats = reader.readBits(7) + 11; |
| 6147 |
repeatedLength = 0; |
| 6148 |
break; |
| 6149 |
default: |
| 6150 |
throw new Jbig2Error("invalid code length in symbol ID table"); |
| 6151 |
} |
| 6152 |
for (j = 0; j < numberOfRepeats; j++) { |
| 6153 |
codes.push(new HuffmanLine([i, repeatedLength, 0, 0])); |
| 6154 |
i++; |
| 6155 |
} |
| 6156 |
} else { |
| 6157 |
codes.push(new HuffmanLine([i, codeLength, 0, 0])); |
| 6158 |
i++; |
| 6159 |
} |
| 6160 |
} |
| 6161 |
reader.byteAlign(); |
| 6162 |
const symbolIDTable = new HuffmanTable(codes, false); |
| 6163 |
let customIndex = 0, |
| 6164 |
tableFirstS, |
| 6165 |
tableDeltaS, |
| 6166 |
tableDeltaT; |
| 6167 |
switch (textRegion.huffmanFS) { |
| 6168 |
case 0: |
| 6169 |
case 1: |
| 6170 |
tableFirstS = getStandardTable(textRegion.huffmanFS + 6); |
| 6171 |
break; |
| 6172 |
case 3: |
| 6173 |
tableFirstS = getCustomHuffmanTable(customIndex, referredTo, customTables); |
| 6174 |
customIndex++; |
| 6175 |
break; |
| 6176 |
default: |
| 6177 |
throw new Jbig2Error("invalid Huffman FS selector"); |
| 6178 |
} |
| 6179 |
switch (textRegion.huffmanDS) { |
| 6180 |
case 0: |
| 6181 |
case 1: |
| 6182 |
case 2: |
| 6183 |
tableDeltaS = getStandardTable(textRegion.huffmanDS + 8); |
| 6184 |
break; |
| 6185 |
case 3: |
| 6186 |
tableDeltaS = getCustomHuffmanTable(customIndex, referredTo, customTables); |
| 6187 |
customIndex++; |
| 6188 |
break; |
| 6189 |
default: |
| 6190 |
throw new Jbig2Error("invalid Huffman DS selector"); |
| 6191 |
} |
| 6192 |
switch (textRegion.huffmanDT) { |
| 6193 |
case 0: |
| 6194 |
case 1: |
| 6195 |
case 2: |
| 6196 |
tableDeltaT = getStandardTable(textRegion.huffmanDT + 11); |
| 6197 |
break; |
| 6198 |
case 3: |
| 6199 |
tableDeltaT = getCustomHuffmanTable(customIndex, referredTo, customTables); |
| 6200 |
customIndex++; |
| 6201 |
break; |
| 6202 |
default: |
| 6203 |
throw new Jbig2Error("invalid Huffman DT selector"); |
| 6204 |
} |
| 6205 |
if (textRegion.refinement) { |
| 6206 |
throw new Jbig2Error("refinement with Huffman is not supported"); |
| 6207 |
} |
| 6208 |
return { |
| 6209 |
symbolIDTable, |
| 6210 |
tableFirstS, |
| 6211 |
tableDeltaS, |
| 6212 |
tableDeltaT |
| 6213 |
}; |
| 6214 |
} |
| 6215 |
function getSymbolDictionaryHuffmanTables(dictionary, referredTo, customTables) { |
| 6216 |
let customIndex = 0, |
| 6217 |
tableDeltaHeight, |
| 6218 |
tableDeltaWidth; |
| 6219 |
switch (dictionary.huffmanDHSelector) { |
| 6220 |
case 0: |
| 6221 |
case 1: |
| 6222 |
tableDeltaHeight = getStandardTable(dictionary.huffmanDHSelector + 4); |
| 6223 |
break; |
| 6224 |
case 3: |
| 6225 |
tableDeltaHeight = getCustomHuffmanTable(customIndex, referredTo, customTables); |
| 6226 |
customIndex++; |
| 6227 |
break; |
| 6228 |
default: |
| 6229 |
throw new Jbig2Error("invalid Huffman DH selector"); |
| 6230 |
} |
| 6231 |
switch (dictionary.huffmanDWSelector) { |
| 6232 |
case 0: |
| 6233 |
case 1: |
| 6234 |
tableDeltaWidth = getStandardTable(dictionary.huffmanDWSelector + 2); |
| 6235 |
break; |
| 6236 |
case 3: |
| 6237 |
tableDeltaWidth = getCustomHuffmanTable(customIndex, referredTo, customTables); |
| 6238 |
customIndex++; |
| 6239 |
break; |
| 6240 |
default: |
| 6241 |
throw new Jbig2Error("invalid Huffman DW selector"); |
| 6242 |
} |
| 6243 |
let tableBitmapSize, tableAggregateInstances; |
| 6244 |
if (dictionary.bitmapSizeSelector) { |
| 6245 |
tableBitmapSize = getCustomHuffmanTable(customIndex, referredTo, customTables); |
| 6246 |
customIndex++; |
| 6247 |
} else { |
| 6248 |
tableBitmapSize = getStandardTable(1); |
| 6249 |
} |
| 6250 |
if (dictionary.aggregationInstancesSelector) { |
| 6251 |
tableAggregateInstances = getCustomHuffmanTable(customIndex, referredTo, customTables); |
| 6252 |
} else { |
| 6253 |
tableAggregateInstances = getStandardTable(1); |
| 6254 |
} |
| 6255 |
return { |
| 6256 |
tableDeltaHeight, |
| 6257 |
tableDeltaWidth, |
| 6258 |
tableBitmapSize, |
| 6259 |
tableAggregateInstances |
| 6260 |
}; |
| 6261 |
} |
| 6262 |
function readUncompressedBitmap(reader, width, height) { |
| 6263 |
const bitmap = []; |
| 6264 |
for (let y = 0; y < height; y++) { |
| 6265 |
const row = new Uint8Array(width); |
| 6266 |
bitmap.push(row); |
| 6267 |
for (let x = 0; x < width; x++) { |
| 6268 |
row[x] = reader.readBit(); |
| 6269 |
} |
| 6270 |
reader.byteAlign(); |
| 6271 |
} |
| 6272 |
return bitmap; |
| 6273 |
} |
| 6274 |
function decodeMMRBitmap(input, width, height, endOfBlock) { |
| 6275 |
const params = { |
| 6276 |
K: -1, |
| 6277 |
Columns: width, |
| 6278 |
Rows: height, |
| 6279 |
BlackIs1: true, |
| 6280 |
EndOfBlock: endOfBlock |
| 6281 |
}; |
| 6282 |
const decoder = new CCITTFaxDecoder(input, params); |
| 6283 |
const bitmap = []; |
| 6284 |
let currentByte, |
| 6285 |
eof = false; |
| 6286 |
for (let y = 0; y < height; y++) { |
| 6287 |
const row = new Uint8Array(width); |
| 6288 |
bitmap.push(row); |
| 6289 |
let shift = -1; |
| 6290 |
for (let x = 0; x < width; x++) { |
| 6291 |
if (shift < 0) { |
| 6292 |
currentByte = decoder.readNextChar(); |
| 6293 |
if (currentByte === -1) { |
| 6294 |
currentByte = 0; |
| 6295 |
eof = true; |
| 6296 |
} |
| 6297 |
shift = 7; |
| 6298 |
} |
| 6299 |
row[x] = currentByte >> shift & 1; |
| 6300 |
shift--; |
| 6301 |
} |
| 6302 |
} |
| 6303 |
if (endOfBlock && !eof) { |
| 6304 |
const lookForEOFLimit = 5; |
| 6305 |
for (let i = 0; i < lookForEOFLimit; i++) { |
| 6306 |
if (decoder.readNextChar() === -1) { |
| 6307 |
break; |
| 6308 |
} |
| 6309 |
} |
| 6310 |
} |
| 6311 |
return bitmap; |
| 6312 |
} |
| 6313 |
class Jbig2Image { |
| 6314 |
parseChunks(chunks) { |
| 6315 |
return parseJbig2Chunks(chunks); |
| 6316 |
} |
| 6317 |
parse(data) { |
| 6318 |
throw new Error("Not implemented: Jbig2Image.parse"); |
| 6319 |
} |
| 6320 |
} |
| 6321 |
|
| 6322 |
;// ./src/core/jbig2_stream.js |
| 6323 |
|
| 6324 |
|
| 6325 |
|
| 6326 |
|
| 6327 |
|
| 6328 |
class Jbig2Stream extends DecodeStream { |
| 6329 |
constructor(stream, maybeLength, params) { |
| 6330 |
super(maybeLength); |
| 6331 |
this.stream = stream; |
| 6332 |
this.dict = stream.dict; |
| 6333 |
this.maybeLength = maybeLength; |
| 6334 |
this.params = params; |
| 6335 |
} |
| 6336 |
get bytes() { |
| 6337 |
return shadow(this, "bytes", this.stream.getBytes(this.maybeLength)); |
| 6338 |
} |
| 6339 |
ensureBuffer(requested) {} |
| 6340 |
readBlock() { |
| 6341 |
this.decodeImage(); |
| 6342 |
} |
| 6343 |
decodeImage(bytes) { |
| 6344 |
if (this.eof) { |
| 6345 |
return this.buffer; |
| 6346 |
} |
| 6347 |
bytes ||= this.bytes; |
| 6348 |
const jbig2Image = new Jbig2Image(); |
| 6349 |
const chunks = []; |
| 6350 |
if (this.params instanceof Dict) { |
| 6351 |
const globalsStream = this.params.get("JBIG2Globals"); |
| 6352 |
if (globalsStream instanceof BaseStream) { |
| 6353 |
const globals = globalsStream.getBytes(); |
| 6354 |
chunks.push({ |
| 6355 |
data: globals, |
| 6356 |
start: 0, |
| 6357 |
end: globals.length |
| 6358 |
}); |
| 6359 |
} |
| 6360 |
} |
| 6361 |
chunks.push({ |
| 6362 |
data: bytes, |
| 6363 |
start: 0, |
| 6364 |
end: bytes.length |
| 6365 |
}); |
| 6366 |
const data = jbig2Image.parseChunks(chunks); |
| 6367 |
const dataLength = data.length; |
| 6368 |
for (let i = 0; i < dataLength; i++) { |
| 6369 |
data[i] ^= 0xff; |
| 6370 |
} |
| 6371 |
this.buffer = data; |
| 6372 |
this.bufferLength = dataLength; |
| 6373 |
this.eof = true; |
| 6374 |
return this.buffer; |
| 6375 |
} |
| 6376 |
get canAsyncDecodeImageFromBuffer() { |
| 6377 |
return this.stream.isAsync; |
| 6378 |
} |
| 6379 |
} |
| 6380 |
|
| 6381 |
;// ./src/shared/image_utils.js |
| 6382 |
|
| 6383 |
function convertToRGBA(params) { |
| 6384 |
switch (params.kind) { |
| 6385 |
case ImageKind.GRAYSCALE_1BPP: |
| 6386 |
return convertBlackAndWhiteToRGBA(params); |
| 6387 |
case ImageKind.RGB_24BPP: |
| 6388 |
return convertRGBToRGBA(params); |
| 6389 |
} |
| 6390 |
return null; |
| 6391 |
} |
| 6392 |
function convertBlackAndWhiteToRGBA({ |
| 6393 |
src, |
| 6394 |
srcPos = 0, |
| 6395 |
dest, |
| 6396 |
width, |
| 6397 |
height, |
| 6398 |
nonBlackColor = 0xffffffff, |
| 6399 |
inverseDecode = false |
| 6400 |
}) { |
| 6401 |
const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff; |
| 6402 |
const [zeroMapping, oneMapping] = inverseDecode ? [nonBlackColor, black] : [black, nonBlackColor]; |
| 6403 |
const widthInSource = width >> 3; |
| 6404 |
const widthRemainder = width & 7; |
| 6405 |
const srcLength = src.length; |
| 6406 |
dest = new Uint32Array(dest.buffer); |
| 6407 |
let destPos = 0; |
| 6408 |
for (let i = 0; i < height; i++) { |
| 6409 |
for (const max = srcPos + widthInSource; srcPos < max; srcPos++) { |
| 6410 |
const elem = srcPos < srcLength ? src[srcPos] : 255; |
| 6411 |
dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping; |
| 6412 |
dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping; |
| 6413 |
dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping; |
| 6414 |
dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping; |
| 6415 |
dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping; |
| 6416 |
dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping; |
| 6417 |
dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping; |
| 6418 |
dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping; |
| 6419 |
} |
| 6420 |
if (widthRemainder === 0) { |
| 6421 |
continue; |
| 6422 |
} |
| 6423 |
const elem = srcPos < srcLength ? src[srcPos++] : 255; |
| 6424 |
for (let j = 0; j < widthRemainder; j++) { |
| 6425 |
dest[destPos++] = elem & 1 << 7 - j ? oneMapping : zeroMapping; |
| 6426 |
} |
| 6427 |
} |
| 6428 |
return { |
| 6429 |
srcPos, |
| 6430 |
destPos |
| 6431 |
}; |
| 6432 |
} |
| 6433 |
function convertRGBToRGBA({ |
| 6434 |
src, |
| 6435 |
srcPos = 0, |
| 6436 |
dest, |
| 6437 |
destPos = 0, |
| 6438 |
width, |
| 6439 |
height |
| 6440 |
}) { |
| 6441 |
let i = 0; |
| 6442 |
const len32 = src.length >> 2; |
| 6443 |
const src32 = new Uint32Array(src.buffer, srcPos, len32); |
| 6444 |
if (FeatureTest.isLittleEndian) { |
| 6445 |
for (; i < len32 - 2; i += 3, destPos += 4) { |
| 6446 |
const s1 = src32[i]; |
| 6447 |
const s2 = src32[i + 1]; |
| 6448 |
const s3 = src32[i + 2]; |
| 6449 |
dest[destPos] = s1 | 0xff000000; |
| 6450 |
dest[destPos + 1] = s1 >>> 24 | s2 << 8 | 0xff000000; |
| 6451 |
dest[destPos + 2] = s2 >>> 16 | s3 << 16 | 0xff000000; |
| 6452 |
dest[destPos + 3] = s3 >>> 8 | 0xff000000; |
| 6453 |
} |
| 6454 |
for (let j = i * 4, jj = src.length; j < jj; j += 3) { |
| 6455 |
dest[destPos++] = src[j] | src[j + 1] << 8 | src[j + 2] << 16 | 0xff000000; |
| 6456 |
} |
| 6457 |
} else { |
| 6458 |
for (; i < len32 - 2; i += 3, destPos += 4) { |
| 6459 |
const s1 = src32[i]; |
| 6460 |
const s2 = src32[i + 1]; |
| 6461 |
const s3 = src32[i + 2]; |
| 6462 |
dest[destPos] = s1 | 0xff; |
| 6463 |
dest[destPos + 1] = s1 << 24 | s2 >>> 8 | 0xff; |
| 6464 |
dest[destPos + 2] = s2 << 16 | s3 >>> 16 | 0xff; |
| 6465 |
dest[destPos + 3] = s3 << 8 | 0xff; |
| 6466 |
} |
| 6467 |
for (let j = i * 4, jj = src.length; j < jj; j += 3) { |
| 6468 |
dest[destPos++] = src[j] << 24 | src[j + 1] << 16 | src[j + 2] << 8 | 0xff; |
| 6469 |
} |
| 6470 |
} |
| 6471 |
return { |
| 6472 |
srcPos, |
| 6473 |
destPos |
| 6474 |
}; |
| 6475 |
} |
| 6476 |
function grayToRGBA(src, dest) { |
| 6477 |
if (FeatureTest.isLittleEndian) { |
| 6478 |
for (let i = 0, ii = src.length; i < ii; i++) { |
| 6479 |
dest[i] = src[i] * 0x10101 | 0xff000000; |
| 6480 |
} |
| 6481 |
} else { |
| 6482 |
for (let i = 0, ii = src.length; i < ii; i++) { |
| 6483 |
dest[i] = src[i] * 0x1010100 | 0x000000ff; |
| 6484 |
} |
| 6485 |
} |
| 6486 |
} |
| 6487 |
|
| 6488 |
;// ./src/core/jpg.js |
| 6489 |
|
| 6490 |
|
| 6491 |
|
| 6492 |
class JpegError extends BaseException { |
| 6493 |
constructor(msg) { |
| 6494 |
super(msg, "JpegError"); |
| 6495 |
} |
| 6496 |
} |
| 6497 |
class DNLMarkerError extends BaseException { |
| 6498 |
constructor(message, scanLines) { |
| 6499 |
super(message, "DNLMarkerError"); |
| 6500 |
this.scanLines = scanLines; |
| 6501 |
} |
| 6502 |
} |
| 6503 |
class EOIMarkerError extends BaseException { |
| 6504 |
constructor(msg) { |
| 6505 |
super(msg, "EOIMarkerError"); |
| 6506 |
} |
| 6507 |
} |
| 6508 |
const dctZigZag = new Uint8Array([0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63]); |
| 6509 |
const dctCos1 = 4017; |
| 6510 |
const dctSin1 = 799; |
| 6511 |
const dctCos3 = 3406; |
| 6512 |
const dctSin3 = 2276; |
| 6513 |
const dctCos6 = 1567; |
| 6514 |
const dctSin6 = 3784; |
| 6515 |
const dctSqrt2 = 5793; |
| 6516 |
const dctSqrt1d2 = 2896; |
| 6517 |
function buildHuffmanTable(codeLengths, values) { |
| 6518 |
let k = 0, |
| 6519 |
i, |
| 6520 |
j, |
| 6521 |
length = 16; |
| 6522 |
while (length > 0 && !codeLengths[length - 1]) { |
| 6523 |
length--; |
| 6524 |
} |
| 6525 |
const code = [{ |
| 6526 |
children: [], |
| 6527 |
index: 0 |
| 6528 |
}]; |
| 6529 |
let p = code[0], |
| 6530 |
q; |
| 6531 |
for (i = 0; i < length; i++) { |
| 6532 |
for (j = 0; j < codeLengths[i]; j++) { |
| 6533 |
p = code.pop(); |
| 6534 |
p.children[p.index] = values[k]; |
| 6535 |
while (p.index > 0) { |
| 6536 |
p = code.pop(); |
| 6537 |
} |
| 6538 |
p.index++; |
| 6539 |
code.push(p); |
| 6540 |
while (code.length <= i) { |
| 6541 |
code.push(q = { |
| 6542 |
children: [], |
| 6543 |
index: 0 |
| 6544 |
}); |
| 6545 |
p.children[p.index] = q.children; |
| 6546 |
p = q; |
| 6547 |
} |
| 6548 |
k++; |
| 6549 |
} |
| 6550 |
if (i + 1 < length) { |
| 6551 |
code.push(q = { |
| 6552 |
children: [], |
| 6553 |
index: 0 |
| 6554 |
}); |
| 6555 |
p.children[p.index] = q.children; |
| 6556 |
p = q; |
| 6557 |
} |
| 6558 |
} |
| 6559 |
return code[0].children; |
| 6560 |
} |
| 6561 |
function getBlockBufferOffset(component, row, col) { |
| 6562 |
return 64 * ((component.blocksPerLine + 1) * row + col); |
| 6563 |
} |
| 6564 |
function decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successivePrev, successive, parseDNLMarker = false) { |
| 6565 |
const mcusPerLine = frame.mcusPerLine; |
| 6566 |
const progressive = frame.progressive; |
| 6567 |
const startOffset = offset; |
| 6568 |
let bitsData = 0, |
| 6569 |
bitsCount = 0; |
| 6570 |
function readBit() { |
| 6571 |
if (bitsCount > 0) { |
| 6572 |
bitsCount--; |
| 6573 |
return bitsData >> bitsCount & 1; |
| 6574 |
} |
| 6575 |
bitsData = data[offset++]; |
| 6576 |
if (bitsData === 0xff) { |
| 6577 |
const nextByte = data[offset++]; |
| 6578 |
if (nextByte) { |
| 6579 |
if (nextByte === 0xdc && parseDNLMarker) { |
| 6580 |
offset += 2; |
| 6581 |
const scanLines = readUint16(data, offset); |
| 6582 |
offset += 2; |
| 6583 |
if (scanLines > 0 && scanLines !== frame.scanLines) { |
| 6584 |
throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data", scanLines); |
| 6585 |
} |
| 6586 |
} else if (nextByte === 0xd9) { |
| 6587 |
if (parseDNLMarker) { |
| 6588 |
const maybeScanLines = blockRow * (frame.precision === 8 ? 8 : 0); |
| 6589 |
if (maybeScanLines > 0 && Math.round(frame.scanLines / maybeScanLines) >= 5) { |
| 6590 |
throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, " + "possibly caused by incorrect `scanLines` parameter", maybeScanLines); |
| 6591 |
} |
| 6592 |
} |
| 6593 |
throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data"); |
| 6594 |
} |
| 6595 |
throw new JpegError(`unexpected marker ${(bitsData << 8 | nextByte).toString(16)}`); |
| 6596 |
} |
| 6597 |
} |
| 6598 |
bitsCount = 7; |
| 6599 |
return bitsData >>> 7; |
| 6600 |
} |
| 6601 |
function decodeHuffman(tree) { |
| 6602 |
let node = tree; |
| 6603 |
while (true) { |
| 6604 |
node = node[readBit()]; |
| 6605 |
switch (typeof node) { |
| 6606 |
case "number": |
| 6607 |
return node; |
| 6608 |
case "object": |
| 6609 |
continue; |
| 6610 |
} |
| 6611 |
throw new JpegError("invalid huffman sequence"); |
| 6612 |
} |
| 6613 |
} |
| 6614 |
function receive(length) { |
| 6615 |
let n = 0; |
| 6616 |
while (length > 0) { |
| 6617 |
n = n << 1 | readBit(); |
| 6618 |
length--; |
| 6619 |
} |
| 6620 |
return n; |
| 6621 |
} |
| 6622 |
function receiveAndExtend(length) { |
| 6623 |
if (length === 1) { |
| 6624 |
return readBit() === 1 ? 1 : -1; |
| 6625 |
} |
| 6626 |
const n = receive(length); |
| 6627 |
if (n >= 1 << length - 1) { |
| 6628 |
return n; |
| 6629 |
} |
| 6630 |
return n + (-1 << length) + 1; |
| 6631 |
} |
| 6632 |
function decodeBaseline(component, blockOffset) { |
| 6633 |
const t = decodeHuffman(component.huffmanTableDC); |
| 6634 |
const diff = t === 0 ? 0 : receiveAndExtend(t); |
| 6635 |
component.blockData[blockOffset] = component.pred += diff; |
| 6636 |
let k = 1; |
| 6637 |
while (k < 64) { |
| 6638 |
const rs = decodeHuffman(component.huffmanTableAC); |
| 6639 |
const s = rs & 15, |
| 6640 |
r = rs >> 4; |
| 6641 |
if (s === 0) { |
| 6642 |
if (r < 15) { |
| 6643 |
break; |
| 6644 |
} |
| 6645 |
k += 16; |
| 6646 |
continue; |
| 6647 |
} |
| 6648 |
k += r; |
| 6649 |
const z = dctZigZag[k]; |
| 6650 |
component.blockData[blockOffset + z] = receiveAndExtend(s); |
| 6651 |
k++; |
| 6652 |
} |
| 6653 |
} |
| 6654 |
function decodeDCFirst(component, blockOffset) { |
| 6655 |
const t = decodeHuffman(component.huffmanTableDC); |
| 6656 |
const diff = t === 0 ? 0 : receiveAndExtend(t) << successive; |
| 6657 |
component.blockData[blockOffset] = component.pred += diff; |
| 6658 |
} |
| 6659 |
function decodeDCSuccessive(component, blockOffset) { |
| 6660 |
component.blockData[blockOffset] |= readBit() << successive; |
| 6661 |
} |
| 6662 |
let eobrun = 0; |
| 6663 |
function decodeACFirst(component, blockOffset) { |
| 6664 |
if (eobrun > 0) { |
| 6665 |
eobrun--; |
| 6666 |
return; |
| 6667 |
} |
| 6668 |
let k = spectralStart; |
| 6669 |
const e = spectralEnd; |
| 6670 |
while (k <= e) { |
| 6671 |
const rs = decodeHuffman(component.huffmanTableAC); |
| 6672 |
const s = rs & 15, |
| 6673 |
r = rs >> 4; |
| 6674 |
if (s === 0) { |
| 6675 |
if (r < 15) { |
| 6676 |
eobrun = receive(r) + (1 << r) - 1; |
| 6677 |
break; |
| 6678 |
} |
| 6679 |
k += 16; |
| 6680 |
continue; |
| 6681 |
} |
| 6682 |
k += r; |
| 6683 |
const z = dctZigZag[k]; |
| 6684 |
component.blockData[blockOffset + z] = receiveAndExtend(s) * (1 << successive); |
| 6685 |
k++; |
| 6686 |
} |
| 6687 |
} |
| 6688 |
let successiveACState = 0, |
| 6689 |
successiveACNextValue; |
| 6690 |
function decodeACSuccessive(component, blockOffset) { |
| 6691 |
let k = spectralStart; |
| 6692 |
const e = spectralEnd; |
| 6693 |
let r = 0; |
| 6694 |
let s; |
| 6695 |
let rs; |
| 6696 |
while (k <= e) { |
| 6697 |
const offsetZ = blockOffset + dctZigZag[k]; |
| 6698 |
const sign = component.blockData[offsetZ] < 0 ? -1 : 1; |
| 6699 |
switch (successiveACState) { |
| 6700 |
case 0: |
| 6701 |
rs = decodeHuffman(component.huffmanTableAC); |
| 6702 |
s = rs & 15; |
| 6703 |
r = rs >> 4; |
| 6704 |
if (s === 0) { |
| 6705 |
if (r < 15) { |
| 6706 |
eobrun = receive(r) + (1 << r); |
| 6707 |
successiveACState = 4; |
| 6708 |
} else { |
| 6709 |
r = 16; |
| 6710 |
successiveACState = 1; |
| 6711 |
} |
| 6712 |
} else { |
| 6713 |
if (s !== 1) { |
| 6714 |
throw new JpegError("invalid ACn encoding"); |
| 6715 |
} |
| 6716 |
successiveACNextValue = receiveAndExtend(s); |
| 6717 |
successiveACState = r ? 2 : 3; |
| 6718 |
} |
| 6719 |
continue; |
| 6720 |
case 1: |
| 6721 |
case 2: |
| 6722 |
if (component.blockData[offsetZ]) { |
| 6723 |
component.blockData[offsetZ] += sign * (readBit() << successive); |
| 6724 |
} else { |
| 6725 |
r--; |
| 6726 |
if (r === 0) { |
| 6727 |
successiveACState = successiveACState === 2 ? 3 : 0; |
| 6728 |
} |
| 6729 |
} |
| 6730 |
break; |
| 6731 |
case 3: |
| 6732 |
if (component.blockData[offsetZ]) { |
| 6733 |
component.blockData[offsetZ] += sign * (readBit() << successive); |
| 6734 |
} else { |
| 6735 |
component.blockData[offsetZ] = successiveACNextValue << successive; |
| 6736 |
successiveACState = 0; |
| 6737 |
} |
| 6738 |
break; |
| 6739 |
case 4: |
| 6740 |
if (component.blockData[offsetZ]) { |
| 6741 |
component.blockData[offsetZ] += sign * (readBit() << successive); |
| 6742 |
} |
| 6743 |
break; |
| 6744 |
} |
| 6745 |
k++; |
| 6746 |
} |
| 6747 |
if (successiveACState === 4) { |
| 6748 |
eobrun--; |
| 6749 |
if (eobrun === 0) { |
| 6750 |
successiveACState = 0; |
| 6751 |
} |
| 6752 |
} |
| 6753 |
} |
| 6754 |
let blockRow = 0; |
| 6755 |
function decodeMcu(component, decode, mcu, row, col) { |
| 6756 |
const mcuRow = mcu / mcusPerLine | 0; |
| 6757 |
const mcuCol = mcu % mcusPerLine; |
| 6758 |
blockRow = mcuRow * component.v + row; |
| 6759 |
const blockCol = mcuCol * component.h + col; |
| 6760 |
const blockOffset = getBlockBufferOffset(component, blockRow, blockCol); |
| 6761 |
decode(component, blockOffset); |
| 6762 |
} |
| 6763 |
function decodeBlock(component, decode, mcu) { |
| 6764 |
blockRow = mcu / component.blocksPerLine | 0; |
| 6765 |
const blockCol = mcu % component.blocksPerLine; |
| 6766 |
const blockOffset = getBlockBufferOffset(component, blockRow, blockCol); |
| 6767 |
decode(component, blockOffset); |
| 6768 |
} |
| 6769 |
const componentsLength = components.length; |
| 6770 |
let component, i, j, k, n; |
| 6771 |
let decodeFn; |
| 6772 |
if (progressive) { |
| 6773 |
if (spectralStart === 0) { |
| 6774 |
decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive; |
| 6775 |
} else { |
| 6776 |
decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive; |
| 6777 |
} |
| 6778 |
} else { |
| 6779 |
decodeFn = decodeBaseline; |
| 6780 |
} |
| 6781 |
let mcu = 0, |
| 6782 |
fileMarker; |
| 6783 |
const mcuExpected = componentsLength === 1 ? components[0].blocksPerLine * components[0].blocksPerColumn : mcusPerLine * frame.mcusPerColumn; |
| 6784 |
let h, v; |
| 6785 |
while (mcu <= mcuExpected) { |
| 6786 |
const mcuToRead = resetInterval ? Math.min(mcuExpected - mcu, resetInterval) : mcuExpected; |
| 6787 |
if (mcuToRead > 0) { |
| 6788 |
for (i = 0; i < componentsLength; i++) { |
| 6789 |
components[i].pred = 0; |
| 6790 |
} |
| 6791 |
eobrun = 0; |
| 6792 |
if (componentsLength === 1) { |
| 6793 |
component = components[0]; |
| 6794 |
for (n = 0; n < mcuToRead; n++) { |
| 6795 |
decodeBlock(component, decodeFn, mcu); |
| 6796 |
mcu++; |
| 6797 |
} |
| 6798 |
} else { |
| 6799 |
for (n = 0; n < mcuToRead; n++) { |
| 6800 |
for (i = 0; i < componentsLength; i++) { |
| 6801 |
component = components[i]; |
| 6802 |
h = component.h; |
| 6803 |
v = component.v; |
| 6804 |
for (j = 0; j < v; j++) { |
| 6805 |
for (k = 0; k < h; k++) { |
| 6806 |
decodeMcu(component, decodeFn, mcu, j, k); |
| 6807 |
} |
| 6808 |
} |
| 6809 |
} |
| 6810 |
mcu++; |
| 6811 |
} |
| 6812 |
} |
| 6813 |
} |
| 6814 |
bitsCount = 0; |
| 6815 |
fileMarker = findNextFileMarker(data, offset); |
| 6816 |
if (!fileMarker) { |
| 6817 |
break; |
| 6818 |
} |
| 6819 |
if (fileMarker.invalid) { |
| 6820 |
const partialMsg = mcuToRead > 0 ? "unexpected" : "excessive"; |
| 6821 |
warn(`decodeScan - ${partialMsg} MCU data, current marker is: ${fileMarker.invalid}`); |
| 6822 |
offset = fileMarker.offset; |
| 6823 |
} |
| 6824 |
if (fileMarker.marker >= 0xffd0 && fileMarker.marker <= 0xffd7) { |
| 6825 |
offset += 2; |
| 6826 |
} else { |
| 6827 |
break; |
| 6828 |
} |
| 6829 |
} |
| 6830 |
return offset - startOffset; |
| 6831 |
} |
| 6832 |
function quantizeAndInverse(component, blockBufferOffset, p) { |
| 6833 |
const qt = component.quantizationTable, |
| 6834 |
blockData = component.blockData; |
| 6835 |
let v0, v1, v2, v3, v4, v5, v6, v7; |
| 6836 |
let p0, p1, p2, p3, p4, p5, p6, p7; |
| 6837 |
let t; |
| 6838 |
if (!qt) { |
| 6839 |
throw new JpegError("missing required Quantization Table."); |
| 6840 |
} |
| 6841 |
for (let row = 0; row < 64; row += 8) { |
| 6842 |
p0 = blockData[blockBufferOffset + row]; |
| 6843 |
p1 = blockData[blockBufferOffset + row + 1]; |
| 6844 |
p2 = blockData[blockBufferOffset + row + 2]; |
| 6845 |
p3 = blockData[blockBufferOffset + row + 3]; |
| 6846 |
p4 = blockData[blockBufferOffset + row + 4]; |
| 6847 |
p5 = blockData[blockBufferOffset + row + 5]; |
| 6848 |
p6 = blockData[blockBufferOffset + row + 6]; |
| 6849 |
p7 = blockData[blockBufferOffset + row + 7]; |
| 6850 |
p0 *= qt[row]; |
| 6851 |
if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { |
| 6852 |
t = dctSqrt2 * p0 + 512 >> 10; |
| 6853 |
p[row] = t; |
| 6854 |
p[row + 1] = t; |
| 6855 |
p[row + 2] = t; |
| 6856 |
p[row + 3] = t; |
| 6857 |
p[row + 4] = t; |
| 6858 |
p[row + 5] = t; |
| 6859 |
p[row + 6] = t; |
| 6860 |
p[row + 7] = t; |
| 6861 |
continue; |
| 6862 |
} |
| 6863 |
p1 *= qt[row + 1]; |
| 6864 |
p2 *= qt[row + 2]; |
| 6865 |
p3 *= qt[row + 3]; |
| 6866 |
p4 *= qt[row + 4]; |
| 6867 |
p5 *= qt[row + 5]; |
| 6868 |
p6 *= qt[row + 6]; |
| 6869 |
p7 *= qt[row + 7]; |
| 6870 |
v0 = dctSqrt2 * p0 + 128 >> 8; |
| 6871 |
v1 = dctSqrt2 * p4 + 128 >> 8; |
| 6872 |
v2 = p2; |
| 6873 |
v3 = p6; |
| 6874 |
v4 = dctSqrt1d2 * (p1 - p7) + 128 >> 8; |
| 6875 |
v7 = dctSqrt1d2 * (p1 + p7) + 128 >> 8; |
| 6876 |
v5 = p3 << 4; |
| 6877 |
v6 = p5 << 4; |
| 6878 |
v0 = v0 + v1 + 1 >> 1; |
| 6879 |
v1 = v0 - v1; |
| 6880 |
t = v2 * dctSin6 + v3 * dctCos6 + 128 >> 8; |
| 6881 |
v2 = v2 * dctCos6 - v3 * dctSin6 + 128 >> 8; |
| 6882 |
v3 = t; |
| 6883 |
v4 = v4 + v6 + 1 >> 1; |
| 6884 |
v6 = v4 - v6; |
| 6885 |
v7 = v7 + v5 + 1 >> 1; |
| 6886 |
v5 = v7 - v5; |
| 6887 |
v0 = v0 + v3 + 1 >> 1; |
| 6888 |
v3 = v0 - v3; |
| 6889 |
v1 = v1 + v2 + 1 >> 1; |
| 6890 |
v2 = v1 - v2; |
| 6891 |
t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12; |
| 6892 |
v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12; |
| 6893 |
v7 = t; |
| 6894 |
t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12; |
| 6895 |
v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12; |
| 6896 |
v6 = t; |
| 6897 |
p[row] = v0 + v7; |
| 6898 |
p[row + 7] = v0 - v7; |
| 6899 |
p[row + 1] = v1 + v6; |
| 6900 |
p[row + 6] = v1 - v6; |
| 6901 |
p[row + 2] = v2 + v5; |
| 6902 |
p[row + 5] = v2 - v5; |
| 6903 |
p[row + 3] = v3 + v4; |
| 6904 |
p[row + 4] = v3 - v4; |
| 6905 |
} |
| 6906 |
for (let col = 0; col < 8; ++col) { |
| 6907 |
p0 = p[col]; |
| 6908 |
p1 = p[col + 8]; |
| 6909 |
p2 = p[col + 16]; |
| 6910 |
p3 = p[col + 24]; |
| 6911 |
p4 = p[col + 32]; |
| 6912 |
p5 = p[col + 40]; |
| 6913 |
p6 = p[col + 48]; |
| 6914 |
p7 = p[col + 56]; |
| 6915 |
if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { |
| 6916 |
t = dctSqrt2 * p0 + 8192 >> 14; |
| 6917 |
if (t < -2040) { |
| 6918 |
t = 0; |
| 6919 |
} else if (t >= 2024) { |
| 6920 |
t = 255; |
| 6921 |
} else { |
| 6922 |
t = t + 2056 >> 4; |
| 6923 |
} |
| 6924 |
blockData[blockBufferOffset + col] = t; |
| 6925 |
blockData[blockBufferOffset + col + 8] = t; |
| 6926 |
blockData[blockBufferOffset + col + 16] = t; |
| 6927 |
blockData[blockBufferOffset + col + 24] = t; |
| 6928 |
blockData[blockBufferOffset + col + 32] = t; |
| 6929 |
blockData[blockBufferOffset + col + 40] = t; |
| 6930 |
blockData[blockBufferOffset + col + 48] = t; |
| 6931 |
blockData[blockBufferOffset + col + 56] = t; |
| 6932 |
continue; |
| 6933 |
} |
| 6934 |
v0 = dctSqrt2 * p0 + 2048 >> 12; |
| 6935 |
v1 = dctSqrt2 * p4 + 2048 >> 12; |
| 6936 |
v2 = p2; |
| 6937 |
v3 = p6; |
| 6938 |
v4 = dctSqrt1d2 * (p1 - p7) + 2048 >> 12; |
| 6939 |
v7 = dctSqrt1d2 * (p1 + p7) + 2048 >> 12; |
| 6940 |
v5 = p3; |
| 6941 |
v6 = p5; |
| 6942 |
v0 = (v0 + v1 + 1 >> 1) + 4112; |
| 6943 |
v1 = v0 - v1; |
| 6944 |
t = v2 * dctSin6 + v3 * dctCos6 + 2048 >> 12; |
| 6945 |
v2 = v2 * dctCos6 - v3 * dctSin6 + 2048 >> 12; |
| 6946 |
v3 = t; |
| 6947 |
v4 = v4 + v6 + 1 >> 1; |
| 6948 |
v6 = v4 - v6; |
| 6949 |
v7 = v7 + v5 + 1 >> 1; |
| 6950 |
v5 = v7 - v5; |
| 6951 |
v0 = v0 + v3 + 1 >> 1; |
| 6952 |
v3 = v0 - v3; |
| 6953 |
v1 = v1 + v2 + 1 >> 1; |
| 6954 |
v2 = v1 - v2; |
| 6955 |
t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12; |
| 6956 |
v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12; |
| 6957 |
v7 = t; |
| 6958 |
t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12; |
| 6959 |
v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12; |
| 6960 |
v6 = t; |
| 6961 |
p0 = v0 + v7; |
| 6962 |
p7 = v0 - v7; |
| 6963 |
p1 = v1 + v6; |
| 6964 |
p6 = v1 - v6; |
| 6965 |
p2 = v2 + v5; |
| 6966 |
p5 = v2 - v5; |
| 6967 |
p3 = v3 + v4; |
| 6968 |
p4 = v3 - v4; |
| 6969 |
if (p0 < 16) { |
| 6970 |
p0 = 0; |
| 6971 |
} else if (p0 >= 4080) { |
| 6972 |
p0 = 255; |
| 6973 |
} else { |
| 6974 |
p0 >>= 4; |
| 6975 |
} |
| 6976 |
if (p1 < 16) { |
| 6977 |
p1 = 0; |
| 6978 |
} else if (p1 >= 4080) { |
| 6979 |
p1 = 255; |
| 6980 |
} else { |
| 6981 |
p1 >>= 4; |
| 6982 |
} |
| 6983 |
if (p2 < 16) { |
| 6984 |
p2 = 0; |
| 6985 |
} else if (p2 >= 4080) { |
| 6986 |
p2 = 255; |
| 6987 |
} else { |
| 6988 |
p2 >>= 4; |
| 6989 |
} |
| 6990 |
if (p3 < 16) { |
| 6991 |
p3 = 0; |
| 6992 |
} else if (p3 >= 4080) { |
| 6993 |
p3 = 255; |
| 6994 |
} else { |
| 6995 |
p3 >>= 4; |
| 6996 |
} |
| 6997 |
if (p4 < 16) { |
| 6998 |
p4 = 0; |
| 6999 |
} else if (p4 >= 4080) { |
| 7000 |
p4 = 255; |
| 7001 |
} else { |
| 7002 |
p4 >>= 4; |
| 7003 |
} |
| 7004 |
if (p5 < 16) { |
| 7005 |
p5 = 0; |
| 7006 |
} else if (p5 >= 4080) { |
| 7007 |
p5 = 255; |
| 7008 |
} else { |
| 7009 |
p5 >>= 4; |
| 7010 |
} |
| 7011 |
if (p6 < 16) { |
| 7012 |
p6 = 0; |
| 7013 |
} else if (p6 >= 4080) { |
| 7014 |
p6 = 255; |
| 7015 |
} else { |
| 7016 |
p6 >>= 4; |
| 7017 |
} |
| 7018 |
if (p7 < 16) { |
| 7019 |
p7 = 0; |
| 7020 |
} else if (p7 >= 4080) { |
| 7021 |
p7 = 255; |
| 7022 |
} else { |
| 7023 |
p7 >>= 4; |
| 7024 |
} |
| 7025 |
blockData[blockBufferOffset + col] = p0; |
| 7026 |
blockData[blockBufferOffset + col + 8] = p1; |
| 7027 |
blockData[blockBufferOffset + col + 16] = p2; |
| 7028 |
blockData[blockBufferOffset + col + 24] = p3; |
| 7029 |
blockData[blockBufferOffset + col + 32] = p4; |
| 7030 |
blockData[blockBufferOffset + col + 40] = p5; |
| 7031 |
blockData[blockBufferOffset + col + 48] = p6; |
| 7032 |
blockData[blockBufferOffset + col + 56] = p7; |
| 7033 |
} |
| 7034 |
} |
| 7035 |
function buildComponentData(frame, component) { |
| 7036 |
const blocksPerLine = component.blocksPerLine; |
| 7037 |
const blocksPerColumn = component.blocksPerColumn; |
| 7038 |
const computationBuffer = new Int16Array(64); |
| 7039 |
for (let blockRow = 0; blockRow < blocksPerColumn; blockRow++) { |
| 7040 |
for (let blockCol = 0; blockCol < blocksPerLine; blockCol++) { |
| 7041 |
const offset = getBlockBufferOffset(component, blockRow, blockCol); |
| 7042 |
quantizeAndInverse(component, offset, computationBuffer); |
| 7043 |
} |
| 7044 |
} |
| 7045 |
return component.blockData; |
| 7046 |
} |
| 7047 |
function findNextFileMarker(data, currentPos, startPos = currentPos) { |
| 7048 |
const maxPos = data.length - 1; |
| 7049 |
let newPos = startPos < currentPos ? startPos : currentPos; |
| 7050 |
if (currentPos >= maxPos) { |
| 7051 |
return null; |
| 7052 |
} |
| 7053 |
const currentMarker = readUint16(data, currentPos); |
| 7054 |
if (currentMarker >= 0xffc0 && currentMarker <= 0xfffe) { |
| 7055 |
return { |
| 7056 |
invalid: null, |
| 7057 |
marker: currentMarker, |
| 7058 |
offset: currentPos |
| 7059 |
}; |
| 7060 |
} |
| 7061 |
let newMarker = readUint16(data, newPos); |
| 7062 |
while (!(newMarker >= 0xffc0 && newMarker <= 0xfffe)) { |
| 7063 |
if (++newPos >= maxPos) { |
| 7064 |
return null; |
| 7065 |
} |
| 7066 |
newMarker = readUint16(data, newPos); |
| 7067 |
} |
| 7068 |
return { |
| 7069 |
invalid: currentMarker.toString(16), |
| 7070 |
marker: newMarker, |
| 7071 |
offset: newPos |
| 7072 |
}; |
| 7073 |
} |
| 7074 |
class JpegImage { |
| 7075 |
constructor({ |
| 7076 |
decodeTransform = null, |
| 7077 |
colorTransform = -1 |
| 7078 |
} = {}) { |
| 7079 |
this._decodeTransform = decodeTransform; |
| 7080 |
this._colorTransform = colorTransform; |
| 7081 |
} |
| 7082 |
parse(data, { |
| 7083 |
dnlScanLines = null |
| 7084 |
} = {}) { |
| 7085 |
function readDataBlock() { |
| 7086 |
const length = readUint16(data, offset); |
| 7087 |
offset += 2; |
| 7088 |
let endOffset = offset + length - 2; |
| 7089 |
const fileMarker = findNextFileMarker(data, endOffset, offset); |
| 7090 |
if (fileMarker?.invalid) { |
| 7091 |
warn("readDataBlock - incorrect length, current marker is: " + fileMarker.invalid); |
| 7092 |
endOffset = fileMarker.offset; |
| 7093 |
} |
| 7094 |
const array = data.subarray(offset, endOffset); |
| 7095 |
offset += array.length; |
| 7096 |
return array; |
| 7097 |
} |
| 7098 |
function prepareComponents(frame) { |
| 7099 |
const mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH); |
| 7100 |
const mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV); |
| 7101 |
for (const component of frame.components) { |
| 7102 |
const blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) * component.h / frame.maxH); |
| 7103 |
const blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) * component.v / frame.maxV); |
| 7104 |
const blocksPerLineForMcu = mcusPerLine * component.h; |
| 7105 |
const blocksPerColumnForMcu = mcusPerColumn * component.v; |
| 7106 |
const blocksBufferSize = 64 * blocksPerColumnForMcu * (blocksPerLineForMcu + 1); |
| 7107 |
component.blockData = new Int16Array(blocksBufferSize); |
| 7108 |
component.blocksPerLine = blocksPerLine; |
| 7109 |
component.blocksPerColumn = blocksPerColumn; |
| 7110 |
} |
| 7111 |
frame.mcusPerLine = mcusPerLine; |
| 7112 |
frame.mcusPerColumn = mcusPerColumn; |
| 7113 |
} |
| 7114 |
let offset = 0; |
| 7115 |
let jfif = null; |
| 7116 |
let adobe = null; |
| 7117 |
let frame, resetInterval; |
| 7118 |
let numSOSMarkers = 0; |
| 7119 |
const quantizationTables = []; |
| 7120 |
const huffmanTablesAC = [], |
| 7121 |
huffmanTablesDC = []; |
| 7122 |
let fileMarker = readUint16(data, offset); |
| 7123 |
offset += 2; |
| 7124 |
if (fileMarker !== 0xffd8) { |
| 7125 |
throw new JpegError("SOI not found"); |
| 7126 |
} |
| 7127 |
fileMarker = readUint16(data, offset); |
| 7128 |
offset += 2; |
| 7129 |
markerLoop: while (fileMarker !== 0xffd9) { |
| 7130 |
let i, j, l; |
| 7131 |
switch (fileMarker) { |
| 7132 |
case 0xffe0: |
| 7133 |
case 0xffe1: |
| 7134 |
case 0xffe2: |
| 7135 |
case 0xffe3: |
| 7136 |
case 0xffe4: |
| 7137 |
case 0xffe5: |
| 7138 |
case 0xffe6: |
| 7139 |
case 0xffe7: |
| 7140 |
case 0xffe8: |
| 7141 |
case 0xffe9: |
| 7142 |
case 0xffea: |
| 7143 |
case 0xffeb: |
| 7144 |
case 0xffec: |
| 7145 |
case 0xffed: |
| 7146 |
case 0xffee: |
| 7147 |
case 0xffef: |
| 7148 |
case 0xfffe: |
| 7149 |
const appData = readDataBlock(); |
| 7150 |
if (fileMarker === 0xffe0) { |
| 7151 |
if (appData[0] === 0x4a && appData[1] === 0x46 && appData[2] === 0x49 && appData[3] === 0x46 && appData[4] === 0) { |
| 7152 |
jfif = { |
| 7153 |
version: { |
| 7154 |
major: appData[5], |
| 7155 |
minor: appData[6] |
| 7156 |
}, |
| 7157 |
densityUnits: appData[7], |
| 7158 |
xDensity: appData[8] << 8 | appData[9], |
| 7159 |
yDensity: appData[10] << 8 | appData[11], |
| 7160 |
thumbWidth: appData[12], |
| 7161 |
thumbHeight: appData[13], |
| 7162 |
thumbData: appData.subarray(14, 14 + 3 * appData[12] * appData[13]) |
| 7163 |
}; |
| 7164 |
} |
| 7165 |
} |
| 7166 |
if (fileMarker === 0xffee) { |
| 7167 |
if (appData[0] === 0x41 && appData[1] === 0x64 && appData[2] === 0x6f && appData[3] === 0x62 && appData[4] === 0x65) { |
| 7168 |
adobe = { |
| 7169 |
version: appData[5] << 8 | appData[6], |
| 7170 |
flags0: appData[7] << 8 | appData[8], |
| 7171 |
flags1: appData[9] << 8 | appData[10], |
| 7172 |
transformCode: appData[11] |
| 7173 |
}; |
| 7174 |
} |
| 7175 |
} |
| 7176 |
break; |
| 7177 |
case 0xffdb: |
| 7178 |
const quantizationTablesLength = readUint16(data, offset); |
| 7179 |
offset += 2; |
| 7180 |
const quantizationTablesEnd = quantizationTablesLength + offset - 2; |
| 7181 |
let z; |
| 7182 |
while (offset < quantizationTablesEnd) { |
| 7183 |
const quantizationTableSpec = data[offset++]; |
| 7184 |
const tableData = new Uint16Array(64); |
| 7185 |
if (quantizationTableSpec >> 4 === 0) { |
| 7186 |
for (j = 0; j < 64; j++) { |
| 7187 |
z = dctZigZag[j]; |
| 7188 |
tableData[z] = data[offset++]; |
| 7189 |
} |
| 7190 |
} else if (quantizationTableSpec >> 4 === 1) { |
| 7191 |
for (j = 0; j < 64; j++) { |
| 7192 |
z = dctZigZag[j]; |
| 7193 |
tableData[z] = readUint16(data, offset); |
| 7194 |
offset += 2; |
| 7195 |
} |
| 7196 |
} else { |
| 7197 |
throw new JpegError("DQT - invalid table spec"); |
| 7198 |
} |
| 7199 |
quantizationTables[quantizationTableSpec & 15] = tableData; |
| 7200 |
} |
| 7201 |
break; |
| 7202 |
case 0xffc0: |
| 7203 |
case 0xffc1: |
| 7204 |
case 0xffc2: |
| 7205 |
if (frame) { |
| 7206 |
throw new JpegError("Only single frame JPEGs supported"); |
| 7207 |
} |
| 7208 |
offset += 2; |
| 7209 |
frame = {}; |
| 7210 |
frame.extended = fileMarker === 0xffc1; |
| 7211 |
frame.progressive = fileMarker === 0xffc2; |
| 7212 |
frame.precision = data[offset++]; |
| 7213 |
const sofScanLines = readUint16(data, offset); |
| 7214 |
offset += 2; |
| 7215 |
frame.scanLines = dnlScanLines || sofScanLines; |
| 7216 |
frame.samplesPerLine = readUint16(data, offset); |
| 7217 |
offset += 2; |
| 7218 |
frame.components = []; |
| 7219 |
frame.componentIds = {}; |
| 7220 |
const componentsCount = data[offset++]; |
| 7221 |
let maxH = 0, |
| 7222 |
maxV = 0; |
| 7223 |
for (i = 0; i < componentsCount; i++) { |
| 7224 |
const componentId = data[offset]; |
| 7225 |
const h = data[offset + 1] >> 4; |
| 7226 |
const v = data[offset + 1] & 15; |
| 7227 |
if (maxH < h) { |
| 7228 |
maxH = h; |
| 7229 |
} |
| 7230 |
if (maxV < v) { |
| 7231 |
maxV = v; |
| 7232 |
} |
| 7233 |
const qId = data[offset + 2]; |
| 7234 |
l = frame.components.push({ |
| 7235 |
h, |
| 7236 |
v, |
| 7237 |
quantizationId: qId, |
| 7238 |
quantizationTable: null |
| 7239 |
}); |
| 7240 |
frame.componentIds[componentId] = l - 1; |
| 7241 |
offset += 3; |
| 7242 |
} |
| 7243 |
frame.maxH = maxH; |
| 7244 |
frame.maxV = maxV; |
| 7245 |
prepareComponents(frame); |
| 7246 |
break; |
| 7247 |
case 0xffc4: |
| 7248 |
const huffmanLength = readUint16(data, offset); |
| 7249 |
offset += 2; |
| 7250 |
for (i = 2; i < huffmanLength;) { |
| 7251 |
const huffmanTableSpec = data[offset++]; |
| 7252 |
const codeLengths = new Uint8Array(16); |
| 7253 |
let codeLengthSum = 0; |
| 7254 |
for (j = 0; j < 16; j++, offset++) { |
| 7255 |
codeLengthSum += codeLengths[j] = data[offset]; |
| 7256 |
} |
| 7257 |
const huffmanValues = new Uint8Array(codeLengthSum); |
| 7258 |
for (j = 0; j < codeLengthSum; j++, offset++) { |
| 7259 |
huffmanValues[j] = data[offset]; |
| 7260 |
} |
| 7261 |
i += 17 + codeLengthSum; |
| 7262 |
(huffmanTableSpec >> 4 === 0 ? huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = buildHuffmanTable(codeLengths, huffmanValues); |
| 7263 |
} |
| 7264 |
break; |
| 7265 |
case 0xffdd: |
| 7266 |
offset += 2; |
| 7267 |
resetInterval = readUint16(data, offset); |
| 7268 |
offset += 2; |
| 7269 |
break; |
| 7270 |
case 0xffda: |
| 7271 |
const parseDNLMarker = ++numSOSMarkers === 1 && !dnlScanLines; |
| 7272 |
offset += 2; |
| 7273 |
const selectorsCount = data[offset++], |
| 7274 |
components = []; |
| 7275 |
for (i = 0; i < selectorsCount; i++) { |
| 7276 |
const index = data[offset++]; |
| 7277 |
const componentIndex = frame.componentIds[index]; |
| 7278 |
const component = frame.components[componentIndex]; |
| 7279 |
component.index = index; |
| 7280 |
const tableSpec = data[offset++]; |
| 7281 |
component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4]; |
| 7282 |
component.huffmanTableAC = huffmanTablesAC[tableSpec & 15]; |
| 7283 |
components.push(component); |
| 7284 |
} |
| 7285 |
const spectralStart = data[offset++], |
| 7286 |
spectralEnd = data[offset++], |
| 7287 |
successiveApproximation = data[offset++]; |
| 7288 |
try { |
| 7289 |
const processed = decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successiveApproximation >> 4, successiveApproximation & 15, parseDNLMarker); |
| 7290 |
offset += processed; |
| 7291 |
} catch (ex) { |
| 7292 |
if (ex instanceof DNLMarkerError) { |
| 7293 |
warn(`${ex.message} -- attempting to re-parse the JPEG image.`); |
| 7294 |
return this.parse(data, { |
| 7295 |
dnlScanLines: ex.scanLines |
| 7296 |
}); |
| 7297 |
} else if (ex instanceof EOIMarkerError) { |
| 7298 |
warn(`${ex.message} -- ignoring the rest of the image data.`); |
| 7299 |
break markerLoop; |
| 7300 |
} |
| 7301 |
throw ex; |
| 7302 |
} |
| 7303 |
break; |
| 7304 |
case 0xffdc: |
| 7305 |
offset += 4; |
| 7306 |
break; |
| 7307 |
case 0xffff: |
| 7308 |
if (data[offset] !== 0xff) { |
| 7309 |
offset--; |
| 7310 |
} |
| 7311 |
break; |
| 7312 |
default: |
| 7313 |
const nextFileMarker = findNextFileMarker(data, offset - 2, offset - 3); |
| 7314 |
if (nextFileMarker?.invalid) { |
| 7315 |
warn("JpegImage.parse - unexpected data, current marker is: " + nextFileMarker.invalid); |
| 7316 |
offset = nextFileMarker.offset; |
| 7317 |
break; |
| 7318 |
} |
| 7319 |
if (!nextFileMarker || offset >= data.length - 1) { |
| 7320 |
warn("JpegImage.parse - reached the end of the image data " + "without finding an EOI marker (0xFFD9)."); |
| 7321 |
break markerLoop; |
| 7322 |
} |
| 7323 |
throw new JpegError("JpegImage.parse - unknown marker: " + fileMarker.toString(16)); |
| 7324 |
} |
| 7325 |
fileMarker = readUint16(data, offset); |
| 7326 |
offset += 2; |
| 7327 |
} |
| 7328 |
if (!frame) { |
| 7329 |
throw new JpegError("JpegImage.parse - no frame data found."); |
| 7330 |
} |
| 7331 |
this.width = frame.samplesPerLine; |
| 7332 |
this.height = frame.scanLines; |
| 7333 |
this.jfif = jfif; |
| 7334 |
this.adobe = adobe; |
| 7335 |
this.components = []; |
| 7336 |
for (const component of frame.components) { |
| 7337 |
const quantizationTable = quantizationTables[component.quantizationId]; |
| 7338 |
if (quantizationTable) { |
| 7339 |
component.quantizationTable = quantizationTable; |
| 7340 |
} |
| 7341 |
this.components.push({ |
| 7342 |
index: component.index, |
| 7343 |
output: buildComponentData(frame, component), |
| 7344 |
scaleX: component.h / frame.maxH, |
| 7345 |
scaleY: component.v / frame.maxV, |
| 7346 |
blocksPerLine: component.blocksPerLine, |
| 7347 |
blocksPerColumn: component.blocksPerColumn |
| 7348 |
}); |
| 7349 |
} |
| 7350 |
this.numComponents = this.components.length; |
| 7351 |
return undefined; |
| 7352 |
} |
| 7353 |
_getLinearizedBlockData(width, height, isSourcePDF = false) { |
| 7354 |
const scaleX = this.width / width, |
| 7355 |
scaleY = this.height / height; |
| 7356 |
let component, componentScaleX, componentScaleY, blocksPerScanline; |
| 7357 |
let x, y, i, j, k; |
| 7358 |
let index; |
| 7359 |
let offset = 0; |
| 7360 |
let output; |
| 7361 |
const numComponents = this.components.length; |
| 7362 |
const dataLength = width * height * numComponents; |
| 7363 |
const data = new Uint8ClampedArray(dataLength); |
| 7364 |
const xScaleBlockOffset = new Uint32Array(width); |
| 7365 |
const mask3LSB = 0xfffffff8; |
| 7366 |
let lastComponentScaleX; |
| 7367 |
for (i = 0; i < numComponents; i++) { |
| 7368 |
component = this.components[i]; |
| 7369 |
componentScaleX = component.scaleX * scaleX; |
| 7370 |
componentScaleY = component.scaleY * scaleY; |
| 7371 |
offset = i; |
| 7372 |
output = component.output; |
| 7373 |
blocksPerScanline = component.blocksPerLine + 1 << 3; |
| 7374 |
if (componentScaleX !== lastComponentScaleX) { |
| 7375 |
for (x = 0; x < width; x++) { |
| 7376 |
j = 0 | x * componentScaleX; |
| 7377 |
xScaleBlockOffset[x] = (j & mask3LSB) << 3 | j & 7; |
| 7378 |
} |
| 7379 |
lastComponentScaleX = componentScaleX; |
| 7380 |
} |
| 7381 |
for (y = 0; y < height; y++) { |
| 7382 |
j = 0 | y * componentScaleY; |
| 7383 |
index = blocksPerScanline * (j & mask3LSB) | (j & 7) << 3; |
| 7384 |
for (x = 0; x < width; x++) { |
| 7385 |
data[offset] = output[index + xScaleBlockOffset[x]]; |
| 7386 |
offset += numComponents; |
| 7387 |
} |
| 7388 |
} |
| 7389 |
} |
| 7390 |
let transform = this._decodeTransform; |
| 7391 |
if (!isSourcePDF && numComponents === 4 && !transform) { |
| 7392 |
transform = new Int32Array([-256, 255, -256, 255, -256, 255, -256, 255]); |
| 7393 |
} |
| 7394 |
if (transform) { |
| 7395 |
for (i = 0; i < dataLength;) { |
| 7396 |
for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) { |
| 7397 |
data[i] = (data[i] * transform[k] >> 8) + transform[k + 1]; |
| 7398 |
} |
| 7399 |
} |
| 7400 |
} |
| 7401 |
return data; |
| 7402 |
} |
| 7403 |
get _isColorConversionNeeded() { |
| 7404 |
if (this.adobe) { |
| 7405 |
return !!this.adobe.transformCode; |
| 7406 |
} |
| 7407 |
if (this.numComponents === 3) { |
| 7408 |
if (this._colorTransform === 0) { |
| 7409 |
return false; |
| 7410 |
} else if (this.components[0].index === 0x52 && this.components[1].index === 0x47 && this.components[2].index === 0x42) { |
| 7411 |
return false; |
| 7412 |
} |
| 7413 |
return true; |
| 7414 |
} |
| 7415 |
if (this._colorTransform === 1) { |
| 7416 |
return true; |
| 7417 |
} |
| 7418 |
return false; |
| 7419 |
} |
| 7420 |
_convertYccToRgb(data) { |
| 7421 |
let Y, Cb, Cr; |
| 7422 |
for (let i = 0, length = data.length; i < length; i += 3) { |
| 7423 |
Y = data[i]; |
| 7424 |
Cb = data[i + 1]; |
| 7425 |
Cr = data[i + 2]; |
| 7426 |
data[i] = Y - 179.456 + 1.402 * Cr; |
| 7427 |
data[i + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr; |
| 7428 |
data[i + 2] = Y - 226.816 + 1.772 * Cb; |
| 7429 |
} |
| 7430 |
return data; |
| 7431 |
} |
| 7432 |
_convertYccToRgba(data, out) { |
| 7433 |
for (let i = 0, j = 0, length = data.length; i < length; i += 3, j += 4) { |
| 7434 |
const Y = data[i]; |
| 7435 |
const Cb = data[i + 1]; |
| 7436 |
const Cr = data[i + 2]; |
| 7437 |
out[j] = Y - 179.456 + 1.402 * Cr; |
| 7438 |
out[j + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr; |
| 7439 |
out[j + 2] = Y - 226.816 + 1.772 * Cb; |
| 7440 |
out[j + 3] = 255; |
| 7441 |
} |
| 7442 |
return out; |
| 7443 |
} |
| 7444 |
_convertYcckToRgb(data) { |
| 7445 |
let Y, Cb, Cr, k; |
| 7446 |
let offset = 0; |
| 7447 |
for (let i = 0, length = data.length; i < length; i += 4) { |
| 7448 |
Y = data[i]; |
| 7449 |
Cb = data[i + 1]; |
| 7450 |
Cr = data[i + 2]; |
| 7451 |
k = data[i + 3]; |
| 7452 |
data[offset++] = -122.67195406894 + Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - 0.154362151871126) + Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - 0.00477271405408747 * k + 1.53380253221734) + Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + 0.48357088451265) + k * (-0.000336197177618394 * k + 0.484791561490776); |
| 7453 |
data[offset++] = 107.268039397724 + Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + 0.000659397001245577 * Y + 0.000426105652938837 * k - 0.176491792462875) + Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + 0.000770482631801132 * k - 0.151051492775562) + Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + 0.25802910206845) + k * (-0.000318913117588328 * k - 0.213742400323665); |
| 7454 |
data[offset++] = -20.810012546947 + Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + 0.0020741088115012 * Y - 0.00288260236853442 * k + 0.814272968359295) + Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + 0.000560833691242812 * k - 0.195152027534049) + Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + 0.116935020465145) + k * (-0.000343531996510555 * k + 0.24165260232407); |
| 7455 |
} |
| 7456 |
return data.subarray(0, offset); |
| 7457 |
} |
| 7458 |
_convertYcckToRgba(data) { |
| 7459 |
for (let i = 0, length = data.length; i < length; i += 4) { |
| 7460 |
const Y = data[i]; |
| 7461 |
const Cb = data[i + 1]; |
| 7462 |
const Cr = data[i + 2]; |
| 7463 |
const k = data[i + 3]; |
| 7464 |
data[i] = -122.67195406894 + Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - 0.154362151871126) + Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - 0.00477271405408747 * k + 1.53380253221734) + Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + 0.48357088451265) + k * (-0.000336197177618394 * k + 0.484791561490776); |
| 7465 |
data[i + 1] = 107.268039397724 + Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + 0.000659397001245577 * Y + 0.000426105652938837 * k - 0.176491792462875) + Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + 0.000770482631801132 * k - 0.151051492775562) + Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + 0.25802910206845) + k * (-0.000318913117588328 * k - 0.213742400323665); |
| 7466 |
data[i + 2] = -20.810012546947 + Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + 0.0020741088115012 * Y - 0.00288260236853442 * k + 0.814272968359295) + Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + 0.000560833691242812 * k - 0.195152027534049) + Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + 0.116935020465145) + k * (-0.000343531996510555 * k + 0.24165260232407); |
| 7467 |
data[i + 3] = 255; |
| 7468 |
} |
| 7469 |
return data; |
| 7470 |
} |
| 7471 |
_convertYcckToCmyk(data) { |
| 7472 |
let Y, Cb, Cr; |
| 7473 |
for (let i = 0, length = data.length; i < length; i += 4) { |
| 7474 |
Y = data[i]; |
| 7475 |
Cb = data[i + 1]; |
| 7476 |
Cr = data[i + 2]; |
| 7477 |
data[i] = 434.456 - Y - 1.402 * Cr; |
| 7478 |
data[i + 1] = 119.541 - Y + 0.344 * Cb + 0.714 * Cr; |
| 7479 |
data[i + 2] = 481.816 - Y - 1.772 * Cb; |
| 7480 |
} |
| 7481 |
return data; |
| 7482 |
} |
| 7483 |
_convertCmykToRgb(data) { |
| 7484 |
let c, m, y, k; |
| 7485 |
let offset = 0; |
| 7486 |
for (let i = 0, length = data.length; i < length; i += 4) { |
| 7487 |
c = data[i]; |
| 7488 |
m = data[i + 1]; |
| 7489 |
y = data[i + 2]; |
| 7490 |
k = data[i + 3]; |
| 7491 |
data[offset++] = 255 + c * (-0.00006747147073602441 * c + 0.0008379262121013727 * m + 0.0002894718188643294 * y + 0.003264231057537806 * k - 1.1185611867203937) + m * (0.000026374107616089405 * m - 0.00008626949158638572 * y - 0.0002748769067499491 * k - 0.02155688794978967) + y * (-0.00003878099212869363 * y - 0.0003267808279485286 * k + 0.0686742238595345) - k * (0.0003361971776183937 * k + 0.7430659151342254); |
| 7492 |
data[offset++] = 255 + c * (0.00013596372813588848 * c + 0.000924537132573585 * m + 0.00010567359618683593 * y + 0.0004791864687436512 * k - 0.3109689587515875) + m * (-0.00023545346108370344 * m + 0.0002702845253534714 * y + 0.0020200308977307156 * k - 0.7488052167015494) + y * (0.00006834815998235662 * y + 0.00015168452363460973 * k - 0.09751927774728933) - k * (0.0003189131175883281 * k + 0.7364883807733168); |
| 7493 |
data[offset++] = 255 + c * (0.000013598650411385307 * c + 0.00012423956175490851 * m + 0.0004751985097583589 * y - 0.0000036729317476630422 * k - 0.05562186980264034) + m * (0.00016141380598724676 * m + 0.0009692239130725186 * y + 0.0007782692450036253 * k - 0.44015232367526463) + y * (5.068882914068769e-7 * y + 0.0017778369011375071 * k - 0.7591454649749609) - k * (0.0003435319965105553 * k + 0.7063770186160144); |
| 7494 |
} |
| 7495 |
return data.subarray(0, offset); |
| 7496 |
} |
| 7497 |
_convertCmykToRgba(data) { |
| 7498 |
for (let i = 0, length = data.length; i < length; i += 4) { |
| 7499 |
const c = data[i]; |
| 7500 |
const m = data[i + 1]; |
| 7501 |
const y = data[i + 2]; |
| 7502 |
const k = data[i + 3]; |
| 7503 |
data[i] = 255 + c * (-0.00006747147073602441 * c + 0.0008379262121013727 * m + 0.0002894718188643294 * y + 0.003264231057537806 * k - 1.1185611867203937) + m * (0.000026374107616089405 * m - 0.00008626949158638572 * y - 0.0002748769067499491 * k - 0.02155688794978967) + y * (-0.00003878099212869363 * y - 0.0003267808279485286 * k + 0.0686742238595345) - k * (0.0003361971776183937 * k + 0.7430659151342254); |
| 7504 |
data[i + 1] = 255 + c * (0.00013596372813588848 * c + 0.000924537132573585 * m + 0.00010567359618683593 * y + 0.0004791864687436512 * k - 0.3109689587515875) + m * (-0.00023545346108370344 * m + 0.0002702845253534714 * y + 0.0020200308977307156 * k - 0.7488052167015494) + y * (0.00006834815998235662 * y + 0.00015168452363460973 * k - 0.09751927774728933) - k * (0.0003189131175883281 * k + 0.7364883807733168); |
| 7505 |
data[i + 2] = 255 + c * (0.000013598650411385307 * c + 0.00012423956175490851 * m + 0.0004751985097583589 * y - 0.0000036729317476630422 * k - 0.05562186980264034) + m * (0.00016141380598724676 * m + 0.0009692239130725186 * y + 0.0007782692450036253 * k - 0.44015232367526463) + y * (5.068882914068769e-7 * y + 0.0017778369011375071 * k - 0.7591454649749609) - k * (0.0003435319965105553 * k + 0.7063770186160144); |
| 7506 |
data[i + 3] = 255; |
| 7507 |
} |
| 7508 |
return data; |
| 7509 |
} |
| 7510 |
getData({ |
| 7511 |
width, |
| 7512 |
height, |
| 7513 |
forceRGBA = false, |
| 7514 |
forceRGB = false, |
| 7515 |
isSourcePDF = false |
| 7516 |
}) { |
| 7517 |
if (this.numComponents > 4) { |
| 7518 |
throw new JpegError("Unsupported color mode"); |
| 7519 |
} |
| 7520 |
const data = this._getLinearizedBlockData(width, height, isSourcePDF); |
| 7521 |
if (this.numComponents === 1 && (forceRGBA || forceRGB)) { |
| 7522 |
const len = data.length * (forceRGBA ? 4 : 3); |
| 7523 |
const rgbaData = new Uint8ClampedArray(len); |
| 7524 |
let offset = 0; |
| 7525 |
if (forceRGBA) { |
| 7526 |
grayToRGBA(data, new Uint32Array(rgbaData.buffer)); |
| 7527 |
} else { |
| 7528 |
for (const grayColor of data) { |
| 7529 |
rgbaData[offset++] = grayColor; |
| 7530 |
rgbaData[offset++] = grayColor; |
| 7531 |
rgbaData[offset++] = grayColor; |
| 7532 |
} |
| 7533 |
} |
| 7534 |
return rgbaData; |
| 7535 |
} else if (this.numComponents === 3 && this._isColorConversionNeeded) { |
| 7536 |
if (forceRGBA) { |
| 7537 |
const rgbaData = new Uint8ClampedArray(data.length / 3 * 4); |
| 7538 |
return this._convertYccToRgba(data, rgbaData); |
| 7539 |
} |
| 7540 |
return this._convertYccToRgb(data); |
| 7541 |
} else if (this.numComponents === 4) { |
| 7542 |
if (this._isColorConversionNeeded) { |
| 7543 |
if (forceRGBA) { |
| 7544 |
return this._convertYcckToRgba(data); |
| 7545 |
} |
| 7546 |
if (forceRGB) { |
| 7547 |
return this._convertYcckToRgb(data); |
| 7548 |
} |
| 7549 |
return this._convertYcckToCmyk(data); |
| 7550 |
} else if (forceRGBA) { |
| 7551 |
return this._convertCmykToRgba(data); |
| 7552 |
} else if (forceRGB) { |
| 7553 |
return this._convertCmykToRgb(data); |
| 7554 |
} |
| 7555 |
} |
| 7556 |
return data; |
| 7557 |
} |
| 7558 |
} |
| 7559 |
|
| 7560 |
;// ./src/core/jpeg_stream.js |
| 7561 |
|
| 7562 |
|
| 7563 |
|
| 7564 |
|
| 7565 |
class JpegStream extends DecodeStream { |
| 7566 |
constructor(stream, maybeLength, params) { |
| 7567 |
super(maybeLength); |
| 7568 |
this.stream = stream; |
| 7569 |
this.dict = stream.dict; |
| 7570 |
this.maybeLength = maybeLength; |
| 7571 |
this.params = params; |
| 7572 |
} |
| 7573 |
get bytes() { |
| 7574 |
return shadow(this, "bytes", this.stream.getBytes(this.maybeLength)); |
| 7575 |
} |
| 7576 |
ensureBuffer(requested) {} |
| 7577 |
readBlock() { |
| 7578 |
this.decodeImage(); |
| 7579 |
} |
| 7580 |
decodeImage(bytes) { |
| 7581 |
if (this.eof) { |
| 7582 |
return this.buffer; |
| 7583 |
} |
| 7584 |
bytes ||= this.bytes; |
| 7585 |
for (let i = 0, ii = bytes.length - 1; i < ii; i++) { |
| 7586 |
if (bytes[i] === 0xff && bytes[i + 1] === 0xd8) { |
| 7587 |
if (i > 0) { |
| 7588 |
bytes = bytes.subarray(i); |
| 7589 |
} |
| 7590 |
break; |
| 7591 |
} |
| 7592 |
} |
| 7593 |
const jpegOptions = { |
| 7594 |
decodeTransform: undefined, |
| 7595 |
colorTransform: undefined |
| 7596 |
}; |
| 7597 |
const decodeArr = this.dict.getArray("D", "Decode"); |
| 7598 |
if ((this.forceRGBA || this.forceRGB) && Array.isArray(decodeArr)) { |
| 7599 |
const bitsPerComponent = this.dict.get("BPC", "BitsPerComponent") || 8; |
| 7600 |
const decodeArrLength = decodeArr.length; |
| 7601 |
const transform = new Int32Array(decodeArrLength); |
| 7602 |
let transformNeeded = false; |
| 7603 |
const maxValue = (1 << bitsPerComponent) - 1; |
| 7604 |
for (let i = 0; i < decodeArrLength; i += 2) { |
| 7605 |
transform[i] = (decodeArr[i + 1] - decodeArr[i]) * 256 | 0; |
| 7606 |
transform[i + 1] = decodeArr[i] * maxValue | 0; |
| 7607 |
if (transform[i] !== 256 || transform[i + 1] !== 0) { |
| 7608 |
transformNeeded = true; |
| 7609 |
} |
| 7610 |
} |
| 7611 |
if (transformNeeded) { |
| 7612 |
jpegOptions.decodeTransform = transform; |
| 7613 |
} |
| 7614 |
} |
| 7615 |
if (this.params instanceof Dict) { |
| 7616 |
const colorTransform = this.params.get("ColorTransform"); |
| 7617 |
if (Number.isInteger(colorTransform)) { |
| 7618 |
jpegOptions.colorTransform = colorTransform; |
| 7619 |
} |
| 7620 |
} |
| 7621 |
const jpegImage = new JpegImage(jpegOptions); |
| 7622 |
jpegImage.parse(bytes); |
| 7623 |
const data = jpegImage.getData({ |
| 7624 |
width: this.drawWidth, |
| 7625 |
height: this.drawHeight, |
| 7626 |
forceRGBA: this.forceRGBA, |
| 7627 |
forceRGB: this.forceRGB, |
| 7628 |
isSourcePDF: true |
| 7629 |
}); |
| 7630 |
this.buffer = data; |
| 7631 |
this.bufferLength = data.length; |
| 7632 |
this.eof = true; |
| 7633 |
return this.buffer; |
| 7634 |
} |
| 7635 |
get canAsyncDecodeImageFromBuffer() { |
| 7636 |
return this.stream.isAsync; |
| 7637 |
} |
| 7638 |
} |
| 7639 |
|
| 7640 |
;// ./external/openjpeg/openjpeg.js |
| 7641 |
var OpenJPEG = (() => { |
| 7642 |
var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined; |
| 7643 |
return function (moduleArg = {}) { |
| 7644 |
var moduleRtn; |
| 7645 |
var Module = moduleArg; |
| 7646 |
var readyPromiseResolve, readyPromiseReject; |
| 7647 |
var readyPromise = new Promise((resolve, reject) => { |
| 7648 |
readyPromiseResolve = resolve; |
| 7649 |
readyPromiseReject = reject; |
| 7650 |
}); |
| 7651 |
var ENVIRONMENT_IS_WEB = true; |
| 7652 |
var ENVIRONMENT_IS_WORKER = false; |
| 7653 |
Module.decode = function (bytes, { |
| 7654 |
numComponents = 4, |
| 7655 |
isIndexedColormap = false, |
| 7656 |
smaskInData = false |
| 7657 |
}) { |
| 7658 |
const size = bytes.length; |
| 7659 |
const ptr = Module._malloc(size); |
| 7660 |
Module.HEAPU8.set(bytes, ptr); |
| 7661 |
const ret = Module._jp2_decode(ptr, size, numComponents > 0 ? numComponents : 0, !!isIndexedColormap, !!smaskInData); |
| 7662 |
Module._free(ptr); |
| 7663 |
if (ret) { |
| 7664 |
const { |
| 7665 |
errorMessages: errorMessages |
| 7666 |
} = Module; |
| 7667 |
if (errorMessages) { |
| 7668 |
delete Module.errorMessages; |
| 7669 |
return errorMessages; |
| 7670 |
} |
| 7671 |
return "Unknown error"; |
| 7672 |
} |
| 7673 |
const { |
| 7674 |
imageData: imageData |
| 7675 |
} = Module; |
| 7676 |
Module.imageData = null; |
| 7677 |
return imageData; |
| 7678 |
}; |
| 7679 |
var moduleOverrides = Object.assign({}, Module); |
| 7680 |
var arguments_ = []; |
| 7681 |
var thisProgram = "./this.program"; |
| 7682 |
var quit_ = (status, toThrow) => { |
| 7683 |
throw toThrow; |
| 7684 |
}; |
| 7685 |
var scriptDirectory = ""; |
| 7686 |
var read_, readAsync, readBinary; |
| 7687 |
if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { |
| 7688 |
if (ENVIRONMENT_IS_WORKER) { |
| 7689 |
scriptDirectory = self.location.href; |
| 7690 |
} else if (typeof document != "undefined" && document.currentScript) { |
| 7691 |
scriptDirectory = document.currentScript.src; |
| 7692 |
} |
| 7693 |
if (_scriptName) { |
| 7694 |
scriptDirectory = _scriptName; |
| 7695 |
} |
| 7696 |
if (scriptDirectory.startsWith("blob:")) { |
| 7697 |
scriptDirectory = ""; |
| 7698 |
} else { |
| 7699 |
scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1); |
| 7700 |
} |
| 7701 |
read_ = url => { |
| 7702 |
var xhr = new XMLHttpRequest(); |
| 7703 |
xhr.open("GET", url, false); |
| 7704 |
xhr.send(null); |
| 7705 |
return xhr.responseText; |
| 7706 |
}; |
| 7707 |
if (ENVIRONMENT_IS_WORKER) { |
| 7708 |
readBinary = url => { |
| 7709 |
var xhr = new XMLHttpRequest(); |
| 7710 |
xhr.open("GET", url, false); |
| 7711 |
xhr.responseType = "arraybuffer"; |
| 7712 |
xhr.send(null); |
| 7713 |
return new Uint8Array(xhr.response); |
| 7714 |
}; |
| 7715 |
} |
| 7716 |
readAsync = (url, onload, onerror) => { |
| 7717 |
fetch(url, { |
| 7718 |
credentials: "same-origin" |
| 7719 |
}).then(response => { |
| 7720 |
if (response.ok) { |
| 7721 |
return response.arrayBuffer(); |
| 7722 |
} |
| 7723 |
return Promise.reject(new Error(response.status + " : " + response.url)); |
| 7724 |
}).then(onload, onerror); |
| 7725 |
}; |
| 7726 |
} else {} |
| 7727 |
var out = Module["print"] || console.log.bind(console); |
| 7728 |
var err = Module["printErr"] || console.error.bind(console); |
| 7729 |
Object.assign(Module, moduleOverrides); |
| 7730 |
moduleOverrides = null; |
| 7731 |
if (Module["arguments"]) arguments_ = Module["arguments"]; |
| 7732 |
if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; |
| 7733 |
if (Module["quit"]) quit_ = Module["quit"]; |
| 7734 |
var wasmBinary; |
| 7735 |
if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; |
| 7736 |
function intArrayFromBase64(s) { |
| 7737 |
var decoded = atob(s); |
| 7738 |
var bytes = new Uint8Array(decoded.length); |
| 7739 |
for (var i = 0; i < decoded.length; ++i) { |
| 7740 |
bytes[i] = decoded.charCodeAt(i); |
| 7741 |
} |
| 7742 |
return bytes; |
| 7743 |
} |
| 7744 |
function tryParseAsDataURI(filename) { |
| 7745 |
if (!isDataURI(filename)) { |
| 7746 |
return; |
| 7747 |
} |
| 7748 |
return intArrayFromBase64(filename.slice(dataURIPrefix.length)); |
| 7749 |
} |
| 7750 |
var wasmMemory; |
| 7751 |
var ABORT = false; |
| 7752 |
var HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; |
| 7753 |
function updateMemoryViews() { |
| 7754 |
var b = wasmMemory.buffer; |
| 7755 |
Module["HEAP8"] = HEAP8 = new Int8Array(b); |
| 7756 |
Module["HEAP16"] = HEAP16 = new Int16Array(b); |
| 7757 |
Module["HEAPU8"] = HEAPU8 = new Uint8Array(b); |
| 7758 |
Module["HEAPU16"] = HEAPU16 = new Uint16Array(b); |
| 7759 |
Module["HEAP32"] = HEAP32 = new Int32Array(b); |
| 7760 |
Module["HEAPU32"] = HEAPU32 = new Uint32Array(b); |
| 7761 |
Module["HEAPF32"] = HEAPF32 = new Float32Array(b); |
| 7762 |
Module["HEAPF64"] = HEAPF64 = new Float64Array(b); |
| 7763 |
} |
| 7764 |
var __ATPRERUN__ = []; |
| 7765 |
var __ATINIT__ = []; |
| 7766 |
var __ATPOSTRUN__ = []; |
| 7767 |
var runtimeInitialized = false; |
| 7768 |
function preRun() { |
| 7769 |
if (Module["preRun"]) { |
| 7770 |
if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]]; |
| 7771 |
while (Module["preRun"].length) { |
| 7772 |
addOnPreRun(Module["preRun"].shift()); |
| 7773 |
} |
| 7774 |
} |
| 7775 |
callRuntimeCallbacks(__ATPRERUN__); |
| 7776 |
} |
| 7777 |
function initRuntime() { |
| 7778 |
runtimeInitialized = true; |
| 7779 |
callRuntimeCallbacks(__ATINIT__); |
| 7780 |
} |
| 7781 |
function postRun() { |
| 7782 |
if (Module["postRun"]) { |
| 7783 |
if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]]; |
| 7784 |
while (Module["postRun"].length) { |
| 7785 |
addOnPostRun(Module["postRun"].shift()); |
| 7786 |
} |
| 7787 |
} |
| 7788 |
callRuntimeCallbacks(__ATPOSTRUN__); |
| 7789 |
} |
| 7790 |
function addOnPreRun(cb) { |
| 7791 |
__ATPRERUN__.unshift(cb); |
| 7792 |
} |
| 7793 |
function addOnInit(cb) { |
| 7794 |
__ATINIT__.unshift(cb); |
| 7795 |
} |
| 7796 |
function addOnPostRun(cb) { |
| 7797 |
__ATPOSTRUN__.unshift(cb); |
| 7798 |
} |
| 7799 |
var runDependencies = 0; |
| 7800 |
var runDependencyWatcher = null; |
| 7801 |
var dependenciesFulfilled = null; |
| 7802 |
function addRunDependency(id) { |
| 7803 |
runDependencies++; |
| 7804 |
Module["monitorRunDependencies"]?.(runDependencies); |
| 7805 |
} |
| 7806 |
function removeRunDependency(id) { |
| 7807 |
runDependencies--; |
| 7808 |
Module["monitorRunDependencies"]?.(runDependencies); |
| 7809 |
if (runDependencies == 0) { |
| 7810 |
if (runDependencyWatcher !== null) { |
| 7811 |
clearInterval(runDependencyWatcher); |
| 7812 |
runDependencyWatcher = null; |
| 7813 |
} |
| 7814 |
if (dependenciesFulfilled) { |
| 7815 |
var callback = dependenciesFulfilled; |
| 7816 |
dependenciesFulfilled = null; |
| 7817 |
callback(); |
| 7818 |
} |
| 7819 |
} |
| 7820 |
} |
| 7821 |
var dataURIPrefix = "data:application/octet-stream;base64,"; |
| 7822 |
var isDataURI = filename => filename.startsWith(dataURIPrefix); |
| 7823 |
function findWasmBinary() { |
| 7824 |
var f = "data:application/octet-stream;base64,AGFzbQEAAAABzgEaYAN/f38Bf2AEf39/fwF/YAF/AGACf38AYAF/AX9gA39/fwBgAn9/AX9gBH9/f38AYAN/fn8BfmAFf39/f38Bf2ACfn8Bf2ACfn8BfmAFf39/f38AYAN/fn8Bf2AAAX9gB39/f39/f38Bf2AJf39/f39/f39/AX9gC39/f39/f39/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QEgAkEBaiICQQNxRQ0BIAIgA0kNAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgACADQQRrIgRLBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAswAQF/AkAgAEUNACABRQ0AQQggACABbCIBECUiAARAIABBACABEBUaCyAAIQILIAILEQAgAEUEQEEADwtBCCAAECUL8gICAn8BfgJAIAJFDQAgACABOgAAIAAgAmoiA0EBayABOgAAIAJBA0kNACAAIAE6AAIgACABOgABIANBA2sgAToAACADQQJrIAE6AAAgAkEHSQ0AIAAgAToAAyADQQRrIAE6AAAgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBBGsgATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQQhrIAE2AgAgAkEMayABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkEQayABNgIAIAJBFGsgATYCACACQRhrIAE2AgAgAkEcayABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa1CgYCAgBB+IQUgAyAEaiEBA0AgASAFNwMYIAEgBTcDECABIAU3AwggASAFNwMAIAFBIGohASACQSBrIgJBH0sNAAsLI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EUgBhsoAgBqQQJqQQJ1azYCACABICRqIgogCigCACAgKAIAIAEgIGogPCAGGygCAGpBAmpBAnVrNgIAIAEgKmoiCiAKKAIAIB8oAgAgASAfaiA6IAYbKAIAakECakECdWs2AgAgQygCACABIENqICYgBhsoAgBqQQJqIQYgASApaiEBDAILIBQgAUECdCIBaiIGIAYoAgAgCkEBdEECakECdWs2AgAgASAkaiIGIAYoAgAgFCgCFEEBdEECakECdWs2AgAgASAqaiIGIAYoAgAgFCgCGEEBdEECakECdWs2AgAgASApaiEBIBQoAhxBAXRBAmohBgwBCyAUIAcgLCAGG0EDdEEEa0ECdCIKaigCACEyIAZFBEAgFCABQQJ0IgFqIgYgBigCACAyIEUoAgBqQQJqQQJ1azYCACABICRqIgYgBigCACAKICRqKAIAIDwoAgBqQQJqQQJ1azYCACABICpqIgYgBigCACAKICpqKAIAIDooAgBqQQJqQQJ1azYCACABIClqIQEgCiApaigCACAmKAIAakECaiEGDAELIBQgAUECdCIBaiIGIAYoAgAgMiAGKAIQakECakECdWs2AgAgASAkaiIGIAYoAgAgCiAkaigCACAGKAIQakECakECdWs2AgAgASAqaiIGIAYoAgAgCiAqaigCACAGKAIQakECakECdWs2AgAgCiApaigCACABIClqIgEoAhBqQQJqIQYLIAEgASgCACAGQQJ1azYCACAHQQFqIgcgG0cNAAsLIA4gHE4NACAMIA4iASIHSgRAA0AgFCABQQV0aiIHIAf9AAIgIAf9AAIA/a4BQQH9rAEgB/0AAhD9rgH9CwIQIAFBAWoiASAMRw0ACyAMIQcLIAcgHE4NAANAIEMgB0EDdCIBQQJ0aiIyAn8gB0EASARAIBQoAgAhBiAHQX9HBEAgNiABQQJ0IgFqIgogCigCACAGajYCACABICBqIgYgBigCACAkKAIAajYCACABIB9qIgEgASgCACAqKAIAajYCACApKAIADAILIDYgAUECdCIBaiIKIAooAgAgVygCACAGakEBdWo2AgAgASAgaiIGIAYoAgAgVigCACAkKAIAakEBdWo2AgAgASAfaiIBIAEoAgAgVSgCACAqKA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iCkIAUw0AIAAoAhghACAHQgF9IQwgCEIBfSENIAlCAX0hCSAKQgF9IQoDQCAAIAwgACgCACICrSIHfCAHgCILPgIQIAAgDSAAKAIEIgatIgd8IAeAIg4+AhRCASAANQIoIgeGIg9CAX0iCCAJIAKsIhB8IBB/xHwgB4enIAggC8R8IAeHp2siAkEASARAIAMgAjYCBCADIAQ2AgAgAUEBQdPkACADEA9BACECDAMLIAAgAjYCCCAIIAogBqwiC3wgC3/EfCAHh6cgDsQgD3xCAX0gB4enayICQQBIBEAgAyACNgIUIAMgBDYCECABQQFBmOUAIANBEGoQD0EAIQIMAwsgACACNgIMIABBNGohAEEBIQIgBEEBaiIEIAVHDQALDAELIAFBAUGnM0EAEA8LIANBIGokACACC9cGAQZ/IAAEQAJAIAAoAgAEQCAAKAIMIgEEQCABEC4gACgCDBAQIABBADYCDAsgACgCECIBBEAgARAQIABCADcDEAsgACgCQBAQIABCADcCPAwBCyAAKAIsIgEEQCABEBAgAEEANgIsCyAAKAIgIgEEQCABEBAgAEIANwMgCyAAKAI0IgFFDQAgARAQIABCADcCNAsgACgC0AEQVSAAKAKcASIBBEAgACgCaCAAKAJsbCIDBH8DQCABEC4gAUGMLGohASACQQFqIgIgA0cNAAsgACgCnAEFIAELEBAgAEEANgKcAQsgACgCdCIBBEAgACgCcCICBEBBACEBA0AgACgCdCABQQN0aigCACIDBEAgAxAQIAAoAnAhAgsgAUEBaiIBIAJJDQALIAAoAnQhAQsgAEEANgJwIAEQECAAQQA2AnQLIAAoAogBEBAgAEEANgJ4IABBADYCiAEgACgCZBAQIABBADYCZCAALQC8AUECcUUEQCAAKAKoARAQCyAAQdAAakEAQfAAEBUaIAAoAsABEDIgAEEANgLAASAAKALEARAyIABBADYCwAEgACgCyAEiAQRAIAEoAhwiAgRAIAIQECABQQA2AhwLIAEoAigiAgRAIAEoAiQEQANAIAIgBUEobCIDaigCJCIEBEAgBBAQIAEoAigiAiADakEANgIkCyACIANqKAIQIgQEQCAEEBAgASgCKC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iACKAIAIgFBBGo2AgAgACABMwEANwMADwsgAiACKAIAIgFBBGo2AgAgACABMAAANwMADwsgAiACKAIAIgFBBGo2AgAgACABMQAANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKwMAOQMADwsgACACIAMRAwALDwsgAiACKAIAIgFBBGo2AgAgACABNAIANwMADwsgAiACKAIAIgFBBGo2AgAgACABNQIANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKQMANwMAC3MBBn8gACgCACIDLAAAQTBrIgFBCUsEQEEADwsDQEF/IQQgAkHMmbPmAE0EQEF/IAEgAkEKbCIFaiABIAVB/////wdzSxshBAsgACADQQFqIgU2AgAgAywAASEGIAQhAiAFIQMgBkEwayIBQQpJDQALIAILtBQCFX8BfiMAQUBqIggkACAIIAE2AjwgCEEnaiEWIAhBKGohEQJAAkACQAJAA0BBACEHA0AgASENIAcgDkH/////B3NKDQIgByAOaiEOAkACQAJAAkAgASIHLQAAIgsEQANAAkACQCALQf8BcSIBRQRAIAchAQwBCyABQSVHDQEgByELA0AgCy0AAUElRwRAIAshAQwCCyAHQQFqIQcgCy0AAiEZIAtBAmoiASELIBlBJUYNAAsLIAcgDWsiByAOQf////8HcyIXSg0JIAAEQCAAIA0gBxAZCyAHDQcgCCABNgI8IAFBAWohB0F/IRACQCABLAABQTBrIglBCUsNACABLQACQSRHDQAgAUEDaiEHQQEhEiAJIRALIAggBzYCPEEAIQwCQCAHLAAAIgtBIGsiAUEfSwRAIAchCQwBCyAHIQlBASABdCIBQYnRBHFFDQADQCAIIAdBAWoiCTYCPCABIAxyIQwgBywAASILQSBrIgFBIE8NASAJIQdBASABdCIBQYnRBHENAAsLAkAgC0EqRgRAAn8CQCAJLAABQTBrIgFBCUsNACAJLQACQSRHDQACfyAARQRAIAQgAUECdGpBCjYCAEEADAELIAMgAUEDdGooAgALIQ8gCUEDaiEBQQEMAQsgEg0GIAlBAWohASAARQRAIAggATYCPEEAIRJBACEPDAMLIAIgAigCACIHQQRq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CCkDACICQjyIhCEDAkAgACAKRyAIKQMQIAgpAxiEQgBSca0gAkL//////////w+DhCICQoGAgICAgICACFoEQCADQgF8IQMMAQsgAkKAgICAgICAgAhSDQAgA0IBgyADfCEDCyADQoCAgICAgIAIhSADIANC/////////wdWIgAbIQIgAK0LIQMgCEEgaiQAIAsgB0KAgICAgICAgIB/gyADQjSGhCAChL85AwALhhgDE38BfAN+IwBBsARrIgwkACAMQQA2AiwCQCABvSIaQgBTBEBBASERQboIIRMgAZoiAb0hGgwBCyAEQYAQcQRAQQEhEUG9CCETDAELQcAIQbsIIARBAXEiERshEyARRSEVCwJAIBpCgICAgICAgPj/AINCgICAgICAgPj/AFEEQCAAQSAgAiARQQNqIgMgBEH//3txEBwgACATIBEQGSAAQZIJQfYKIAVBIHEiBRtB+wlB+gogBRsgASABYhtBAxAZIABBICACIAMgBEGAwABzEBwgAyACIAIgA0gbIQoMAQsgDEEQaiESAkACfwJAIAEgDEEsahBlIgEgAaAiAUQAAAAAAAAAAGIEQCAMIAwoAiwiBkEBazYCLCAFQSByIg5B4QBHDQEMAwsgBUEgciIOQeEARg0CIAwoAiwhCUEGIAMgA0EASBsMAQsgDCAGQR1rIgk2AiwgAUQAAAAAAACwQaIhAUEGIAMgA0EASBsLIQsgDEEwakGgAkEAIAlBAE4baiINIQcDQCAHAn8gAUQAAAAAAADwQWMgAUQAAAAAAAAAAGZxBEAgAasMAQtBAAsiAzYCACAHQQRqIQcgASADuKFEAAAAAGXNzUGiIgFEAAAAAAAAAABiDQALAkAgCUEATARAIAkhAyAHIQYgDSEIDAELIA0hCCAJIQMDQEEdIAMgA0EdTxshAwJAIAdBBGsiBiAISQ0AIAOtIRxCACEaA0AgBiAaQv////8PgyAGNQIAIByGfCIbQoCU69wDgCIaQoDslKMMfiAbfD4CACAGQQRrIgYgCE8NAAsgG0KAlOvcA1QNACAIQQRrIgggGj4CAAsDQCAIIAciBkkEQCAGQQRrIgcoAgBFDQELCyAMIAwoAiwgA2siAzYCLCA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QFxIQcgA0EBRw0BQQAMAgsgBkEANgIADAILIANBfnEhAwNAAn9BACAERQ0AGkEAIAAgASACIAUoAgARAABFDQAaIAAgASACIAUoAgQRAABBAEcLIQQgBUEIaiEFIAhBAmoiCCADRw0ACyAERQshAyAHBEAgAw0CIAAgASACIAUoAgARAABBAEchBAsgBkEANgIAIARFDQILIAAoAgAaQQEPCyAGQQA2AgALC0EACwoAIAAoAgAaQQALFAAgACgCACIABEAgACABNgK4AQsLIQAgACgCACABEFMgAEEAOgB8IAAgASgCuEBBAXE2AoABCzIAIAJFBEBBAA8LIAAoAgAgASACIAMQSEUEQCADQQFBqS9BABAPQQAPCyAAIAIgAxBxC2kCAn8BfCMAQRBrIgMkACACBEADQCAAIANBCGoQRCABAn8gAysDCCIFmUQAAAAAAADgQWMEQCAFqgwBC0GAgICAeAs2AgAgAUEEaiEBIABBCGohACAEQQFqIgQgAkcNAAsLIANBEGokAAuEAQICfwF9IwBBEGsiAyQAIAIEQANAIAMgAC0AADoADyADIAAtAAE6AA4gAyAALQACOgANIAMgAC0AAzoADCABAn8gAyoCDCIFi0MAAABPXQRAIAWoDAELQYCAgIB4CzYCACABQQRqIQEgAEEEaiEAIARBAWoiBCACRw0ACwsgA0EQaiQAC0sBAn8jAEEQayIDJAAgAgRAA0AgACADQQxqQQQQESABIAMoAgw2AgAgAUEEaiEBIABBBGohACAEQQFqIgQgAkcNAAsLIANBEGokAAtLAQJ/IwBBEGsiAyQAIAIEQANAIAAgA0EMakECEBEgASADKAIMNgIAIAFBBGohASAAQQJqIQAgBEEBaiIEIAJHDQALCyADQRBqJAALSgECfyMAQRBrIgMkACACBEADQCAAIANBCGoQRCABIAMrAwi2OAIAIAFBBGohASAAQQhqIQAgBEEBaiIEIAJHDQALCyADQRBqJAALaAECfyMAQRBrIgMkACACBEADQCADIAAtAAA6AA8gAyAALQABOgAOIAMgAC0AAjoADSADIAAtAAM6AAwgASADKgIMOAIAIAFBBGohASAAQQRqIQAgBEEBaiIEIAJHD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/8IBCwESAEGLwwELHhEAAAAAEQAAAAAJEgAAAAAAEgAAEgAAGgAAABoaGgBBwsMBCw4aAAAAGhoaAAAAAAAACQBB88MBCwEUAEH/wwELFRcAAAAAFwAAAAAJFAAAAAAAFAAAFABBrcQBCwEWAEG5xAELJxUAAAAAFQAAAAAJFgAAAAAAFgAAFgAAMDEyMzQ1Njc4OUFCQ0RFRgBB4MQBCwmQbAEAAAAAAAUAQfTEAQsBaQBBjMUBCwpqAAAAawAAAHhoAEGkxQELAQIAQbTFAQsI//////////8AQfjFAQsBBQBBhMYBCwFsAEGcxgELDmoAAABtAAAAiGgAAAAEAEG0xgELAQEAQcTGAQsF/////wo="; |
| 7825 |
return f; |
| 7826 |
} |
| 7827 |
var wasmBinaryFile; |
| 7828 |
function getBinarySync(file) { |
| 7829 |
if (file == wasmBinaryFile && wasmBinary) { |
| 7830 |
return new Uint8Array(wasmBinary); |
| 7831 |
} |
| 7832 |
var binary = tryParseAsDataURI(file); |
| 7833 |
if (binary) { |
| 7834 |
return binary; |
| 7835 |
} |
| 7836 |
if (readBinary) { |
| 7837 |
return readBinary(file); |
| 7838 |
} |
| 7839 |
throw 'sync fetching of the wasm failed: you can preload it to Module["wasmBinary"] manually, or emcc.py will do that for you when generating HTML (but not JS)'; |
| 7840 |
} |
| 7841 |
function instantiateSync(file, info) { |
| 7842 |
var module; |
| 7843 |
var binary = getBinarySync(file); |
| 7844 |
module = new WebAssembly.Module(binary); |
| 7845 |
var instance = new WebAssembly.Instance(module, info); |
| 7846 |
return [instance, module]; |
| 7847 |
} |
| 7848 |
function getWasmImports() { |
| 7849 |
return { |
| 7850 |
a: wasmImports |
| 7851 |
}; |
| 7852 |
} |
| 7853 |
function createWasm() { |
| 7854 |
var info = getWasmImports(); |
| 7855 |
function receiveInstance(instance, module) { |
| 7856 |
wasmExports = instance.exports; |
| 7857 |
wasmMemory = wasmExports["p"]; |
| 7858 |
updateMemoryViews(); |
| 7859 |
addOnInit(wasmExports["q"]); |
| 7860 |
removeRunDependency("wasm-instantiate"); |
| 7861 |
return wasmExports; |
| 7862 |
} |
| 7863 |
addRunDependency("wasm-instantiate"); |
| 7864 |
if (Module["instantiateWasm"]) { |
| 7865 |
try { |
| 7866 |
return Module["instantiateWasm"](info, receiveInstance); |
| 7867 |
} catch (e) { |
| 7868 |
err(`Module.instantiateWasm callback failed with error: ${e}`); |
| 7869 |
readyPromiseReject(e); |
| 7870 |
} |
| 7871 |
} |
| 7872 |
if (!wasmBinaryFile) wasmBinaryFile = findWasmBinary(); |
| 7873 |
var result = instantiateSync(wasmBinaryFile, info); |
| 7874 |
return receiveInstance(result[0]); |
| 7875 |
} |
| 7876 |
var callRuntimeCallbacks = callbacks => { |
| 7877 |
while (callbacks.length > 0) { |
| 7878 |
callbacks.shift()(Module); |
| 7879 |
} |
| 7880 |
}; |
| 7881 |
var noExitRuntime = Module["noExitRuntime"] || true; |
| 7882 |
var __emscripten_memcpy_js = (dest, src, num) => HEAPU8.copyWithin(dest, src, src + num); |
| 7883 |
function _copy_pixels_1(compG_ptr, nb_pixels) { |
| 7884 |
compG_ptr >>= 2; |
| 7885 |
const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels); |
| 7886 |
const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); |
| 7887 |
imageData.set(compG); |
| 7888 |
} |
| 7889 |
function _copy_pixels_3(compR_ptr, compG_ptr, compB_ptr, nb_pixels) { |
| 7890 |
compR_ptr >>= 2; |
| 7891 |
compG_ptr >>= 2; |
| 7892 |
compB_ptr >>= 2; |
| 7893 |
const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 3); |
| 7894 |
const compR = Module.HEAP32.subarray(compR_ptr, compR_ptr + nb_pixels); |
| 7895 |
const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); |
| 7896 |
const compB = Module.HEAP32.subarray(compB_ptr, compB_ptr + nb_pixels); |
| 7897 |
for (let i = 0; i < nb_pixels; i++) { |
| 7898 |
imageData[3 * i] = compR[i]; |
| 7899 |
imageData[3 * i + 1] = compG[i]; |
| 7900 |
imageData[3 * i + 2] = compB[i]; |
| 7901 |
} |
| 7902 |
} |
| 7903 |
function _copy_pixels_4(compR_ptr, compG_ptr, compB_ptr, compA_ptr, nb_pixels) { |
| 7904 |
compR_ptr >>= 2; |
| 7905 |
compG_ptr >>= 2; |
| 7906 |
compB_ptr >>= 2; |
| 7907 |
compA_ptr >>= 2; |
| 7908 |
const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 4); |
| 7909 |
const compR = Module.HEAP32.subarray(compR_ptr, compR_ptr + nb_pixels); |
| 7910 |
const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); |
| 7911 |
const compB = Module.HEAP32.subarray(compB_ptr, compB_ptr + nb_pixels); |
| 7912 |
const compA = Module.HEAP32.subarray(compA_ptr, compA_ptr + nb_pixels); |
| 7913 |
for (let i = 0; i < nb_pixels; i++) { |
| 7914 |
imageData[4 * i] = compR[i]; |
| 7915 |
imageData[4 * i + 1] = compG[i]; |
| 7916 |
imageData[4 * i + 2] = compB[i]; |
| 7917 |
imageData[4 * i + 3] = compA[i]; |
| 7918 |
} |
| 7919 |
} |
| 7920 |
var getHeapMax = () => 2147483648; |
| 7921 |
var growMemory = size => { |
| 7922 |
var b = wasmMemory.buffer; |
| 7923 |
var pages = (size - b.byteLength + 65535) / 65536; |
| 7924 |
try { |
| 7925 |
wasmMemory.grow(pages); |
| 7926 |
updateMemoryViews(); |
| 7927 |
return 1; |
| 7928 |
} catch (e) {} |
| 7929 |
}; |
| 7930 |
var _emscripten_resize_heap = requestedSize => { |
| 7931 |
var oldSize = HEAPU8.length; |
| 7932 |
requestedSize >>>= 0; |
| 7933 |
var maxHeapSize = getHeapMax(); |
| 7934 |
if (requestedSize > maxHeapSize) { |
| 7935 |
return false; |
| 7936 |
} |
| 7937 |
var alignUp = (x, multiple) => x + (multiple - x % multiple) % multiple; |
| 7938 |
for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { |
| 7939 |
var overGrownHeapSize = oldSize * (1 + .2 / cutDown); |
| 7940 |
overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296); |
| 7941 |
var newSize = Math.min(maxHeapSize, alignUp(Math.max(requestedSize, overGrownHeapSize), 65536)); |
| 7942 |
var replacement = growMemory(newSize); |
| 7943 |
if (replacement) { |
| 7944 |
return true; |
| 7945 |
} |
| 7946 |
} |
| 7947 |
return false; |
| 7948 |
}; |
| 7949 |
var ENV = {}; |
| 7950 |
var getExecutableName = () => thisProgram || "./this.program"; |
| 7951 |
var getEnvStrings = () => { |
| 7952 |
if (!getEnvStrings.strings) { |
| 7953 |
var lang = (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8"; |
| 7954 |
var env = { |
| 7955 |
USER: "web_user", |
| 7956 |
LOGNAME: "web_user", |
| 7957 |
PATH: "/", |
| 7958 |
PWD: "/", |
| 7959 |
HOME: "/home/web_user", |
| 7960 |
LANG: lang, |
| 7961 |
_: getExecutableName() |
| 7962 |
}; |
| 7963 |
for (var x in ENV) { |
| 7964 |
if (ENV[x] === undefined) delete env[x];else env[x] = ENV[x]; |
| 7965 |
} |
| 7966 |
var strings = []; |
| 7967 |
for (var x in env) { |
| 7968 |
strings.push(`${x}=${env[x]}`); |
| 7969 |
} |
| 7970 |
getEnvStrings.strings = strings; |
| 7971 |
} |
| 7972 |
return getEnvStrings.strings; |
| 7973 |
}; |
| 7974 |
var stringToAscii = (str, buffer) => { |
| 7975 |
for (var i = 0; i < str.length; ++i) { |
| 7976 |
HEAP8[buffer++] = str.charCodeAt(i); |
| 7977 |
} |
| 7978 |
HEAP8[buffer] = 0; |
| 7979 |
}; |
| 7980 |
var _environ_get = (__environ, environ_buf) => { |
| 7981 |
var bufSize = 0; |
| 7982 |
getEnvStrings().forEach((string, i) => { |
| 7983 |
var ptr = environ_buf + bufSize; |
| 7984 |
HEAPU32[__environ + i * 4 >> 2] = ptr; |
| 7985 |
stringToAscii(string, ptr); |
| 7986 |
bufSize += string.length + 1; |
| 7987 |
}); |
| 7988 |
return 0; |
| 7989 |
}; |
| 7990 |
var _environ_sizes_get = (penviron_count, penviron_buf_size) => { |
| 7991 |
var strings = getEnvStrings(); |
| 7992 |
HEAPU32[penviron_count >> 2] = strings.length; |
| 7993 |
var bufSize = 0; |
| 7994 |
strings.forEach(string => bufSize += string.length + 1); |
| 7995 |
HEAPU32[penviron_buf_size >> 2] = bufSize; |
| 7996 |
return 0; |
| 7997 |
}; |
| 7998 |
var _fd_close = fd => 52; |
| 7999 |
var convertI32PairToI53Checked = (lo, hi) => hi + 2097152 >>> 0 < 4194305 - !!lo ? (lo >>> 0) + hi * 4294967296 : NaN; |
| 8000 |
function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { |
| 8001 |
var offset = convertI32PairToI53Checked(offset_low, offset_high); |
| 8002 |
return 70; |
| 8003 |
} |
| 8004 |
var printCharBuffers = [null, [], []]; |
| 8005 |
var UTF8Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : undefined; |
| 8006 |
var UTF8ArrayToString = (heapOrArray, idx, maxBytesToRead) => { |
| 8007 |
var endIdx = idx + maxBytesToRead; |
| 8008 |
var endPtr = idx; |
| 8009 |
while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr; |
| 8010 |
if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) { |
| 8011 |
return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr)); |
| 8012 |
} |
| 8013 |
var str = ""; |
| 8014 |
while (idx < endPtr) { |
| 8015 |
var u0 = heapOrArray[idx++]; |
| 8016 |
if (!(u0 & 128)) { |
| 8017 |
str += String.fromCharCode(u0); |
| 8018 |
continue; |
| 8019 |
} |
| 8020 |
var u1 = heapOrArray[idx++] & 63; |
| 8021 |
if ((u0 & 224) == 192) { |
| 8022 |
str += String.fromCharCode((u0 & 31) << 6 | u1); |
| 8023 |
continue; |
| 8024 |
} |
| 8025 |
var u2 = heapOrArray[idx++] & 63; |
| 8026 |
if ((u0 & 240) == 224) { |
| 8027 |
u0 = (u0 & 15) << 12 | u1 << 6 | u2; |
| 8028 |
} else { |
| 8029 |
u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63; |
| 8030 |
} |
| 8031 |
if (u0 < 65536) { |
| 8032 |
str += String.fromCharCode(u0); |
| 8033 |
} else { |
| 8034 |
var ch = u0 - 65536; |
| 8035 |
str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023); |
| 8036 |
} |
| 8037 |
} |
| 8038 |
return str; |
| 8039 |
}; |
| 8040 |
var printChar = (stream, curr) => { |
| 8041 |
var buffer = printCharBuffers[stream]; |
| 8042 |
if (curr === 0 || curr === 10) { |
| 8043 |
(stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); |
| 8044 |
buffer.length = 0; |
| 8045 |
} else { |
| 8046 |
buffer.push(curr); |
| 8047 |
} |
| 8048 |
}; |
| 8049 |
var UTF8ToString = (ptr, maxBytesToRead) => ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : ""; |
| 8050 |
var _fd_write = (fd, iov, iovcnt, pnum) => { |
| 8051 |
var num = 0; |
| 8052 |
for (var i = 0; i < iovcnt; i++) { |
| 8053 |
var ptr = HEAPU32[iov >> 2]; |
| 8054 |
var len = HEAPU32[iov + 4 >> 2]; |
| 8055 |
iov += 8; |
| 8056 |
for (var j = 0; j < len; j++) { |
| 8057 |
printChar(fd, HEAPU8[ptr + j]); |
| 8058 |
} |
| 8059 |
num += len; |
| 8060 |
} |
| 8061 |
HEAPU32[pnum >> 2] = num; |
| 8062 |
return 0; |
| 8063 |
}; |
| 8064 |
function _gray_to_rgba(compG_ptr, nb_pixels) { |
| 8065 |
compG_ptr >>= 2; |
| 8066 |
const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 4); |
| 8067 |
const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); |
| 8068 |
for (let i = 0; i < nb_pixels; i++) { |
| 8069 |
imageData[4 * i] = imageData[4 * i + 1] = imageData[4 * i + 2] = compG[i]; |
| 8070 |
imageData[4 * i + 3] = 255; |
| 8071 |
} |
| 8072 |
} |
| 8073 |
function _graya_to_rgba(compG_ptr, compA_ptr, nb_pixels) { |
| 8074 |
compG_ptr >>= 2; |
| 8075 |
compA_ptr >>= 2; |
| 8076 |
const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 4); |
| 8077 |
const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); |
| 8078 |
const compA = Module.HEAP32.subarray(compA_ptr, compA_ptr + nb_pixels); |
| 8079 |
for (let i = 0; i < nb_pixels; i++) { |
| 8080 |
imageData[4 * i] = imageData[4 * i + 1] = imageData[4 * i + 2] = compG[i]; |
| 8081 |
imageData[4 * i + 3] = compA[i]; |
| 8082 |
} |
| 8083 |
} |
| 8084 |
function _jsPrintWarning(message_ptr) { |
| 8085 |
const message = UTF8ToString(message_ptr); |
| 8086 |
(Module.warn || console.warn)(`OpenJPEG: ${message}`); |
| 8087 |
} |
| 8088 |
function _rgb_to_rgba(compR_ptr, compG_ptr, compB_ptr, nb_pixels) { |
| 8089 |
compR_ptr >>= 2; |
| 8090 |
compG_ptr >>= 2; |
| 8091 |
compB_ptr >>= 2; |
| 8092 |
const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 4); |
| 8093 |
const compR = Module.HEAP32.subarray(compR_ptr, compR_ptr + nb_pixels); |
| 8094 |
const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); |
| 8095 |
const compB = Module.HEAP32.subarray(compB_ptr, compB_ptr + nb_pixels); |
| 8096 |
for (let i = 0; i < nb_pixels; i++) { |
| 8097 |
imageData[4 * i] = compR[i]; |
| 8098 |
imageData[4 * i + 1] = compG[i]; |
| 8099 |
imageData[4 * i + 2] = compB[i]; |
| 8100 |
imageData[4 * i + 3] = 255; |
| 8101 |
} |
| 8102 |
} |
| 8103 |
function _storeErrorMessage(message_ptr) { |
| 8104 |
const message = UTF8ToString(message_ptr); |
| 8105 |
if (!Module.errorMessages) { |
| 8106 |
Module.errorMessages = message; |
| 8107 |
} else { |
| 8108 |
Module.errorMessages += "\n" + message; |
| 8109 |
} |
| 8110 |
} |
| 8111 |
var wasmImports = { |
| 8112 |
c: __emscripten_memcpy_js, |
| 8113 |
g: _copy_pixels_1, |
| 8114 |
f: _copy_pixels_3, |
| 8115 |
e: _copy_pixels_4, |
| 8116 |
k: _emscripten_resize_heap, |
| 8117 |
l: _environ_get, |
| 8118 |
m: _environ_sizes_get, |
| 8119 |
n: _fd_close, |
| 8120 |
j: _fd_seek, |
| 8121 |
b: _fd_write, |
| 8122 |
o: _gray_to_rgba, |
| 8123 |
i: _graya_to_rgba, |
| 8124 |
d: _jsPrintWarning, |
| 8125 |
h: _rgb_to_rgba, |
| 8126 |
a: _storeErrorMessage |
| 8127 |
}; |
| 8128 |
var wasmExports = createWasm(); |
| 8129 |
var ___wasm_call_ctors = wasmExports["q"]; |
| 8130 |
var _malloc = Module["_malloc"] = wasmExports["r"]; |
| 8131 |
var _free = Module["_free"] = wasmExports["s"]; |
| 8132 |
var _jp2_decode = Module["_jp2_decode"] = wasmExports["u"]; |
| 8133 |
var calledRun; |
| 8134 |
dependenciesFulfilled = function runCaller() { |
| 8135 |
if (!calledRun) run(); |
| 8136 |
if (!calledRun) dependenciesFulfilled = runCaller; |
| 8137 |
}; |
| 8138 |
function run() { |
| 8139 |
if (runDependencies > 0) { |
| 8140 |
return; |
| 8141 |
} |
| 8142 |
preRun(); |
| 8143 |
if (runDependencies > 0) { |
| 8144 |
return; |
| 8145 |
} |
| 8146 |
function doRun() { |
| 8147 |
if (calledRun) return; |
| 8148 |
calledRun = true; |
| 8149 |
Module["calledRun"] = true; |
| 8150 |
if (ABORT) return; |
| 8151 |
initRuntime(); |
| 8152 |
readyPromiseResolve(Module); |
| 8153 |
if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); |
| 8154 |
postRun(); |
| 8155 |
} |
| 8156 |
if (Module["setStatus"]) { |
| 8157 |
Module["setStatus"]("Running..."); |
| 8158 |
setTimeout(function () { |
| 8159 |
setTimeout(function () { |
| 8160 |
Module["setStatus"](""); |
| 8161 |
}, 1); |
| 8162 |
doRun(); |
| 8163 |
}, 1); |
| 8164 |
} else { |
| 8165 |
doRun(); |
| 8166 |
} |
| 8167 |
} |
| 8168 |
if (Module["preInit"]) { |
| 8169 |
if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; |
| 8170 |
while (Module["preInit"].length > 0) { |
| 8171 |
Module["preInit"].pop()(); |
| 8172 |
} |
| 8173 |
} |
| 8174 |
run(); |
| 8175 |
moduleRtn = Module; |
| 8176 |
return moduleRtn; |
| 8177 |
}; |
| 8178 |
})(); |
| 8179 |
/* harmony default export */ const openjpeg = (OpenJPEG); |
| 8180 |
;// ./src/core/jpx.js |
| 8181 |
|
| 8182 |
|
| 8183 |
|
| 8184 |
class JpxError extends BaseException { |
| 8185 |
constructor(msg) { |
| 8186 |
super(msg, "JpxError"); |
| 8187 |
} |
| 8188 |
} |
| 8189 |
class JpxImage { |
| 8190 |
static #module = null; |
| 8191 |
static decode(data, decoderOptions) { |
| 8192 |
decoderOptions ||= {}; |
| 8193 |
this.#module ||= openjpeg({ |
| 8194 |
warn: warn |
| 8195 |
}); |
| 8196 |
const imageData = this.#module.decode(data, decoderOptions); |
| 8197 |
if (typeof imageData === "string") { |
| 8198 |
throw new JpxError(imageData); |
| 8199 |
} |
| 8200 |
return imageData; |
| 8201 |
} |
| 8202 |
static cleanup() { |
| 8203 |
this.#module = null; |
| 8204 |
} |
| 8205 |
static parseImageProperties(stream) { |
| 8206 |
let newByte = stream.getByte(); |
| 8207 |
while (newByte >= 0) { |
| 8208 |
const oldByte = newByte; |
| 8209 |
newByte = stream.getByte(); |
| 8210 |
const code = oldByte << 8 | newByte; |
| 8211 |
if (code === 0xff51) { |
| 8212 |
stream.skip(4); |
| 8213 |
const Xsiz = stream.getInt32() >>> 0; |
| 8214 |
const Ysiz = stream.getInt32() >>> 0; |
| 8215 |
const XOsiz = stream.getInt32() >>> 0; |
| 8216 |
const YOsiz = stream.getInt32() >>> 0; |
| 8217 |
stream.skip(16); |
| 8218 |
const Csiz = stream.getUint16(); |
| 8219 |
return { |
| 8220 |
width: Xsiz - XOsiz, |
| 8221 |
height: Ysiz - YOsiz, |
| 8222 |
bitsPerComponent: 8, |
| 8223 |
componentsCount: Csiz |
| 8224 |
}; |
| 8225 |
} |
| 8226 |
} |
| 8227 |
throw new JpxError("No size marker found in JPX stream"); |
| 8228 |
} |
| 8229 |
} |
| 8230 |
|
| 8231 |
;// ./src/core/jpx_stream.js |
| 8232 |
|
| 8233 |
|
| 8234 |
|
| 8235 |
class JpxStream extends DecodeStream { |
| 8236 |
constructor(stream, maybeLength, params) { |
| 8237 |
super(maybeLength); |
| 8238 |
this.stream = stream; |
| 8239 |
this.dict = stream.dict; |
| 8240 |
this.maybeLength = maybeLength; |
| 8241 |
this.params = params; |
| 8242 |
} |
| 8243 |
get bytes() { |
| 8244 |
return shadow(this, "bytes", this.stream.getBytes(this.maybeLength)); |
| 8245 |
} |
| 8246 |
ensureBuffer(requested) {} |
| 8247 |
readBlock(decoderOptions) { |
| 8248 |
this.decodeImage(null, decoderOptions); |
| 8249 |
} |
| 8250 |
decodeImage(bytes, decoderOptions) { |
| 8251 |
if (this.eof) { |
| 8252 |
return this.buffer; |
| 8253 |
} |
| 8254 |
bytes ||= this.bytes; |
| 8255 |
this.buffer = JpxImage.decode(bytes, decoderOptions); |
| 8256 |
this.bufferLength = this.buffer.length; |
| 8257 |
this.eof = true; |
| 8258 |
return this.buffer; |
| 8259 |
} |
| 8260 |
get canAsyncDecodeImageFromBuffer() { |
| 8261 |
return this.stream.isAsync; |
| 8262 |
} |
| 8263 |
} |
| 8264 |
|
| 8265 |
;// ./src/core/lzw_stream.js |
| 8266 |
|
| 8267 |
class LZWStream extends DecodeStream { |
| 8268 |
constructor(str, maybeLength, earlyChange) { |
| 8269 |
super(maybeLength); |
| 8270 |
this.str = str; |
| 8271 |
this.dict = str.dict; |
| 8272 |
this.cachedData = 0; |
| 8273 |
this.bitsCached = 0; |
| 8274 |
const maxLzwDictionarySize = 4096; |
| 8275 |
const lzwState = { |
| 8276 |
earlyChange, |
| 8277 |
codeLength: 9, |
| 8278 |
nextCode: 258, |
| 8279 |
dictionaryValues: new Uint8Array(maxLzwDictionarySize), |
| 8280 |
dictionaryLengths: new Uint16Array(maxLzwDictionarySize), |
| 8281 |
dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize), |
| 8282 |
currentSequence: new Uint8Array(maxLzwDictionarySize), |
| 8283 |
currentSequenceLength: 0 |
| 8284 |
}; |
| 8285 |
for (let i = 0; i < 256; ++i) { |
| 8286 |
lzwState.dictionaryValues[i] = i; |
| 8287 |
lzwState.dictionaryLengths[i] = 1; |
| 8288 |
} |
| 8289 |
this.lzwState = lzwState; |
| 8290 |
} |
| 8291 |
readBits(n) { |
| 8292 |
let bitsCached = this.bitsCached; |
| 8293 |
let cachedData = this.cachedData; |
| 8294 |
while (bitsCached < n) { |
| 8295 |
const c = this.str.getByte(); |
| 8296 |
if (c === -1) { |
| 8297 |
this.eof = true; |
| 8298 |
return null; |
| 8299 |
} |
| 8300 |
cachedData = cachedData << 8 | c; |
| 8301 |
bitsCached += 8; |
| 8302 |
} |
| 8303 |
this.bitsCached = bitsCached -= n; |
| 8304 |
this.cachedData = cachedData; |
| 8305 |
this.lastCode = null; |
| 8306 |
return cachedData >>> bitsCached & (1 << n) - 1; |
| 8307 |
} |
| 8308 |
readBlock() { |
| 8309 |
const blockSize = 512, |
| 8310 |
decodedSizeDelta = blockSize; |
| 8311 |
let estimatedDecodedSize = blockSize * 2; |
| 8312 |
let i, j, q; |
| 8313 |
const lzwState = this.lzwState; |
| 8314 |
if (!lzwState) { |
| 8315 |
return; |
| 8316 |
} |
| 8317 |
const earlyChange = lzwState.earlyChange; |
| 8318 |
let nextCode = lzwState.nextCode; |
| 8319 |
const dictionaryValues = lzwState.dictionaryValues; |
| 8320 |
const dictionaryLengths = lzwState.dictionaryLengths; |
| 8321 |
const dictionaryPrevCodes = lzwState.dictionaryPrevCodes; |
| 8322 |
let codeLength = lzwState.codeLength; |
| 8323 |
let prevCode = lzwState.prevCode; |
| 8324 |
const currentSequence = lzwState.currentSequence; |
| 8325 |
let currentSequenceLength = lzwState.currentSequenceLength; |
| 8326 |
let decodedLength = 0; |
| 8327 |
let currentBufferLength = this.bufferLength; |
| 8328 |
let buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); |
| 8329 |
for (i = 0; i < blockSize; i++) { |
| 8330 |
const code = this.readBits(codeLength); |
| 8331 |
const hasPrev = currentSequenceLength > 0; |
| 8332 |
if (code < 256) { |
| 8333 |
currentSequence[0] = code; |
| 8334 |
currentSequenceLength = 1; |
| 8335 |
} else if (code >= 258) { |
| 8336 |
if (code < nextCode) { |
| 8337 |
currentSequenceLength = dictionaryLengths[code]; |
| 8338 |
for (j = currentSequenceLength - 1, q = code; j >= 0; j--) { |
| 8339 |
currentSequence[j] = dictionaryValues[q]; |
| 8340 |
q = dictionaryPrevCodes[q]; |
| 8341 |
} |
| 8342 |
} else { |
| 8343 |
currentSequence[currentSequenceLength++] = currentSequence[0]; |
| 8344 |
} |
| 8345 |
} else if (code === 256) { |
| 8346 |
codeLength = 9; |
| 8347 |
nextCode = 258; |
| 8348 |
currentSequenceLength = 0; |
| 8349 |
continue; |
| 8350 |
} else { |
| 8351 |
this.eof = true; |
| 8352 |
delete this.lzwState; |
| 8353 |
break; |
| 8354 |
} |
| 8355 |
if (hasPrev) { |
| 8356 |
dictionaryPrevCodes[nextCode] = prevCode; |
| 8357 |
dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1; |
| 8358 |
dictionaryValues[nextCode] = currentSequence[0]; |
| 8359 |
nextCode++; |
| 8360 |
codeLength = nextCode + earlyChange & nextCode + earlyChange - 1 ? codeLength : Math.min(Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1, 12) | 0; |
| 8361 |
} |
| 8362 |
prevCode = code; |
| 8363 |
decodedLength += currentSequenceLength; |
| 8364 |
if (estimatedDecodedSize < decodedLength) { |
| 8365 |
do { |
| 8366 |
estimatedDecodedSize += decodedSizeDelta; |
| 8367 |
} while (estimatedDecodedSize < decodedLength); |
| 8368 |
buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); |
| 8369 |
} |
| 8370 |
for (j = 0; j < currentSequenceLength; j++) { |
| 8371 |
buffer[currentBufferLength++] = currentSequence[j]; |
| 8372 |
} |
| 8373 |
} |
| 8374 |
lzwState.nextCode = nextCode; |
| 8375 |
lzwState.codeLength = codeLength; |
| 8376 |
lzwState.prevCode = prevCode; |
| 8377 |
lzwState.currentSequenceLength = currentSequenceLength; |
| 8378 |
this.bufferLength = currentBufferLength; |
| 8379 |
} |
| 8380 |
} |
| 8381 |
|
| 8382 |
;// ./src/core/predictor_stream.js |
| 8383 |
|
| 8384 |
|
| 8385 |
|
| 8386 |
class PredictorStream extends DecodeStream { |
| 8387 |
constructor(str, maybeLength, params) { |
| 8388 |
super(maybeLength); |
| 8389 |
if (!(params instanceof Dict)) { |
| 8390 |
return str; |
| 8391 |
} |
| 8392 |
const predictor = this.predictor = params.get("Predictor") || 1; |
| 8393 |
if (predictor <= 1) { |
| 8394 |
return str; |
| 8395 |
} |
| 8396 |
if (predictor !== 2 && (predictor < 10 || predictor > 15)) { |
| 8397 |
throw new FormatError(`Unsupported predictor: ${predictor}`); |
| 8398 |
} |
| 8399 |
this.readBlock = predictor === 2 ? this.readBlockTiff : this.readBlockPng; |
| 8400 |
this.str = str; |
| 8401 |
this.dict = str.dict; |
| 8402 |
const colors = this.colors = params.get("Colors") || 1; |
| 8403 |
const bits = this.bits = params.get("BPC", "BitsPerComponent") || 8; |
| 8404 |
const columns = this.columns = params.get("Columns") || 1; |
| 8405 |
this.pixBytes = colors * bits + 7 >> 3; |
| 8406 |
this.rowBytes = columns * colors * bits + 7 >> 3; |
| 8407 |
return this; |
| 8408 |
} |
| 8409 |
readBlockTiff() { |
| 8410 |
const rowBytes = this.rowBytes; |
| 8411 |
const bufferLength = this.bufferLength; |
| 8412 |
const buffer = this.ensureBuffer(bufferLength + rowBytes); |
| 8413 |
const bits = this.bits; |
| 8414 |
const colors = this.colors; |
| 8415 |
const rawBytes = this.str.getBytes(rowBytes); |
| 8416 |
this.eof = !rawBytes.length; |
| 8417 |
if (this.eof) { |
| 8418 |
return; |
| 8419 |
} |
| 8420 |
let inbuf = 0, |
| 8421 |
outbuf = 0; |
| 8422 |
let inbits = 0, |
| 8423 |
outbits = 0; |
| 8424 |
let pos = bufferLength; |
| 8425 |
let i; |
| 8426 |
if (bits === 1 && colors === 1) { |
| 8427 |
for (i = 0; i < rowBytes; ++i) { |
| 8428 |
let c = rawBytes[i] ^ inbuf; |
| 8429 |
c ^= c >> 1; |
| 8430 |
c ^= c >> 2; |
| 8431 |
c ^= c >> 4; |
| 8432 |
inbuf = (c & 1) << 7; |
| 8433 |
buffer[pos++] = c; |
| 8434 |
} |
| 8435 |
} else if (bits === 8) { |
| 8436 |
for (i = 0; i < colors; ++i) { |
| 8437 |
buffer[pos++] = rawBytes[i]; |
| 8438 |
} |
| 8439 |
for (; i < rowBytes; ++i) { |
| 8440 |
buffer[pos] = buffer[pos - colors] + rawBytes[i]; |
| 8441 |
pos++; |
| 8442 |
} |
| 8443 |
} else if (bits === 16) { |
| 8444 |
const bytesPerPixel = colors * 2; |
| 8445 |
for (i = 0; i < bytesPerPixel; ++i) { |
| 8446 |
buffer[pos++] = rawBytes[i]; |
| 8447 |
} |
| 8448 |
for (; i < rowBytes; i += 2) { |
| 8449 |
const sum = ((rawBytes[i] & 0xff) << 8) + (rawBytes[i + 1] & 0xff) + ((buffer[pos - bytesPerPixel] & 0xff) << 8) + (buffer[pos - bytesPerPixel + 1] & 0xff); |
| 8450 |
buffer[pos++] = sum >> 8 & 0xff; |
| 8451 |
buffer[pos++] = sum & 0xff; |
| 8452 |
} |
| 8453 |
} else { |
| 8454 |
const compArray = new Uint8Array(colors + 1); |
| 8455 |
const bitMask = (1 << bits) - 1; |
| 8456 |
let j = 0, |
| 8457 |
k = bufferLength; |
| 8458 |
const columns = this.columns; |
| 8459 |
for (i = 0; i < columns; ++i) { |
| 8460 |
for (let kk = 0; kk < colors; ++kk) { |
| 8461 |
if (inbits < bits) { |
| 8462 |
inbuf = inbuf << 8 | rawBytes[j++] & 0xff; |
| 8463 |
inbits += 8; |
| 8464 |
} |
| 8465 |
compArray[kk] = compArray[kk] + (inbuf >> inbits - bits) & bitMask; |
| 8466 |
inbits -= bits; |
| 8467 |
outbuf = outbuf << bits | compArray[kk]; |
| 8468 |
outbits += bits; |
| 8469 |
if (outbits >= 8) { |
| 8470 |
buffer[k++] = outbuf >> outbits - 8 & 0xff; |
| 8471 |
outbits -= 8; |
| 8472 |
} |
| 8473 |
} |
| 8474 |
} |
| 8475 |
if (outbits > 0) { |
| 8476 |
buffer[k++] = (outbuf << 8 - outbits) + (inbuf & (1 << 8 - outbits) - 1); |
| 8477 |
} |
| 8478 |
} |
| 8479 |
this.bufferLength += rowBytes; |
| 8480 |
} |
| 8481 |
readBlockPng() { |
| 8482 |
const rowBytes = this.rowBytes; |
| 8483 |
const pixBytes = this.pixBytes; |
| 8484 |
const predictor = this.str.getByte(); |
| 8485 |
const rawBytes = this.str.getBytes(rowBytes); |
| 8486 |
this.eof = !rawBytes.length; |
| 8487 |
if (this.eof) { |
| 8488 |
return; |
| 8489 |
} |
| 8490 |
const bufferLength = this.bufferLength; |
| 8491 |
const buffer = this.ensureBuffer(bufferLength + rowBytes); |
| 8492 |
let prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength); |
| 8493 |
if (prevRow.length === 0) { |
| 8494 |
prevRow = new Uint8Array(rowBytes); |
| 8495 |
} |
| 8496 |
let i, |
| 8497 |
j = bufferLength, |
| 8498 |
up, |
| 8499 |
c; |
| 8500 |
switch (predictor) { |
| 8501 |
case 0: |
| 8502 |
for (i = 0; i < rowBytes; ++i) { |
| 8503 |
buffer[j++] = rawBytes[i]; |
| 8504 |
} |
| 8505 |
break; |
| 8506 |
case 1: |
| 8507 |
for (i = 0; i < pixBytes; ++i) { |
| 8508 |
buffer[j++] = rawBytes[i]; |
| 8509 |
} |
| 8510 |
for (; i < rowBytes; ++i) { |
| 8511 |
buffer[j] = buffer[j - pixBytes] + rawBytes[i] & 0xff; |
| 8512 |
j++; |
| 8513 |
} |
| 8514 |
break; |
| 8515 |
case 2: |
| 8516 |
for (i = 0; i < rowBytes; ++i) { |
| 8517 |
buffer[j++] = prevRow[i] + rawBytes[i] & 0xff; |
| 8518 |
} |
| 8519 |
break; |
| 8520 |
case 3: |
| 8521 |
for (i = 0; i < pixBytes; ++i) { |
| 8522 |
buffer[j++] = (prevRow[i] >> 1) + rawBytes[i]; |
| 8523 |
} |
| 8524 |
for (; i < rowBytes; ++i) { |
| 8525 |
buffer[j] = (prevRow[i] + buffer[j - pixBytes] >> 1) + rawBytes[i] & 0xff; |
| 8526 |
j++; |
| 8527 |
} |
| 8528 |
break; |
| 8529 |
case 4: |
| 8530 |
for (i = 0; i < pixBytes; ++i) { |
| 8531 |
up = prevRow[i]; |
| 8532 |
c = rawBytes[i]; |
| 8533 |
buffer[j++] = up + c; |
| 8534 |
} |
| 8535 |
for (; i < rowBytes; ++i) { |
| 8536 |
up = prevRow[i]; |
| 8537 |
const upLeft = prevRow[i - pixBytes]; |
| 8538 |
const left = buffer[j - pixBytes]; |
| 8539 |
const p = left + up - upLeft; |
| 8540 |
let pa = p - left; |
| 8541 |
if (pa < 0) { |
| 8542 |
pa = -pa; |
| 8543 |
} |
| 8544 |
let pb = p - up; |
| 8545 |
if (pb < 0) { |
| 8546 |
pb = -pb; |
| 8547 |
} |
| 8548 |
let pc = p - upLeft; |
| 8549 |
if (pc < 0) { |
| 8550 |
pc = -pc; |
| 8551 |
} |
| 8552 |
c = rawBytes[i]; |
| 8553 |
if (pa <= pb && pa <= pc) { |
| 8554 |
buffer[j++] = left + c; |
| 8555 |
} else if (pb <= pc) { |
| 8556 |
buffer[j++] = up + c; |
| 8557 |
} else { |
| 8558 |
buffer[j++] = upLeft + c; |
| 8559 |
} |
| 8560 |
} |
| 8561 |
break; |
| 8562 |
default: |
| 8563 |
throw new FormatError(`Unsupported predictor: ${predictor}`); |
| 8564 |
} |
| 8565 |
this.bufferLength += rowBytes; |
| 8566 |
} |
| 8567 |
} |
| 8568 |
|
| 8569 |
;// ./src/core/run_length_stream.js |
| 8570 |
|
| 8571 |
class RunLengthStream extends DecodeStream { |
| 8572 |
constructor(str, maybeLength) { |
| 8573 |
super(maybeLength); |
| 8574 |
this.str = str; |
| 8575 |
this.dict = str.dict; |
| 8576 |
} |
| 8577 |
readBlock() { |
| 8578 |
const repeatHeader = this.str.getBytes(2); |
| 8579 |
if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) { |
| 8580 |
this.eof = true; |
| 8581 |
return; |
| 8582 |
} |
| 8583 |
let buffer; |
| 8584 |
let bufferLength = this.bufferLength; |
| 8585 |
let n = repeatHeader[0]; |
| 8586 |
if (n < 128) { |
| 8587 |
buffer = this.ensureBuffer(bufferLength + n + 1); |
| 8588 |
buffer[bufferLength++] = repeatHeader[1]; |
| 8589 |
if (n > 0) { |
| 8590 |
const source = this.str.getBytes(n); |
| 8591 |
buffer.set(source, bufferLength); |
| 8592 |
bufferLength += n; |
| 8593 |
} |
| 8594 |
} else { |
| 8595 |
n = 257 - n; |
| 8596 |
const b = repeatHeader[1]; |
| 8597 |
buffer = this.ensureBuffer(bufferLength + n + 1); |
| 8598 |
for (let i = 0; i < n; i++) { |
| 8599 |
buffer[bufferLength++] = b; |
| 8600 |
} |
| 8601 |
} |
| 8602 |
this.bufferLength = bufferLength; |
| 8603 |
} |
| 8604 |
} |
| 8605 |
|
| 8606 |
;// ./src/core/parser.js |
| 8607 |
|
| 8608 |
|
| 8609 |
|
| 8610 |
|
| 8611 |
|
| 8612 |
|
| 8613 |
|
| 8614 |
|
| 8615 |
|
| 8616 |
|
| 8617 |
|
| 8618 |
|
| 8619 |
|
| 8620 |
|
| 8621 |
const MAX_LENGTH_TO_CACHE = 1000; |
| 8622 |
function getInlineImageCacheKey(bytes) { |
| 8623 |
const strBuf = [], |
| 8624 |
ii = bytes.length; |
| 8625 |
let i = 0; |
| 8626 |
while (i < ii - 1) { |
| 8627 |
strBuf.push(bytes[i++] << 8 | bytes[i++]); |
| 8628 |
} |
| 8629 |
if (i < ii) { |
| 8630 |
strBuf.push(bytes[i]); |
| 8631 |
} |
| 8632 |
return ii + "_" + String.fromCharCode.apply(null, strBuf); |
| 8633 |
} |
| 8634 |
class Parser { |
| 8635 |
constructor({ |
| 8636 |
lexer, |
| 8637 |
xref, |
| 8638 |
allowStreams = false, |
| 8639 |
recoveryMode = false |
| 8640 |
}) { |
| 8641 |
this.lexer = lexer; |
| 8642 |
this.xref = xref; |
| 8643 |
this.allowStreams = allowStreams; |
| 8644 |
this.recoveryMode = recoveryMode; |
| 8645 |
this.imageCache = Object.create(null); |
| 8646 |
this._imageId = 0; |
| 8647 |
this.refill(); |
| 8648 |
} |
| 8649 |
refill() { |
| 8650 |
this.buf1 = this.lexer.getObj(); |
| 8651 |
this.buf2 = this.lexer.getObj(); |
| 8652 |
} |
| 8653 |
shift() { |
| 8654 |
if (this.buf2 instanceof Cmd && this.buf2.cmd === "ID") { |
| 8655 |
this.buf1 = this.buf2; |
| 8656 |
this.buf2 = null; |
| 8657 |
} else { |
| 8658 |
this.buf1 = this.buf2; |
| 8659 |
this.buf2 = this.lexer.getObj(); |
| 8660 |
} |
| 8661 |
} |
| 8662 |
tryShift() { |
| 8663 |
try { |
| 8664 |
this.shift(); |
| 8665 |
return true; |
| 8666 |
} catch (e) { |
| 8667 |
if (e instanceof MissingDataException) { |
| 8668 |
throw e; |
| 8669 |
} |
| 8670 |
return false; |
| 8671 |
} |
| 8672 |
} |
| 8673 |
getObj(cipherTransform = null) { |
| 8674 |
const buf1 = this.buf1; |
| 8675 |
this.shift(); |
| 8676 |
if (buf1 instanceof Cmd) { |
| 8677 |
switch (buf1.cmd) { |
| 8678 |
case "BI": |
| 8679 |
return this.makeInlineImage(cipherTransform); |
| 8680 |
case "[": |
| 8681 |
const array = []; |
| 8682 |
while (!isCmd(this.buf1, "]") && this.buf1 !== EOF) { |
| 8683 |
array.push(this.getObj(cipherTransform)); |
| 8684 |
} |
| 8685 |
if (this.buf1 === EOF) { |
| 8686 |
if (this.recoveryMode) { |
| 8687 |
return array; |
| 8688 |
} |
| 8689 |
throw new ParserEOFException("End of file inside array."); |
| 8690 |
} |
| 8691 |
this.shift(); |
| 8692 |
return array; |
| 8693 |
case "<<": |
| 8694 |
const dict = new Dict(this.xref); |
| 8695 |
while (!isCmd(this.buf1, ">>") && this.buf1 !== EOF) { |
| 8696 |
if (!(this.buf1 instanceof Name)) { |
| 8697 |
info("Malformed dictionary: key must be a name object"); |
| 8698 |
this.shift(); |
| 8699 |
continue; |
| 8700 |
} |
| 8701 |
const key = this.buf1.name; |
| 8702 |
this.shift(); |
| 8703 |
if (this.buf1 === EOF) { |
| 8704 |
break; |
| 8705 |
} |
| 8706 |
dict.set(key, this.getObj(cipherTransform)); |
| 8707 |
} |
| 8708 |
if (this.buf1 === EOF) { |
| 8709 |
if (this.recoveryMode) { |
| 8710 |
return dict; |
| 8711 |
} |
| 8712 |
throw new ParserEOFException("End of file inside dictionary."); |
| 8713 |
} |
| 8714 |
if (isCmd(this.buf2, "stream")) { |
| 8715 |
return this.allowStreams ? this.makeStream(dict, cipherTransform) : dict; |
| 8716 |
} |
| 8717 |
this.shift(); |
| 8718 |
return dict; |
| 8719 |
default: |
| 8720 |
return buf1; |
| 8721 |
} |
| 8722 |
} |
| 8723 |
if (Number.isInteger(buf1)) { |
| 8724 |
if (Number.isInteger(this.buf1) && isCmd(this.buf2, "R")) { |
| 8725 |
const ref = Ref.get(buf1, this.buf1); |
| 8726 |
this.shift(); |
| 8727 |
this.shift(); |
| 8728 |
return ref; |
| 8729 |
} |
| 8730 |
return buf1; |
| 8731 |
} |
| 8732 |
if (typeof buf1 === "string") { |
| 8733 |
if (cipherTransform) { |
| 8734 |
return cipherTransform.decryptString(buf1); |
| 8735 |
} |
| 8736 |
return buf1; |
| 8737 |
} |
| 8738 |
return buf1; |
| 8739 |
} |
| 8740 |
findDefaultInlineStreamEnd(stream) { |
| 8741 |
const E = 0x45, |
| 8742 |
I = 0x49, |
| 8743 |
SPACE = 0x20, |
| 8744 |
LF = 0xa, |
| 8745 |
CR = 0xd, |
| 8746 |
NUL = 0x0; |
| 8747 |
const { |
| 8748 |
knownCommands |
| 8749 |
} = this.lexer, |
| 8750 |
startPos = stream.pos, |
| 8751 |
n = 15; |
| 8752 |
let state = 0, |
| 8753 |
ch, |
| 8754 |
maybeEIPos; |
| 8755 |
while ((ch = stream.getByte()) !== -1) { |
| 8756 |
if (state === 0) { |
| 8757 |
state = ch === E ? 1 : 0; |
| 8758 |
} else if (state === 1) { |
| 8759 |
state = ch === I ? 2 : 0; |
| 8760 |
} else { |
| 8761 |
if (ch === SPACE || ch === LF || ch === CR) { |
| 8762 |
maybeEIPos = stream.pos; |
| 8763 |
const followingBytes = stream.peekBytes(n); |
| 8764 |
const ii = followingBytes.length; |
| 8765 |
if (ii === 0) { |
| 8766 |
break; |
| 8767 |
} |
| 8768 |
for (let i = 0; i < ii; i++) { |
| 8769 |
ch = followingBytes[i]; |
| 8770 |
if (ch === NUL && followingBytes[i + 1] !== NUL) { |
| 8771 |
continue; |
| 8772 |
} |
| 8773 |
if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7f)) { |
| 8774 |
state = 0; |
| 8775 |
break; |
| 8776 |
} |
| 8777 |
} |
| 8778 |
if (state !== 2) { |
| 8779 |
continue; |
| 8780 |
} |
| 8781 |
if (!knownCommands) { |
| 8782 |
warn("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined."); |
| 8783 |
continue; |
| 8784 |
} |
| 8785 |
const tmpLexer = new Lexer(new Stream(followingBytes.slice()), knownCommands); |
| 8786 |
tmpLexer._hexStringWarn = () => {}; |
| 8787 |
let numArgs = 0; |
| 8788 |
while (true) { |
| 8789 |
const nextObj = tmpLexer.getObj(); |
| 8790 |
if (nextObj === EOF) { |
| 8791 |
state = 0; |
| 8792 |
break; |
| 8793 |
} |
| 8794 |
if (nextObj instanceof Cmd) { |
| 8795 |
const knownCommand = knownCommands[nextObj.cmd]; |
| 8796 |
if (!knownCommand) { |
| 8797 |
state = 0; |
| 8798 |
break; |
| 8799 |
} else if (knownCommand.variableArgs ? numArgs <= knownCommand.numArgs : numArgs === knownCommand.numArgs) { |
| 8800 |
break; |
| 8801 |
} |
| 8802 |
numArgs = 0; |
| 8803 |
continue; |
| 8804 |
} |
| 8805 |
numArgs++; |
| 8806 |
} |
| 8807 |
if (state === 2) { |
| 8808 |
break; |
| 8809 |
} |
| 8810 |
} else { |
| 8811 |
state = 0; |
| 8812 |
} |
| 8813 |
} |
| 8814 |
} |
| 8815 |
if (ch === -1) { |
| 8816 |
warn("findDefaultInlineStreamEnd: " + "Reached the end of the stream without finding a valid EI marker"); |
| 8817 |
if (maybeEIPos) { |
| 8818 |
warn('... trying to recover by using the last "EI" occurrence.'); |
| 8819 |
stream.skip(-(stream.pos - maybeEIPos)); |
| 8820 |
} |
| 8821 |
} |
| 8822 |
let endOffset = 4; |
| 8823 |
stream.skip(-endOffset); |
| 8824 |
ch = stream.peekByte(); |
| 8825 |
stream.skip(endOffset); |
| 8826 |
if (!isWhiteSpace(ch)) { |
| 8827 |
endOffset--; |
| 8828 |
} |
| 8829 |
return stream.pos - endOffset - startPos; |
| 8830 |
} |
| 8831 |
findDCTDecodeInlineStreamEnd(stream) { |
| 8832 |
const startPos = stream.pos; |
| 8833 |
let foundEOI = false, |
| 8834 |
b, |
| 8835 |
markerLength; |
| 8836 |
while ((b = stream.getByte()) !== -1) { |
| 8837 |
if (b !== 0xff) { |
| 8838 |
continue; |
| 8839 |
} |
| 8840 |
switch (stream.getByte()) { |
| 8841 |
case 0x00: |
| 8842 |
break; |
| 8843 |
case 0xff: |
| 8844 |
stream.skip(-1); |
| 8845 |
break; |
| 8846 |
case 0xd9: |
| 8847 |
foundEOI = true; |
| 8848 |
break; |
| 8849 |
case 0xc0: |
| 8850 |
case 0xc1: |
| 8851 |
case 0xc2: |
| 8852 |
case 0xc3: |
| 8853 |
case 0xc5: |
| 8854 |
case 0xc6: |
| 8855 |
case 0xc7: |
| 8856 |
case 0xc9: |
| 8857 |
case 0xca: |
| 8858 |
case 0xcb: |
| 8859 |
case 0xcd: |
| 8860 |
case 0xce: |
| 8861 |
case 0xcf: |
| 8862 |
case 0xc4: |
| 8863 |
case 0xcc: |
| 8864 |
case 0xda: |
| 8865 |
case 0xdb: |
| 8866 |
case 0xdc: |
| 8867 |
case 0xdd: |
| 8868 |
case 0xde: |
| 8869 |
case 0xdf: |
| 8870 |
case 0xe0: |
| 8871 |
case 0xe1: |
| 8872 |
case 0xe2: |
| 8873 |
case 0xe3: |
| 8874 |
case 0xe4: |
| 8875 |
case 0xe5: |
| 8876 |
case 0xe6: |
| 8877 |
case 0xe7: |
| 8878 |
case 0xe8: |
| 8879 |
case 0xe9: |
| 8880 |
case 0xea: |
| 8881 |
case 0xeb: |
| 8882 |
case 0xec: |
| 8883 |
case 0xed: |
| 8884 |
case 0xee: |
| 8885 |
case 0xef: |
| 8886 |
case 0xfe: |
| 8887 |
markerLength = stream.getUint16(); |
| 8888 |
if (markerLength > 2) { |
| 8889 |
stream.skip(markerLength - 2); |
| 8890 |
} else { |
| 8891 |
stream.skip(-2); |
| 8892 |
} |
| 8893 |
break; |
| 8894 |
} |
| 8895 |
if (foundEOI) { |
| 8896 |
break; |
| 8897 |
} |
| 8898 |
} |
| 8899 |
const length = stream.pos - startPos; |
| 8900 |
if (b === -1) { |
| 8901 |
warn("Inline DCTDecode image stream: " + "EOI marker not found, searching for /EI/ instead."); |
| 8902 |
stream.skip(-length); |
| 8903 |
return this.findDefaultInlineStreamEnd(stream); |
| 8904 |
} |
| 8905 |
this.inlineStreamSkipEI(stream); |
| 8906 |
return length; |
| 8907 |
} |
| 8908 |
findASCII85DecodeInlineStreamEnd(stream) { |
| 8909 |
const TILDE = 0x7e, |
| 8910 |
GT = 0x3e; |
| 8911 |
const startPos = stream.pos; |
| 8912 |
let ch; |
| 8913 |
while ((ch = stream.getByte()) !== -1) { |
| 8914 |
if (ch === TILDE) { |
| 8915 |
const tildePos = stream.pos; |
| 8916 |
ch = stream.peekByte(); |
| 8917 |
while (isWhiteSpace(ch)) { |
| 8918 |
stream.skip(); |
| 8919 |
ch = stream.peekByte(); |
| 8920 |
} |
| 8921 |
if (ch === GT) { |
| 8922 |
stream.skip(); |
| 8923 |
break; |
| 8924 |
} |
| 8925 |
if (stream.pos > tildePos) { |
| 8926 |
const maybeEI = stream.peekBytes(2); |
| 8927 |
if (maybeEI[0] === 0x45 && maybeEI[1] === 0x49) { |
| 8928 |
break; |
| 8929 |
} |
| 8930 |
} |
| 8931 |
} |
| 8932 |
} |
| 8933 |
const length = stream.pos - startPos; |
| 8934 |
if (ch === -1) { |
| 8935 |
warn("Inline ASCII85Decode image stream: " + "EOD marker not found, searching for /EI/ instead."); |
| 8936 |
stream.skip(-length); |
| 8937 |
return this.findDefaultInlineStreamEnd(stream); |
| 8938 |
} |
| 8939 |
this.inlineStreamSkipEI(stream); |
| 8940 |
return length; |
| 8941 |
} |
| 8942 |
findASCIIHexDecodeInlineStreamEnd(stream) { |
| 8943 |
const GT = 0x3e; |
| 8944 |
const startPos = stream.pos; |
| 8945 |
let ch; |
| 8946 |
while ((ch = stream.getByte()) !== -1) { |
| 8947 |
if (ch === GT) { |
| 8948 |
break; |
| 8949 |
} |
| 8950 |
} |
| 8951 |
const length = stream.pos - startPos; |
| 8952 |
if (ch === -1) { |
| 8953 |
warn("Inline ASCIIHexDecode image stream: " + "EOD marker not found, searching for /EI/ instead."); |
| 8954 |
stream.skip(-length); |
| 8955 |
return this.findDefaultInlineStreamEnd(stream); |
| 8956 |
} |
| 8957 |
this.inlineStreamSkipEI(stream); |
| 8958 |
return length; |
| 8959 |
} |
| 8960 |
inlineStreamSkipEI(stream) { |
| 8961 |
const E = 0x45, |
| 8962 |
I = 0x49; |
| 8963 |
let state = 0, |
| 8964 |
ch; |
| 8965 |
while ((ch = stream.getByte()) !== -1) { |
| 8966 |
if (state === 0) { |
| 8967 |
state = ch === E ? 1 : 0; |
| 8968 |
} else if (state === 1) { |
| 8969 |
state = ch === I ? 2 : 0; |
| 8970 |
} else if (state === 2) { |
| 8971 |
break; |
| 8972 |
} |
| 8973 |
} |
| 8974 |
} |
| 8975 |
makeInlineImage(cipherTransform) { |
| 8976 |
const lexer = this.lexer; |
| 8977 |
const stream = lexer.stream; |
| 8978 |
const dictMap = Object.create(null); |
| 8979 |
let dictLength; |
| 8980 |
while (!isCmd(this.buf1, "ID") && this.buf1 !== EOF) { |
| 8981 |
if (!(this.buf1 instanceof Name)) { |
| 8982 |
throw new FormatError("Dictionary key must be a name object"); |
| 8983 |
} |
| 8984 |
const key = this.buf1.name; |
| 8985 |
this.shift(); |
| 8986 |
if (this.buf1 === EOF) { |
| 8987 |
break; |
| 8988 |
} |
| 8989 |
dictMap[key] = this.getObj(cipherTransform); |
| 8990 |
} |
| 8991 |
if (lexer.beginInlineImagePos !== -1) { |
| 8992 |
dictLength = stream.pos - lexer.beginInlineImagePos; |
| 8993 |
} |
| 8994 |
const filter = this.xref.fetchIfRef(dictMap.F || dictMap.Filter); |
| 8995 |
let filterName; |
| 8996 |
if (filter instanceof Name) { |
| 8997 |
filterName = filter.name; |
| 8998 |
} else if (Array.isArray(filter)) { |
| 8999 |
const filterZero = this.xref.fetchIfRef(filter[0]); |
| 9000 |
if (filterZero instanceof Name) { |
| 9001 |
filterName = filterZero.name; |
| 9002 |
} |
| 9003 |
} |
| 9004 |
const startPos = stream.pos; |
| 9005 |
let length; |
| 9006 |
switch (filterName) { |
| 9007 |
case "DCT": |
| 9008 |
case "DCTDecode": |
| 9009 |
length = this.findDCTDecodeInlineStreamEnd(stream); |
| 9010 |
break; |
| 9011 |
case "A85": |
| 9012 |
case "ASCII85Decode": |
| 9013 |
length = this.findASCII85DecodeInlineStreamEnd(stream); |
| 9014 |
break; |
| 9015 |
case "AHx": |
| 9016 |
case "ASCIIHexDecode": |
| 9017 |
length = this.findASCIIHexDecodeInlineStreamEnd(stream); |
| 9018 |
break; |
| 9019 |
default: |
| 9020 |
length = this.findDefaultInlineStreamEnd(stream); |
| 9021 |
} |
| 9022 |
let cacheKey; |
| 9023 |
if (length < MAX_LENGTH_TO_CACHE && dictLength > 0) { |
| 9024 |
const initialStreamPos = stream.pos; |
| 9025 |
stream.pos = lexer.beginInlineImagePos; |
| 9026 |
cacheKey = getInlineImageCacheKey(stream.getBytes(dictLength + length)); |
| 9027 |
stream.pos = initialStreamPos; |
| 9028 |
const cacheEntry = this.imageCache[cacheKey]; |
| 9029 |
if (cacheEntry !== undefined) { |
| 9030 |
this.buf2 = Cmd.get("EI"); |
| 9031 |
this.shift(); |
| 9032 |
cacheEntry.reset(); |
| 9033 |
return cacheEntry; |
| 9034 |
} |
| 9035 |
} |
| 9036 |
const dict = new Dict(this.xref); |
| 9037 |
for (const key in dictMap) { |
| 9038 |
dict.set(key, dictMap[key]); |
| 9039 |
} |
| 9040 |
let imageStream = stream.makeSubStream(startPos, length, dict); |
| 9041 |
if (cipherTransform) { |
| 9042 |
imageStream = cipherTransform.createStream(imageStream, length); |
| 9043 |
} |
| 9044 |
imageStream = this.filter(imageStream, dict, length); |
| 9045 |
imageStream.dict = dict; |
| 9046 |
if (cacheKey !== undefined) { |
| 9047 |
imageStream.cacheKey = `inline_img_${++this._imageId}`; |
| 9048 |
this.imageCache[cacheKey] = imageStream; |
| 9049 |
} |
| 9050 |
this.buf2 = Cmd.get("EI"); |
| 9051 |
this.shift(); |
| 9052 |
return imageStream; |
| 9053 |
} |
| 9054 |
#findStreamLength(startPos) { |
| 9055 |
const { |
| 9056 |
stream |
| 9057 |
} = this.lexer; |
| 9058 |
stream.pos = startPos; |
| 9059 |
const SCAN_BLOCK_LENGTH = 2048; |
| 9060 |
const signatureLength = "endstream".length; |
| 9061 |
const END_SIGNATURE = new Uint8Array([0x65, 0x6e, 0x64]); |
| 9062 |
const endLength = END_SIGNATURE.length; |
| 9063 |
const PARTIAL_SIGNATURE = [new Uint8Array([0x73, 0x74, 0x72, 0x65, 0x61, 0x6d]), new Uint8Array([0x73, 0x74, 0x65, 0x61, 0x6d]), new Uint8Array([0x73, 0x74, 0x72, 0x65, 0x61])]; |
| 9064 |
const normalLength = signatureLength - endLength; |
| 9065 |
while (stream.pos < stream.end) { |
| 9066 |
const scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH); |
| 9067 |
const scanLength = scanBytes.length - signatureLength; |
| 9068 |
if (scanLength <= 0) { |
| 9069 |
break; |
| 9070 |
} |
| 9071 |
let pos = 0; |
| 9072 |
while (pos < scanLength) { |
| 9073 |
let j = 0; |
| 9074 |
while (j < endLength && scanBytes[pos + j] === END_SIGNATURE[j]) { |
| 9075 |
j++; |
| 9076 |
} |
| 9077 |
if (j >= endLength) { |
| 9078 |
let found = false; |
| 9079 |
for (const part of PARTIAL_SIGNATURE) { |
| 9080 |
const partLen = part.length; |
| 9081 |
let k = 0; |
| 9082 |
while (k < partLen && scanBytes[pos + j + k] === part[k]) { |
| 9083 |
k++; |
| 9084 |
} |
| 9085 |
if (k >= normalLength) { |
| 9086 |
found = true; |
| 9087 |
break; |
| 9088 |
} |
| 9089 |
if (k >= partLen) { |
| 9090 |
const lastByte = scanBytes[pos + j + k]; |
| 9091 |
if (isWhiteSpace(lastByte)) { |
| 9092 |
info(`Found "${bytesToString([...END_SIGNATURE, ...part])}" when ` + "searching for endstream command."); |
| 9093 |
found = true; |
| 9094 |
} |
| 9095 |
break; |
| 9096 |
} |
| 9097 |
} |
| 9098 |
if (found) { |
| 9099 |
stream.pos += pos; |
| 9100 |
return stream.pos - startPos; |
| 9101 |
} |
| 9102 |
} |
| 9103 |
pos++; |
| 9104 |
} |
| 9105 |
stream.pos += scanLength; |
| 9106 |
} |
| 9107 |
return -1; |
| 9108 |
} |
| 9109 |
makeStream(dict, cipherTransform) { |
| 9110 |
const lexer = this.lexer; |
| 9111 |
let stream = lexer.stream; |
| 9112 |
lexer.skipToNextLine(); |
| 9113 |
const startPos = stream.pos - 1; |
| 9114 |
let length = dict.get("Length"); |
| 9115 |
if (!Number.isInteger(length)) { |
| 9116 |
info(`Bad length "${length && length.toString()}" in stream.`); |
| 9117 |
length = 0; |
| 9118 |
} |
| 9119 |
stream.pos = startPos + length; |
| 9120 |
lexer.nextChar(); |
| 9121 |
if (this.tryShift() && isCmd(this.buf2, "endstream")) { |
| 9122 |
this.shift(); |
| 9123 |
} else { |
| 9124 |
length = this.#findStreamLength(startPos); |
| 9125 |
if (length < 0) { |
| 9126 |
throw new FormatError("Missing endstream command."); |
| 9127 |
} |
| 9128 |
lexer.nextChar(); |
| 9129 |
this.shift(); |
| 9130 |
this.shift(); |
| 9131 |
} |
| 9132 |
this.shift(); |
| 9133 |
stream = stream.makeSubStream(startPos, length, dict); |
| 9134 |
if (cipherTransform) { |
| 9135 |
stream = cipherTransform.createStream(stream, length); |
| 9136 |
} |
| 9137 |
stream = this.filter(stream, dict, length); |
| 9138 |
stream.dict = dict; |
| 9139 |
return stream; |
| 9140 |
} |
| 9141 |
filter(stream, dict, length) { |
| 9142 |
let filter = dict.get("F", "Filter"); |
| 9143 |
let params = dict.get("DP", "DecodeParms"); |
| 9144 |
if (filter instanceof Name) { |
| 9145 |
if (Array.isArray(params)) { |
| 9146 |
warn("/DecodeParms should not be an Array, when /Filter is a Name."); |
| 9147 |
} |
| 9148 |
return this.makeFilter(stream, filter.name, length, params); |
| 9149 |
} |
| 9150 |
let maybeLength = length; |
| 9151 |
if (Array.isArray(filter)) { |
| 9152 |
const filterArray = filter; |
| 9153 |
const paramsArray = params; |
| 9154 |
for (let i = 0, ii = filterArray.length; i < ii; ++i) { |
| 9155 |
filter = this.xref.fetchIfRef(filterArray[i]); |
| 9156 |
if (!(filter instanceof Name)) { |
| 9157 |
throw new FormatError(`Bad filter name "${filter}"`); |
| 9158 |
} |
| 9159 |
params = null; |
| 9160 |
if (Array.isArray(paramsArray) && i in paramsArray) { |
| 9161 |
params = this.xref.fetchIfRef(paramsArray[i]); |
| 9162 |
} |
| 9163 |
stream = this.makeFilter(stream, filter.name, maybeLength, params); |
| 9164 |
maybeLength = null; |
| 9165 |
} |
| 9166 |
} |
| 9167 |
return stream; |
| 9168 |
} |
| 9169 |
makeFilter(stream, name, maybeLength, params) { |
| 9170 |
if (maybeLength === 0) { |
| 9171 |
warn(`Empty "${name}" stream.`); |
| 9172 |
return new NullStream(); |
| 9173 |
} |
| 9174 |
try { |
| 9175 |
switch (name) { |
| 9176 |
case "Fl": |
| 9177 |
case "FlateDecode": |
| 9178 |
if (params) { |
| 9179 |
return new PredictorStream(new FlateStream(stream, maybeLength), maybeLength, params); |
| 9180 |
} |
| 9181 |
return new FlateStream(stream, maybeLength); |
| 9182 |
case "LZW": |
| 9183 |
case "LZWDecode": |
| 9184 |
let earlyChange = 1; |
| 9185 |
if (params) { |
| 9186 |
if (params.has("EarlyChange")) { |
| 9187 |
earlyChange = params.get("EarlyChange"); |
| 9188 |
} |
| 9189 |
return new PredictorStream(new LZWStream(stream, maybeLength, earlyChange), maybeLength, params); |
| 9190 |
} |
| 9191 |
return new LZWStream(stream, maybeLength, earlyChange); |
| 9192 |
case "DCT": |
| 9193 |
case "DCTDecode": |
| 9194 |
return new JpegStream(stream, maybeLength, params); |
| 9195 |
case "JPX": |
| 9196 |
case "JPXDecode": |
| 9197 |
return new JpxStream(stream, maybeLength, params); |
| 9198 |
case "A85": |
| 9199 |
case "ASCII85Decode": |
| 9200 |
return new Ascii85Stream(stream, maybeLength); |
| 9201 |
case "AHx": |
| 9202 |
case "ASCIIHexDecode": |
| 9203 |
return new AsciiHexStream(stream, maybeLength); |
| 9204 |
case "CCF": |
| 9205 |
case "CCITTFaxDecode": |
| 9206 |
return new CCITTFaxStream(stream, maybeLength, params); |
| 9207 |
case "RL": |
| 9208 |
case "RunLengthDecode": |
| 9209 |
return new RunLengthStream(stream, maybeLength); |
| 9210 |
case "JBIG2Decode": |
| 9211 |
return new Jbig2Stream(stream, maybeLength, params); |
| 9212 |
} |
| 9213 |
warn(`Filter "${name}" is not supported.`); |
| 9214 |
return stream; |
| 9215 |
} catch (ex) { |
| 9216 |
if (ex instanceof MissingDataException) { |
| 9217 |
throw ex; |
| 9218 |
} |
| 9219 |
warn(`Invalid stream: "${ex}"`); |
| 9220 |
return new NullStream(); |
| 9221 |
} |
| 9222 |
} |
| 9223 |
} |
| 9224 |
const specialChars = [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; |
| 9225 |
function toHexDigit(ch) { |
| 9226 |
if (ch >= 0x30 && ch <= 0x39) { |
| 9227 |
return ch & 0x0f; |
| 9228 |
} |
| 9229 |
if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) { |
| 9230 |
return (ch & 0x0f) + 9; |
| 9231 |
} |
| 9232 |
return -1; |
| 9233 |
} |
| 9234 |
class Lexer { |
| 9235 |
constructor(stream, knownCommands = null) { |
| 9236 |
this.stream = stream; |
| 9237 |
this.nextChar(); |
| 9238 |
this.strBuf = []; |
| 9239 |
this.knownCommands = knownCommands; |
| 9240 |
this._hexStringNumWarn = 0; |
| 9241 |
this.beginInlineImagePos = -1; |
| 9242 |
} |
| 9243 |
nextChar() { |
| 9244 |
return this.currentChar = this.stream.getByte(); |
| 9245 |
} |
| 9246 |
peekChar() { |
| 9247 |
return this.stream.peekByte(); |
| 9248 |
} |
| 9249 |
getNumber() { |
| 9250 |
let ch = this.currentChar; |
| 9251 |
let eNotation = false; |
| 9252 |
let divideBy = 0; |
| 9253 |
let sign = 1; |
| 9254 |
if (ch === 0x2d) { |
| 9255 |
sign = -1; |
| 9256 |
ch = this.nextChar(); |
| 9257 |
if (ch === 0x2d) { |
| 9258 |
ch = this.nextChar(); |
| 9259 |
} |
| 9260 |
} else if (ch === 0x2b) { |
| 9261 |
ch = this.nextChar(); |
| 9262 |
} |
| 9263 |
if (ch === 0x0a || ch === 0x0d) { |
| 9264 |
do { |
| 9265 |
ch = this.nextChar(); |
| 9266 |
} while (ch === 0x0a || ch === 0x0d); |
| 9267 |
} |
| 9268 |
if (ch === 0x2e) { |
| 9269 |
divideBy = 10; |
| 9270 |
ch = this.nextChar(); |
| 9271 |
} |
| 9272 |
if (ch < 0x30 || ch > 0x39) { |
| 9273 |
const msg = `Invalid number: ${String.fromCharCode(ch)} (charCode ${ch})`; |
| 9274 |
if (isWhiteSpace(ch) || ch === -1) { |
| 9275 |
info(`Lexer.getNumber - "${msg}".`); |
| 9276 |
return 0; |
| 9277 |
} |
| 9278 |
throw new FormatError(msg); |
| 9279 |
} |
| 9280 |
let baseValue = ch - 0x30; |
| 9281 |
let powerValue = 0; |
| 9282 |
let powerValueSign = 1; |
| 9283 |
while ((ch = this.nextChar()) >= 0) { |
| 9284 |
if (ch >= 0x30 && ch <= 0x39) { |
| 9285 |
const currentDigit = ch - 0x30; |
| 9286 |
if (eNotation) { |
| 9287 |
powerValue = powerValue * 10 + currentDigit; |
| 9288 |
} else { |
| 9289 |
if (divideBy !== 0) { |
| 9290 |
divideBy *= 10; |
| 9291 |
} |
| 9292 |
baseValue = baseValue * 10 + currentDigit; |
| 9293 |
} |
| 9294 |
} else if (ch === 0x2e) { |
| 9295 |
if (divideBy === 0) { |
| 9296 |
divideBy = 1; |
| 9297 |
} else { |
| 9298 |
break; |
| 9299 |
} |
| 9300 |
} else if (ch === 0x2d) { |
| 9301 |
warn("Badly formatted number: minus sign in the middle"); |
| 9302 |
} else if (ch === 0x45 || ch === 0x65) { |
| 9303 |
ch = this.peekChar(); |
| 9304 |
if (ch === 0x2b || ch === 0x2d) { |
| 9305 |
powerValueSign = ch === 0x2d ? -1 : 1; |
| 9306 |
this.nextChar(); |
| 9307 |
} else if (ch < 0x30 || ch > 0x39) { |
| 9308 |
break; |
| 9309 |
} |
| 9310 |
eNotation = true; |
| 9311 |
} else { |
| 9312 |
break; |
| 9313 |
} |
| 9314 |
} |
| 9315 |
if (divideBy !== 0) { |
| 9316 |
baseValue /= divideBy; |
| 9317 |
} |
| 9318 |
if (eNotation) { |
| 9319 |
baseValue *= 10 ** (powerValueSign * powerValue); |
| 9320 |
} |
| 9321 |
return sign * baseValue; |
| 9322 |
} |
| 9323 |
getString() { |
| 9324 |
let numParen = 1; |
| 9325 |
let done = false; |
| 9326 |
const strBuf = this.strBuf; |
| 9327 |
strBuf.length = 0; |
| 9328 |
let ch = this.nextChar(); |
| 9329 |
while (true) { |
| 9330 |
let charBuffered = false; |
| 9331 |
switch (ch | 0) { |
| 9332 |
case -1: |
| 9333 |
warn("Unterminated string"); |
| 9334 |
done = true; |
| 9335 |
break; |
| 9336 |
case 0x28: |
| 9337 |
++numParen; |
| 9338 |
strBuf.push("("); |
| 9339 |
break; |
| 9340 |
case 0x29: |
| 9341 |
if (--numParen === 0) { |
| 9342 |
this.nextChar(); |
| 9343 |
done = true; |
| 9344 |
} else { |
| 9345 |
strBuf.push(")"); |
| 9346 |
} |
| 9347 |
break; |
| 9348 |
case 0x5c: |
| 9349 |
ch = this.nextChar(); |
| 9350 |
switch (ch) { |
| 9351 |
case -1: |
| 9352 |
warn("Unterminated string"); |
| 9353 |
done = true; |
| 9354 |
break; |
| 9355 |
case 0x6e: |
| 9356 |
strBuf.push("\n"); |
| 9357 |
break; |
| 9358 |
case 0x72: |
| 9359 |
strBuf.push("\r"); |
| 9360 |
break; |
| 9361 |
case 0x74: |
| 9362 |
strBuf.push("\t"); |
| 9363 |
break; |
| 9364 |
case 0x62: |
| 9365 |
strBuf.push("\b"); |
| 9366 |
break; |
| 9367 |
case 0x66: |
| 9368 |
strBuf.push("\f"); |
| 9369 |
break; |
| 9370 |
case 0x5c: |
| 9371 |
case 0x28: |
| 9372 |
case 0x29: |
| 9373 |
strBuf.push(String.fromCharCode(ch)); |
| 9374 |
break; |
| 9375 |
case 0x30: |
| 9376 |
case 0x31: |
| 9377 |
case 0x32: |
| 9378 |
case 0x33: |
| 9379 |
case 0x34: |
| 9380 |
case 0x35: |
| 9381 |
case 0x36: |
| 9382 |
case 0x37: |
| 9383 |
let x = ch & 0x0f; |
| 9384 |
ch = this.nextChar(); |
| 9385 |
charBuffered = true; |
| 9386 |
if (ch >= 0x30 && ch <= 0x37) { |
| 9387 |
x = (x << 3) + (ch & 0x0f); |
| 9388 |
ch = this.nextChar(); |
| 9389 |
if (ch >= 0x30 && ch <= 0x37) { |
| 9390 |
charBuffered = false; |
| 9391 |
x = (x << 3) + (ch & 0x0f); |
| 9392 |
} |
| 9393 |
} |
| 9394 |
strBuf.push(String.fromCharCode(x)); |
| 9395 |
break; |
| 9396 |
case 0x0d: |
| 9397 |
if (this.peekChar() === 0x0a) { |
| 9398 |
this.nextChar(); |
| 9399 |
} |
| 9400 |
break; |
| 9401 |
case 0x0a: |
| 9402 |
break; |
| 9403 |
default: |
| 9404 |
strBuf.push(String.fromCharCode(ch)); |
| 9405 |
break; |
| 9406 |
} |
| 9407 |
break; |
| 9408 |
default: |
| 9409 |
strBuf.push(String.fromCharCode(ch)); |
| 9410 |
break; |
| 9411 |
} |
| 9412 |
if (done) { |
| 9413 |
break; |
| 9414 |
} |
| 9415 |
if (!charBuffered) { |
| 9416 |
ch = this.nextChar(); |
| 9417 |
} |
| 9418 |
} |
| 9419 |
return strBuf.join(""); |
| 9420 |
} |
| 9421 |
getName() { |
| 9422 |
let ch, previousCh; |
| 9423 |
const strBuf = this.strBuf; |
| 9424 |
strBuf.length = 0; |
| 9425 |
while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { |
| 9426 |
if (ch === 0x23) { |
| 9427 |
ch = this.nextChar(); |
| 9428 |
if (specialChars[ch]) { |
| 9429 |
warn("Lexer_getName: " + "NUMBER SIGN (#) should be followed by a hexadecimal number."); |
| 9430 |
strBuf.push("#"); |
| 9431 |
break; |
| 9432 |
} |
| 9433 |
const x = toHexDigit(ch); |
| 9434 |
if (x !== -1) { |
| 9435 |
previousCh = ch; |
| 9436 |
ch = this.nextChar(); |
| 9437 |
const x2 = toHexDigit(ch); |
| 9438 |
if (x2 === -1) { |
| 9439 |
warn(`Lexer_getName: Illegal digit (${String.fromCharCode(ch)}) ` + "in hexadecimal number."); |
| 9440 |
strBuf.push("#", String.fromCharCode(previousCh)); |
| 9441 |
if (specialChars[ch]) { |
| 9442 |
break; |
| 9443 |
} |
| 9444 |
strBuf.push(String.fromCharCode(ch)); |
| 9445 |
continue; |
| 9446 |
} |
| 9447 |
strBuf.push(String.fromCharCode(x << 4 | x2)); |
| 9448 |
} else { |
| 9449 |
strBuf.push("#", String.fromCharCode(ch)); |
| 9450 |
} |
| 9451 |
} else { |
| 9452 |
strBuf.push(String.fromCharCode(ch)); |
| 9453 |
} |
| 9454 |
} |
| 9455 |
if (strBuf.length > 127) { |
| 9456 |
warn(`Name token is longer than allowed by the spec: ${strBuf.length}`); |
| 9457 |
} |
| 9458 |
return Name.get(strBuf.join("")); |
| 9459 |
} |
| 9460 |
_hexStringWarn(ch) { |
| 9461 |
const MAX_HEX_STRING_NUM_WARN = 5; |
| 9462 |
if (this._hexStringNumWarn++ === MAX_HEX_STRING_NUM_WARN) { |
| 9463 |
warn("getHexString - ignoring additional invalid characters."); |
| 9464 |
return; |
| 9465 |
} |
| 9466 |
if (this._hexStringNumWarn > MAX_HEX_STRING_NUM_WARN) { |
| 9467 |
return; |
| 9468 |
} |
| 9469 |
warn(`getHexString - ignoring invalid character: ${ch}`); |
| 9470 |
} |
| 9471 |
getHexString() { |
| 9472 |
const strBuf = this.strBuf; |
| 9473 |
strBuf.length = 0; |
| 9474 |
let ch = this.currentChar; |
| 9475 |
let firstDigit = -1, |
| 9476 |
digit = -1; |
| 9477 |
this._hexStringNumWarn = 0; |
| 9478 |
while (true) { |
| 9479 |
if (ch < 0) { |
| 9480 |
warn("Unterminated hex string"); |
| 9481 |
break; |
| 9482 |
} else if (ch === 0x3e) { |
| 9483 |
this.nextChar(); |
| 9484 |
break; |
| 9485 |
} else if (specialChars[ch] === 1) { |
| 9486 |
ch = this.nextChar(); |
| 9487 |
continue; |
| 9488 |
} else { |
| 9489 |
digit = toHexDigit(ch); |
| 9490 |
if (digit === -1) { |
| 9491 |
this._hexStringWarn(ch); |
| 9492 |
} else if (firstDigit === -1) { |
| 9493 |
firstDigit = digit; |
| 9494 |
} else { |
| 9495 |
strBuf.push(String.fromCharCode(firstDigit << 4 | digit)); |
| 9496 |
firstDigit = -1; |
| 9497 |
} |
| 9498 |
ch = this.nextChar(); |
| 9499 |
} |
| 9500 |
} |
| 9501 |
if (firstDigit !== -1) { |
| 9502 |
strBuf.push(String.fromCharCode(firstDigit << 4)); |
| 9503 |
} |
| 9504 |
return strBuf.join(""); |
| 9505 |
} |
| 9506 |
getObj() { |
| 9507 |
let comment = false; |
| 9508 |
let ch = this.currentChar; |
| 9509 |
while (true) { |
| 9510 |
if (ch < 0) { |
| 9511 |
return EOF; |
| 9512 |
} |
| 9513 |
if (comment) { |
| 9514 |
if (ch === 0x0a || ch === 0x0d) { |
| 9515 |
comment = false; |
| 9516 |
} |
| 9517 |
} else if (ch === 0x25) { |
| 9518 |
comment = true; |
| 9519 |
} else if (specialChars[ch] !== 1) { |
| 9520 |
break; |
| 9521 |
} |
| 9522 |
ch = this.nextChar(); |
| 9523 |
} |
| 9524 |
switch (ch | 0) { |
| 9525 |
case 0x30: |
| 9526 |
case 0x31: |
| 9527 |
case 0x32: |
| 9528 |
case 0x33: |
| 9529 |
case 0x34: |
| 9530 |
case 0x35: |
| 9531 |
case 0x36: |
| 9532 |
case 0x37: |
| 9533 |
case 0x38: |
| 9534 |
case 0x39: |
| 9535 |
case 0x2b: |
| 9536 |
case 0x2d: |
| 9537 |
case 0x2e: |
| 9538 |
return this.getNumber(); |
| 9539 |
case 0x28: |
| 9540 |
return this.getString(); |
| 9541 |
case 0x2f: |
| 9542 |
return this.getName(); |
| 9543 |
case 0x5b: |
| 9544 |
this.nextChar(); |
| 9545 |
return Cmd.get("["); |
| 9546 |
case 0x5d: |
| 9547 |
this.nextChar(); |
| 9548 |
return Cmd.get("]"); |
| 9549 |
case 0x3c: |
| 9550 |
ch = this.nextChar(); |
| 9551 |
if (ch === 0x3c) { |
| 9552 |
this.nextChar(); |
| 9553 |
return Cmd.get("<<"); |
| 9554 |
} |
| 9555 |
return this.getHexString(); |
| 9556 |
case 0x3e: |
| 9557 |
ch = this.nextChar(); |
| 9558 |
if (ch === 0x3e) { |
| 9559 |
this.nextChar(); |
| 9560 |
return Cmd.get(">>"); |
| 9561 |
} |
| 9562 |
return Cmd.get(">"); |
| 9563 |
case 0x7b: |
| 9564 |
this.nextChar(); |
| 9565 |
return Cmd.get("{"); |
| 9566 |
case 0x7d: |
| 9567 |
this.nextChar(); |
| 9568 |
return Cmd.get("}"); |
| 9569 |
case 0x29: |
| 9570 |
this.nextChar(); |
| 9571 |
throw new FormatError(`Illegal character: ${ch}`); |
| 9572 |
} |
| 9573 |
let str = String.fromCharCode(ch); |
| 9574 |
if (ch < 0x20 || ch > 0x7f) { |
| 9575 |
const nextCh = this.peekChar(); |
| 9576 |
if (nextCh >= 0x20 && nextCh <= 0x7f) { |
| 9577 |
this.nextChar(); |
| 9578 |
return Cmd.get(str); |
| 9579 |
} |
| 9580 |
} |
| 9581 |
const knownCommands = this.knownCommands; |
| 9582 |
let knownCommandFound = knownCommands?.[str] !== undefined; |
| 9583 |
while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { |
| 9584 |
const possibleCommand = str + String.fromCharCode(ch); |
| 9585 |
if (knownCommandFound && knownCommands[possibleCommand] === undefined) { |
| 9586 |
break; |
| 9587 |
} |
| 9588 |
if (str.length === 128) { |
| 9589 |
throw new FormatError(`Command token too long: ${str.length}`); |
| 9590 |
} |
| 9591 |
str = possibleCommand; |
| 9592 |
knownCommandFound = knownCommands?.[str] !== undefined; |
| 9593 |
} |
| 9594 |
if (str === "true") { |
| 9595 |
return true; |
| 9596 |
} |
| 9597 |
if (str === "false") { |
| 9598 |
return false; |
| 9599 |
} |
| 9600 |
if (str === "null") { |
| 9601 |
return null; |
| 9602 |
} |
| 9603 |
if (str === "BI") { |
| 9604 |
this.beginInlineImagePos = this.stream.pos; |
| 9605 |
} |
| 9606 |
return Cmd.get(str); |
| 9607 |
} |
| 9608 |
skipToNextLine() { |
| 9609 |
let ch = this.currentChar; |
| 9610 |
while (ch >= 0) { |
| 9611 |
if (ch === 0x0d) { |
| 9612 |
ch = this.nextChar(); |
| 9613 |
if (ch === 0x0a) { |
| 9614 |
this.nextChar(); |
| 9615 |
} |
| 9616 |
break; |
| 9617 |
} else if (ch === 0x0a) { |
| 9618 |
this.nextChar(); |
| 9619 |
break; |
| 9620 |
} |
| 9621 |
ch = this.nextChar(); |
| 9622 |
} |
| 9623 |
} |
| 9624 |
} |
| 9625 |
class Linearization { |
| 9626 |
static create(stream) { |
| 9627 |
function getInt(linDict, name, allowZeroValue = false) { |
| 9628 |
const obj = linDict.get(name); |
| 9629 |
if (Number.isInteger(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) { |
| 9630 |
return obj; |
| 9631 |
} |
| 9632 |
throw new Error(`The "${name}" parameter in the linearization ` + "dictionary is invalid."); |
| 9633 |
} |
| 9634 |
function getHints(linDict) { |
| 9635 |
const hints = linDict.get("H"); |
| 9636 |
let hintsLength; |
| 9637 |
if (Array.isArray(hints) && ((hintsLength = hints.length) === 2 || hintsLength === 4)) { |
| 9638 |
for (let index = 0; index < hintsLength; index++) { |
| 9639 |
const hint = hints[index]; |
| 9640 |
if (!(Number.isInteger(hint) && hint > 0)) { |
| 9641 |
throw new Error(`Hint (${index}) in the linearization dictionary is invalid.`); |
| 9642 |
} |
| 9643 |
} |
| 9644 |
return hints; |
| 9645 |
} |
| 9646 |
throw new Error("Hint array in the linearization dictionary is invalid."); |
| 9647 |
} |
| 9648 |
const parser = new Parser({ |
| 9649 |
lexer: new Lexer(stream), |
| 9650 |
xref: null |
| 9651 |
}); |
| 9652 |
const obj1 = parser.getObj(); |
| 9653 |
const obj2 = parser.getObj(); |
| 9654 |
const obj3 = parser.getObj(); |
| 9655 |
const linDict = parser.getObj(); |
| 9656 |
let obj, length; |
| 9657 |
if (!(Number.isInteger(obj1) && Number.isInteger(obj2) && isCmd(obj3, "obj") && linDict instanceof Dict && typeof (obj = linDict.get("Linearized")) === "number" && obj > 0)) { |
| 9658 |
return null; |
| 9659 |
} else if ((length = getInt(linDict, "L")) !== stream.length) { |
| 9660 |
throw new Error('The "L" parameter in the linearization dictionary ' + "does not equal the stream length."); |
| 9661 |
} |
| 9662 |
return { |
| 9663 |
length, |
| 9664 |
hints: getHints(linDict), |
| 9665 |
objectNumberFirst: getInt(linDict, "O"), |
| 9666 |
endFirst: getInt(linDict, "E"), |
| 9667 |
numPages: getInt(linDict, "N"), |
| 9668 |
mainXRefEntriesOffset: getInt(linDict, "T"), |
| 9669 |
pageFirst: linDict.has("P") ? getInt(linDict, "P", true) : 0 |
| 9670 |
}; |
| 9671 |
} |
| 9672 |
} |
| 9673 |
|
| 9674 |
;// ./src/core/cmap.js |
| 9675 |
|
| 9676 |
|
| 9677 |
|
| 9678 |
|
| 9679 |
|
| 9680 |
|
| 9681 |
|
| 9682 |
const BUILT_IN_CMAPS = ["Adobe-GB1-UCS2", "Adobe-CNS1-UCS2", "Adobe-Japan1-UCS2", "Adobe-Korea1-UCS2", "78-EUC-H", "78-EUC-V", "78-H", "78-RKSJ-H", "78-RKSJ-V", "78-V", "78ms-RKSJ-H", "78ms-RKSJ-V", "83pv-RKSJ-H", "90ms-RKSJ-H", "90ms-RKSJ-V", "90msp-RKSJ-H", "90msp-RKSJ-V", "90pv-RKSJ-H", "90pv-RKSJ-V", "Add-H", "Add-RKSJ-H", "Add-RKSJ-V", "Add-V", "Adobe-CNS1-0", "Adobe-CNS1-1", "Adobe-CNS1-2", "Adobe-CNS1-3", "Adobe-CNS1-4", "Adobe-CNS1-5", "Adobe-CNS1-6", "Adobe-GB1-0", "Adobe-GB1-1", "Adobe-GB1-2", "Adobe-GB1-3", "Adobe-GB1-4", "Adobe-GB1-5", "Adobe-Japan1-0", "Adobe-Japan1-1", "Adobe-Japan1-2", "Adobe-Japan1-3", "Adobe-Japan1-4", "Adobe-Japan1-5", "Adobe-Japan1-6", "Adobe-Korea1-0", "Adobe-Korea1-1", "Adobe-Korea1-2", "B5-H", "B5-V", "B5pc-H", "B5pc-V", "CNS-EUC-H", "CNS-EUC-V", "CNS1-H", "CNS1-V", "CNS2-H", "CNS2-V", "ETHK-B5-H", "ETHK-B5-V", "ETen-B5-H", "ETen-B5-V", "ETenms-B5-H", "ETenms-B5-V", "EUC-H", "EUC-V", "Ext-H", "Ext-RKSJ-H", "Ext-RKSJ-V", "Ext-V", "GB-EUC-H", "GB-EUC-V", "GB-H", "GB-V", "GBK-EUC-H", "GBK-EUC-V", "GBK2K-H", "GBK2K-V", "GBKp-EUC-H", "GBKp-EUC-V", "GBT-EUC-H", "GBT-EUC-V", "GBT-H", "GBT-V", "GBTpc-EUC-H", "GBTpc-EUC-V", "GBpc-EUC-H", "GBpc-EUC-V", "H", "HKdla-B5-H", "HKdla-B5-V", "HKdlb-B5-H", "HKdlb-B5-V", "HKgccs-B5-H", "HKgccs-B5-V", "HKm314-B5-H", "HKm314-B5-V", "HKm471-B5-H", "HKm471-B5-V", "HKscs-B5-H", "HKscs-B5-V", "Hankaku", "Hiragana", "KSC-EUC-H", "KSC-EUC-V", "KSC-H", "KSC-Johab-H", "KSC-Johab-V", "KSC-V", "KSCms-UHC-H", "KSCms-UHC-HW-H", "KSCms-UHC-HW-V", "KSCms-UHC-V", "KSCpc-EUC-H", "KSCpc-EUC-V", "Katakana", "NWP-H", "NWP-V", "RKSJ-H", "RKSJ-V", "Roman", "UniCNS-UCS2-H", "UniCNS-UCS2-V", "UniCNS-UTF16-H", "UniCNS-UTF16-V", "UniCNS-UTF32-H", "UniCNS-UTF32-V", "UniCNS-UTF8-H", "UniCNS-UTF8-V", "UniGB-UCS2-H", "UniGB-UCS2-V", "UniGB-UTF16-H", "UniGB-UTF16-V", "UniGB-UTF32-H", "UniGB-UTF32-V", "UniGB-UTF8-H", "UniGB-UTF8-V", "UniJIS-UCS2-H", "UniJIS-UCS2-HW-H", "UniJIS-UCS2-HW-V", "UniJIS-UCS2-V", "UniJIS-UTF16-H", "UniJIS-UTF16-V", "UniJIS-UTF32-H", "UniJIS-UTF32-V", "UniJIS-UTF8-H", "UniJIS-UTF8-V", "UniJIS2004-UTF16-H", "UniJIS2004-UTF16-V", "UniJIS2004-UTF32-H", "UniJIS2004-UTF32-V", "UniJIS2004-UTF8-H", "UniJIS2004-UTF8-V", "UniJISPro-UCS2-HW-V", "UniJISPro-UCS2-V", "UniJISPro-UTF8-V", "UniJISX0213-UTF32-H", "UniJISX0213-UTF32-V", "UniJISX02132004-UTF32-H", "UniJISX02132004-UTF32-V", "UniKS-UCS2-H", "UniKS-UCS2-V", "UniKS-UTF16-H", "UniKS-UTF16-V", "UniKS-UTF32-H", "UniKS-UTF32-V", "UniKS-UTF8-H", "UniKS-UTF8-V", "V", "WP-Symbol"]; |
| 9683 |
const MAX_MAP_RANGE = 2 ** 24 - 1; |
| 9684 |
class CMap { |
| 9685 |
constructor(builtInCMap = false) { |
| 9686 |
this.codespaceRanges = [[], [], [], []]; |
| 9687 |
this.numCodespaceRanges = 0; |
| 9688 |
this._map = []; |
| 9689 |
this.name = ""; |
| 9690 |
this.vertical = false; |
| 9691 |
this.useCMap = null; |
| 9692 |
this.builtInCMap = builtInCMap; |
| 9693 |
} |
| 9694 |
addCodespaceRange(n, low, high) { |
| 9695 |
this.codespaceRanges[n - 1].push(low, high); |
| 9696 |
this.numCodespaceRanges++; |
| 9697 |
} |
| 9698 |
mapCidRange(low, high, dstLow) { |
| 9699 |
if (high - low > MAX_MAP_RANGE) { |
| 9700 |
throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE."); |
| 9701 |
} |
| 9702 |
while (low <= high) { |
| 9703 |
this._map[low++] = dstLow++; |
| 9704 |
} |
| 9705 |
} |
| 9706 |
mapBfRange(low, high, dstLow) { |
| 9707 |
if (high - low > MAX_MAP_RANGE) { |
| 9708 |
throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE."); |
| 9709 |
} |
| 9710 |
const lastByte = dstLow.length - 1; |
| 9711 |
while (low <= high) { |
| 9712 |
this._map[low++] = dstLow; |
| 9713 |
const nextCharCode = dstLow.charCodeAt(lastByte) + 1; |
| 9714 |
if (nextCharCode > 0xff) { |
| 9715 |
dstLow = dstLow.substring(0, lastByte - 1) + String.fromCharCode(dstLow.charCodeAt(lastByte - 1) + 1) + "\x00"; |
| 9716 |
continue; |
| 9717 |
} |
| 9718 |
dstLow = dstLow.substring(0, lastByte) + String.fromCharCode(nextCharCode); |
| 9719 |
} |
| 9720 |
} |
| 9721 |
mapBfRangeToArray(low, high, array) { |
| 9722 |
if (high - low > MAX_MAP_RANGE) { |
| 9723 |
throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE."); |
| 9724 |
} |
| 9725 |
const ii = array.length; |
| 9726 |
let i = 0; |
| 9727 |
while (low <= high && i < ii) { |
| 9728 |
this._map[low] = array[i++]; |
| 9729 |
++low; |
| 9730 |
} |
| 9731 |
} |
| 9732 |
mapOne(src, dst) { |
| 9733 |
this._map[src] = dst; |
| 9734 |
} |
| 9735 |
lookup(code) { |
| 9736 |
return this._map[code]; |
| 9737 |
} |
| 9738 |
contains(code) { |
| 9739 |
return this._map[code] !== undefined; |
| 9740 |
} |
| 9741 |
forEach(callback) { |
| 9742 |
const map = this._map; |
| 9743 |
const length = map.length; |
| 9744 |
if (length <= 0x10000) { |
| 9745 |
for (let i = 0; i < length; i++) { |
| 9746 |
if (map[i] !== undefined) { |
| 9747 |
callback(i, map[i]); |
| 9748 |
} |
| 9749 |
} |
| 9750 |
} else { |
| 9751 |
for (const i in map) { |
| 9752 |
callback(i, map[i]); |
| 9753 |
} |
| 9754 |
} |
| 9755 |
} |
| 9756 |
charCodeOf(value) { |
| 9757 |
const map = this._map; |
| 9758 |
if (map.length <= 0x10000) { |
| 9759 |
return map.indexOf(value); |
| 9760 |
} |
| 9761 |
for (const charCode in map) { |
| 9762 |
if (map[charCode] === value) { |
| 9763 |
return charCode | 0; |
| 9764 |
} |
| 9765 |
} |
| 9766 |
return -1; |
| 9767 |
} |
| 9768 |
getMap() { |
| 9769 |
return this._map; |
| 9770 |
} |
| 9771 |
readCharCode(str, offset, out) { |
| 9772 |
let c = 0; |
| 9773 |
const codespaceRanges = this.codespaceRanges; |
| 9774 |
for (let n = 0, nn = codespaceRanges.length; n < nn; n++) { |
| 9775 |
c = (c << 8 | str.charCodeAt(offset + n)) >>> 0; |
| 9776 |
const codespaceRange = codespaceRanges[n]; |
| 9777 |
for (let k = 0, kk = codespaceRange.length; k < kk;) { |
| 9778 |
const low = codespaceRange[k++]; |
| 9779 |
const high = codespaceRange[k++]; |
| 9780 |
if (c >= low && c <= high) { |
| 9781 |
out.charcode = c; |
| 9782 |
out.length = n + 1; |
| 9783 |
return; |
| 9784 |
} |
| 9785 |
} |
| 9786 |
} |
| 9787 |
out.charcode = 0; |
| 9788 |
out.length = 1; |
| 9789 |
} |
| 9790 |
getCharCodeLength(charCode) { |
| 9791 |
const codespaceRanges = this.codespaceRanges; |
| 9792 |
for (let n = 0, nn = codespaceRanges.length; n < nn; n++) { |
| 9793 |
const codespaceRange = codespaceRanges[n]; |
| 9794 |
for (let k = 0, kk = codespaceRange.length; k < kk;) { |
| 9795 |
const low = codespaceRange[k++]; |
| 9796 |
const high = codespaceRange[k++]; |
| 9797 |
if (charCode >= low && charCode <= high) { |
| 9798 |
return n + 1; |
| 9799 |
} |
| 9800 |
} |
| 9801 |
} |
| 9802 |
return 1; |
| 9803 |
} |
| 9804 |
get length() { |
| 9805 |
return this._map.length; |
| 9806 |
} |
| 9807 |
get isIdentityCMap() { |
| 9808 |
if (!(this.name === "Identity-H" || this.name === "Identity-V")) { |
| 9809 |
return false; |
| 9810 |
} |
| 9811 |
if (this._map.length !== 0x10000) { |
| 9812 |
return false; |
| 9813 |
} |
| 9814 |
for (let i = 0; i < 0x10000; i++) { |
| 9815 |
if (this._map[i] !== i) { |
| 9816 |
return false; |
| 9817 |
} |
| 9818 |
} |
| 9819 |
return true; |
| 9820 |
} |
| 9821 |
} |
| 9822 |
class IdentityCMap extends CMap { |
| 9823 |
constructor(vertical, n) { |
| 9824 |
super(); |
| 9825 |
this.vertical = vertical; |
| 9826 |
this.addCodespaceRange(n, 0, 0xffff); |
| 9827 |
} |
| 9828 |
mapCidRange(low, high, dstLow) { |
| 9829 |
unreachable("should not call mapCidRange"); |
| 9830 |
} |
| 9831 |
mapBfRange(low, high, dstLow) { |
| 9832 |
unreachable("should not call mapBfRange"); |
| 9833 |
} |
| 9834 |
mapBfRangeToArray(low, high, array) { |
| 9835 |
unreachable("should not call mapBfRangeToArray"); |
| 9836 |
} |
| 9837 |
mapOne(src, dst) { |
| 9838 |
unreachable("should not call mapCidOne"); |
| 9839 |
} |
| 9840 |
lookup(code) { |
| 9841 |
return Number.isInteger(code) && code <= 0xffff ? code : undefined; |
| 9842 |
} |
| 9843 |
contains(code) { |
| 9844 |
return Number.isInteger(code) && code <= 0xffff; |
| 9845 |
} |
| 9846 |
forEach(callback) { |
| 9847 |
for (let i = 0; i <= 0xffff; i++) { |
| 9848 |
callback(i, i); |
| 9849 |
} |
| 9850 |
} |
| 9851 |
charCodeOf(value) { |
| 9852 |
return Number.isInteger(value) && value <= 0xffff ? value : -1; |
| 9853 |
} |
| 9854 |
getMap() { |
| 9855 |
const map = new Array(0x10000); |
| 9856 |
for (let i = 0; i <= 0xffff; i++) { |
| 9857 |
map[i] = i; |
| 9858 |
} |
| 9859 |
return map; |
| 9860 |
} |
| 9861 |
get length() { |
| 9862 |
return 0x10000; |
| 9863 |
} |
| 9864 |
get isIdentityCMap() { |
| 9865 |
unreachable("should not access .isIdentityCMap"); |
| 9866 |
} |
| 9867 |
} |
| 9868 |
function strToInt(str) { |
| 9869 |
let a = 0; |
| 9870 |
for (let i = 0; i < str.length; i++) { |
| 9871 |
a = a << 8 | str.charCodeAt(i); |
| 9872 |
} |
| 9873 |
return a >>> 0; |
| 9874 |
} |
| 9875 |
function expectString(obj) { |
| 9876 |
if (typeof obj !== "string") { |
| 9877 |
throw new FormatError("Malformed CMap: expected string."); |
| 9878 |
} |
| 9879 |
} |
| 9880 |
function expectInt(obj) { |
| 9881 |
if (!Number.isInteger(obj)) { |
| 9882 |
throw new FormatError("Malformed CMap: expected int."); |
| 9883 |
} |
| 9884 |
} |
| 9885 |
function parseBfChar(cMap, lexer) { |
| 9886 |
while (true) { |
| 9887 |
let obj = lexer.getObj(); |
| 9888 |
if (obj === EOF) { |
| 9889 |
break; |
| 9890 |
} |
| 9891 |
if (isCmd(obj, "endbfchar")) { |
| 9892 |
return; |
| 9893 |
} |
| 9894 |
expectString(obj); |
| 9895 |
const src = strToInt(obj); |
| 9896 |
obj = lexer.getObj(); |
| 9897 |
expectString(obj); |
| 9898 |
const dst = obj; |
| 9899 |
cMap.mapOne(src, dst); |
| 9900 |
} |
| 9901 |
} |
| 9902 |
function parseBfRange(cMap, lexer) { |
| 9903 |
while (true) { |
| 9904 |
let obj = lexer.getObj(); |
| 9905 |
if (obj === EOF) { |
| 9906 |
break; |
| 9907 |
} |
| 9908 |
if (isCmd(obj, "endbfrange")) { |
| 9909 |
return; |
| 9910 |
} |
| 9911 |
expectString(obj); |
| 9912 |
const low = strToInt(obj); |
| 9913 |
obj = lexer.getObj(); |
| 9914 |
expectString(obj); |
| 9915 |
const high = strToInt(obj); |
| 9916 |
obj = lexer.getObj(); |
| 9917 |
if (Number.isInteger(obj) || typeof obj === "string") { |
| 9918 |
const dstLow = Number.isInteger(obj) ? String.fromCharCode(obj) : obj; |
| 9919 |
cMap.mapBfRange(low, high, dstLow); |
| 9920 |
} else if (isCmd(obj, "[")) { |
| 9921 |
obj = lexer.getObj(); |
| 9922 |
const array = []; |
| 9923 |
while (!isCmd(obj, "]") && obj !== EOF) { |
| 9924 |
array.push(obj); |
| 9925 |
obj = lexer.getObj(); |
| 9926 |
} |
| 9927 |
cMap.mapBfRangeToArray(low, high, array); |
| 9928 |
} else { |
| 9929 |
break; |
| 9930 |
} |
| 9931 |
} |
| 9932 |
throw new FormatError("Invalid bf range."); |
| 9933 |
} |
| 9934 |
function parseCidChar(cMap, lexer) { |
| 9935 |
while (true) { |
| 9936 |
let obj = lexer.getObj(); |
| 9937 |
if (obj === EOF) { |
| 9938 |
break; |
| 9939 |
} |
| 9940 |
if (isCmd(obj, "endcidchar")) { |
| 9941 |
return; |
| 9942 |
} |
| 9943 |
expectString(obj); |
| 9944 |
const src = strToInt(obj); |
| 9945 |
obj = lexer.getObj(); |
| 9946 |
expectInt(obj); |
| 9947 |
const dst = obj; |
| 9948 |
cMap.mapOne(src, dst); |
| 9949 |
} |
| 9950 |
} |
| 9951 |
function parseCidRange(cMap, lexer) { |
| 9952 |
while (true) { |
| 9953 |
let obj = lexer.getObj(); |
| 9954 |
if (obj === EOF) { |
| 9955 |
break; |
| 9956 |
} |
| 9957 |
if (isCmd(obj, "endcidrange")) { |
| 9958 |
return; |
| 9959 |
} |
| 9960 |
expectString(obj); |
| 9961 |
const low = strToInt(obj); |
| 9962 |
obj = lexer.getObj(); |
| 9963 |
expectString(obj); |
| 9964 |
const high = strToInt(obj); |
| 9965 |
obj = lexer.getObj(); |
| 9966 |
expectInt(obj); |
| 9967 |
const dstLow = obj; |
| 9968 |
cMap.mapCidRange(low, high, dstLow); |
| 9969 |
} |
| 9970 |
} |
| 9971 |
function parseCodespaceRange(cMap, lexer) { |
| 9972 |
while (true) { |
| 9973 |
let obj = lexer.getObj(); |
| 9974 |
if (obj === EOF) { |
| 9975 |
break; |
| 9976 |
} |
| 9977 |
if (isCmd(obj, "endcodespacerange")) { |
| 9978 |
return; |
| 9979 |
} |
| 9980 |
if (typeof obj !== "string") { |
| 9981 |
break; |
| 9982 |
} |
| 9983 |
const low = strToInt(obj); |
| 9984 |
obj = lexer.getObj(); |
| 9985 |
if (typeof obj !== "string") { |
| 9986 |
break; |
| 9987 |
} |
| 9988 |
const high = strToInt(obj); |
| 9989 |
cMap.addCodespaceRange(obj.length, low, high); |
| 9990 |
} |
| 9991 |
throw new FormatError("Invalid codespace range."); |
| 9992 |
} |
| 9993 |
function parseWMode(cMap, lexer) { |
| 9994 |
const obj = lexer.getObj(); |
| 9995 |
if (Number.isInteger(obj)) { |
| 9996 |
cMap.vertical = !!obj; |
| 9997 |
} |
| 9998 |
} |
| 9999 |
function parseCMapName(cMap, lexer) { |
| 10000 |
const obj = lexer.getObj(); |
| 10001 |
if (obj instanceof Name) { |
| 10002 |
cMap.name = obj.name; |
| 10003 |
} |
| 10004 |
} |
| 10005 |
async function parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap) { |
| 10006 |
let previous, embeddedUseCMap; |
| 10007 |
objLoop: while (true) { |
| 10008 |
try { |
| 10009 |
const obj = lexer.getObj(); |
| 10010 |
if (obj === EOF) { |
| 10011 |
break; |
| 10012 |
} else if (obj instanceof Name) { |
| 10013 |
if (obj.name === "WMode") { |
| 10014 |
parseWMode(cMap, lexer); |
| 10015 |
} else if (obj.name === "CMapName") { |
| 10016 |
parseCMapName(cMap, lexer); |
| 10017 |
} |
| 10018 |
previous = obj; |
| 10019 |
} else if (obj instanceof Cmd) { |
| 10020 |
switch (obj.cmd) { |
| 10021 |
case "endcmap": |
| 10022 |
break objLoop; |
| 10023 |
case "usecmap": |
| 10024 |
if (previous instanceof Name) { |
| 10025 |
embeddedUseCMap = previous.name; |
| 10026 |
} |
| 10027 |
break; |
| 10028 |
case "begincodespacerange": |
| 10029 |
parseCodespaceRange(cMap, lexer); |
| 10030 |
break; |
| 10031 |
case "beginbfchar": |
| 10032 |
parseBfChar(cMap, lexer); |
| 10033 |
break; |
| 10034 |
case "begincidchar": |
| 10035 |
parseCidChar(cMap, lexer); |
| 10036 |
break; |
| 10037 |
case "beginbfrange": |
| 10038 |
parseBfRange(cMap, lexer); |
| 10039 |
break; |
| 10040 |
case "begincidrange": |
| 10041 |
parseCidRange(cMap, lexer); |
| 10042 |
break; |
| 10043 |
} |
| 10044 |
} |
| 10045 |
} catch (ex) { |
| 10046 |
if (ex instanceof MissingDataException) { |
| 10047 |
throw ex; |
| 10048 |
} |
| 10049 |
warn("Invalid cMap data: " + ex); |
| 10050 |
continue; |
| 10051 |
} |
| 10052 |
} |
| 10053 |
if (!useCMap && embeddedUseCMap) { |
| 10054 |
useCMap = embeddedUseCMap; |
| 10055 |
} |
| 10056 |
if (useCMap) { |
| 10057 |
return extendCMap(cMap, fetchBuiltInCMap, useCMap); |
| 10058 |
} |
| 10059 |
return cMap; |
| 10060 |
} |
| 10061 |
async function extendCMap(cMap, fetchBuiltInCMap, useCMap) { |
| 10062 |
cMap.useCMap = await createBuiltInCMap(useCMap, fetchBuiltInCMap); |
| 10063 |
if (cMap.numCodespaceRanges === 0) { |
| 10064 |
const useCodespaceRanges = cMap.useCMap.codespaceRanges; |
| 10065 |
for (let i = 0; i < useCodespaceRanges.length; i++) { |
| 10066 |
cMap.codespaceRanges[i] = useCodespaceRanges[i].slice(); |
| 10067 |
} |
| 10068 |
cMap.numCodespaceRanges = cMap.useCMap.numCodespaceRanges; |
| 10069 |
} |
| 10070 |
cMap.useCMap.forEach(function (key, value) { |
| 10071 |
if (!cMap.contains(key)) { |
| 10072 |
cMap.mapOne(key, cMap.useCMap.lookup(key)); |
| 10073 |
} |
| 10074 |
}); |
| 10075 |
return cMap; |
| 10076 |
} |
| 10077 |
async function createBuiltInCMap(name, fetchBuiltInCMap) { |
| 10078 |
if (name === "Identity-H") { |
| 10079 |
return new IdentityCMap(false, 2); |
| 10080 |
} else if (name === "Identity-V") { |
| 10081 |
return new IdentityCMap(true, 2); |
| 10082 |
} |
| 10083 |
if (!BUILT_IN_CMAPS.includes(name)) { |
| 10084 |
throw new Error("Unknown CMap name: " + name); |
| 10085 |
} |
| 10086 |
if (!fetchBuiltInCMap) { |
| 10087 |
throw new Error("Built-in CMap parameters are not provided."); |
| 10088 |
} |
| 10089 |
const { |
| 10090 |
cMapData, |
| 10091 |
compressionType |
| 10092 |
} = await fetchBuiltInCMap(name); |
| 10093 |
const cMap = new CMap(true); |
| 10094 |
if (compressionType === CMapCompressionType.BINARY) { |
| 10095 |
return new BinaryCMapReader().process(cMapData, cMap, useCMap => extendCMap(cMap, fetchBuiltInCMap, useCMap)); |
| 10096 |
} |
| 10097 |
if (compressionType === CMapCompressionType.NONE) { |
| 10098 |
const lexer = new Lexer(new Stream(cMapData)); |
| 10099 |
return parseCMap(cMap, lexer, fetchBuiltInCMap, null); |
| 10100 |
} |
| 10101 |
throw new Error(`Invalid CMap "compressionType" value: ${compressionType}`); |
| 10102 |
} |
| 10103 |
class CMapFactory { |
| 10104 |
static async create({ |
| 10105 |
encoding, |
| 10106 |
fetchBuiltInCMap, |
| 10107 |
useCMap |
| 10108 |
}) { |
| 10109 |
if (encoding instanceof Name) { |
| 10110 |
return createBuiltInCMap(encoding.name, fetchBuiltInCMap); |
| 10111 |
} else if (encoding instanceof BaseStream) { |
| 10112 |
const parsedCMap = await parseCMap(new CMap(), new Lexer(encoding), fetchBuiltInCMap, useCMap); |
| 10113 |
if (parsedCMap.isIdentityCMap) { |
| 10114 |
return createBuiltInCMap(parsedCMap.name, fetchBuiltInCMap); |
| 10115 |
} |
| 10116 |
return parsedCMap; |
| 10117 |
} |
| 10118 |
throw new Error("Encoding required."); |
| 10119 |
} |
| 10120 |
} |
| 10121 |
|
| 10122 |
;// ./src/core/charsets.js |
| 10123 |
const ISOAdobeCharset = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "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", "quoteleft", "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", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron"]; |
| 10124 |
const ExpertCharset = [".notdef", "space", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "onequarter", "onehalf", "threequarters", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall"]; |
| 10125 |
const ExpertSubsetCharset = [".notdef", "space", "dollaroldstyle", "dollarsuperior", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "hyphensuperior", "colonmonetary", "onefitted", "rupiah", "centoldstyle", "figuredash", "hypheninferior", "onequarter", "onehalf", "threequarters", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior"]; |
| 10126 |
|
| 10127 |
;// ./src/core/encodings.js |
| 10128 |
const ExpertEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclamsmall", "Hungarumlautsmall", "", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "", "", "", "isuperior", "", "", "lsuperior", "msuperior", "nsuperior", "osuperior", "", "", "rsuperior", "ssuperior", "tsuperior", "", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "exclamdownsmall", "centoldstyle", "Lslashsmall", "", "", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "", "Dotaccentsmall", "", "", "Macronsmall", "", "", "figuredash", "hypheninferior", "", "", "Ogoneksmall", "Ringsmall", "Cedillasmall", "", "", "", "onequarter", "onehalf", "threequarters", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "", "", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall"]; |
| 10129 |
const MacExpertEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclamsmall", "Hungarumlautsmall", "centoldstyle", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "", "threequartersemdash", "", "questionsmall", "", "", "", "", "Ethsmall", "", "", "onequarter", "onehalf", "threequarters", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "", "", "", "", "", "", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "", "parenrightinferior", "Circumflexsmall", "hypheninferior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "", "", "asuperior", "centsuperior", "", "", "", "", "Aacutesmall", "Agravesmall", "Acircumflexsmall", "Adieresissmall", "Atildesmall", "Aringsmall", "Ccedillasmall", "Eacutesmall", "Egravesmall", "Ecircumflexsmall", "Edieresissmall", "Iacutesmall", "Igravesmall", "Icircumflexsmall", "Idieresissmall", "Ntildesmall", "Oacutesmall", "Ogravesmall", "Ocircumflexsmall", "Odieresissmall", "Otildesmall", "Uacutesmall", "Ugravesmall", "Ucircumflexsmall", "Udieresissmall", "", "eightsuperior", "fourinferior", "threeinferior", "sixinferior", "eightinferior", "seveninferior", "Scaronsmall", "", "centinferior", "twoinferior", "", "Dieresissmall", "", "Caronsmall", "osuperior", "fiveinferior", "", "commainferior", "periodinferior", "Yacutesmall", "", "dollarinferior", "", "", "Thornsmall", "", "nineinferior", "zeroinferior", "Zcaronsmall", "AEsmall", "Oslashsmall", "questiondownsmall", "oneinferior", "Lslashsmall", "", "", "", "", "", "", "Cedillasmall", "", "", "", "", "", "OEsmall", "figuredash", "hyphensuperior", "", "", "", "", "exclamdownsmall", "", "Ydieresissmall", "", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "ninesuperior", "zerosuperior", "", "esuperior", "rsuperior", "tsuperior", "", "", "isuperior", "ssuperior", "dsuperior", "", "", "", "", "", "lsuperior", "Ogoneksmall", "Brevesmall", "Macronsmall", "bsuperior", "nsuperior", "msuperior", "commasuperior", "periodsuperior", "Dotaccentsmall", "Ringsmall", "", "", "", ""]; |
| 10130 |
const MacRomanEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "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", "space", "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"]; |
| 10131 |
const StandardEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "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", "quoteleft", "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", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "", "endash", "dagger", "daggerdbl", "periodcentered", "", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "", "questiondown", "", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "", "ring", "cedilla", "", "hungarumlaut", "ogonek", "caron", "emdash", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "AE", "", "ordfeminine", "", "", "", "", "Lslash", "Oslash", "OE", "ordmasculine", "", "", "", "", "", "ae", "", "", "", "dotlessi", "", "", "lslash", "oslash", "oe", "germandbls", "", "", "", ""]; |
| 10132 |
const WinAnsiEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "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", "bullet", "Euro", "bullet", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", "bullet", "Zcaron", "bullet", "bullet", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", "bullet", "zcaron", "Ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis"]; |
| 10133 |
const SymbolSetEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "universal", "numbersign", "existential", "percent", "ampersand", "suchthat", "parenleft", "parenright", "asteriskmath", "plus", "comma", "minus", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "congruent", "Alpha", "Beta", "Chi", "Delta", "Epsilon", "Phi", "Gamma", "Eta", "Iota", "theta1", "Kappa", "Lambda", "Mu", "Nu", "Omicron", "Pi", "Theta", "Rho", "Sigma", "Tau", "Upsilon", "sigma1", "Omega", "Xi", "Psi", "Zeta", "bracketleft", "therefore", "bracketright", "perpendicular", "underscore", "radicalex", "alpha", "beta", "chi", "delta", "epsilon", "phi", "gamma", "eta", "iota", "phi1", "kappa", "lambda", "mu", "nu", "omicron", "pi", "theta", "rho", "sigma", "tau", "upsilon", "omega1", "omega", "xi", "psi", "zeta", "braceleft", "bar", "braceright", "similar", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Euro", "Upsilon1", "minute", "lessequal", "fraction", "infinity", "florin", "club", "diamond", "heart", "spade", "arrowboth", "arrowleft", "arrowup", "arrowright", "arrowdown", "degree", "plusminus", "second", "greaterequal", "multiply", "proportional", "partialdiff", "bullet", "divide", "notequal", "equivalence", "approxequal", "ellipsis", "arrowvertex", "arrowhorizex", "carriagereturn", "aleph", "Ifraktur", "Rfraktur", "weierstrass", "circlemultiply", "circleplus", "emptyset", "intersection", "union", "propersuperset", "reflexsuperset", "notsubset", "propersubset", "reflexsubset", "element", "notelement", "angle", "gradient", "registerserif", "copyrightserif", "trademarkserif", "product", "radical", "dotmath", "logicalnot", "logicaland", "logicalor", "arrowdblboth", "arrowdblleft", "arrowdblup", "arrowdblright", "arrowdbldown", "lozenge", "angleleft", "registersans", "copyrightsans", "trademarksans", "summation", "parenlefttp", "parenleftex", "parenleftbt", "bracketlefttp", "bracketleftex", "bracketleftbt", "bracelefttp", "braceleftmid", "braceleftbt", "braceex", "", "angleright", "integral", "integraltp", "integralex", "integralbt", "parenrighttp", "parenrightex", "parenrightbt", "bracketrighttp", "bracketrightex", "bracketrightbt", "bracerighttp", "bracerightmid", "bracerightbt", ""]; |
| 10134 |
const ZapfDingbatsEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "a1", "a2", "a202", "a3", "a4", "a5", "a119", "a118", "a117", "a11", "a12", "a13", "a14", "a15", "a16", "a105", "a17", "a18", "a19", "a20", "a21", "a22", "a23", "a24", "a25", "a26", "a27", "a28", "a6", "a7", "a8", "a9", "a10", "a29", "a30", "a31", "a32", "a33", "a34", "a35", "a36", "a37", "a38", "a39", "a40", "a41", "a42", "a43", "a44", "a45", "a46", "a47", "a48", "a49", "a50", "a51", "a52", "a53", "a54", "a55", "a56", "a57", "a58", "a59", "a60", "a61", "a62", "a63", "a64", "a65", "a66", "a67", "a68", "a69", "a70", "a71", "a72", "a73", "a74", "a203", "a75", "a204", "a76", "a77", "a78", "a79", "a81", "a82", "a83", "a84", "a97", "a98", "a99", "a100", "", "a89", "a90", "a93", "a94", "a91", "a92", "a205", "a85", "a206", "a86", "a87", "a88", "a95", "a96", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "a101", "a102", "a103", "a104", "a106", "a107", "a108", "a112", "a111", "a110", "a109", "a120", "a121", "a122", "a123", "a124", "a125", "a126", "a127", "a128", "a129", "a130", "a131", "a132", "a133", "a134", "a135", "a136", "a137", "a138", "a139", "a140", "a141", "a142", "a143", "a144", "a145", "a146", "a147", "a148", "a149", "a150", "a151", "a152", "a153", "a154", "a155", "a156", "a157", "a158", "a159", "a160", "a161", "a163", "a164", "a196", "a165", "a192", "a166", "a167", "a168", "a169", "a170", "a171", "a172", "a173", "a162", "a174", "a175", "a176", "a177", "a178", "a179", "a193", "a180", "a199", "a181", "a200", "a182", "", "a201", "a183", "a184", "a197", "a185", "a194", "a198", "a186", "a195", "a187", "a188", "a189", "a190", "a191", ""]; |
| 10135 |
function getEncoding(encodingName) { |
| 10136 |
switch (encodingName) { |
| 10137 |
case "WinAnsiEncoding": |
| 10138 |
return WinAnsiEncoding; |
| 10139 |
case "StandardEncoding": |
| 10140 |
return StandardEncoding; |
| 10141 |
case "MacRomanEncoding": |
| 10142 |
return MacRomanEncoding; |
| 10143 |
case "SymbolSetEncoding": |
| 10144 |
return SymbolSetEncoding; |
| 10145 |
case "ZapfDingbatsEncoding": |
| 10146 |
return ZapfDingbatsEncoding; |
| 10147 |
case "ExpertEncoding": |
| 10148 |
return ExpertEncoding; |
| 10149 |
case "MacExpertEncoding": |
| 10150 |
return MacExpertEncoding; |
| 10151 |
default: |
| 10152 |
return null; |
| 10153 |
} |
| 10154 |
} |
| 10155 |
|
| 10156 |
;// ./src/core/cff_parser.js |
| 10157 |
|
| 10158 |
|
| 10159 |
|
| 10160 |
const MAX_SUBR_NESTING = 10; |
| 10161 |
const CFFStandardStrings = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "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", "quoteleft", "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", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", "001.000", "001.001", "001.002", "001.003", "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold"]; |
| 10162 |
const NUM_STANDARD_CFF_STRINGS = 391; |
| 10163 |
const CharstringValidationData = [null, { |
| 10164 |
id: "hstem", |
| 10165 |
min: 2, |
| 10166 |
stackClearing: true, |
| 10167 |
stem: true |
| 10168 |
}, null, { |
| 10169 |
id: "vstem", |
| 10170 |
min: 2, |
| 10171 |
stackClearing: true, |
| 10172 |
stem: true |
| 10173 |
}, { |
| 10174 |
id: "vmoveto", |
| 10175 |
min: 1, |
| 10176 |
stackClearing: true |
| 10177 |
}, { |
| 10178 |
id: "rlineto", |
| 10179 |
min: 2, |
| 10180 |
resetStack: true |
| 10181 |
}, { |
| 10182 |
id: "hlineto", |
| 10183 |
min: 1, |
| 10184 |
resetStack: true |
| 10185 |
}, { |
| 10186 |
id: "vlineto", |
| 10187 |
min: 1, |
| 10188 |
resetStack: true |
| 10189 |
}, { |
| 10190 |
id: "rrcurveto", |
| 10191 |
min: 6, |
| 10192 |
resetStack: true |
| 10193 |
}, null, { |
| 10194 |
id: "callsubr", |
| 10195 |
min: 1, |
| 10196 |
undefStack: true |
| 10197 |
}, { |
| 10198 |
id: "return", |
| 10199 |
min: 0, |
| 10200 |
undefStack: true |
| 10201 |
}, null, null, { |
| 10202 |
id: "endchar", |
| 10203 |
min: 0, |
| 10204 |
stackClearing: true |
| 10205 |
}, null, null, null, { |
| 10206 |
id: "hstemhm", |
| 10207 |
min: 2, |
| 10208 |
stackClearing: true, |
| 10209 |
stem: true |
| 10210 |
}, { |
| 10211 |
id: "hintmask", |
| 10212 |
min: 0, |
| 10213 |
stackClearing: true |
| 10214 |
}, { |
| 10215 |
id: "cntrmask", |
| 10216 |
min: 0, |
| 10217 |
stackClearing: true |
| 10218 |
}, { |
| 10219 |
id: "rmoveto", |
| 10220 |
min: 2, |
| 10221 |
stackClearing: true |
| 10222 |
}, { |
| 10223 |
id: "hmoveto", |
| 10224 |
min: 1, |
| 10225 |
stackClearing: true |
| 10226 |
}, { |
| 10227 |
id: "vstemhm", |
| 10228 |
min: 2, |
| 10229 |
stackClearing: true, |
| 10230 |
stem: true |
| 10231 |
}, { |
| 10232 |
id: "rcurveline", |
| 10233 |
min: 8, |
| 10234 |
resetStack: true |
| 10235 |
}, { |
| 10236 |
id: "rlinecurve", |
| 10237 |
min: 8, |
| 10238 |
resetStack: true |
| 10239 |
}, { |
| 10240 |
id: "vvcurveto", |
| 10241 |
min: 4, |
| 10242 |
resetStack: true |
| 10243 |
}, { |
| 10244 |
id: "hhcurveto", |
| 10245 |
min: 4, |
| 10246 |
resetStack: true |
| 10247 |
}, null, { |
| 10248 |
id: "callgsubr", |
| 10249 |
min: 1, |
| 10250 |
undefStack: true |
| 10251 |
}, { |
| 10252 |
id: "vhcurveto", |
| 10253 |
min: 4, |
| 10254 |
resetStack: true |
| 10255 |
}, { |
| 10256 |
id: "hvcurveto", |
| 10257 |
min: 4, |
| 10258 |
resetStack: true |
| 10259 |
}]; |
| 10260 |
const CharstringValidationData12 = [null, null, null, { |
| 10261 |
id: "and", |
| 10262 |
min: 2, |
| 10263 |
stackDelta: -1 |
| 10264 |
}, { |
| 10265 |
id: "or", |
| 10266 |
min: 2, |
| 10267 |
stackDelta: -1 |
| 10268 |
}, { |
| 10269 |
id: "not", |
| 10270 |
min: 1, |
| 10271 |
stackDelta: 0 |
| 10272 |
}, null, null, null, { |
| 10273 |
id: "abs", |
| 10274 |
min: 1, |
| 10275 |
stackDelta: 0 |
| 10276 |
}, { |
| 10277 |
id: "add", |
| 10278 |
min: 2, |
| 10279 |
stackDelta: -1, |
| 10280 |
stackFn(stack, index) { |
| 10281 |
stack[index - 2] = stack[index - 2] + stack[index - 1]; |
| 10282 |
} |
| 10283 |
}, { |
| 10284 |
id: "sub", |
| 10285 |
min: 2, |
| 10286 |
stackDelta: -1, |
| 10287 |
stackFn(stack, index) { |
| 10288 |
stack[index - 2] = stack[index - 2] - stack[index - 1]; |
| 10289 |
} |
| 10290 |
}, { |
| 10291 |
id: "div", |
| 10292 |
min: 2, |
| 10293 |
stackDelta: -1, |
| 10294 |
stackFn(stack, index) { |
| 10295 |
stack[index - 2] = stack[index - 2] / stack[index - 1]; |
| 10296 |
} |
| 10297 |
}, null, { |
| 10298 |
id: "neg", |
| 10299 |
min: 1, |
| 10300 |
stackDelta: 0, |
| 10301 |
stackFn(stack, index) { |
| 10302 |
stack[index - 1] = -stack[index - 1]; |
| 10303 |
} |
| 10304 |
}, { |
| 10305 |
id: "eq", |
| 10306 |
min: 2, |
| 10307 |
stackDelta: -1 |
| 10308 |
}, null, null, { |
| 10309 |
id: "drop", |
| 10310 |
min: 1, |
| 10311 |
stackDelta: -1 |
| 10312 |
}, null, { |
| 10313 |
id: "put", |
| 10314 |
min: 2, |
| 10315 |
stackDelta: -2 |
| 10316 |
}, { |
| 10317 |
id: "get", |
| 10318 |
min: 1, |
| 10319 |
stackDelta: 0 |
| 10320 |
}, { |
| 10321 |
id: "ifelse", |
| 10322 |
min: 4, |
| 10323 |
stackDelta: -3 |
| 10324 |
}, { |
| 10325 |
id: "random", |
| 10326 |
min: 0, |
| 10327 |
stackDelta: 1 |
| 10328 |
}, { |
| 10329 |
id: "mul", |
| 10330 |
min: 2, |
| 10331 |
stackDelta: -1, |
| 10332 |
stackFn(stack, index) { |
| 10333 |
stack[index - 2] = stack[index - 2] * stack[index - 1]; |
| 10334 |
} |
| 10335 |
}, null, { |
| 10336 |
id: "sqrt", |
| 10337 |
min: 1, |
| 10338 |
stackDelta: 0 |
| 10339 |
}, { |
| 10340 |
id: "dup", |
| 10341 |
min: 1, |
| 10342 |
stackDelta: 1 |
| 10343 |
}, { |
| 10344 |
id: "exch", |
| 10345 |
min: 2, |
| 10346 |
stackDelta: 0 |
| 10347 |
}, { |
| 10348 |
id: "index", |
| 10349 |
min: 2, |
| 10350 |
stackDelta: 0 |
| 10351 |
}, { |
| 10352 |
id: "roll", |
| 10353 |
min: 3, |
| 10354 |
stackDelta: -2 |
| 10355 |
}, null, null, null, { |
| 10356 |
id: "hflex", |
| 10357 |
min: 7, |
| 10358 |
resetStack: true |
| 10359 |
}, { |
| 10360 |
id: "flex", |
| 10361 |
min: 13, |
| 10362 |
resetStack: true |
| 10363 |
}, { |
| 10364 |
id: "hflex1", |
| 10365 |
min: 9, |
| 10366 |
resetStack: true |
| 10367 |
}, { |
| 10368 |
id: "flex1", |
| 10369 |
min: 11, |
| 10370 |
resetStack: true |
| 10371 |
}]; |
| 10372 |
class CFFParser { |
| 10373 |
constructor(file, properties, seacAnalysisEnabled) { |
| 10374 |
this.bytes = file.getBytes(); |
| 10375 |
this.properties = properties; |
| 10376 |
this.seacAnalysisEnabled = !!seacAnalysisEnabled; |
| 10377 |
} |
| 10378 |
parse() { |
| 10379 |
const properties = this.properties; |
| 10380 |
const cff = new CFF(); |
| 10381 |
this.cff = cff; |
| 10382 |
const header = this.parseHeader(); |
| 10383 |
const nameIndex = this.parseIndex(header.endPos); |
| 10384 |
const topDictIndex = this.parseIndex(nameIndex.endPos); |
| 10385 |
const stringIndex = this.parseIndex(topDictIndex.endPos); |
| 10386 |
const globalSubrIndex = this.parseIndex(stringIndex.endPos); |
| 10387 |
const topDictParsed = this.parseDict(topDictIndex.obj.get(0)); |
| 10388 |
const topDict = this.createDict(CFFTopDict, topDictParsed, cff.strings); |
| 10389 |
cff.header = header.obj; |
| 10390 |
cff.names = this.parseNameIndex(nameIndex.obj); |
| 10391 |
cff.strings = this.parseStringIndex(stringIndex.obj); |
| 10392 |
cff.topDict = topDict; |
| 10393 |
cff.globalSubrIndex = globalSubrIndex.obj; |
| 10394 |
this.parsePrivateDict(cff.topDict); |
| 10395 |
cff.isCIDFont = topDict.hasName("ROS"); |
| 10396 |
const charStringOffset = topDict.getByName("CharStrings"); |
| 10397 |
const charStringIndex = this.parseIndex(charStringOffset).obj; |
| 10398 |
const fontMatrix = topDict.getByName("FontMatrix"); |
| 10399 |
if (fontMatrix) { |
| 10400 |
properties.fontMatrix = fontMatrix; |
| 10401 |
} |
| 10402 |
const fontBBox = topDict.getByName("FontBBox"); |
| 10403 |
if (fontBBox) { |
| 10404 |
properties.ascent = Math.max(fontBBox[3], fontBBox[1]); |
| 10405 |
properties.descent = Math.min(fontBBox[1], fontBBox[3]); |
| 10406 |
properties.ascentScaled = true; |
| 10407 |
} |
| 10408 |
let charset, encoding; |
| 10409 |
if (cff.isCIDFont) { |
| 10410 |
const fdArrayIndex = this.parseIndex(topDict.getByName("FDArray")).obj; |
| 10411 |
for (let i = 0, ii = fdArrayIndex.count; i < ii; ++i) { |
| 10412 |
const dictRaw = fdArrayIndex.get(i); |
| 10413 |
const fontDict = this.createDict(CFFTopDict, this.parseDict(dictRaw), cff.strings); |
| 10414 |
this.parsePrivateDict(fontDict); |
| 10415 |
cff.fdArray.push(fontDict); |
| 10416 |
} |
| 10417 |
encoding = null; |
| 10418 |
charset = this.parseCharsets(topDict.getByName("charset"), charStringIndex.count, cff.strings, true); |
| 10419 |
cff.fdSelect = this.parseFDSelect(topDict.getByName("FDSelect"), charStringIndex.count); |
| 10420 |
} else { |
| 10421 |
charset = this.parseCharsets(topDict.getByName("charset"), charStringIndex.count, cff.strings, false); |
| 10422 |
encoding = this.parseEncoding(topDict.getByName("Encoding"), properties, cff.strings, charset.charset); |
| 10423 |
} |
| 10424 |
cff.charset = charset; |
| 10425 |
cff.encoding = encoding; |
| 10426 |
const charStringsAndSeacs = this.parseCharStrings({ |
| 10427 |
charStrings: charStringIndex, |
| 10428 |
localSubrIndex: topDict.privateDict.subrsIndex, |
| 10429 |
globalSubrIndex: globalSubrIndex.obj, |
| 10430 |
fdSelect: cff.fdSelect, |
| 10431 |
fdArray: cff.fdArray, |
| 10432 |
privateDict: topDict.privateDict |
| 10433 |
}); |
| 10434 |
cff.charStrings = charStringsAndSeacs.charStrings; |
| 10435 |
cff.seacs = charStringsAndSeacs.seacs; |
| 10436 |
cff.widths = charStringsAndSeacs.widths; |
| 10437 |
return cff; |
| 10438 |
} |
| 10439 |
parseHeader() { |
| 10440 |
let bytes = this.bytes; |
| 10441 |
const bytesLength = bytes.length; |
| 10442 |
let offset = 0; |
| 10443 |
while (offset < bytesLength && bytes[offset] !== 1) { |
| 10444 |
++offset; |
| 10445 |
} |
| 10446 |
if (offset >= bytesLength) { |
| 10447 |
throw new FormatError("Invalid CFF header"); |
| 10448 |
} |
| 10449 |
if (offset !== 0) { |
| 10450 |
info("cff data is shifted"); |
| 10451 |
bytes = bytes.subarray(offset); |
| 10452 |
this.bytes = bytes; |
| 10453 |
} |
| 10454 |
const major = bytes[0]; |
| 10455 |
const minor = bytes[1]; |
| 10456 |
const hdrSize = bytes[2]; |
| 10457 |
const offSize = bytes[3]; |
| 10458 |
const header = new CFFHeader(major, minor, hdrSize, offSize); |
| 10459 |
return { |
| 10460 |
obj: header, |
| 10461 |
endPos: hdrSize |
| 10462 |
}; |
| 10463 |
} |
| 10464 |
parseDict(dict) { |
| 10465 |
let pos = 0; |
| 10466 |
function parseOperand() { |
| 10467 |
let value = dict[pos++]; |
| 10468 |
if (value === 30) { |
| 10469 |
return parseFloatOperand(); |
| 10470 |
} else if (value === 28) { |
| 10471 |
value = dict[pos++]; |
| 10472 |
value = (value << 24 | dict[pos++] << 16) >> 16; |
| 10473 |
return value; |
| 10474 |
} else if (value === 29) { |
| 10475 |
value = dict[pos++]; |
| 10476 |
value = value << 8 | dict[pos++]; |
| 10477 |
value = value << 8 | dict[pos++]; |
| 10478 |
value = value << 8 | dict[pos++]; |
| 10479 |
return value; |
| 10480 |
} else if (value >= 32 && value <= 246) { |
| 10481 |
return value - 139; |
| 10482 |
} else if (value >= 247 && value <= 250) { |
| 10483 |
return (value - 247) * 256 + dict[pos++] + 108; |
| 10484 |
} else if (value >= 251 && value <= 254) { |
| 10485 |
return -((value - 251) * 256) - dict[pos++] - 108; |
| 10486 |
} |
| 10487 |
warn('CFFParser_parseDict: "' + value + '" is a reserved command.'); |
| 10488 |
return NaN; |
| 10489 |
} |
| 10490 |
function parseFloatOperand() { |
| 10491 |
let str = ""; |
| 10492 |
const eof = 15; |
| 10493 |
const lookup = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "E", "E-", null, "-"]; |
| 10494 |
const length = dict.length; |
| 10495 |
while (pos < length) { |
| 10496 |
const b = dict[pos++]; |
| 10497 |
const b1 = b >> 4; |
| 10498 |
const b2 = b & 15; |
| 10499 |
if (b1 === eof) { |
| 10500 |
break; |
| 10501 |
} |
| 10502 |
str += lookup[b1]; |
| 10503 |
if (b2 === eof) { |
| 10504 |
break; |
| 10505 |
} |
| 10506 |
str += lookup[b2]; |
| 10507 |
} |
| 10508 |
return parseFloat(str); |
| 10509 |
} |
| 10510 |
let operands = []; |
| 10511 |
const entries = []; |
| 10512 |
pos = 0; |
| 10513 |
const end = dict.length; |
| 10514 |
while (pos < end) { |
| 10515 |
let b = dict[pos]; |
| 10516 |
if (b <= 21) { |
| 10517 |
if (b === 12) { |
| 10518 |
b = b << 8 | dict[++pos]; |
| 10519 |
} |
| 10520 |
entries.push([b, operands]); |
| 10521 |
operands = []; |
| 10522 |
++pos; |
| 10523 |
} else { |
| 10524 |
operands.push(parseOperand()); |
| 10525 |
} |
| 10526 |
} |
| 10527 |
return entries; |
| 10528 |
} |
| 10529 |
parseIndex(pos) { |
| 10530 |
const cffIndex = new CFFIndex(); |
| 10531 |
const bytes = this.bytes; |
| 10532 |
const count = bytes[pos++] << 8 | bytes[pos++]; |
| 10533 |
const offsets = []; |
| 10534 |
let end = pos; |
| 10535 |
let i, ii; |
| 10536 |
if (count !== 0) { |
| 10537 |
const offsetSize = bytes[pos++]; |
| 10538 |
const startPos = pos + (count + 1) * offsetSize - 1; |
| 10539 |
for (i = 0, ii = count + 1; i < ii; ++i) { |
| 10540 |
let offset = 0; |
| 10541 |
for (let j = 0; j < offsetSize; ++j) { |
| 10542 |
offset <<= 8; |
| 10543 |
offset += bytes[pos++]; |
| 10544 |
} |
| 10545 |
offsets.push(startPos + offset); |
| 10546 |
} |
| 10547 |
end = offsets[count]; |
| 10548 |
} |
| 10549 |
for (i = 0, ii = offsets.length - 1; i < ii; ++i) { |
| 10550 |
const offsetStart = offsets[i]; |
| 10551 |
const offsetEnd = offsets[i + 1]; |
| 10552 |
cffIndex.add(bytes.subarray(offsetStart, offsetEnd)); |
| 10553 |
} |
| 10554 |
return { |
| 10555 |
obj: cffIndex, |
| 10556 |
endPos: end |
| 10557 |
}; |
| 10558 |
} |
| 10559 |
parseNameIndex(index) { |
| 10560 |
const names = []; |
| 10561 |
for (let i = 0, ii = index.count; i < ii; ++i) { |
| 10562 |
const name = index.get(i); |
| 10563 |
names.push(bytesToString(name)); |
| 10564 |
} |
| 10565 |
return names; |
| 10566 |
} |
| 10567 |
parseStringIndex(index) { |
| 10568 |
const strings = new CFFStrings(); |
| 10569 |
for (let i = 0, ii = index.count; i < ii; ++i) { |
| 10570 |
const data = index.get(i); |
| 10571 |
strings.add(bytesToString(data)); |
| 10572 |
} |
| 10573 |
return strings; |
| 10574 |
} |
| 10575 |
createDict(Type, dict, strings) { |
| 10576 |
const cffDict = new Type(strings); |
| 10577 |
for (const [key, value] of dict) { |
| 10578 |
cffDict.setByKey(key, value); |
| 10579 |
} |
| 10580 |
return cffDict; |
| 10581 |
} |
| 10582 |
parseCharString(state, data, localSubrIndex, globalSubrIndex) { |
| 10583 |
if (!data || state.callDepth > MAX_SUBR_NESTING) { |
| 10584 |
return false; |
| 10585 |
} |
| 10586 |
let stackSize = state.stackSize; |
| 10587 |
const stack = state.stack; |
| 10588 |
let length = data.length; |
| 10589 |
for (let j = 0; j < length;) { |
| 10590 |
const value = data[j++]; |
| 10591 |
let validationCommand = null; |
| 10592 |
if (value === 12) { |
| 10593 |
const q = data[j++]; |
| 10594 |
if (q === 0) { |
| 10595 |
data[j - 2] = 139; |
| 10596 |
data[j - 1] = 22; |
| 10597 |
stackSize = 0; |
| 10598 |
} else { |
| 10599 |
validationCommand = CharstringValidationData12[q]; |
| 10600 |
} |
| 10601 |
} else if (value === 28) { |
| 10602 |
stack[stackSize] = (data[j] << 24 | data[j + 1] << 16) >> 16; |
| 10603 |
j += 2; |
| 10604 |
stackSize++; |
| 10605 |
} else if (value === 14) { |
| 10606 |
if (stackSize >= 4) { |
| 10607 |
stackSize -= 4; |
| 10608 |
if (this.seacAnalysisEnabled) { |
| 10609 |
state.seac = stack.slice(stackSize, stackSize + 4); |
| 10610 |
return false; |
| 10611 |
} |
| 10612 |
} |
| 10613 |
validationCommand = CharstringValidationData[value]; |
| 10614 |
} else if (value >= 32 && value <= 246) { |
| 10615 |
stack[stackSize] = value - 139; |
| 10616 |
stackSize++; |
| 10617 |
} else if (value >= 247 && value <= 254) { |
| 10618 |
stack[stackSize] = value < 251 ? (value - 247 << 8) + data[j] + 108 : -(value - 251 << 8) - data[j] - 108; |
| 10619 |
j++; |
| 10620 |
stackSize++; |
| 10621 |
} else if (value === 255) { |
| 10622 |
stack[stackSize] = (data[j] << 24 | data[j + 1] << 16 | data[j + 2] << 8 | data[j + 3]) / 65536; |
| 10623 |
j += 4; |
| 10624 |
stackSize++; |
| 10625 |
} else if (value === 19 || value === 20) { |
| 10626 |
state.hints += stackSize >> 1; |
| 10627 |
if (state.hints === 0) { |
| 10628 |
data.copyWithin(j - 1, j, -1); |
| 10629 |
j -= 1; |
| 10630 |
length -= 1; |
| 10631 |
continue; |
| 10632 |
} |
| 10633 |
j += state.hints + 7 >> 3; |
| 10634 |
stackSize %= 2; |
| 10635 |
validationCommand = CharstringValidationData[value]; |
| 10636 |
} else if (value === 10 || value === 29) { |
| 10637 |
const subrsIndex = value === 10 ? localSubrIndex : globalSubrIndex; |
| 10638 |
if (!subrsIndex) { |
| 10639 |
validationCommand = CharstringValidationData[value]; |
| 10640 |
warn("Missing subrsIndex for " + validationCommand.id); |
| 10641 |
return false; |
| 10642 |
} |
| 10643 |
let bias = 32768; |
| 10644 |
if (subrsIndex.count < 1240) { |
| 10645 |
bias = 107; |
| 10646 |
} else if (subrsIndex.count < 33900) { |
| 10647 |
bias = 1131; |
| 10648 |
} |
| 10649 |
const subrNumber = stack[--stackSize] + bias; |
| 10650 |
if (subrNumber < 0 || subrNumber >= subrsIndex.count || isNaN(subrNumber)) { |
| 10651 |
validationCommand = CharstringValidationData[value]; |
| 10652 |
warn("Out of bounds subrIndex for " + validationCommand.id); |
| 10653 |
return false; |
| 10654 |
} |
| 10655 |
state.stackSize = stackSize; |
| 10656 |
state.callDepth++; |
| 10657 |
const valid = this.parseCharString(state, subrsIndex.get(subrNumber), localSubrIndex, globalSubrIndex); |
| 10658 |
if (!valid) { |
| 10659 |
return false; |
| 10660 |
} |
| 10661 |
state.callDepth--; |
| 10662 |
stackSize = state.stackSize; |
| 10663 |
continue; |
| 10664 |
} else if (value === 11) { |
| 10665 |
state.stackSize = stackSize; |
| 10666 |
return true; |
| 10667 |
} else if (value === 0 && j === data.length) { |
| 10668 |
data[j - 1] = 14; |
| 10669 |
validationCommand = CharstringValidationData[14]; |
| 10670 |
} else if (value === 9) { |
| 10671 |
data.copyWithin(j - 1, j, -1); |
| 10672 |
j -= 1; |
| 10673 |
length -= 1; |
| 10674 |
continue; |
| 10675 |
} else { |
| 10676 |
validationCommand = CharstringValidationData[value]; |
| 10677 |
} |
| 10678 |
if (validationCommand) { |
| 10679 |
if (validationCommand.stem) { |
| 10680 |
state.hints += stackSize >> 1; |
| 10681 |
if (value === 3 || value === 23) { |
| 10682 |
state.hasVStems = true; |
| 10683 |
} else if (state.hasVStems && (value === 1 || value === 18)) { |
| 10684 |
warn("CFF stem hints are in wrong order"); |
| 10685 |
data[j - 1] = value === 1 ? 3 : 23; |
| 10686 |
} |
| 10687 |
} |
| 10688 |
if ("min" in validationCommand) { |
| 10689 |
if (!state.undefStack && stackSize < validationCommand.min) { |
| 10690 |
warn("Not enough parameters for " + validationCommand.id + "; actual: " + stackSize + ", expected: " + validationCommand.min); |
| 10691 |
if (stackSize === 0) { |
| 10692 |
data[j - 1] = 14; |
| 10693 |
return true; |
| 10694 |
} |
| 10695 |
return false; |
| 10696 |
} |
| 10697 |
} |
| 10698 |
if (state.firstStackClearing && validationCommand.stackClearing) { |
| 10699 |
state.firstStackClearing = false; |
| 10700 |
stackSize -= validationCommand.min; |
| 10701 |
if (stackSize >= 2 && validationCommand.stem) { |
| 10702 |
stackSize %= 2; |
| 10703 |
} else if (stackSize > 1) { |
| 10704 |
warn("Found too many parameters for stack-clearing command"); |
| 10705 |
} |
| 10706 |
if (stackSize > 0) { |
| 10707 |
state.width = stack[stackSize - 1]; |
| 10708 |
} |
| 10709 |
} |
| 10710 |
if ("stackDelta" in validationCommand) { |
| 10711 |
if ("stackFn" in validationCommand) { |
| 10712 |
validationCommand.stackFn(stack, stackSize); |
| 10713 |
} |
| 10714 |
stackSize += validationCommand.stackDelta; |
| 10715 |
} else if (validationCommand.stackClearing) { |
| 10716 |
stackSize = 0; |
| 10717 |
} else if (validationCommand.resetStack) { |
| 10718 |
stackSize = 0; |
| 10719 |
state.undefStack = false; |
| 10720 |
} else if (validationCommand.undefStack) { |
| 10721 |
stackSize = 0; |
| 10722 |
state.undefStack = true; |
| 10723 |
state.firstStackClearing = false; |
| 10724 |
} |
| 10725 |
} |
| 10726 |
} |
| 10727 |
if (length < data.length) { |
| 10728 |
data.fill(14, length); |
| 10729 |
} |
| 10730 |
state.stackSize = stackSize; |
| 10731 |
return true; |
| 10732 |
} |
| 10733 |
parseCharStrings({ |
| 10734 |
charStrings, |
| 10735 |
localSubrIndex, |
| 10736 |
globalSubrIndex, |
| 10737 |
fdSelect, |
| 10738 |
fdArray, |
| 10739 |
privateDict |
| 10740 |
}) { |
| 10741 |
const seacs = []; |
| 10742 |
const widths = []; |
| 10743 |
const count = charStrings.count; |
| 10744 |
for (let i = 0; i < count; i++) { |
| 10745 |
const charstring = charStrings.get(i); |
| 10746 |
const state = { |
| 10747 |
callDepth: 0, |
| 10748 |
stackSize: 0, |
| 10749 |
stack: [], |
| 10750 |
undefStack: true, |
| 10751 |
hints: 0, |
| 10752 |
firstStackClearing: true, |
| 10753 |
seac: null, |
| 10754 |
width: null, |
| 10755 |
hasVStems: false |
| 10756 |
}; |
| 10757 |
let valid = true; |
| 10758 |
let localSubrToUse = null; |
| 10759 |
let privateDictToUse = privateDict; |
| 10760 |
if (fdSelect && fdArray.length) { |
| 10761 |
const fdIndex = fdSelect.getFDIndex(i); |
| 10762 |
if (fdIndex === -1) { |
| 10763 |
warn("Glyph index is not in fd select."); |
| 10764 |
valid = false; |
| 10765 |
} |
| 10766 |
if (fdIndex >= fdArray.length) { |
| 10767 |
warn("Invalid fd index for glyph index."); |
| 10768 |
valid = false; |
| 10769 |
} |
| 10770 |
if (valid) { |
| 10771 |
privateDictToUse = fdArray[fdIndex].privateDict; |
| 10772 |
localSubrToUse = privateDictToUse.subrsIndex; |
| 10773 |
} |
| 10774 |
} else if (localSubrIndex) { |
| 10775 |
localSubrToUse = localSubrIndex; |
| 10776 |
} |
| 10777 |
if (valid) { |
| 10778 |
valid = this.parseCharString(state, charstring, localSubrToUse, globalSubrIndex); |
| 10779 |
} |
| 10780 |
if (state.width !== null) { |
| 10781 |
const nominalWidth = privateDictToUse.getByName("nominalWidthX"); |
| 10782 |
widths[i] = nominalWidth + state.width; |
| 10783 |
} else { |
| 10784 |
const defaultWidth = privateDictToUse.getByName("defaultWidthX"); |
| 10785 |
widths[i] = defaultWidth; |
| 10786 |
} |
| 10787 |
if (state.seac !== null) { |
| 10788 |
seacs[i] = state.seac; |
| 10789 |
} |
| 10790 |
if (!valid) { |
| 10791 |
charStrings.set(i, new Uint8Array([14])); |
| 10792 |
} |
| 10793 |
} |
| 10794 |
return { |
| 10795 |
charStrings, |
| 10796 |
seacs, |
| 10797 |
widths |
| 10798 |
}; |
| 10799 |
} |
| 10800 |
emptyPrivateDictionary(parentDict) { |
| 10801 |
const privateDict = this.createDict(CFFPrivateDict, [], parentDict.strings); |
| 10802 |
parentDict.setByKey(18, [0, 0]); |
| 10803 |
parentDict.privateDict = privateDict; |
| 10804 |
} |
| 10805 |
parsePrivateDict(parentDict) { |
| 10806 |
if (!parentDict.hasName("Private")) { |
| 10807 |
this.emptyPrivateDictionary(parentDict); |
| 10808 |
return; |
| 10809 |
} |
| 10810 |
const privateOffset = parentDict.getByName("Private"); |
| 10811 |
if (!Array.isArray(privateOffset) || privateOffset.length !== 2) { |
| 10812 |
parentDict.removeByName("Private"); |
| 10813 |
return; |
| 10814 |
} |
| 10815 |
const size = privateOffset[0]; |
| 10816 |
const offset = privateOffset[1]; |
| 10817 |
if (size === 0 || offset >= this.bytes.length) { |
| 10818 |
this.emptyPrivateDictionary(parentDict); |
| 10819 |
return; |
| 10820 |
} |
| 10821 |
const privateDictEnd = offset + size; |
| 10822 |
const dictData = this.bytes.subarray(offset, privateDictEnd); |
| 10823 |
const dict = this.parseDict(dictData); |
| 10824 |
const privateDict = this.createDict(CFFPrivateDict, dict, parentDict.strings); |
| 10825 |
parentDict.privateDict = privateDict; |
| 10826 |
if (privateDict.getByName("ExpansionFactor") === 0) { |
| 10827 |
privateDict.setByName("ExpansionFactor", 0.06); |
| 10828 |
} |
| 10829 |
if (!privateDict.getByName("Subrs")) { |
| 10830 |
return; |
| 10831 |
} |
| 10832 |
const subrsOffset = privateDict.getByName("Subrs"); |
| 10833 |
const relativeOffset = offset + subrsOffset; |
| 10834 |
if (subrsOffset === 0 || relativeOffset >= this.bytes.length) { |
| 10835 |
this.emptyPrivateDictionary(parentDict); |
| 10836 |
return; |
| 10837 |
} |
| 10838 |
const subrsIndex = this.parseIndex(relativeOffset); |
| 10839 |
privateDict.subrsIndex = subrsIndex.obj; |
| 10840 |
} |
| 10841 |
parseCharsets(pos, length, strings, cid) { |
| 10842 |
if (pos === 0) { |
| 10843 |
return new CFFCharset(true, CFFCharsetPredefinedTypes.ISO_ADOBE, ISOAdobeCharset); |
| 10844 |
} else if (pos === 1) { |
| 10845 |
return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT, ExpertCharset); |
| 10846 |
} else if (pos === 2) { |
| 10847 |
return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT_SUBSET, ExpertSubsetCharset); |
| 10848 |
} |
| 10849 |
const bytes = this.bytes; |
| 10850 |
const start = pos; |
| 10851 |
const format = bytes[pos++]; |
| 10852 |
const charset = [cid ? 0 : ".notdef"]; |
| 10853 |
let id, count, i; |
| 10854 |
length -= 1; |
| 10855 |
switch (format) { |
| 10856 |
case 0: |
| 10857 |
for (i = 0; i < length; i++) { |
| 10858 |
id = bytes[pos++] << 8 | bytes[pos++]; |
| 10859 |
charset.push(cid ? id : strings.get(id)); |
| 10860 |
} |
| 10861 |
break; |
| 10862 |
case 1: |
| 10863 |
while (charset.length <= length) { |
| 10864 |
id = bytes[pos++] << 8 | bytes[pos++]; |
| 10865 |
count = bytes[pos++]; |
| 10866 |
for (i = 0; i <= count; i++) { |
| 10867 |
charset.push(cid ? id++ : strings.get(id++)); |
| 10868 |
} |
| 10869 |
} |
| 10870 |
break; |
| 10871 |
case 2: |
| 10872 |
while (charset.length <= length) { |
| 10873 |
id = bytes[pos++] << 8 | bytes[pos++]; |
| 10874 |
count = bytes[pos++] << 8 | bytes[pos++]; |
| 10875 |
for (i = 0; i <= count; i++) { |
| 10876 |
charset.push(cid ? id++ : strings.get(id++)); |
| 10877 |
} |
| 10878 |
} |
| 10879 |
break; |
| 10880 |
default: |
| 10881 |
throw new FormatError("Unknown charset format"); |
| 10882 |
} |
| 10883 |
const end = pos; |
| 10884 |
const raw = bytes.subarray(start, end); |
| 10885 |
return new CFFCharset(false, format, charset, raw); |
| 10886 |
} |
| 10887 |
parseEncoding(pos, properties, strings, charset) { |
| 10888 |
const encoding = Object.create(null); |
| 10889 |
const bytes = this.bytes; |
| 10890 |
let predefined = false; |
| 10891 |
let format, i, ii; |
| 10892 |
let raw = null; |
| 10893 |
function readSupplement() { |
| 10894 |
const supplementsCount = bytes[pos++]; |
| 10895 |
for (i = 0; i < supplementsCount; i++) { |
| 10896 |
const code = bytes[pos++]; |
| 10897 |
const sid = (bytes[pos++] << 8) + (bytes[pos++] & 0xff); |
| 10898 |
encoding[code] = charset.indexOf(strings.get(sid)); |
| 10899 |
} |
| 10900 |
} |
| 10901 |
if (pos === 0 || pos === 1) { |
| 10902 |
predefined = true; |
| 10903 |
format = pos; |
| 10904 |
const baseEncoding = pos ? ExpertEncoding : StandardEncoding; |
| 10905 |
for (i = 0, ii = charset.length; i < ii; i++) { |
| 10906 |
const index = baseEncoding.indexOf(charset[i]); |
| 10907 |
if (index !== -1) { |
| 10908 |
encoding[index] = i; |
| 10909 |
} |
| 10910 |
} |
| 10911 |
} else { |
| 10912 |
const dataStart = pos; |
| 10913 |
format = bytes[pos++]; |
| 10914 |
switch (format & 0x7f) { |
| 10915 |
case 0: |
| 10916 |
const glyphsCount = bytes[pos++]; |
| 10917 |
for (i = 1; i <= glyphsCount; i++) { |
| 10918 |
encoding[bytes[pos++]] = i; |
| 10919 |
} |
| 10920 |
break; |
| 10921 |
case 1: |
| 10922 |
const rangesCount = bytes[pos++]; |
| 10923 |
let gid = 1; |
| 10924 |
for (i = 0; i < rangesCount; i++) { |
| 10925 |
const start = bytes[pos++]; |
| 10926 |
const left = bytes[pos++]; |
| 10927 |
for (let j = start; j <= start + left; j++) { |
| 10928 |
encoding[j] = gid++; |
| 10929 |
} |
| 10930 |
} |
| 10931 |
break; |
| 10932 |
default: |
| 10933 |
throw new FormatError(`Unknown encoding format: ${format} in CFF`); |
| 10934 |
} |
| 10935 |
const dataEnd = pos; |
| 10936 |
if (format & 0x80) { |
| 10937 |
bytes[dataStart] &= 0x7f; |
| 10938 |
readSupplement(); |
| 10939 |
} |
| 10940 |
raw = bytes.subarray(dataStart, dataEnd); |
| 10941 |
} |
| 10942 |
format &= 0x7f; |
| 10943 |
return new CFFEncoding(predefined, format, encoding, raw); |
| 10944 |
} |
| 10945 |
parseFDSelect(pos, length) { |
| 10946 |
const bytes = this.bytes; |
| 10947 |
const format = bytes[pos++]; |
| 10948 |
const fdSelect = []; |
| 10949 |
let i; |
| 10950 |
switch (format) { |
| 10951 |
case 0: |
| 10952 |
for (i = 0; i < length; ++i) { |
| 10953 |
const id = bytes[pos++]; |
| 10954 |
fdSelect.push(id); |
| 10955 |
} |
| 10956 |
break; |
| 10957 |
case 3: |
| 10958 |
const rangesCount = bytes[pos++] << 8 | bytes[pos++]; |
| 10959 |
for (i = 0; i < rangesCount; ++i) { |
| 10960 |
let first = bytes[pos++] << 8 | bytes[pos++]; |
| 10961 |
if (i === 0 && first !== 0) { |
| 10962 |
warn("parseFDSelect: The first range must have a first GID of 0" + " -- trying to recover."); |
| 10963 |
first = 0; |
| 10964 |
} |
| 10965 |
const fdIndex = bytes[pos++]; |
| 10966 |
const next = bytes[pos] << 8 | bytes[pos + 1]; |
| 10967 |
for (let j = first; j < next; ++j) { |
| 10968 |
fdSelect.push(fdIndex); |
| 10969 |
} |
| 10970 |
} |
| 10971 |
pos += 2; |
| 10972 |
break; |
| 10973 |
default: |
| 10974 |
throw new FormatError(`parseFDSelect: Unknown format "${format}".`); |
| 10975 |
} |
| 10976 |
if (fdSelect.length !== length) { |
| 10977 |
throw new FormatError("parseFDSelect: Invalid font data."); |
| 10978 |
} |
| 10979 |
return new CFFFDSelect(format, fdSelect); |
| 10980 |
} |
| 10981 |
} |
| 10982 |
class CFF { |
| 10983 |
constructor() { |
| 10984 |
this.header = null; |
| 10985 |
this.names = []; |
| 10986 |
this.topDict = null; |
| 10987 |
this.strings = new CFFStrings(); |
| 10988 |
this.globalSubrIndex = null; |
| 10989 |
this.encoding = null; |
| 10990 |
this.charset = null; |
| 10991 |
this.charStrings = null; |
| 10992 |
this.fdArray = []; |
| 10993 |
this.fdSelect = null; |
| 10994 |
this.isCIDFont = false; |
| 10995 |
} |
| 10996 |
duplicateFirstGlyph() { |
| 10997 |
if (this.charStrings.count >= 65535) { |
| 10998 |
warn("Not enough space in charstrings to duplicate first glyph."); |
| 10999 |
return; |
| 11000 |
} |
| 11001 |
const glyphZero = this.charStrings.get(0); |
| 11002 |
this.charStrings.add(glyphZero); |
| 11003 |
if (this.isCIDFont) { |
| 11004 |
this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]); |
| 11005 |
} |
| 11006 |
} |
| 11007 |
hasGlyphId(id) { |
| 11008 |
if (id < 0 || id >= this.charStrings.count) { |
| 11009 |
return false; |
| 11010 |
} |
| 11011 |
const glyph = this.charStrings.get(id); |
| 11012 |
return glyph.length > 0; |
| 11013 |
} |
| 11014 |
} |
| 11015 |
class CFFHeader { |
| 11016 |
constructor(major, minor, hdrSize, offSize) { |
| 11017 |
this.major = major; |
| 11018 |
this.minor = minor; |
| 11019 |
this.hdrSize = hdrSize; |
| 11020 |
this.offSize = offSize; |
| 11021 |
} |
| 11022 |
} |
| 11023 |
class CFFStrings { |
| 11024 |
constructor() { |
| 11025 |
this.strings = []; |
| 11026 |
} |
| 11027 |
get(index) { |
| 11028 |
if (index >= 0 && index <= NUM_STANDARD_CFF_STRINGS - 1) { |
| 11029 |
return CFFStandardStrings[index]; |
| 11030 |
} |
| 11031 |
if (index - NUM_STANDARD_CFF_STRINGS <= this.strings.length) { |
| 11032 |
return this.strings[index - NUM_STANDARD_CFF_STRINGS]; |
| 11033 |
} |
| 11034 |
return CFFStandardStrings[0]; |
| 11035 |
} |
| 11036 |
getSID(str) { |
| 11037 |
let index = CFFStandardStrings.indexOf(str); |
| 11038 |
if (index !== -1) { |
| 11039 |
return index; |
| 11040 |
} |
| 11041 |
index = this.strings.indexOf(str); |
| 11042 |
if (index !== -1) { |
| 11043 |
return index + NUM_STANDARD_CFF_STRINGS; |
| 11044 |
} |
| 11045 |
return -1; |
| 11046 |
} |
| 11047 |
add(value) { |
| 11048 |
this.strings.push(value); |
| 11049 |
} |
| 11050 |
get count() { |
| 11051 |
return this.strings.length; |
| 11052 |
} |
| 11053 |
} |
| 11054 |
class CFFIndex { |
| 11055 |
constructor() { |
| 11056 |
this.objects = []; |
| 11057 |
this.length = 0; |
| 11058 |
} |
| 11059 |
add(data) { |
| 11060 |
this.length += data.length; |
| 11061 |
this.objects.push(data); |
| 11062 |
} |
| 11063 |
set(index, data) { |
| 11064 |
this.length += data.length - this.objects[index].length; |
| 11065 |
this.objects[index] = data; |
| 11066 |
} |
| 11067 |
get(index) { |
| 11068 |
return this.objects[index]; |
| 11069 |
} |
| 11070 |
get count() { |
| 11071 |
return this.objects.length; |
| 11072 |
} |
| 11073 |
} |
| 11074 |
class CFFDict { |
| 11075 |
constructor(tables, strings) { |
| 11076 |
this.keyToNameMap = tables.keyToNameMap; |
| 11077 |
this.nameToKeyMap = tables.nameToKeyMap; |
| 11078 |
this.defaults = tables.defaults; |
| 11079 |
this.types = tables.types; |
| 11080 |
this.opcodes = tables.opcodes; |
| 11081 |
this.order = tables.order; |
| 11082 |
this.strings = strings; |
| 11083 |
this.values = Object.create(null); |
| 11084 |
} |
| 11085 |
setByKey(key, value) { |
| 11086 |
if (!(key in this.keyToNameMap)) { |
| 11087 |
return false; |
| 11088 |
} |
| 11089 |
if (value.length === 0) { |
| 11090 |
return true; |
| 11091 |
} |
| 11092 |
for (const val of value) { |
| 11093 |
if (isNaN(val)) { |
| 11094 |
warn(`Invalid CFFDict value: "${value}" for key "${key}".`); |
| 11095 |
return true; |
| 11096 |
} |
| 11097 |
} |
| 11098 |
const type = this.types[key]; |
| 11099 |
if (type === "num" || type === "sid" || type === "offset") { |
| 11100 |
value = value[0]; |
| 11101 |
} |
| 11102 |
this.values[key] = value; |
| 11103 |
return true; |
| 11104 |
} |
| 11105 |
setByName(name, value) { |
| 11106 |
if (!(name in this.nameToKeyMap)) { |
| 11107 |
throw new FormatError(`Invalid dictionary name "${name}"`); |
| 11108 |
} |
| 11109 |
this.values[this.nameToKeyMap[name]] = value; |
| 11110 |
} |
| 11111 |
hasName(name) { |
| 11112 |
return this.nameToKeyMap[name] in this.values; |
| 11113 |
} |
| 11114 |
getByName(name) { |
| 11115 |
if (!(name in this.nameToKeyMap)) { |
| 11116 |
throw new FormatError(`Invalid dictionary name ${name}"`); |
| 11117 |
} |
| 11118 |
const key = this.nameToKeyMap[name]; |
| 11119 |
if (!(key in this.values)) { |
| 11120 |
return this.defaults[key]; |
| 11121 |
} |
| 11122 |
return this.values[key]; |
| 11123 |
} |
| 11124 |
removeByName(name) { |
| 11125 |
delete this.values[this.nameToKeyMap[name]]; |
| 11126 |
} |
| 11127 |
static createTables(layout) { |
| 11128 |
const tables = { |
| 11129 |
keyToNameMap: {}, |
| 11130 |
nameToKeyMap: {}, |
| 11131 |
defaults: {}, |
| 11132 |
types: {}, |
| 11133 |
opcodes: {}, |
| 11134 |
order: [] |
| 11135 |
}; |
| 11136 |
for (const entry of layout) { |
| 11137 |
const key = Array.isArray(entry[0]) ? (entry[0][0] << 8) + entry[0][1] : entry[0]; |
| 11138 |
tables.keyToNameMap[key] = entry[1]; |
| 11139 |
tables.nameToKeyMap[entry[1]] = key; |
| 11140 |
tables.types[key] = entry[2]; |
| 11141 |
tables.defaults[key] = entry[3]; |
| 11142 |
tables.opcodes[key] = Array.isArray(entry[0]) ? entry[0] : [entry[0]]; |
| 11143 |
tables.order.push(key); |
| 11144 |
} |
| 11145 |
return tables; |
| 11146 |
} |
| 11147 |
} |
| 11148 |
const CFFTopDictLayout = [[[12, 30], "ROS", ["sid", "sid", "num"], null], [[12, 20], "SyntheticBase", "num", null], [0, "version", "sid", null], [1, "Notice", "sid", null], [[12, 0], "Copyright", "sid", null], [2, "FullName", "sid", null], [3, "FamilyName", "sid", null], [4, "Weight", "sid", null], [[12, 1], "isFixedPitch", "num", 0], [[12, 2], "ItalicAngle", "num", 0], [[12, 3], "UnderlinePosition", "num", -100], [[12, 4], "UnderlineThickness", "num", 50], [[12, 5], "PaintType", "num", 0], [[12, 6], "CharstringType", "num", 2], [[12, 7], "FontMatrix", ["num", "num", "num", "num", "num", "num"], [0.001, 0, 0, 0.001, 0, 0]], [13, "UniqueID", "num", null], [5, "FontBBox", ["num", "num", "num", "num"], [0, 0, 0, 0]], [[12, 8], "StrokeWidth", "num", 0], [14, "XUID", "array", null], [15, "charset", "offset", 0], [16, "Encoding", "offset", 0], [17, "CharStrings", "offset", 0], [18, "Private", ["offset", "offset"], null], [[12, 21], "PostScript", "sid", null], [[12, 22], "BaseFontName", "sid", null], [[12, 23], "BaseFontBlend", "delta", null], [[12, 31], "CIDFontVersion", "num", 0], [[12, 32], "CIDFontRevision", "num", 0], [[12, 33], "CIDFontType", "num", 0], [[12, 34], "CIDCount", "num", 8720], [[12, 35], "UIDBase", "num", null], [[12, 37], "FDSelect", "offset", null], [[12, 36], "FDArray", "offset", null], [[12, 38], "FontName", "sid", null]]; |
| 11149 |
class CFFTopDict extends CFFDict { |
| 11150 |
static get tables() { |
| 11151 |
return shadow(this, "tables", this.createTables(CFFTopDictLayout)); |
| 11152 |
} |
| 11153 |
constructor(strings) { |
| 11154 |
super(CFFTopDict.tables, strings); |
| 11155 |
this.privateDict = null; |
| 11156 |
} |
| 11157 |
} |
| 11158 |
const CFFPrivateDictLayout = [[6, "BlueValues", "delta", null], [7, "OtherBlues", "delta", null], [8, "FamilyBlues", "delta", null], [9, "FamilyOtherBlues", "delta", null], [[12, 9], "BlueScale", "num", 0.039625], [[12, 10], "BlueShift", "num", 7], [[12, 11], "BlueFuzz", "num", 1], [10, "StdHW", "num", null], [11, "StdVW", "num", null], [[12, 12], "StemSnapH", "delta", null], [[12, 13], "StemSnapV", "delta", null], [[12, 14], "ForceBold", "num", 0], [[12, 17], "LanguageGroup", "num", 0], [[12, 18], "ExpansionFactor", "num", 0.06], [[12, 19], "initialRandomSeed", "num", 0], [20, "defaultWidthX", "num", 0], [21, "nominalWidthX", "num", 0], [19, "Subrs", "offset", null]]; |
| 11159 |
class CFFPrivateDict extends CFFDict { |
| 11160 |
static get tables() { |
| 11161 |
return shadow(this, "tables", this.createTables(CFFPrivateDictLayout)); |
| 11162 |
} |
| 11163 |
constructor(strings) { |
| 11164 |
super(CFFPrivateDict.tables, strings); |
| 11165 |
this.subrsIndex = null; |
| 11166 |
} |
| 11167 |
} |
| 11168 |
const CFFCharsetPredefinedTypes = { |
| 11169 |
ISO_ADOBE: 0, |
| 11170 |
EXPERT: 1, |
| 11171 |
EXPERT_SUBSET: 2 |
| 11172 |
}; |
| 11173 |
class CFFCharset { |
| 11174 |
constructor(predefined, format, charset, raw) { |
| 11175 |
this.predefined = predefined; |
| 11176 |
this.format = format; |
| 11177 |
this.charset = charset; |
| 11178 |
this.raw = raw; |
| 11179 |
} |
| 11180 |
} |
| 11181 |
class CFFEncoding { |
| 11182 |
constructor(predefined, format, encoding, raw) { |
| 11183 |
this.predefined = predefined; |
| 11184 |
this.format = format; |
| 11185 |
this.encoding = encoding; |
| 11186 |
this.raw = raw; |
| 11187 |
} |
| 11188 |
} |
| 11189 |
class CFFFDSelect { |
| 11190 |
constructor(format, fdSelect) { |
| 11191 |
this.format = format; |
| 11192 |
this.fdSelect = fdSelect; |
| 11193 |
} |
| 11194 |
getFDIndex(glyphIndex) { |
| 11195 |
if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) { |
| 11196 |
return -1; |
| 11197 |
} |
| 11198 |
return this.fdSelect[glyphIndex]; |
| 11199 |
} |
| 11200 |
} |
| 11201 |
class CFFOffsetTracker { |
| 11202 |
constructor() { |
| 11203 |
this.offsets = Object.create(null); |
| 11204 |
} |
| 11205 |
isTracking(key) { |
| 11206 |
return key in this.offsets; |
| 11207 |
} |
| 11208 |
track(key, location) { |
| 11209 |
if (key in this.offsets) { |
| 11210 |
throw new FormatError(`Already tracking location of ${key}`); |
| 11211 |
} |
| 11212 |
this.offsets[key] = location; |
| 11213 |
} |
| 11214 |
offset(value) { |
| 11215 |
for (const key in this.offsets) { |
| 11216 |
this.offsets[key] += value; |
| 11217 |
} |
| 11218 |
} |
| 11219 |
setEntryLocation(key, values, output) { |
| 11220 |
if (!(key in this.offsets)) { |
| 11221 |
throw new FormatError(`Not tracking location of ${key}`); |
| 11222 |
} |
| 11223 |
const data = output.data; |
| 11224 |
const dataOffset = this.offsets[key]; |
| 11225 |
const size = 5; |
| 11226 |
for (let i = 0, ii = values.length; i < ii; ++i) { |
| 11227 |
const offset0 = i * size + dataOffset; |
| 11228 |
const offset1 = offset0 + 1; |
| 11229 |
const offset2 = offset0 + 2; |
| 11230 |
const offset3 = offset0 + 3; |
| 11231 |
const offset4 = offset0 + 4; |
| 11232 |
if (data[offset0] !== 0x1d || data[offset1] !== 0 || data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) { |
| 11233 |
throw new FormatError("writing to an offset that is not empty"); |
| 11234 |
} |
| 11235 |
const value = values[i]; |
| 11236 |
data[offset0] = 0x1d; |
| 11237 |
data[offset1] = value >> 24 & 0xff; |
| 11238 |
data[offset2] = value >> 16 & 0xff; |
| 11239 |
data[offset3] = value >> 8 & 0xff; |
| 11240 |
data[offset4] = value & 0xff; |
| 11241 |
} |
| 11242 |
} |
| 11243 |
} |
| 11244 |
class CFFCompiler { |
| 11245 |
constructor(cff) { |
| 11246 |
this.cff = cff; |
| 11247 |
} |
| 11248 |
compile() { |
| 11249 |
const cff = this.cff; |
| 11250 |
const output = { |
| 11251 |
data: [], |
| 11252 |
length: 0, |
| 11253 |
add(data) { |
| 11254 |
try { |
| 11255 |
this.data.push(...data); |
| 11256 |
} catch { |
| 11257 |
this.data = this.data.concat(data); |
| 11258 |
} |
| 11259 |
this.length = this.data.length; |
| 11260 |
} |
| 11261 |
}; |
| 11262 |
const header = this.compileHeader(cff.header); |
| 11263 |
output.add(header); |
| 11264 |
const nameIndex = this.compileNameIndex(cff.names); |
| 11265 |
output.add(nameIndex); |
| 11266 |
if (cff.isCIDFont) { |
| 11267 |
if (cff.topDict.hasName("FontMatrix")) { |
| 11268 |
const base = cff.topDict.getByName("FontMatrix"); |
| 11269 |
cff.topDict.removeByName("FontMatrix"); |
| 11270 |
for (const subDict of cff.fdArray) { |
| 11271 |
let matrix = base.slice(0); |
| 11272 |
if (subDict.hasName("FontMatrix")) { |
| 11273 |
matrix = Util.transform(matrix, subDict.getByName("FontMatrix")); |
| 11274 |
} |
| 11275 |
subDict.setByName("FontMatrix", matrix); |
| 11276 |
} |
| 11277 |
} |
| 11278 |
} |
| 11279 |
const xuid = cff.topDict.getByName("XUID"); |
| 11280 |
if (xuid?.length > 16) { |
| 11281 |
cff.topDict.removeByName("XUID"); |
| 11282 |
} |
| 11283 |
cff.topDict.setByName("charset", 0); |
| 11284 |
let compiled = this.compileTopDicts([cff.topDict], output.length, cff.isCIDFont); |
| 11285 |
output.add(compiled.output); |
| 11286 |
const topDictTracker = compiled.trackers[0]; |
| 11287 |
const stringIndex = this.compileStringIndex(cff.strings.strings); |
| 11288 |
output.add(stringIndex); |
| 11289 |
const globalSubrIndex = this.compileIndex(cff.globalSubrIndex); |
| 11290 |
output.add(globalSubrIndex); |
| 11291 |
if (cff.encoding && cff.topDict.hasName("Encoding")) { |
| 11292 |
if (cff.encoding.predefined) { |
| 11293 |
topDictTracker.setEntryLocation("Encoding", [cff.encoding.format], output); |
| 11294 |
} else { |
| 11295 |
const encoding = this.compileEncoding(cff.encoding); |
| 11296 |
topDictTracker.setEntryLocation("Encoding", [output.length], output); |
| 11297 |
output.add(encoding); |
| 11298 |
} |
| 11299 |
} |
| 11300 |
const charset = this.compileCharset(cff.charset, cff.charStrings.count, cff.strings, cff.isCIDFont); |
| 11301 |
topDictTracker.setEntryLocation("charset", [output.length], output); |
| 11302 |
output.add(charset); |
| 11303 |
const charStrings = this.compileCharStrings(cff.charStrings); |
| 11304 |
topDictTracker.setEntryLocation("CharStrings", [output.length], output); |
| 11305 |
output.add(charStrings); |
| 11306 |
if (cff.isCIDFont) { |
| 11307 |
topDictTracker.setEntryLocation("FDSelect", [output.length], output); |
| 11308 |
const fdSelect = this.compileFDSelect(cff.fdSelect); |
| 11309 |
output.add(fdSelect); |
| 11310 |
compiled = this.compileTopDicts(cff.fdArray, output.length, true); |
| 11311 |
topDictTracker.setEntryLocation("FDArray", [output.length], output); |
| 11312 |
output.add(compiled.output); |
| 11313 |
const fontDictTrackers = compiled.trackers; |
| 11314 |
this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); |
| 11315 |
} |
| 11316 |
this.compilePrivateDicts([cff.topDict], [topDictTracker], output); |
| 11317 |
output.add([0]); |
| 11318 |
return output.data; |
| 11319 |
} |
| 11320 |
encodeNumber(value) { |
| 11321 |
if (Number.isInteger(value)) { |
| 11322 |
return this.encodeInteger(value); |
| 11323 |
} |
| 11324 |
return this.encodeFloat(value); |
| 11325 |
} |
| 11326 |
static get EncodeFloatRegExp() { |
| 11327 |
return shadow(this, "EncodeFloatRegExp", /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/); |
| 11328 |
} |
| 11329 |
encodeFloat(num) { |
| 11330 |
let value = num.toString(); |
| 11331 |
const m = CFFCompiler.EncodeFloatRegExp.exec(value); |
| 11332 |
if (m) { |
| 11333 |
const epsilon = parseFloat("1e" + ((m[2] ? +m[2] : 0) + m[1].length)); |
| 11334 |
value = (Math.round(num * epsilon) / epsilon).toString(); |
| 11335 |
} |
| 11336 |
let nibbles = ""; |
| 11337 |
let i, ii; |
| 11338 |
for (i = 0, ii = value.length; i < ii; ++i) { |
| 11339 |
const a = value[i]; |
| 11340 |
if (a === "e") { |
| 11341 |
nibbles += value[++i] === "-" ? "c" : "b"; |
| 11342 |
} else if (a === ".") { |
| 11343 |
nibbles += "a"; |
| 11344 |
} else if (a === "-") { |
| 11345 |
nibbles += "e"; |
| 11346 |
} else { |
| 11347 |
nibbles += a; |
| 11348 |
} |
| 11349 |
} |
| 11350 |
nibbles += nibbles.length & 1 ? "f" : "ff"; |
| 11351 |
const out = [30]; |
| 11352 |
for (i = 0, ii = nibbles.length; i < ii; i += 2) { |
| 11353 |
out.push(parseInt(nibbles.substring(i, i + 2), 16)); |
| 11354 |
} |
| 11355 |
return out; |
| 11356 |
} |
| 11357 |
encodeInteger(value) { |
| 11358 |
let code; |
| 11359 |
if (value >= -107 && value <= 107) { |
| 11360 |
code = [value + 139]; |
| 11361 |
} else if (value >= 108 && value <= 1131) { |
| 11362 |
value -= 108; |
| 11363 |
code = [(value >> 8) + 247, value & 0xff]; |
| 11364 |
} else if (value >= -1131 && value <= -108) { |
| 11365 |
value = -value - 108; |
| 11366 |
code = [(value >> 8) + 251, value & 0xff]; |
| 11367 |
} else if (value >= -32768 && value <= 32767) { |
| 11368 |
code = [0x1c, value >> 8 & 0xff, value & 0xff]; |
| 11369 |
} else { |
| 11370 |
code = [0x1d, value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff]; |
| 11371 |
} |
| 11372 |
return code; |
| 11373 |
} |
| 11374 |
compileHeader(header) { |
| 11375 |
return [header.major, header.minor, 4, header.offSize]; |
| 11376 |
} |
| 11377 |
compileNameIndex(names) { |
| 11378 |
const nameIndex = new CFFIndex(); |
| 11379 |
for (const name of names) { |
| 11380 |
const length = Math.min(name.length, 127); |
| 11381 |
let sanitizedName = new Array(length); |
| 11382 |
for (let j = 0; j < length; j++) { |
| 11383 |
let char = name[j]; |
| 11384 |
if (char < "!" || char > "~" || char === "[" || char === "]" || char === "(" || char === ")" || char === "{" || char === "}" || char === "<" || char === ">" || char === "/" || char === "%") { |
| 11385 |
char = "_"; |
| 11386 |
} |
| 11387 |
sanitizedName[j] = char; |
| 11388 |
} |
| 11389 |
sanitizedName = sanitizedName.join(""); |
| 11390 |
if (sanitizedName === "") { |
| 11391 |
sanitizedName = "Bad_Font_Name"; |
| 11392 |
} |
| 11393 |
nameIndex.add(stringToBytes(sanitizedName)); |
| 11394 |
} |
| 11395 |
return this.compileIndex(nameIndex); |
| 11396 |
} |
| 11397 |
compileTopDicts(dicts, length, removeCidKeys) { |
| 11398 |
const fontDictTrackers = []; |
| 11399 |
let fdArrayIndex = new CFFIndex(); |
| 11400 |
for (const fontDict of dicts) { |
| 11401 |
if (removeCidKeys) { |
| 11402 |
fontDict.removeByName("CIDFontVersion"); |
| 11403 |
fontDict.removeByName("CIDFontRevision"); |
| 11404 |
fontDict.removeByName("CIDFontType"); |
| 11405 |
fontDict.removeByName("CIDCount"); |
| 11406 |
fontDict.removeByName("UIDBase"); |
| 11407 |
} |
| 11408 |
const fontDictTracker = new CFFOffsetTracker(); |
| 11409 |
const fontDictData = this.compileDict(fontDict, fontDictTracker); |
| 11410 |
fontDictTrackers.push(fontDictTracker); |
| 11411 |
fdArrayIndex.add(fontDictData); |
| 11412 |
fontDictTracker.offset(length); |
| 11413 |
} |
| 11414 |
fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); |
| 11415 |
return { |
| 11416 |
trackers: fontDictTrackers, |
| 11417 |
output: fdArrayIndex |
| 11418 |
}; |
| 11419 |
} |
| 11420 |
compilePrivateDicts(dicts, trackers, output) { |
| 11421 |
for (let i = 0, ii = dicts.length; i < ii; ++i) { |
| 11422 |
const fontDict = dicts[i]; |
| 11423 |
const privateDict = fontDict.privateDict; |
| 11424 |
if (!privateDict || !fontDict.hasName("Private")) { |
| 11425 |
throw new FormatError("There must be a private dictionary."); |
| 11426 |
} |
| 11427 |
const privateDictTracker = new CFFOffsetTracker(); |
| 11428 |
const privateDictData = this.compileDict(privateDict, privateDictTracker); |
| 11429 |
let outputLength = output.length; |
| 11430 |
privateDictTracker.offset(outputLength); |
| 11431 |
if (!privateDictData.length) { |
| 11432 |
outputLength = 0; |
| 11433 |
} |
| 11434 |
trackers[i].setEntryLocation("Private", [privateDictData.length, outputLength], output); |
| 11435 |
output.add(privateDictData); |
| 11436 |
if (privateDict.subrsIndex && privateDict.hasName("Subrs")) { |
| 11437 |
const subrs = this.compileIndex(privateDict.subrsIndex); |
| 11438 |
privateDictTracker.setEntryLocation("Subrs", [privateDictData.length], output); |
| 11439 |
output.add(subrs); |
| 11440 |
} |
| 11441 |
} |
| 11442 |
} |
| 11443 |
compileDict(dict, offsetTracker) { |
| 11444 |
const out = []; |
| 11445 |
for (const key of dict.order) { |
| 11446 |
if (!(key in dict.values)) { |
| 11447 |
continue; |
| 11448 |
} |
| 11449 |
let values = dict.values[key]; |
| 11450 |
let types = dict.types[key]; |
| 11451 |
if (!Array.isArray(types)) { |
| 11452 |
types = [types]; |
| 11453 |
} |
| 11454 |
if (!Array.isArray(values)) { |
| 11455 |
values = [values]; |
| 11456 |
} |
| 11457 |
if (values.length === 0) { |
| 11458 |
continue; |
| 11459 |
} |
| 11460 |
for (let j = 0, jj = types.length; j < jj; ++j) { |
| 11461 |
const type = types[j]; |
| 11462 |
const value = values[j]; |
| 11463 |
switch (type) { |
| 11464 |
case "num": |
| 11465 |
case "sid": |
| 11466 |
out.push(...this.encodeNumber(value)); |
| 11467 |
break; |
| 11468 |
case "offset": |
| 11469 |
const name = dict.keyToNameMap[key]; |
| 11470 |
if (!offsetTracker.isTracking(name)) { |
| 11471 |
offsetTracker.track(name, out.length); |
| 11472 |
} |
| 11473 |
out.push(0x1d, 0, 0, 0, 0); |
| 11474 |
break; |
| 11475 |
case "array": |
| 11476 |
case "delta": |
| 11477 |
out.push(...this.encodeNumber(value)); |
| 11478 |
for (let k = 1, kk = values.length; k < kk; ++k) { |
| 11479 |
out.push(...this.encodeNumber(values[k])); |
| 11480 |
} |
| 11481 |
break; |
| 11482 |
default: |
| 11483 |
throw new FormatError(`Unknown data type of ${type}`); |
| 11484 |
} |
| 11485 |
} |
| 11486 |
out.push(...dict.opcodes[key]); |
| 11487 |
} |
| 11488 |
return out; |
| 11489 |
} |
| 11490 |
compileStringIndex(strings) { |
| 11491 |
const stringIndex = new CFFIndex(); |
| 11492 |
for (const string of strings) { |
| 11493 |
stringIndex.add(stringToBytes(string)); |
| 11494 |
} |
| 11495 |
return this.compileIndex(stringIndex); |
| 11496 |
} |
| 11497 |
compileCharStrings(charStrings) { |
| 11498 |
const charStringsIndex = new CFFIndex(); |
| 11499 |
for (let i = 0; i < charStrings.count; i++) { |
| 11500 |
const glyph = charStrings.get(i); |
| 11501 |
if (glyph.length === 0) { |
| 11502 |
charStringsIndex.add(new Uint8Array([0x8b, 0x0e])); |
| 11503 |
continue; |
| 11504 |
} |
| 11505 |
charStringsIndex.add(glyph); |
| 11506 |
} |
| 11507 |
return this.compileIndex(charStringsIndex); |
| 11508 |
} |
| 11509 |
compileCharset(charset, numGlyphs, strings, isCIDFont) { |
| 11510 |
let out; |
| 11511 |
const numGlyphsLessNotDef = numGlyphs - 1; |
| 11512 |
if (isCIDFont) { |
| 11513 |
out = new Uint8Array([2, 0, 0, numGlyphsLessNotDef >> 8 & 0xff, numGlyphsLessNotDef & 0xff]); |
| 11514 |
} else { |
| 11515 |
const length = 1 + numGlyphsLessNotDef * 2; |
| 11516 |
out = new Uint8Array(length); |
| 11517 |
out[0] = 0; |
| 11518 |
let charsetIndex = 0; |
| 11519 |
const numCharsets = charset.charset.length; |
| 11520 |
let warned = false; |
| 11521 |
for (let i = 1; i < out.length; i += 2) { |
| 11522 |
let sid = 0; |
| 11523 |
if (charsetIndex < numCharsets) { |
| 11524 |
const name = charset.charset[charsetIndex++]; |
| 11525 |
sid = strings.getSID(name); |
| 11526 |
if (sid === -1) { |
| 11527 |
sid = 0; |
| 11528 |
if (!warned) { |
| 11529 |
warned = true; |
| 11530 |
warn(`Couldn't find ${name} in CFF strings`); |
| 11531 |
} |
| 11532 |
} |
| 11533 |
} |
| 11534 |
out[i] = sid >> 8 & 0xff; |
| 11535 |
out[i + 1] = sid & 0xff; |
| 11536 |
} |
| 11537 |
} |
| 11538 |
return this.compileTypedArray(out); |
| 11539 |
} |
| 11540 |
compileEncoding(encoding) { |
| 11541 |
return this.compileTypedArray(encoding.raw); |
| 11542 |
} |
| 11543 |
compileFDSelect(fdSelect) { |
| 11544 |
const format = fdSelect.format; |
| 11545 |
let out, i; |
| 11546 |
switch (format) { |
| 11547 |
case 0: |
| 11548 |
out = new Uint8Array(1 + fdSelect.fdSelect.length); |
| 11549 |
out[0] = format; |
| 11550 |
for (i = 0; i < fdSelect.fdSelect.length; i++) { |
| 11551 |
out[i + 1] = fdSelect.fdSelect[i]; |
| 11552 |
} |
| 11553 |
break; |
| 11554 |
case 3: |
| 11555 |
const start = 0; |
| 11556 |
let lastFD = fdSelect.fdSelect[0]; |
| 11557 |
const ranges = [format, 0, 0, start >> 8 & 0xff, start & 0xff, lastFD]; |
| 11558 |
for (i = 1; i < fdSelect.fdSelect.length; i++) { |
| 11559 |
const currentFD = fdSelect.fdSelect[i]; |
| 11560 |
if (currentFD !== lastFD) { |
| 11561 |
ranges.push(i >> 8 & 0xff, i & 0xff, currentFD); |
| 11562 |
lastFD = currentFD; |
| 11563 |
} |
| 11564 |
} |
| 11565 |
const numRanges = (ranges.length - 3) / 3; |
| 11566 |
ranges[1] = numRanges >> 8 & 0xff; |
| 11567 |
ranges[2] = numRanges & 0xff; |
| 11568 |
ranges.push(i >> 8 & 0xff, i & 0xff); |
| 11569 |
out = new Uint8Array(ranges); |
| 11570 |
break; |
| 11571 |
} |
| 11572 |
return this.compileTypedArray(out); |
| 11573 |
} |
| 11574 |
compileTypedArray(data) { |
| 11575 |
return Array.from(data); |
| 11576 |
} |
| 11577 |
compileIndex(index, trackers = []) { |
| 11578 |
const objects = index.objects; |
| 11579 |
const count = objects.length; |
| 11580 |
if (count === 0) { |
| 11581 |
return [0, 0]; |
| 11582 |
} |
| 11583 |
const data = [count >> 8 & 0xff, count & 0xff]; |
| 11584 |
let lastOffset = 1, |
| 11585 |
i; |
| 11586 |
for (i = 0; i < count; ++i) { |
| 11587 |
lastOffset += objects[i].length; |
| 11588 |
} |
| 11589 |
let offsetSize; |
| 11590 |
if (lastOffset < 0x100) { |
| 11591 |
offsetSize = 1; |
| 11592 |
} else if (lastOffset < 0x10000) { |
| 11593 |
offsetSize = 2; |
| 11594 |
} else if (lastOffset < 0x1000000) { |
| 11595 |
offsetSize = 3; |
| 11596 |
} else { |
| 11597 |
offsetSize = 4; |
| 11598 |
} |
| 11599 |
data.push(offsetSize); |
| 11600 |
let relativeOffset = 1; |
| 11601 |
for (i = 0; i < count + 1; i++) { |
| 11602 |
if (offsetSize === 1) { |
| 11603 |
data.push(relativeOffset & 0xff); |
| 11604 |
} else if (offsetSize === 2) { |
| 11605 |
data.push(relativeOffset >> 8 & 0xff, relativeOffset & 0xff); |
| 11606 |
} else if (offsetSize === 3) { |
| 11607 |
data.push(relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff); |
| 11608 |
} else { |
| 11609 |
data.push(relativeOffset >>> 24 & 0xff, relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff); |
| 11610 |
} |
| 11611 |
if (objects[i]) { |
| 11612 |
relativeOffset += objects[i].length; |
| 11613 |
} |
| 11614 |
} |
| 11615 |
for (i = 0; i < count; i++) { |
| 11616 |
if (trackers[i]) { |
| 11617 |
trackers[i].offset(data.length); |
| 11618 |
} |
| 11619 |
data.push(...objects[i]); |
| 11620 |
} |
| 11621 |
return data; |
| 11622 |
} |
| 11623 |
} |
| 11624 |
|
| 11625 |
;// ./src/core/glyphlist.js |
| 11626 |
|
| 11627 |
const getGlyphsUnicode = getLookupTableFactory(function (t) { |
| 11628 |
t.A = 0x0041; |
| 11629 |
t.AE = 0x00c6; |
| 11630 |
t.AEacute = 0x01fc; |
| 11631 |
t.AEmacron = 0x01e2; |
| 11632 |
t.AEsmall = 0xf7e6; |
| 11633 |
t.Aacute = 0x00c1; |
| 11634 |
t.Aacutesmall = 0xf7e1; |
| 11635 |
t.Abreve = 0x0102; |
| 11636 |
t.Abreveacute = 0x1eae; |
| 11637 |
t.Abrevecyrillic = 0x04d0; |
| 11638 |
t.Abrevedotbelow = 0x1eb6; |
| 11639 |
t.Abrevegrave = 0x1eb0; |
| 11640 |
t.Abrevehookabove = 0x1eb2; |
| 11641 |
t.Abrevetilde = 0x1eb4; |
| 11642 |
t.Acaron = 0x01cd; |
| 11643 |
t.Acircle = 0x24b6; |
| 11644 |
t.Acircumflex = 0x00c2; |
| 11645 |
t.Acircumflexacute = 0x1ea4; |
| 11646 |
t.Acircumflexdotbelow = 0x1eac; |
| 11647 |
t.Acircumflexgrave = 0x1ea6; |
| 11648 |
t.Acircumflexhookabove = 0x1ea8; |
| 11649 |
t.Acircumflexsmall = 0xf7e2; |
| 11650 |
t.Acircumflextilde = 0x1eaa; |
| 11651 |
t.Acute = 0xf6c9; |
| 11652 |
t.Acutesmall = 0xf7b4; |
| 11653 |
t.Acyrillic = 0x0410; |
| 11654 |
t.Adblgrave = 0x0200; |
| 11655 |
t.Adieresis = 0x00c4; |
| 11656 |
t.Adieresiscyrillic = 0x04d2; |
| 11657 |
t.Adieresismacron = 0x01de; |
| 11658 |
t.Adieresissmall = 0xf7e4; |
| 11659 |
t.Adotbelow = 0x1ea0; |
| 11660 |
t.Adotmacron = 0x01e0; |
| 11661 |
t.Agrave = 0x00c0; |
| 11662 |
t.Agravesmall = 0xf7e0; |
| 11663 |
t.Ahookabove = 0x1ea2; |
| 11664 |
t.Aiecyrillic = 0x04d4; |
| 11665 |
t.Ainvertedbreve = 0x0202; |
| 11666 |
t.Alpha = 0x0391; |
| 11667 |
t.Alphatonos = 0x0386; |
| 11668 |
t.Amacron = 0x0100; |
| 11669 |
t.Amonospace = 0xff21; |
| 11670 |
t.Aogonek = 0x0104; |
| 11671 |
t.Aring = 0x00c5; |
| 11672 |
t.Aringacute = 0x01fa; |
| 11673 |
t.Aringbelow = 0x1e00; |
| 11674 |
t.Aringsmall = 0xf7e5; |
| 11675 |
t.Asmall = 0xf761; |
| 11676 |
t.Atilde = 0x00c3; |
| 11677 |
t.Atildesmall = 0xf7e3; |
| 11678 |
t.Aybarmenian = 0x0531; |
| 11679 |
t.B = 0x0042; |
| 11680 |
t.Bcircle = 0x24b7; |
| 11681 |
t.Bdotaccent = 0x1e02; |
| 11682 |
t.Bdotbelow = 0x1e04; |
| 11683 |
t.Becyrillic = 0x0411; |
| 11684 |
t.Benarmenian = 0x0532; |
| 11685 |
t.Beta = 0x0392; |
| 11686 |
t.Bhook = 0x0181; |
| 11687 |
t.Blinebelow = 0x1e06; |
| 11688 |
t.Bmonospace = 0xff22; |
| 11689 |
t.Brevesmall = 0xf6f4; |
| 11690 |
t.Bsmall = 0xf762; |
| 11691 |
t.Btopbar = 0x0182; |
| 11692 |
t.C = 0x0043; |
| 11693 |
t.Caarmenian = 0x053e; |
| 11694 |
t.Cacute = 0x0106; |
| 11695 |
t.Caron = 0xf6ca; |
| 11696 |
t.Caronsmall = 0xf6f5; |
| 11697 |
t.Ccaron = 0x010c; |
| 11698 |
t.Ccedilla = 0x00c7; |
| 11699 |
t.Ccedillaacute = 0x1e08; |
| 11700 |
t.Ccedillasmall = 0xf7e7; |
| 11701 |
t.Ccircle = 0x24b8; |
| 11702 |
t.Ccircumflex = 0x0108; |
| 11703 |
t.Cdot = 0x010a; |
| 11704 |
t.Cdotaccent = 0x010a; |
| 11705 |
t.Cedillasmall = 0xf7b8; |
| 11706 |
t.Chaarmenian = 0x0549; |
| 11707 |
t.Cheabkhasiancyrillic = 0x04bc; |
| 11708 |
t.Checyrillic = 0x0427; |
| 11709 |
t.Chedescenderabkhasiancyrillic = 0x04be; |
| 11710 |
t.Chedescendercyrillic = 0x04b6; |
| 11711 |
t.Chedieresiscyrillic = 0x04f4; |
| 11712 |
t.Cheharmenian = 0x0543; |
| 11713 |
t.Chekhakassiancyrillic = 0x04cb; |
| 11714 |
t.Cheverticalstrokecyrillic = 0x04b8; |
| 11715 |
t.Chi = 0x03a7; |
| 11716 |
t.Chook = 0x0187; |
| 11717 |
t.Circumflexsmall = 0xf6f6; |
| 11718 |
t.Cmonospace = 0xff23; |
| 11719 |
t.Coarmenian = 0x0551; |
| 11720 |
t.Csmall = 0xf763; |
| 11721 |
t.D = 0x0044; |
| 11722 |
t.DZ = 0x01f1; |
| 11723 |
t.DZcaron = 0x01c4; |
| 11724 |
t.Daarmenian = 0x0534; |
| 11725 |
t.Dafrican = 0x0189; |
| 11726 |
t.Dcaron = 0x010e; |
| 11727 |
t.Dcedilla = 0x1e10; |
| 11728 |
t.Dcircle = 0x24b9; |
| 11729 |
t.Dcircumflexbelow = 0x1e12; |
| 11730 |
t.Dcroat = 0x0110; |
| 11731 |
t.Ddotaccent = 0x1e0a; |
| 11732 |
t.Ddotbelow = 0x1e0c; |
| 11733 |
t.Decyrillic = 0x0414; |
| 11734 |
t.Deicoptic = 0x03ee; |
| 11735 |
t.Delta = 0x2206; |
| 11736 |
t.Deltagreek = 0x0394; |
| 11737 |
t.Dhook = 0x018a; |
| 11738 |
t.Dieresis = 0xf6cb; |
| 11739 |
t.DieresisAcute = 0xf6cc; |
| 11740 |
t.DieresisGrave = 0xf6cd; |
| 11741 |
t.Dieresissmall = 0xf7a8; |
| 11742 |
t.Digammagreek = 0x03dc; |
| 11743 |
t.Djecyrillic = 0x0402; |
| 11744 |
t.Dlinebelow = 0x1e0e; |
| 11745 |
t.Dmonospace = 0xff24; |
| 11746 |
t.Dotaccentsmall = 0xf6f7; |
| 11747 |
t.Dslash = 0x0110; |
| 11748 |
t.Dsmall = 0xf764; |
| 11749 |
t.Dtopbar = 0x018b; |
| 11750 |
t.Dz = 0x01f2; |
| 11751 |
t.Dzcaron = 0x01c5; |
| 11752 |
t.Dzeabkhasiancyrillic = 0x04e0; |
| 11753 |
t.Dzecyrillic = 0x0405; |
| 11754 |
t.Dzhecyrillic = 0x040f; |
| 11755 |
t.E = 0x0045; |
| 11756 |
t.Eacute = 0x00c9; |
| 11757 |
t.Eacutesmall = 0xf7e9; |
| 11758 |
t.Ebreve = 0x0114; |
| 11759 |
t.Ecaron = 0x011a; |
| 11760 |
t.Ecedillabreve = 0x1e1c; |
| 11761 |
t.Echarmenian = 0x0535; |
| 11762 |
t.Ecircle = 0x24ba; |
| 11763 |
t.Ecircumflex = 0x00ca; |
| 11764 |
t.Ecircumflexacute = 0x1ebe; |
| 11765 |
t.Ecircumflexbelow = 0x1e18; |
| 11766 |
t.Ecircumflexdotbelow = 0x1ec6; |
| 11767 |
t.Ecircumflexgrave = 0x1ec0; |
| 11768 |
t.Ecircumflexhookabove = 0x1ec2; |
| 11769 |
t.Ecircumflexsmall = 0xf7ea; |
| 11770 |
t.Ecircumflextilde = 0x1ec4; |
| 11771 |
t.Ecyrillic = 0x0404; |
| 11772 |
t.Edblgrave = 0x0204; |
| 11773 |
t.Edieresis = 0x00cb; |
| 11774 |
t.Edieresissmall = 0xf7eb; |
| 11775 |
t.Edot = 0x0116; |
| 11776 |
t.Edotaccent = 0x0116; |
| 11777 |
t.Edotbelow = 0x1eb8; |
| 11778 |
t.Efcyrillic = 0x0424; |
| 11779 |
t.Egrave = 0x00c8; |
| 11780 |
t.Egravesmall = 0xf7e8; |
| 11781 |
t.Eharmenian = 0x0537; |
| 11782 |
t.Ehookabove = 0x1eba; |
| 11783 |
t.Eightroman = 0x2167; |
| 11784 |
t.Einvertedbreve = 0x0206; |
| 11785 |
t.Eiotifiedcyrillic = 0x0464; |
| 11786 |
t.Elcyrillic = 0x041b; |
| 11787 |
t.Elevenroman = 0x216a; |
| 11788 |
t.Emacron = 0x0112; |
| 11789 |
t.Emacronacute = 0x1e16; |
| 11790 |
t.Emacrongrave = 0x1e14; |
| 11791 |
t.Emcyrillic = 0x041c; |
| 11792 |
t.Emonospace = 0xff25; |
| 11793 |
t.Encyrillic = 0x041d; |
| 11794 |
t.Endescendercyrillic = 0x04a2; |
| 11795 |
t.Eng = 0x014a; |
| 11796 |
t.Enghecyrillic = 0x04a4; |
| 11797 |
t.Enhookcyrillic = 0x04c7; |
| 11798 |
t.Eogonek = 0x0118; |
| 11799 |
t.Eopen = 0x0190; |
| 11800 |
t.Epsilon = 0x0395; |
| 11801 |
t.Epsilontonos = 0x0388; |
| 11802 |
t.Ercyrillic = 0x0420; |
| 11803 |
t.Ereversed = 0x018e; |
| 11804 |
t.Ereversedcyrillic = 0x042d; |
| 11805 |
t.Escyrillic = 0x0421; |
| 11806 |
t.Esdescendercyrillic = 0x04aa; |
| 11807 |
t.Esh = 0x01a9; |
| 11808 |
t.Esmall = 0xf765; |
| 11809 |
t.Eta = 0x0397; |
| 11810 |
t.Etarmenian = 0x0538; |
| 11811 |
t.Etatonos = 0x0389; |
| 11812 |
t.Eth = 0x00d0; |
| 11813 |
t.Ethsmall = 0xf7f0; |
| 11814 |
t.Etilde = 0x1ebc; |
| 11815 |
t.Etildebelow = 0x1e1a; |
| 11816 |
t.Euro = 0x20ac; |
| 11817 |
t.Ezh = 0x01b7; |
| 11818 |
t.Ezhcaron = 0x01ee; |
| 11819 |
t.Ezhreversed = 0x01b8; |
| 11820 |
t.F = 0x0046; |
| 11821 |
t.Fcircle = 0x24bb; |
| 11822 |
t.Fdotaccent = 0x1e1e; |
| 11823 |
t.Feharmenian = 0x0556; |
| 11824 |
t.Feicoptic = 0x03e4; |
| 11825 |
t.Fhook = 0x0191; |
| 11826 |
t.Fitacyrillic = 0x0472; |
| 11827 |
t.Fiveroman = 0x2164; |
| 11828 |
t.Fmonospace = 0xff26; |
| 11829 |
t.Fourroman = 0x2163; |
| 11830 |
t.Fsmall = 0xf766; |
| 11831 |
t.G = 0x0047; |
| 11832 |
t.GBsquare = 0x3387; |
| 11833 |
t.Gacute = 0x01f4; |
| 11834 |
t.Gamma = 0x0393; |
| 11835 |
t.Gammaafrican = 0x0194; |
| 11836 |
t.Gangiacoptic = 0x03ea; |
| 11837 |
t.Gbreve = 0x011e; |
| 11838 |
t.Gcaron = 0x01e6; |
| 11839 |
t.Gcedilla = 0x0122; |
| 11840 |
t.Gcircle = 0x24bc; |
| 11841 |
t.Gcircumflex = 0x011c; |
| 11842 |
t.Gcommaaccent = 0x0122; |
| 11843 |
t.Gdot = 0x0120; |
| 11844 |
t.Gdotaccent = 0x0120; |
| 11845 |
t.Gecyrillic = 0x0413; |
| 11846 |
t.Ghadarmenian = 0x0542; |
| 11847 |
t.Ghemiddlehookcyrillic = 0x0494; |
| 11848 |
t.Ghestrokecyrillic = 0x0492; |
| 11849 |
t.Gheupturncyrillic = 0x0490; |
| 11850 |
t.Ghook = 0x0193; |
| 11851 |
t.Gimarmenian = 0x0533; |
| 11852 |
t.Gjecyrillic = 0x0403; |
| 11853 |
t.Gmacron = 0x1e20; |
| 11854 |
t.Gmonospace = 0xff27; |
| 11855 |
t.Grave = 0xf6ce; |
| 11856 |
t.Gravesmall = 0xf760; |
| 11857 |
t.Gsmall = 0xf767; |
| 11858 |
t.Gsmallhook = 0x029b; |
| 11859 |
t.Gstroke = 0x01e4; |
| 11860 |
t.H = 0x0048; |
| 11861 |
t.H18533 = 0x25cf; |
| 11862 |
t.H18543 = 0x25aa; |
| 11863 |
t.H18551 = 0x25ab; |
| 11864 |
t.H22073 = 0x25a1; |
| 11865 |
t.HPsquare = 0x33cb; |
| 11866 |
t.Haabkhasiancyrillic = 0x04a8; |
| 11867 |
t.Hadescendercyrillic = 0x04b2; |
| 11868 |
t.Hardsigncyrillic = 0x042a; |
| 11869 |
t.Hbar = 0x0126; |
| 11870 |
t.Hbrevebelow = 0x1e2a; |
| 11871 |
t.Hcedilla = 0x1e28; |
| 11872 |
t.Hcircle = 0x24bd; |
| 11873 |
t.Hcircumflex = 0x0124; |
| 11874 |
t.Hdieresis = 0x1e26; |
| 11875 |
t.Hdotaccent = 0x1e22; |
| 11876 |
t.Hdotbelow = 0x1e24; |
| 11877 |
t.Hmonospace = 0xff28; |
| 11878 |
t.Hoarmenian = 0x0540; |
| 11879 |
t.Horicoptic = 0x03e8; |
| 11880 |
t.Hsmall = 0xf768; |
| 11881 |
t.Hungarumlaut = 0xf6cf; |
| 11882 |
t.Hungarumlautsmall = 0xf6f8; |
| 11883 |
t.Hzsquare = 0x3390; |
| 11884 |
t.I = 0x0049; |
| 11885 |
t.IAcyrillic = 0x042f; |
| 11886 |
t.IJ = 0x0132; |
| 11887 |
t.IUcyrillic = 0x042e; |
| 11888 |
t.Iacute = 0x00cd; |
| 11889 |
t.Iacutesmall = 0xf7ed; |
| 11890 |
t.Ibreve = 0x012c; |
| 11891 |
t.Icaron = 0x01cf; |
| 11892 |
t.Icircle = 0x24be; |
| 11893 |
t.Icircumflex = 0x00ce; |
| 11894 |
t.Icircumflexsmall = 0xf7ee; |
| 11895 |
t.Icyrillic = 0x0406; |
| 11896 |
t.Idblgrave = 0x0208; |
| 11897 |
t.Idieresis = 0x00cf; |
| 11898 |
t.Idieresisacute = 0x1e2e; |
| 11899 |
t.Idieresiscyrillic = 0x04e4; |
| 11900 |
t.Idieresissmall = 0xf7ef; |
| 11901 |
t.Idot = 0x0130; |
| 11902 |
t.Idotaccent = 0x0130; |
| 11903 |
t.Idotbelow = 0x1eca; |
| 11904 |
t.Iebrevecyrillic = 0x04d6; |
| 11905 |
t.Iecyrillic = 0x0415; |
| 11906 |
t.Ifraktur = 0x2111; |
| 11907 |
t.Igrave = 0x00cc; |
| 11908 |
t.Igravesmall = 0xf7ec; |
| 11909 |
t.Ihookabove = 0x1ec8; |
| 11910 |
t.Iicyrillic = 0x0418; |
| 11911 |
t.Iinvertedbreve = 0x020a; |
| 11912 |
t.Iishortcyrillic = 0x0419; |
| 11913 |
t.Imacron = 0x012a; |
| 11914 |
t.Imacroncyrillic = 0x04e2; |
| 11915 |
t.Imonospace = 0xff29; |
| 11916 |
t.Iniarmenian = 0x053b; |
| 11917 |
t.Iocyrillic = 0x0401; |
| 11918 |
t.Iogonek = 0x012e; |
| 11919 |
t.Iota = 0x0399; |
| 11920 |
t.Iotaafrican = 0x0196; |
| 11921 |
t.Iotadieresis = 0x03aa; |
| 11922 |
t.Iotatonos = 0x038a; |
| 11923 |
t.Ismall = 0xf769; |
| 11924 |
t.Istroke = 0x0197; |
| 11925 |
t.Itilde = 0x0128; |
| 11926 |
t.Itildebelow = 0x1e2c; |
| 11927 |
t.Izhitsacyrillic = 0x0474; |
| 11928 |
t.Izhitsadblgravecyrillic = 0x0476; |
| 11929 |
t.J = 0x004a; |
| 11930 |
t.Jaarmenian = 0x0541; |
| 11931 |
t.Jcircle = 0x24bf; |
| 11932 |
t.Jcircumflex = 0x0134; |
| 11933 |
t.Jecyrillic = 0x0408; |
| 11934 |
t.Jheharmenian = 0x054b; |
| 11935 |
t.Jmonospace = 0xff2a; |
| 11936 |
t.Jsmall = 0xf76a; |
| 11937 |
t.K = 0x004b; |
| 11938 |
t.KBsquare = 0x3385; |
| 11939 |
t.KKsquare = 0x33cd; |
| 11940 |
t.Kabashkircyrillic = 0x04a0; |
| 11941 |
t.Kacute = 0x1e30; |
| 11942 |
t.Kacyrillic = 0x041a; |
| 11943 |
t.Kadescendercyrillic = 0x049a; |
| 11944 |
t.Kahookcyrillic = 0x04c3; |
| 11945 |
t.Kappa = 0x039a; |
| 11946 |
t.Kastrokecyrillic = 0x049e; |
| 11947 |
t.Kaverticalstrokecyrillic = 0x049c; |
| 11948 |
t.Kcaron = 0x01e8; |
| 11949 |
t.Kcedilla = 0x0136; |
| 11950 |
t.Kcircle = 0x24c0; |
| 11951 |
t.Kcommaaccent = 0x0136; |
| 11952 |
t.Kdotbelow = 0x1e32; |
| 11953 |
t.Keharmenian = 0x0554; |
| 11954 |
t.Kenarmenian = 0x053f; |
| 11955 |
t.Khacyrillic = 0x0425; |
| 11956 |
t.Kheicoptic = 0x03e6; |
| 11957 |
t.Khook = 0x0198; |
| 11958 |
t.Kjecyrillic = 0x040c; |
| 11959 |
t.Klinebelow = 0x1e34; |
| 11960 |
t.Kmonospace = 0xff2b; |
| 11961 |
t.Koppacyrillic = 0x0480; |
| 11962 |
t.Koppagreek = 0x03de; |
| 11963 |
t.Ksicyrillic = 0x046e; |
| 11964 |
t.Ksmall = 0xf76b; |
| 11965 |
t.L = 0x004c; |
| 11966 |
t.LJ = 0x01c7; |
| 11967 |
t.LL = 0xf6bf; |
| 11968 |
t.Lacute = 0x0139; |
| 11969 |
t.Lambda = 0x039b; |
| 11970 |
t.Lcaron = 0x013d; |
| 11971 |
t.Lcedilla = 0x013b; |
| 11972 |
t.Lcircle = 0x24c1; |
| 11973 |
t.Lcircumflexbelow = 0x1e3c; |
| 11974 |
t.Lcommaaccent = 0x013b; |
| 11975 |
t.Ldot = 0x013f; |
| 11976 |
t.Ldotaccent = 0x013f; |
| 11977 |
t.Ldotbelow = 0x1e36; |
| 11978 |
t.Ldotbelowmacron = 0x1e38; |
| 11979 |
t.Liwnarmenian = 0x053c; |
| 11980 |
t.Lj = 0x01c8; |
| 11981 |
t.Ljecyrillic = 0x0409; |
| 11982 |
t.Llinebelow = 0x1e3a; |
| 11983 |
t.Lmonospace = 0xff2c; |
| 11984 |
t.Lslash = 0x0141; |
| 11985 |
t.Lslashsmall = 0xf6f9; |
| 11986 |
t.Lsmall = 0xf76c; |
| 11987 |
t.M = 0x004d; |
| 11988 |
t.MBsquare = 0x3386; |
| 11989 |
t.Macron = 0xf6d0; |
| 11990 |
t.Macronsmall = 0xf7af; |
| 11991 |
t.Macute = 0x1e3e; |
| 11992 |
t.Mcircle = 0x24c2; |
| 11993 |
t.Mdotaccent = 0x1e40; |
| 11994 |
t.Mdotbelow = 0x1e42; |
| 11995 |
t.Menarmenian = 0x0544; |
| 11996 |
t.Mmonospace = 0xff2d; |
| 11997 |
t.Msmall = 0xf76d; |
| 11998 |
t.Mturned = 0x019c; |
| 11999 |
t.Mu = 0x039c; |
| 12000 |
t.N = 0x004e; |
| 12001 |
t.NJ = 0x01ca; |
| 12002 |
t.Nacute = 0x0143; |
| 12003 |
t.Ncaron = 0x0147; |
| 12004 |
t.Ncedilla = 0x0145; |
| 12005 |
t.Ncircle = 0x24c3; |
| 12006 |
t.Ncircumflexbelow = 0x1e4a; |
| 12007 |
t.Ncommaaccent = 0x0145; |
| 12008 |
t.Ndotaccent = 0x1e44; |
| 12009 |
t.Ndotbelow = 0x1e46; |
| 12010 |
t.Nhookleft = 0x019d; |
| 12011 |
t.Nineroman = 0x2168; |
| 12012 |
t.Nj = 0x01cb; |
| 12013 |
t.Njecyrillic = 0x040a; |
| 12014 |
t.Nlinebelow = 0x1e48; |
| 12015 |
t.Nmonospace = 0xff2e; |
| 12016 |
t.Nowarmenian = 0x0546; |
| 12017 |
t.Nsmall = 0xf76e; |
| 12018 |
t.Ntilde = 0x00d1; |
| 12019 |
t.Ntildesmall = 0xf7f1; |
| 12020 |
t.Nu = 0x039d; |
| 12021 |
t.O = 0x004f; |
| 12022 |
t.OE = 0x0152; |
| 12023 |
t.OEsmall = 0xf6fa; |
| 12024 |
t.Oacute = 0x00d3; |
| 12025 |
t.Oacutesmall = 0xf7f3; |
| 12026 |
t.Obarredcyrillic = 0x04e8; |
| 12027 |
t.Obarreddieresiscyrillic = 0x04ea; |
| 12028 |
t.Obreve = 0x014e; |
| 12029 |
t.Ocaron = 0x01d1; |
| 12030 |
t.Ocenteredtilde = 0x019f; |
| 12031 |
t.Ocircle = 0x24c4; |
| 12032 |
t.Ocircumflex = 0x00d4; |
| 12033 |
t.Ocircumflexacute = 0x1ed0; |
| 12034 |
t.Ocircumflexdotbelow = 0x1ed8; |
| 12035 |
t.Ocircumflexgrave = 0x1ed2; |
| 12036 |
t.Ocircumflexhookabove = 0x1ed4; |
| 12037 |
t.Ocircumflexsmall = 0xf7f4; |
| 12038 |
t.Ocircumflextilde = 0x1ed6; |
| 12039 |
t.Ocyrillic = 0x041e; |
| 12040 |
t.Odblacute = 0x0150; |
| 12041 |
t.Odblgrave = 0x020c; |
| 12042 |
t.Odieresis = 0x00d6; |
| 12043 |
t.Odieresiscyrillic = 0x04e6; |
| 12044 |
t.Odieresissmall = 0xf7f6; |
| 12045 |
t.Odotbelow = 0x1ecc; |
| 12046 |
t.Ogoneksmall = 0xf6fb; |
| 12047 |
t.Ograve = 0x00d2; |
| 12048 |
t.Ogravesmall = 0xf7f2; |
| 12049 |
t.Oharmenian = 0x0555; |
| 12050 |
t.Ohm = 0x2126; |
| 12051 |
t.Ohookabove = 0x1ece; |
| 12052 |
t.Ohorn = 0x01a0; |
| 12053 |
t.Ohornacute = 0x1eda; |
| 12054 |
t.Ohorndotbelow = 0x1ee2; |
| 12055 |
t.Ohorngrave = 0x1edc; |
| 12056 |
t.Ohornhookabove = 0x1ede; |
| 12057 |
t.Ohorntilde = 0x1ee0; |
| 12058 |
t.Ohungarumlaut = 0x0150; |
| 12059 |
t.Oi = 0x01a2; |
| 12060 |
t.Oinvertedbreve = 0x020e; |
| 12061 |
t.Omacron = 0x014c; |
| 12062 |
t.Omacronacute = 0x1e52; |
| 12063 |
t.Omacrongrave = 0x1e50; |
| 12064 |
t.Omega = 0x2126; |
| 12065 |
t.Omegacyrillic = 0x0460; |
| 12066 |
t.Omegagreek = 0x03a9; |
| 12067 |
t.Omegaroundcyrillic = 0x047a; |
| 12068 |
t.Omegatitlocyrillic = 0x047c; |
| 12069 |
t.Omegatonos = 0x038f; |
| 12070 |
t.Omicron = 0x039f; |
| 12071 |
t.Omicrontonos = 0x038c; |
| 12072 |
t.Omonospace = 0xff2f; |
| 12073 |
t.Oneroman = 0x2160; |
| 12074 |
t.Oogonek = 0x01ea; |
| 12075 |
t.Oogonekmacron = 0x01ec; |
| 12076 |
t.Oopen = 0x0186; |
| 12077 |
t.Oslash = 0x00d8; |
| 12078 |
t.Oslashacute = 0x01fe; |
| 12079 |
t.Oslashsmall = 0xf7f8; |
| 12080 |
t.Osmall = 0xf76f; |
| 12081 |
t.Ostrokeacute = 0x01fe; |
| 12082 |
t.Otcyrillic = 0x047e; |
| 12083 |
t.Otilde = 0x00d5; |
| 12084 |
t.Otildeacute = 0x1e4c; |
| 12085 |
t.Otildedieresis = 0x1e4e; |
| 12086 |
t.Otildesmall = 0xf7f5; |
| 12087 |
t.P = 0x0050; |
| 12088 |
t.Pacute = 0x1e54; |
| 12089 |
t.Pcircle = 0x24c5; |
| 12090 |
t.Pdotaccent = 0x1e56; |
| 12091 |
t.Pecyrillic = 0x041f; |
| 12092 |
t.Peharmenian = 0x054a; |
| 12093 |
t.Pemiddlehookcyrillic = 0x04a6; |
| 12094 |
t.Phi = 0x03a6; |
| 12095 |
t.Phook = 0x01a4; |
| 12096 |
t.Pi = 0x03a0; |
| 12097 |
t.Piwrarmenian = 0x0553; |
| 12098 |
t.Pmonospace = 0xff30; |
| 12099 |
t.Psi = 0x03a8; |
| 12100 |
t.Psicyrillic = 0x0470; |
| 12101 |
t.Psmall = 0xf770; |
| 12102 |
t.Q = 0x0051; |
| 12103 |
t.Qcircle = 0x24c6; |
| 12104 |
t.Qmonospace = 0xff31; |
| 12105 |
t.Qsmall = 0xf771; |
| 12106 |
t.R = 0x0052; |
| 12107 |
t.Raarmenian = 0x054c; |
| 12108 |
t.Racute = 0x0154; |
| 12109 |
t.Rcaron = 0x0158; |
| 12110 |
t.Rcedilla = 0x0156; |
| 12111 |
t.Rcircle = 0x24c7; |
| 12112 |
t.Rcommaaccent = 0x0156; |
| 12113 |
t.Rdblgrave = 0x0210; |
| 12114 |
t.Rdotaccent = 0x1e58; |
| 12115 |
t.Rdotbelow = 0x1e5a; |
| 12116 |
t.Rdotbelowmacron = 0x1e5c; |
| 12117 |
t.Reharmenian = 0x0550; |
| 12118 |
t.Rfraktur = 0x211c; |
| 12119 |
t.Rho = 0x03a1; |
| 12120 |
t.Ringsmall = 0xf6fc; |
| 12121 |
t.Rinvertedbreve = 0x0212; |
| 12122 |
t.Rlinebelow = 0x1e5e; |
| 12123 |
t.Rmonospace = 0xff32; |
| 12124 |
t.Rsmall = 0xf772; |
| 12125 |
t.Rsmallinverted = 0x0281; |
| 12126 |
t.Rsmallinvertedsuperior = 0x02b6; |
| 12127 |
t.S = 0x0053; |
| 12128 |
t.SF010000 = 0x250c; |
| 12129 |
t.SF020000 = 0x2514; |
| 12130 |
t.SF030000 = 0x2510; |
| 12131 |
t.SF040000 = 0x2518; |
| 12132 |
t.SF050000 = 0x253c; |
| 12133 |
t.SF060000 = 0x252c; |
| 12134 |
t.SF070000 = 0x2534; |
| 12135 |
t.SF080000 = 0x251c; |
| 12136 |
t.SF090000 = 0x2524; |
| 12137 |
t.SF100000 = 0x2500; |
| 12138 |
t.SF110000 = 0x2502; |
| 12139 |
t.SF190000 = 0x2561; |
| 12140 |
t.SF200000 = 0x2562; |
| 12141 |
t.SF210000 = 0x2556; |
| 12142 |
t.SF220000 = 0x2555; |
| 12143 |
t.SF230000 = 0x2563; |
| 12144 |
t.SF240000 = 0x2551; |
| 12145 |
t.SF250000 = 0x2557; |
| 12146 |
t.SF260000 = 0x255d; |
| 12147 |
t.SF270000 = 0x255c; |
| 12148 |
t.SF280000 = 0x255b; |
| 12149 |
t.SF360000 = 0x255e; |
| 12150 |
t.SF370000 = 0x255f; |
| 12151 |
t.SF380000 = 0x255a; |
| 12152 |
t.SF390000 = 0x2554; |
| 12153 |
t.SF400000 = 0x2569; |
| 12154 |
t.SF410000 = 0x2566; |
| 12155 |
t.SF420000 = 0x2560; |
| 12156 |
t.SF430000 = 0x2550; |
| 12157 |
t.SF440000 = 0x256c; |
| 12158 |
t.SF450000 = 0x2567; |
| 12159 |
t.SF460000 = 0x2568; |
| 12160 |
t.SF470000 = 0x2564; |
| 12161 |
t.SF480000 = 0x2565; |
| 12162 |
t.SF490000 = 0x2559; |
| 12163 |
t.SF500000 = 0x2558; |
| 12164 |
t.SF510000 = 0x2552; |
| 12165 |
t.SF520000 = 0x2553; |
| 12166 |
t.SF530000 = 0x256b; |
| 12167 |
t.SF540000 = 0x256a; |
| 12168 |
t.Sacute = 0x015a; |
| 12169 |
t.Sacutedotaccent = 0x1e64; |
| 12170 |
t.Sampigreek = 0x03e0; |
| 12171 |
t.Scaron = 0x0160; |
| 12172 |
t.Scarondotaccent = 0x1e66; |
| 12173 |
t.Scaronsmall = 0xf6fd; |
| 12174 |
t.Scedilla = 0x015e; |
| 12175 |
t.Schwa = 0x018f; |
| 12176 |
t.Schwacyrillic = 0x04d8; |
| 12177 |
t.Schwadieresiscyrillic = 0x04da; |
| 12178 |
t.Scircle = 0x24c8; |
| 12179 |
t.Scircumflex = 0x015c; |
| 12180 |
t.Scommaaccent = 0x0218; |
| 12181 |
t.Sdotaccent = 0x1e60; |
| 12182 |
t.Sdotbelow = 0x1e62; |
| 12183 |
t.Sdotbelowdotaccent = 0x1e68; |
| 12184 |
t.Seharmenian = 0x054d; |
| 12185 |
t.Sevenroman = 0x2166; |
| 12186 |
t.Shaarmenian = 0x0547; |
| 12187 |
t.Shacyrillic = 0x0428; |
| 12188 |
t.Shchacyrillic = 0x0429; |
| 12189 |
t.Sheicoptic = 0x03e2; |
| 12190 |
t.Shhacyrillic = 0x04ba; |
| 12191 |
t.Shimacoptic = 0x03ec; |
| 12192 |
t.Sigma = 0x03a3; |
| 12193 |
t.Sixroman = 0x2165; |
| 12194 |
t.Smonospace = 0xff33; |
| 12195 |
t.Softsigncyrillic = 0x042c; |
| 12196 |
t.Ssmall = 0xf773; |
| 12197 |
t.Stigmagreek = 0x03da; |
| 12198 |
t.T = 0x0054; |
| 12199 |
t.Tau = 0x03a4; |
| 12200 |
t.Tbar = 0x0166; |
| 12201 |
t.Tcaron = 0x0164; |
| 12202 |
t.Tcedilla = 0x0162; |
| 12203 |
t.Tcircle = 0x24c9; |
| 12204 |
t.Tcircumflexbelow = 0x1e70; |
| 12205 |
t.Tcommaaccent = 0x0162; |
| 12206 |
t.Tdotaccent = 0x1e6a; |
| 12207 |
t.Tdotbelow = 0x1e6c; |
| 12208 |
t.Tecyrillic = 0x0422; |
| 12209 |
t.Tedescendercyrillic = 0x04ac; |
| 12210 |
t.Tenroman = 0x2169; |
| 12211 |
t.Tetsecyrillic = 0x04b4; |
| 12212 |
t.Theta = 0x0398; |
| 12213 |
t.Thook = 0x01ac; |
| 12214 |
t.Thorn = 0x00de; |
| 12215 |
t.Thornsmall = 0xf7fe; |
| 12216 |
t.Threeroman = 0x2162; |
| 12217 |
t.Tildesmall = 0xf6fe; |
| 12218 |
t.Tiwnarmenian = 0x054f; |
| 12219 |
t.Tlinebelow = 0x1e6e; |
| 12220 |
t.Tmonospace = 0xff34; |
| 12221 |
t.Toarmenian = 0x0539; |
| 12222 |
t.Tonefive = 0x01bc; |
| 12223 |
t.Tonesix = 0x0184; |
| 12224 |
t.Tonetwo = 0x01a7; |
| 12225 |
t.Tretroflexhook = 0x01ae; |
| 12226 |
t.Tsecyrillic = 0x0426; |
| 12227 |
t.Tshecyrillic = 0x040b; |
| 12228 |
t.Tsmall = 0xf774; |
| 12229 |
t.Twelveroman = 0x216b; |
| 12230 |
t.Tworoman = 0x2161; |
| 12231 |
t.U = 0x0055; |
| 12232 |
t.Uacute = 0x00da; |
| 12233 |
t.Uacutesmall = 0xf7fa; |
| 12234 |
t.Ubreve = 0x016c; |
| 12235 |
t.Ucaron = 0x01d3; |
| 12236 |
t.Ucircle = 0x24ca; |
| 12237 |
t.Ucircumflex = 0x00db; |
| 12238 |
t.Ucircumflexbelow = 0x1e76; |
| 12239 |
t.Ucircumflexsmall = 0xf7fb; |
| 12240 |
t.Ucyrillic = 0x0423; |
| 12241 |
t.Udblacute = 0x0170; |
| 12242 |
t.Udblgrave = 0x0214; |
| 12243 |
t.Udieresis = 0x00dc; |
| 12244 |
t.Udieresisacute = 0x01d7; |
| 12245 |
t.Udieresisbelow = 0x1e72; |
| 12246 |
t.Udieresiscaron = 0x01d9; |
| 12247 |
t.Udieresiscyrillic = 0x04f0; |
| 12248 |
t.Udieresisgrave = 0x01db; |
| 12249 |
t.Udieresismacron = 0x01d5; |
| 12250 |
t.Udieresissmall = 0xf7fc; |
| 12251 |
t.Udotbelow = 0x1ee4; |
| 12252 |
t.Ugrave = 0x00d9; |
| 12253 |
t.Ugravesmall = 0xf7f9; |
| 12254 |
t.Uhookabove = 0x1ee6; |
| 12255 |
t.Uhorn = 0x01af; |
| 12256 |
t.Uhornacute = 0x1ee8; |
| 12257 |
t.Uhorndotbelow = 0x1ef0; |
| 12258 |
t.Uhorngrave = 0x1eea; |
| 12259 |
t.Uhornhookabove = 0x1eec; |
| 12260 |
t.Uhorntilde = 0x1eee; |
| 12261 |
t.Uhungarumlaut = 0x0170; |
| 12262 |
t.Uhungarumlautcyrillic = 0x04f2; |
| 12263 |
t.Uinvertedbreve = 0x0216; |
| 12264 |
t.Ukcyrillic = 0x0478; |
| 12265 |
t.Umacron = 0x016a; |
| 12266 |
t.Umacroncyrillic = 0x04ee; |
| 12267 |
t.Umacrondieresis = 0x1e7a; |
| 12268 |
t.Umonospace = 0xff35; |
| 12269 |
t.Uogonek = 0x0172; |
| 12270 |
t.Upsilon = 0x03a5; |
| 12271 |
t.Upsilon1 = 0x03d2; |
| 12272 |
t.Upsilonacutehooksymbolgreek = 0x03d3; |
| 12273 |
t.Upsilonafrican = 0x01b1; |
| 12274 |
t.Upsilondieresis = 0x03ab; |
| 12275 |
t.Upsilondieresishooksymbolgreek = 0x03d4; |
| 12276 |
t.Upsilonhooksymbol = 0x03d2; |
| 12277 |
t.Upsilontonos = 0x038e; |
| 12278 |
t.Uring = 0x016e; |
| 12279 |
t.Ushortcyrillic = 0x040e; |
| 12280 |
t.Usmall = 0xf775; |
| 12281 |
t.Ustraightcyrillic = 0x04ae; |
| 12282 |
t.Ustraightstrokecyrillic = 0x04b0; |
| 12283 |
t.Utilde = 0x0168; |
| 12284 |
t.Utildeacute = 0x1e78; |
| 12285 |
t.Utildebelow = 0x1e74; |
| 12286 |
t.V = 0x0056; |
| 12287 |
t.Vcircle = 0x24cb; |
| 12288 |
t.Vdotbelow = 0x1e7e; |
| 12289 |
t.Vecyrillic = 0x0412; |
| 12290 |
t.Vewarmenian = 0x054e; |
| 12291 |
t.Vhook = 0x01b2; |
| 12292 |
t.Vmonospace = 0xff36; |
| 12293 |
t.Voarmenian = 0x0548; |
| 12294 |
t.Vsmall = 0xf776; |
| 12295 |
t.Vtilde = 0x1e7c; |
| 12296 |
t.W = 0x0057; |
| 12297 |
t.Wacute = 0x1e82; |
| 12298 |
t.Wcircle = 0x24cc; |
| 12299 |
t.Wcircumflex = 0x0174; |
| 12300 |
t.Wdieresis = 0x1e84; |
| 12301 |
t.Wdotaccent = 0x1e86; |
| 12302 |
t.Wdotbelow = 0x1e88; |
| 12303 |
t.Wgrave = 0x1e80; |
| 12304 |
t.Wmonospace = 0xff37; |
| 12305 |
t.Wsmall = 0xf777; |
| 12306 |
t.X = 0x0058; |
| 12307 |
t.Xcircle = 0x24cd; |
| 12308 |
t.Xdieresis = 0x1e8c; |
| 12309 |
t.Xdotaccent = 0x1e8a; |
| 12310 |
t.Xeharmenian = 0x053d; |
| 12311 |
t.Xi = 0x039e; |
| 12312 |
t.Xmonospace = 0xff38; |
| 12313 |
t.Xsmall = 0xf778; |
| 12314 |
t.Y = 0x0059; |
| 12315 |
t.Yacute = 0x00dd; |
| 12316 |
t.Yacutesmall = 0xf7fd; |
| 12317 |
t.Yatcyrillic = 0x0462; |
| 12318 |
t.Ycircle = 0x24ce; |
| 12319 |
t.Ycircumflex = 0x0176; |
| 12320 |
t.Ydieresis = 0x0178; |
| 12321 |
t.Ydieresissmall = 0xf7ff; |
| 12322 |
t.Ydotaccent = 0x1e8e; |
| 12323 |
t.Ydotbelow = 0x1ef4; |
| 12324 |
t.Yericyrillic = 0x042b; |
| 12325 |
t.Yerudieresiscyrillic = 0x04f8; |
| 12326 |
t.Ygrave = 0x1ef2; |
| 12327 |
t.Yhook = 0x01b3; |
| 12328 |
t.Yhookabove = 0x1ef6; |
| 12329 |
t.Yiarmenian = 0x0545; |
| 12330 |
t.Yicyrillic = 0x0407; |
| 12331 |
t.Yiwnarmenian = 0x0552; |
| 12332 |
t.Ymonospace = 0xff39; |
| 12333 |
t.Ysmall = 0xf779; |
| 12334 |
t.Ytilde = 0x1ef8; |
| 12335 |
t.Yusbigcyrillic = 0x046a; |
| 12336 |
t.Yusbigiotifiedcyrillic = 0x046c; |
| 12337 |
t.Yuslittlecyrillic = 0x0466; |
| 12338 |
t.Yuslittleiotifiedcyrillic = 0x0468; |
| 12339 |
t.Z = 0x005a; |
| 12340 |
t.Zaarmenian = 0x0536; |
| 12341 |
t.Zacute = 0x0179; |
| 12342 |
t.Zcaron = 0x017d; |
| 12343 |
t.Zcaronsmall = 0xf6ff; |
| 12344 |
t.Zcircle = 0x24cf; |
| 12345 |
t.Zcircumflex = 0x1e90; |
| 12346 |
t.Zdot = 0x017b; |
| 12347 |
t.Zdotaccent = 0x017b; |
| 12348 |
t.Zdotbelow = 0x1e92; |
| 12349 |
t.Zecyrillic = 0x0417; |
| 12350 |
t.Zedescendercyrillic = 0x0498; |
| 12351 |
t.Zedieresiscyrillic = 0x04de; |
| 12352 |
t.Zeta = 0x0396; |
| 12353 |
t.Zhearmenian = 0x053a; |
| 12354 |
t.Zhebrevecyrillic = 0x04c1; |
| 12355 |
t.Zhecyrillic = 0x0416; |
| 12356 |
t.Zhedescendercyrillic = 0x0496; |
| 12357 |
t.Zhedieresiscyrillic = 0x04dc; |
| 12358 |
t.Zlinebelow = 0x1e94; |
| 12359 |
t.Zmonospace = 0xff3a; |
| 12360 |
t.Zsmall = 0xf77a; |
| 12361 |
t.Zstroke = 0x01b5; |
| 12362 |
t.a = 0x0061; |
| 12363 |
t.aabengali = 0x0986; |
| 12364 |
t.aacute = 0x00e1; |
| 12365 |
t.aadeva = 0x0906; |
| 12366 |
t.aagujarati = 0x0a86; |
| 12367 |
t.aagurmukhi = 0x0a06; |
| 12368 |
t.aamatragurmukhi = 0x0a3e; |
| 12369 |
t.aarusquare = 0x3303; |
| 12370 |
t.aavowelsignbengali = 0x09be; |
| 12371 |
t.aavowelsigndeva = 0x093e; |
| 12372 |
t.aavowelsigngujarati = 0x0abe; |
| 12373 |
t.abbreviationmarkarmenian = 0x055f; |
| 12374 |
t.abbreviationsigndeva = 0x0970; |
| 12375 |
t.abengali = 0x0985; |
| 12376 |
t.abopomofo = 0x311a; |
| 12377 |
t.abreve = 0x0103; |
| 12378 |
t.abreveacute = 0x1eaf; |
| 12379 |
t.abrevecyrillic = 0x04d1; |
| 12380 |
t.abrevedotbelow = 0x1eb7; |
| 12381 |
t.abrevegrave = 0x1eb1; |
| 12382 |
t.abrevehookabove = 0x1eb3; |
| 12383 |
t.abrevetilde = 0x1eb5; |
| 12384 |
t.acaron = 0x01ce; |
| 12385 |
t.acircle = 0x24d0; |
| 12386 |
t.acircumflex = 0x00e2; |
| 12387 |
t.acircumflexacute = 0x1ea5; |
| 12388 |
t.acircumflexdotbelow = 0x1ead; |
| 12389 |
t.acircumflexgrave = 0x1ea7; |
| 12390 |
t.acircumflexhookabove = 0x1ea9; |
| 12391 |
t.acircumflextilde = 0x1eab; |
| 12392 |
t.acute = 0x00b4; |
| 12393 |
t.acutebelowcmb = 0x0317; |
| 12394 |
t.acutecmb = 0x0301; |
| 12395 |
t.acutecomb = 0x0301; |
| 12396 |
t.acutedeva = 0x0954; |
| 12397 |
t.acutelowmod = 0x02cf; |
| 12398 |
t.acutetonecmb = 0x0341; |
| 12399 |
t.acyrillic = 0x0430; |
| 12400 |
t.adblgrave = 0x0201; |
| 12401 |
t.addakgurmukhi = 0x0a71; |
| 12402 |
t.adeva = 0x0905; |
| 12403 |
t.adieresis = 0x00e4; |
| 12404 |
t.adieresiscyrillic = 0x04d3; |
| 12405 |
t.adieresismacron = 0x01df; |
| 12406 |
t.adotbelow = 0x1ea1; |
| 12407 |
t.adotmacron = 0x01e1; |
| 12408 |
t.ae = 0x00e6; |
| 12409 |
t.aeacute = 0x01fd; |
| 12410 |
t.aekorean = 0x3150; |
| 12411 |
t.aemacron = 0x01e3; |
| 12412 |
t.afii00208 = 0x2015; |
| 12413 |
t.afii08941 = 0x20a4; |
| 12414 |
t.afii10017 = 0x0410; |
| 12415 |
t.afii10018 = 0x0411; |
| 12416 |
t.afii10019 = 0x0412; |
| 12417 |
t.afii10020 = 0x0413; |
| 12418 |
t.afii10021 = 0x0414; |
| 12419 |
t.afii10022 = 0x0415; |
| 12420 |
t.afii10023 = 0x0401; |
| 12421 |
t.afii10024 = 0x0416; |
| 12422 |
t.afii10025 = 0x0417; |
| 12423 |
t.afii10026 = 0x0418; |
| 12424 |
t.afii10027 = 0x0419; |
| 12425 |
t.afii10028 = 0x041a; |
| 12426 |
t.afii10029 = 0x041b; |
| 12427 |
t.afii10030 = 0x041c; |
| 12428 |
t.afii10031 = 0x041d; |
| 12429 |
t.afii10032 = 0x041e; |
| 12430 |
t.afii10033 = 0x041f; |
| 12431 |
t.afii10034 = 0x0420; |
| 12432 |
t.afii10035 = 0x0421; |
| 12433 |
t.afii10036 = 0x0422; |
| 12434 |
t.afii10037 = 0x0423; |
| 12435 |
t.afii10038 = 0x0424; |
| 12436 |
t.afii10039 = 0x0425; |
| 12437 |
t.afii10040 = 0x0426; |
| 12438 |
t.afii10041 = 0x0427; |
| 12439 |
t.afii10042 = 0x0428; |
| 12440 |
t.afii10043 = 0x0429; |
| 12441 |
t.afii10044 = 0x042a; |
| 12442 |
t.afii10045 = 0x042b; |
| 12443 |
t.afii10046 = 0x042c; |
| 12444 |
t.afii10047 = 0x042d; |
| 12445 |
t.afii10048 = 0x042e; |
| 12446 |
t.afii10049 = 0x042f; |
| 12447 |
t.afii10050 = 0x0490; |
| 12448 |
t.afii10051 = 0x0402; |
| 12449 |
t.afii10052 = 0x0403; |
| 12450 |
t.afii10053 = 0x0404; |
| 12451 |
t.afii10054 = 0x0405; |
| 12452 |
t.afii10055 = 0x0406; |
| 12453 |
t.afii10056 = 0x0407; |
| 12454 |
t.afii10057 = 0x0408; |
| 12455 |
t.afii10058 = 0x0409; |
| 12456 |
t.afii10059 = 0x040a; |
| 12457 |
t.afii10060 = 0x040b; |
| 12458 |
t.afii10061 = 0x040c; |
| 12459 |
t.afii10062 = 0x040e; |
| 12460 |
t.afii10063 = 0xf6c4; |
| 12461 |
t.afii10064 = 0xf6c5; |
| 12462 |
t.afii10065 = 0x0430; |
| 12463 |
t.afii10066 = 0x0431; |
| 12464 |
t.afii10067 = 0x0432; |
| 12465 |
t.afii10068 = 0x0433; |
| 12466 |
t.afii10069 = 0x0434; |
| 12467 |
t.afii10070 = 0x0435; |
| 12468 |
t.afii10071 = 0x0451; |
| 12469 |
t.afii10072 = 0x0436; |
| 12470 |
t.afii10073 = 0x0437; |
| 12471 |
t.afii10074 = 0x0438; |
| 12472 |
t.afii10075 = 0x0439; |
| 12473 |
t.afii10076 = 0x043a; |
| 12474 |
t.afii10077 = 0x043b; |
| 12475 |
t.afii10078 = 0x043c; |
| 12476 |
t.afii10079 = 0x043d; |
| 12477 |
t.afii10080 = 0x043e; |
| 12478 |
t.afii10081 = 0x043f; |
| 12479 |
t.afii10082 = 0x0440; |
| 12480 |
t.afii10083 = 0x0441; |
| 12481 |
t.afii10084 = 0x0442; |
| 12482 |
t.afii10085 = 0x0443; |
| 12483 |
t.afii10086 = 0x0444; |
| 12484 |
t.afii10087 = 0x0445; |
| 12485 |
t.afii10088 = 0x0446; |
| 12486 |
t.afii10089 = 0x0447; |
| 12487 |
t.afii10090 = 0x0448; |
| 12488 |
t.afii10091 = 0x0449; |
| 12489 |
t.afii10092 = 0x044a; |
| 12490 |
t.afii10093 = 0x044b; |
| 12491 |
t.afii10094 = 0x044c; |
| 12492 |
t.afii10095 = 0x044d; |
| 12493 |
t.afii10096 = 0x044e; |
| 12494 |
t.afii10097 = 0x044f; |
| 12495 |
t.afii10098 = 0x0491; |
| 12496 |
t.afii10099 = 0x0452; |
| 12497 |
t.afii10100 = 0x0453; |
| 12498 |
t.afii10101 = 0x0454; |
| 12499 |
t.afii10102 = 0x0455; |
| 12500 |
t.afii10103 = 0x0456; |
| 12501 |
t.afii10104 = 0x0457; |
| 12502 |
t.afii10105 = 0x0458; |
| 12503 |
t.afii10106 = 0x0459; |
| 12504 |
t.afii10107 = 0x045a; |
| 12505 |
t.afii10108 = 0x045b; |
| 12506 |
t.afii10109 = 0x045c; |
| 12507 |
t.afii10110 = 0x045e; |
| 12508 |
t.afii10145 = 0x040f; |
| 12509 |
t.afii10146 = 0x0462; |
| 12510 |
t.afii10147 = 0x0472; |
| 12511 |
t.afii10148 = 0x0474; |
| 12512 |
t.afii10192 = 0xf6c6; |
| 12513 |
t.afii10193 = 0x045f; |
| 12514 |
t.afii10194 = 0x0463; |
| 12515 |
t.afii10195 = 0x0473; |
| 12516 |
t.afii10196 = 0x0475; |
| 12517 |
t.afii10831 = 0xf6c7; |
| 12518 |
t.afii10832 = 0xf6c8; |
| 12519 |
t.afii10846 = 0x04d9; |
| 12520 |
t.afii299 = 0x200e; |
| 12521 |
t.afii300 = 0x200f; |
| 12522 |
t.afii301 = 0x200d; |
| 12523 |
t.afii57381 = 0x066a; |
| 12524 |
t.afii57388 = 0x060c; |
| 12525 |
t.afii57392 = 0x0660; |
| 12526 |
t.afii57393 = 0x0661; |
| 12527 |
t.afii57394 = 0x0662; |
| 12528 |
t.afii57395 = 0x0663; |
| 12529 |
t.afii57396 = 0x0664; |
| 12530 |
t.afii57397 = 0x0665; |
| 12531 |
t.afii57398 = 0x0666; |
| 12532 |
t.afii57399 = 0x0667; |
| 12533 |
t.afii57400 = 0x0668; |
| 12534 |
t.afii57401 = 0x0669; |
| 12535 |
t.afii57403 = 0x061b; |
| 12536 |
t.afii57407 = 0x061f; |
| 12537 |
t.afii57409 = 0x0621; |
| 12538 |
t.afii57410 = 0x0622; |
| 12539 |
t.afii57411 = 0x0623; |
| 12540 |
t.afii57412 = 0x0624; |
| 12541 |
t.afii57413 = 0x0625; |
| 12542 |
t.afii57414 = 0x0626; |
| 12543 |
t.afii57415 = 0x0627; |
| 12544 |
t.afii57416 = 0x0628; |
| 12545 |
t.afii57417 = 0x0629; |
| 12546 |
t.afii57418 = 0x062a; |
| 12547 |
t.afii57419 = 0x062b; |
| 12548 |
t.afii57420 = 0x062c; |
| 12549 |
t.afii57421 = 0x062d; |
| 12550 |
t.afii57422 = 0x062e; |
| 12551 |
t.afii57423 = 0x062f; |
| 12552 |
t.afii57424 = 0x0630; |
| 12553 |
t.afii57425 = 0x0631; |
| 12554 |
t.afii57426 = 0x0632; |
| 12555 |
t.afii57427 = 0x0633; |
| 12556 |
t.afii57428 = 0x0634; |
| 12557 |
t.afii57429 = 0x0635; |
| 12558 |
t.afii57430 = 0x0636; |
| 12559 |
t.afii57431 = 0x0637; |
| 12560 |
t.afii57432 = 0x0638; |
| 12561 |
t.afii57433 = 0x0639; |
| 12562 |
t.afii57434 = 0x063a; |
| 12563 |
t.afii57440 = 0x0640; |
| 12564 |
t.afii57441 = 0x0641; |
| 12565 |
t.afii57442 = 0x0642; |
| 12566 |
t.afii57443 = 0x0643; |
| 12567 |
t.afii57444 = 0x0644; |
| 12568 |
t.afii57445 = 0x0645; |
| 12569 |
t.afii57446 = 0x0646; |
| 12570 |
t.afii57448 = 0x0648; |
| 12571 |
t.afii57449 = 0x0649; |
| 12572 |
t.afii57450 = 0x064a; |
| 12573 |
t.afii57451 = 0x064b; |
| 12574 |
t.afii57452 = 0x064c; |
| 12575 |
t.afii57453 = 0x064d; |
| 12576 |
t.afii57454 = 0x064e; |
| 12577 |
t.afii57455 = 0x064f; |
| 12578 |
t.afii57456 = 0x0650; |
| 12579 |
t.afii57457 = 0x0651; |
| 12580 |
t.afii57458 = 0x0652; |
| 12581 |
t.afii57470 = 0x0647; |
| 12582 |
t.afii57505 = 0x06a4; |
| 12583 |
t.afii57506 = 0x067e; |
| 12584 |
t.afii57507 = 0x0686; |
| 12585 |
t.afii57508 = 0x0698; |
| 12586 |
t.afii57509 = 0x06af; |
| 12587 |
t.afii57511 = 0x0679; |
| 12588 |
t.afii57512 = 0x0688; |
| 12589 |
t.afii57513 = 0x0691; |
| 12590 |
t.afii57514 = 0x06ba; |
| 12591 |
t.afii57519 = 0x06d2; |
| 12592 |
t.afii57534 = 0x06d5; |
| 12593 |
t.afii57636 = 0x20aa; |
| 12594 |
t.afii57645 = 0x05be; |
| 12595 |
t.afii57658 = 0x05c3; |
| 12596 |
t.afii57664 = 0x05d0; |
| 12597 |
t.afii57665 = 0x05d1; |
| 12598 |
t.afii57666 = 0x05d2; |
| 12599 |
t.afii57667 = 0x05d3; |
| 12600 |
t.afii57668 = 0x05d4; |
| 12601 |
t.afii57669 = 0x05d5; |
| 12602 |
t.afii57670 = 0x05d6; |
| 12603 |
t.afii57671 = 0x05d7; |
| 12604 |
t.afii57672 = 0x05d8; |
| 12605 |
t.afii57673 = 0x05d9; |
| 12606 |
t.afii57674 = 0x05da; |
| 12607 |
t.afii57675 = 0x05db; |
| 12608 |
t.afii57676 = 0x05dc; |
| 12609 |
t.afii57677 = 0x05dd; |
| 12610 |
t.afii57678 = 0x05de; |
| 12611 |
t.afii57679 = 0x05df; |
| 12612 |
t.afii57680 = 0x05e0; |
| 12613 |
t.afii57681 = 0x05e1; |
| 12614 |
t.afii57682 = 0x05e2; |
| 12615 |
t.afii57683 = 0x05e3; |
| 12616 |
t.afii57684 = 0x05e4; |
| 12617 |
t.afii57685 = 0x05e5; |
| 12618 |
t.afii57686 = 0x05e6; |
| 12619 |
t.afii57687 = 0x05e7; |
| 12620 |
t.afii57688 = 0x05e8; |
| 12621 |
t.afii57689 = 0x05e9; |
| 12622 |
t.afii57690 = 0x05ea; |
| 12623 |
t.afii57694 = 0xfb2a; |
| 12624 |
t.afii57695 = 0xfb2b; |
| 12625 |
t.afii57700 = 0xfb4b; |
| 12626 |
t.afii57705 = 0xfb1f; |
| 12627 |
t.afii57716 = 0x05f0; |
| 12628 |
t.afii57717 = 0x05f1; |
| 12629 |
t.afii57718 = 0x05f2; |
| 12630 |
t.afii57723 = 0xfb35; |
| 12631 |
t.afii57793 = 0x05b4; |
| 12632 |
t.afii57794 = 0x05b5; |
| 12633 |
t.afii57795 = 0x05b6; |
| 12634 |
t.afii57796 = 0x05bb; |
| 12635 |
t.afii57797 = 0x05b8; |
| 12636 |
t.afii57798 = 0x05b7; |
| 12637 |
t.afii57799 = 0x05b0; |
| 12638 |
t.afii57800 = 0x05b2; |
| 12639 |
t.afii57801 = 0x05b1; |
| 12640 |
t.afii57802 = 0x05b3; |
| 12641 |
t.afii57803 = 0x05c2; |
| 12642 |
t.afii57804 = 0x05c1; |
| 12643 |
t.afii57806 = 0x05b9; |
| 12644 |
t.afii57807 = 0x05bc; |
| 12645 |
t.afii57839 = 0x05bd; |
| 12646 |
t.afii57841 = 0x05bf; |
| 12647 |
t.afii57842 = 0x05c0; |
| 12648 |
t.afii57929 = 0x02bc; |
| 12649 |
t.afii61248 = 0x2105; |
| 12650 |
t.afii61289 = 0x2113; |
| 12651 |
t.afii61352 = 0x2116; |
| 12652 |
t.afii61573 = 0x202c; |
| 12653 |
t.afii61574 = 0x202d; |
| 12654 |
t.afii61575 = 0x202e; |
| 12655 |
t.afii61664 = 0x200c; |
| 12656 |
t.afii63167 = 0x066d; |
| 12657 |
t.afii64937 = 0x02bd; |
| 12658 |
t.agrave = 0x00e0; |
| 12659 |
t.agujarati = 0x0a85; |
| 12660 |
t.agurmukhi = 0x0a05; |
| 12661 |
t.ahiragana = 0x3042; |
| 12662 |
t.ahookabove = 0x1ea3; |
| 12663 |
t.aibengali = 0x0990; |
| 12664 |
t.aibopomofo = 0x311e; |
| 12665 |
t.aideva = 0x0910; |
| 12666 |
t.aiecyrillic = 0x04d5; |
| 12667 |
t.aigujarati = 0x0a90; |
| 12668 |
t.aigurmukhi = 0x0a10; |
| 12669 |
t.aimatragurmukhi = 0x0a48; |
| 12670 |
t.ainarabic = 0x0639; |
| 12671 |
t.ainfinalarabic = 0xfeca; |
| 12672 |
t.aininitialarabic = 0xfecb; |
| 12673 |
t.ainmedialarabic = 0xfecc; |
| 12674 |
t.ainvertedbreve = 0x0203; |
| 12675 |
t.aivowelsignbengali = 0x09c8; |
| 12676 |
t.aivowelsigndeva = 0x0948; |
| 12677 |
t.aivowelsigngujarati = 0x0ac8; |
| 12678 |
t.akatakana = 0x30a2; |
| 12679 |
t.akatakanahalfwidth = 0xff71; |
| 12680 |
t.akorean = 0x314f; |
| 12681 |
t.alef = 0x05d0; |
| 12682 |
t.alefarabic = 0x0627; |
| 12683 |
t.alefdageshhebrew = 0xfb30; |
| 12684 |
t.aleffinalarabic = 0xfe8e; |
| 12685 |
t.alefhamzaabovearabic = 0x0623; |
| 12686 |
t.alefhamzaabovefinalarabic = 0xfe84; |
| 12687 |
t.alefhamzabelowarabic = 0x0625; |
| 12688 |
t.alefhamzabelowfinalarabic = 0xfe88; |
| 12689 |
t.alefhebrew = 0x05d0; |
| 12690 |
t.aleflamedhebrew = 0xfb4f; |
| 12691 |
t.alefmaddaabovearabic = 0x0622; |
| 12692 |
t.alefmaddaabovefinalarabic = 0xfe82; |
| 12693 |
t.alefmaksuraarabic = 0x0649; |
| 12694 |
t.alefmaksurafinalarabic = 0xfef0; |
| 12695 |
t.alefmaksurainitialarabic = 0xfef3; |
| 12696 |
t.alefmaksuramedialarabic = 0xfef4; |
| 12697 |
t.alefpatahhebrew = 0xfb2e; |
| 12698 |
t.alefqamatshebrew = 0xfb2f; |
| 12699 |
t.aleph = 0x2135; |
| 12700 |
t.allequal = 0x224c; |
| 12701 |
t.alpha = 0x03b1; |
| 12702 |
t.alphatonos = 0x03ac; |
| 12703 |
t.amacron = 0x0101; |
| 12704 |
t.amonospace = 0xff41; |
| 12705 |
t.ampersand = 0x0026; |
| 12706 |
t.ampersandmonospace = 0xff06; |
| 12707 |
t.ampersandsmall = 0xf726; |
| 12708 |
t.amsquare = 0x33c2; |
| 12709 |
t.anbopomofo = 0x3122; |
| 12710 |
t.angbopomofo = 0x3124; |
| 12711 |
t.angbracketleft = 0x3008; |
| 12712 |
t.angbracketright = 0x3009; |
| 12713 |
t.angkhankhuthai = 0x0e5a; |
| 12714 |
t.angle = 0x2220; |
| 12715 |
t.anglebracketleft = 0x3008; |
| 12716 |
t.anglebracketleftvertical = 0xfe3f; |
| 12717 |
t.anglebracketright = 0x3009; |
| 12718 |
t.anglebracketrightvertical = 0xfe40; |
| 12719 |
t.angleleft = 0x2329; |
| 12720 |
t.angleright = 0x232a; |
| 12721 |
t.angstrom = 0x212b; |
| 12722 |
t.anoteleia = 0x0387; |
| 12723 |
t.anudattadeva = 0x0952; |
| 12724 |
t.anusvarabengali = 0x0982; |
| 12725 |
t.anusvaradeva = 0x0902; |
| 12726 |
t.anusvaragujarati = 0x0a82; |
| 12727 |
t.aogonek = 0x0105; |
| 12728 |
t.apaatosquare = 0x3300; |
| 12729 |
t.aparen = 0x249c; |
| 12730 |
t.apostrophearmenian = 0x055a; |
| 12731 |
t.apostrophemod = 0x02bc; |
| 12732 |
t.apple = 0xf8ff; |
| 12733 |
t.approaches = 0x2250; |
| 12734 |
t.approxequal = 0x2248; |
| 12735 |
t.approxequalorimage = 0x2252; |
| 12736 |
t.approximatelyequal = 0x2245; |
| 12737 |
t.araeaekorean = 0x318e; |
| 12738 |
t.araeakorean = 0x318d; |
| 12739 |
t.arc = 0x2312; |
| 12740 |
t.arighthalfring = 0x1e9a; |
| 12741 |
t.aring = 0x00e5; |
| 12742 |
t.aringacute = 0x01fb; |
| 12743 |
t.aringbelow = 0x1e01; |
| 12744 |
t.arrowboth = 0x2194; |
| 12745 |
t.arrowdashdown = 0x21e3; |
| 12746 |
t.arrowdashleft = 0x21e0; |
| 12747 |
t.arrowdashright = 0x21e2; |
| 12748 |
t.arrowdashup = 0x21e1; |
| 12749 |
t.arrowdblboth = 0x21d4; |
| 12750 |
t.arrowdbldown = 0x21d3; |
| 12751 |
t.arrowdblleft = 0x21d0; |
| 12752 |
t.arrowdblright = 0x21d2; |
| 12753 |
t.arrowdblup = 0x21d1; |
| 12754 |
t.arrowdown = 0x2193; |
| 12755 |
t.arrowdownleft = 0x2199; |
| 12756 |
t.arrowdownright = 0x2198; |
| 12757 |
t.arrowdownwhite = 0x21e9; |
| 12758 |
t.arrowheaddownmod = 0x02c5; |
| 12759 |
t.arrowheadleftmod = 0x02c2; |
| 12760 |
t.arrowheadrightmod = 0x02c3; |
| 12761 |
t.arrowheadupmod = 0x02c4; |
| 12762 |
t.arrowhorizex = 0xf8e7; |
| 12763 |
t.arrowleft = 0x2190; |
| 12764 |
t.arrowleftdbl = 0x21d0; |
| 12765 |
t.arrowleftdblstroke = 0x21cd; |
| 12766 |
t.arrowleftoverright = 0x21c6; |
| 12767 |
t.arrowleftwhite = 0x21e6; |
| 12768 |
t.arrowright = 0x2192; |
| 12769 |
t.arrowrightdblstroke = 0x21cf; |
| 12770 |
t.arrowrightheavy = 0x279e; |
| 12771 |
t.arrowrightoverleft = 0x21c4; |
| 12772 |
t.arrowrightwhite = 0x21e8; |
| 12773 |
t.arrowtableft = 0x21e4; |
| 12774 |
t.arrowtabright = 0x21e5; |
| 12775 |
t.arrowup = 0x2191; |
| 12776 |
t.arrowupdn = 0x2195; |
| 12777 |
t.arrowupdnbse = 0x21a8; |
| 12778 |
t.arrowupdownbase = 0x21a8; |
| 12779 |
t.arrowupleft = 0x2196; |
| 12780 |
t.arrowupleftofdown = 0x21c5; |
| 12781 |
t.arrowupright = 0x2197; |
| 12782 |
t.arrowupwhite = 0x21e7; |
| 12783 |
t.arrowvertex = 0xf8e6; |
| 12784 |
t.asciicircum = 0x005e; |
| 12785 |
t.asciicircummonospace = 0xff3e; |
| 12786 |
t.asciitilde = 0x007e; |
| 12787 |
t.asciitildemonospace = 0xff5e; |
| 12788 |
t.ascript = 0x0251; |
| 12789 |
t.ascriptturned = 0x0252; |
| 12790 |
t.asmallhiragana = 0x3041; |
| 12791 |
t.asmallkatakana = 0x30a1; |
| 12792 |
t.asmallkatakanahalfwidth = 0xff67; |
| 12793 |
t.asterisk = 0x002a; |
| 12794 |
t.asteriskaltonearabic = 0x066d; |
| 12795 |
t.asteriskarabic = 0x066d; |
| 12796 |
t.asteriskmath = 0x2217; |
| 12797 |
t.asteriskmonospace = 0xff0a; |
| 12798 |
t.asterisksmall = 0xfe61; |
| 12799 |
t.asterism = 0x2042; |
| 12800 |
t.asuperior = 0xf6e9; |
| 12801 |
t.asymptoticallyequal = 0x2243; |
| 12802 |
t.at = 0x0040; |
| 12803 |
t.atilde = 0x00e3; |
| 12804 |
t.atmonospace = 0xff20; |
| 12805 |
t.atsmall = 0xfe6b; |
| 12806 |
t.aturned = 0x0250; |
| 12807 |
t.aubengali = 0x0994; |
| 12808 |
t.aubopomofo = 0x3120; |
| 12809 |
t.audeva = 0x0914; |
| 12810 |
t.augujarati = 0x0a94; |
| 12811 |
t.augurmukhi = 0x0a14; |
| 12812 |
t.aulengthmarkbengali = 0x09d7; |
| 12813 |
t.aumatragurmukhi = 0x0a4c; |
| 12814 |
t.auvowelsignbengali = 0x09cc; |
| 12815 |
t.auvowelsigndeva = 0x094c; |
| 12816 |
t.auvowelsigngujarati = 0x0acc; |
| 12817 |
t.avagrahadeva = 0x093d; |
| 12818 |
t.aybarmenian = 0x0561; |
| 12819 |
t.ayin = 0x05e2; |
| 12820 |
t.ayinaltonehebrew = 0xfb20; |
| 12821 |
t.ayinhebrew = 0x05e2; |
| 12822 |
t.b = 0x0062; |
| 12823 |
t.babengali = 0x09ac; |
| 12824 |
t.backslash = 0x005c; |
| 12825 |
t.backslashmonospace = 0xff3c; |
| 12826 |
t.badeva = 0x092c; |
| 12827 |
t.bagujarati = 0x0aac; |
| 12828 |
t.bagurmukhi = 0x0a2c; |
| 12829 |
t.bahiragana = 0x3070; |
| 12830 |
t.bahtthai = 0x0e3f; |
| 12831 |
t.bakatakana = 0x30d0; |
| 12832 |
t.bar = 0x007c; |
| 12833 |
t.barmonospace = 0xff5c; |
| 12834 |
t.bbopomofo = 0x3105; |
| 12835 |
t.bcircle = 0x24d1; |
| 12836 |
t.bdotaccent = 0x1e03; |
| 12837 |
t.bdotbelow = 0x1e05; |
| 12838 |
t.beamedsixteenthnotes = 0x266c; |
| 12839 |
t.because = 0x2235; |
| 12840 |
t.becyrillic = 0x0431; |
| 12841 |
t.beharabic = 0x0628; |
| 12842 |
t.behfinalarabic = 0xfe90; |
| 12843 |
t.behinitialarabic = 0xfe91; |
| 12844 |
t.behiragana = 0x3079; |
| 12845 |
t.behmedialarabic = 0xfe92; |
| 12846 |
t.behmeeminitialarabic = 0xfc9f; |
| 12847 |
t.behmeemisolatedarabic = 0xfc08; |
| 12848 |
t.behnoonfinalarabic = 0xfc6d; |
| 12849 |
t.bekatakana = 0x30d9; |
| 12850 |
t.benarmenian = 0x0562; |
| 12851 |
t.bet = 0x05d1; |
| 12852 |
t.beta = 0x03b2; |
| 12853 |
t.betasymbolgreek = 0x03d0; |
| 12854 |
t.betdagesh = 0xfb31; |
| 12855 |
t.betdageshhebrew = 0xfb31; |
| 12856 |
t.bethebrew = 0x05d1; |
| 12857 |
t.betrafehebrew = 0xfb4c; |
| 12858 |
t.bhabengali = 0x09ad; |
| 12859 |
t.bhadeva = 0x092d; |
| 12860 |
t.bhagujarati = 0x0aad; |
| 12861 |
t.bhagurmukhi = 0x0a2d; |
| 12862 |
t.bhook = 0x0253; |
| 12863 |
t.bihiragana = 0x3073; |
| 12864 |
t.bikatakana = 0x30d3; |
| 12865 |
t.bilabialclick = 0x0298; |
| 12866 |
t.bindigurmukhi = 0x0a02; |
| 12867 |
t.birusquare = 0x3331; |
| 12868 |
t.blackcircle = 0x25cf; |
| 12869 |
t.blackdiamond = 0x25c6; |
| 12870 |
t.blackdownpointingtriangle = 0x25bc; |
| 12871 |
t.blackleftpointingpointer = 0x25c4; |
| 12872 |
t.blackleftpointingtriangle = 0x25c0; |
| 12873 |
t.blacklenticularbracketleft = 0x3010; |
| 12874 |
t.blacklenticularbracketleftvertical = 0xfe3b; |
| 12875 |
t.blacklenticularbracketright = 0x3011; |
| 12876 |
t.blacklenticularbracketrightvertical = 0xfe3c; |
| 12877 |
t.blacklowerlefttriangle = 0x25e3; |
| 12878 |
t.blacklowerrighttriangle = 0x25e2; |
| 12879 |
t.blackrectangle = 0x25ac; |
| 12880 |
t.blackrightpointingpointer = 0x25ba; |
| 12881 |
t.blackrightpointingtriangle = 0x25b6; |
| 12882 |
t.blacksmallsquare = 0x25aa; |
| 12883 |
t.blacksmilingface = 0x263b; |
| 12884 |
t.blacksquare = 0x25a0; |
| 12885 |
t.blackstar = 0x2605; |
| 12886 |
t.blackupperlefttriangle = 0x25e4; |
| 12887 |
t.blackupperrighttriangle = 0x25e5; |
| 12888 |
t.blackuppointingsmalltriangle = 0x25b4; |
| 12889 |
t.blackuppointingtriangle = 0x25b2; |
| 12890 |
t.blank = 0x2423; |
| 12891 |
t.blinebelow = 0x1e07; |
| 12892 |
t.block = 0x2588; |
| 12893 |
t.bmonospace = 0xff42; |
| 12894 |
t.bobaimaithai = 0x0e1a; |
| 12895 |
t.bohiragana = 0x307c; |
| 12896 |
t.bokatakana = 0x30dc; |
| 12897 |
t.bparen = 0x249d; |
| 12898 |
t.bqsquare = 0x33c3; |
| 12899 |
t.braceex = 0xf8f4; |
| 12900 |
t.braceleft = 0x007b; |
| 12901 |
t.braceleftbt = 0xf8f3; |
| 12902 |
t.braceleftmid = 0xf8f2; |
| 12903 |
t.braceleftmonospace = 0xff5b; |
| 12904 |
t.braceleftsmall = 0xfe5b; |
| 12905 |
t.bracelefttp = 0xf8f1; |
| 12906 |
t.braceleftvertical = 0xfe37; |
| 12907 |
t.braceright = 0x007d; |
| 12908 |
t.bracerightbt = 0xf8fe; |
| 12909 |
t.bracerightmid = 0xf8fd; |
| 12910 |
t.bracerightmonospace = 0xff5d; |
| 12911 |
t.bracerightsmall = 0xfe5c; |
| 12912 |
t.bracerighttp = 0xf8fc; |
| 12913 |
t.bracerightvertical = 0xfe38; |
| 12914 |
t.bracketleft = 0x005b; |
| 12915 |
t.bracketleftbt = 0xf8f0; |
| 12916 |
t.bracketleftex = 0xf8ef; |
| 12917 |
t.bracketleftmonospace = 0xff3b; |
| 12918 |
t.bracketlefttp = 0xf8ee; |
| 12919 |
t.bracketright = 0x005d; |
| 12920 |
t.bracketrightbt = 0xf8fb; |
| 12921 |
t.bracketrightex = 0xf8fa; |
| 12922 |
t.bracketrightmonospace = 0xff3d; |
| 12923 |
t.bracketrighttp = 0xf8f9; |
| 12924 |
t.breve = 0x02d8; |
| 12925 |
t.brevebelowcmb = 0x032e; |
| 12926 |
t.brevecmb = 0x0306; |
| 12927 |
t.breveinvertedbelowcmb = 0x032f; |
| 12928 |
t.breveinvertedcmb = 0x0311; |
| 12929 |
t.breveinverteddoublecmb = 0x0361; |
| 12930 |
t.bridgebelowcmb = 0x032a; |
| 12931 |
t.bridgeinvertedbelowcmb = 0x033a; |
| 12932 |
t.brokenbar = 0x00a6; |
| 12933 |
t.bstroke = 0x0180; |
| 12934 |
t.bsuperior = 0xf6ea; |
| 12935 |
t.btopbar = 0x0183; |
| 12936 |
t.buhiragana = 0x3076; |
| 12937 |
t.bukatakana = 0x30d6; |
| 12938 |
t.bullet = 0x2022; |
| 12939 |
t.bulletinverse = 0x25d8; |
| 12940 |
t.bulletoperator = 0x2219; |
| 12941 |
t.bullseye = 0x25ce; |
| 12942 |
t.c = 0x0063; |
| 12943 |
t.caarmenian = 0x056e; |
| 12944 |
t.cabengali = 0x099a; |
| 12945 |
t.cacute = 0x0107; |
| 12946 |
t.cadeva = 0x091a; |
| 12947 |
t.cagujarati = 0x0a9a; |
| 12948 |
t.cagurmukhi = 0x0a1a; |
| 12949 |
t.calsquare = 0x3388; |
| 12950 |
t.candrabindubengali = 0x0981; |
| 12951 |
t.candrabinducmb = 0x0310; |
| 12952 |
t.candrabindudeva = 0x0901; |
| 12953 |
t.candrabindugujarati = 0x0a81; |
| 12954 |
t.capslock = 0x21ea; |
| 12955 |
t.careof = 0x2105; |
| 12956 |
t.caron = 0x02c7; |
| 12957 |
t.caronbelowcmb = 0x032c; |
| 12958 |
t.caroncmb = 0x030c; |
| 12959 |
t.carriagereturn = 0x21b5; |
| 12960 |
t.cbopomofo = 0x3118; |
| 12961 |
t.ccaron = 0x010d; |
| 12962 |
t.ccedilla = 0x00e7; |
| 12963 |
t.ccedillaacute = 0x1e09; |
| 12964 |
t.ccircle = 0x24d2; |
| 12965 |
t.ccircumflex = 0x0109; |
| 12966 |
t.ccurl = 0x0255; |
| 12967 |
t.cdot = 0x010b; |
| 12968 |
t.cdotaccent = 0x010b; |
| 12969 |
t.cdsquare = 0x33c5; |
| 12970 |
t.cedilla = 0x00b8; |
| 12971 |
t.cedillacmb = 0x0327; |
| 12972 |
t.cent = 0x00a2; |
| 12973 |
t.centigrade = 0x2103; |
| 12974 |
t.centinferior = 0xf6df; |
| 12975 |
t.centmonospace = 0xffe0; |
| 12976 |
t.centoldstyle = 0xf7a2; |
| 12977 |
t.centsuperior = 0xf6e0; |
| 12978 |
t.chaarmenian = 0x0579; |
| 12979 |
t.chabengali = 0x099b; |
| 12980 |
t.chadeva = 0x091b; |
| 12981 |
t.chagujarati = 0x0a9b; |
| 12982 |
t.chagurmukhi = 0x0a1b; |
| 12983 |
t.chbopomofo = 0x3114; |
| 12984 |
t.cheabkhasiancyrillic = 0x04bd; |
| 12985 |
t.checkmark = 0x2713; |
| 12986 |
t.checyrillic = 0x0447; |
| 12987 |
t.chedescenderabkhasiancyrillic = 0x04bf; |
| 12988 |
t.chedescendercyrillic = 0x04b7; |
| 12989 |
t.chedieresiscyrillic = 0x04f5; |
| 12990 |
t.cheharmenian = 0x0573; |
| 12991 |
t.chekhakassiancyrillic = 0x04cc; |
| 12992 |
t.cheverticalstrokecyrillic = 0x04b9; |
| 12993 |
t.chi = 0x03c7; |
| 12994 |
t.chieuchacirclekorean = 0x3277; |
| 12995 |
t.chieuchaparenkorean = 0x3217; |
| 12996 |
t.chieuchcirclekorean = 0x3269; |
| 12997 |
t.chieuchkorean = 0x314a; |
| 12998 |
t.chieuchparenkorean = 0x3209; |
| 12999 |
t.chochangthai = 0x0e0a; |
| 13000 |
t.chochanthai = 0x0e08; |
| 13001 |
t.chochingthai = 0x0e09; |
| 13002 |
t.chochoethai = 0x0e0c; |
| 13003 |
t.chook = 0x0188; |
| 13004 |
t.cieucacirclekorean = 0x3276; |
| 13005 |
t.cieucaparenkorean = 0x3216; |
| 13006 |
t.cieuccirclekorean = 0x3268; |
| 13007 |
t.cieuckorean = 0x3148; |
| 13008 |
t.cieucparenkorean = 0x3208; |
| 13009 |
t.cieucuparenkorean = 0x321c; |
| 13010 |
t.circle = 0x25cb; |
| 13011 |
t.circlecopyrt = 0x00a9; |
| 13012 |
t.circlemultiply = 0x2297; |
| 13013 |
t.circleot = 0x2299; |
| 13014 |
t.circleplus = 0x2295; |
| 13015 |
t.circlepostalmark = 0x3036; |
| 13016 |
t.circlewithlefthalfblack = 0x25d0; |
| 13017 |
t.circlewithrighthalfblack = 0x25d1; |
| 13018 |
t.circumflex = 0x02c6; |
| 13019 |
t.circumflexbelowcmb = 0x032d; |
| 13020 |
t.circumflexcmb = 0x0302; |
| 13021 |
t.clear = 0x2327; |
| 13022 |
t.clickalveolar = 0x01c2; |
| 13023 |
t.clickdental = 0x01c0; |
| 13024 |
t.clicklateral = 0x01c1; |
| 13025 |
t.clickretroflex = 0x01c3; |
| 13026 |
t.club = 0x2663; |
| 13027 |
t.clubsuitblack = 0x2663; |
| 13028 |
t.clubsuitwhite = 0x2667; |
| 13029 |
t.cmcubedsquare = 0x33a4; |
| 13030 |
t.cmonospace = 0xff43; |
| 13031 |
t.cmsquaredsquare = 0x33a0; |
| 13032 |
t.coarmenian = 0x0581; |
| 13033 |
t.colon = 0x003a; |
| 13034 |
t.colonmonetary = 0x20a1; |
| 13035 |
t.colonmonospace = 0xff1a; |
| 13036 |
t.colonsign = 0x20a1; |
| 13037 |
t.colonsmall = 0xfe55; |
| 13038 |
t.colontriangularhalfmod = 0x02d1; |
| 13039 |
t.colontriangularmod = 0x02d0; |
| 13040 |
t.comma = 0x002c; |
| 13041 |
t.commaabovecmb = 0x0313; |
| 13042 |
t.commaaboverightcmb = 0x0315; |
| 13043 |
t.commaaccent = 0xf6c3; |
| 13044 |
t.commaarabic = 0x060c; |
| 13045 |
t.commaarmenian = 0x055d; |
| 13046 |
t.commainferior = 0xf6e1; |
| 13047 |
t.commamonospace = 0xff0c; |
| 13048 |
t.commareversedabovecmb = 0x0314; |
| 13049 |
t.commareversedmod = 0x02bd; |
| 13050 |
t.commasmall = 0xfe50; |
| 13051 |
t.commasuperior = 0xf6e2; |
| 13052 |
t.commaturnedabovecmb = 0x0312; |
| 13053 |
t.commaturnedmod = 0x02bb; |
| 13054 |
t.compass = 0x263c; |
| 13055 |
t.congruent = 0x2245; |
| 13056 |
t.contourintegral = 0x222e; |
| 13057 |
t.control = 0x2303; |
| 13058 |
t.controlACK = 0x0006; |
| 13059 |
t.controlBEL = 0x0007; |
| 13060 |
t.controlBS = 0x0008; |
| 13061 |
t.controlCAN = 0x0018; |
| 13062 |
t.controlCR = 0x000d; |
| 13063 |
t.controlDC1 = 0x0011; |
| 13064 |
t.controlDC2 = 0x0012; |
| 13065 |
t.controlDC3 = 0x0013; |
| 13066 |
t.controlDC4 = 0x0014; |
| 13067 |
t.controlDEL = 0x007f; |
| 13068 |
t.controlDLE = 0x0010; |
| 13069 |
t.controlEM = 0x0019; |
| 13070 |
t.controlENQ = 0x0005; |
| 13071 |
t.controlEOT = 0x0004; |
| 13072 |
t.controlESC = 0x001b; |
| 13073 |
t.controlETB = 0x0017; |
| 13074 |
t.controlETX = 0x0003; |
| 13075 |
t.controlFF = 0x000c; |
| 13076 |
t.controlFS = 0x001c; |
| 13077 |
t.controlGS = 0x001d; |
| 13078 |
t.controlHT = 0x0009; |
| 13079 |
t.controlLF = 0x000a; |
| 13080 |
t.controlNAK = 0x0015; |
| 13081 |
t.controlNULL = 0x0000; |
| 13082 |
t.controlRS = 0x001e; |
| 13083 |
t.controlSI = 0x000f; |
| 13084 |
t.controlSO = 0x000e; |
| 13085 |
t.controlSOT = 0x0002; |
| 13086 |
t.controlSTX = 0x0001; |
| 13087 |
t.controlSUB = 0x001a; |
| 13088 |
t.controlSYN = 0x0016; |
| 13089 |
t.controlUS = 0x001f; |
| 13090 |
t.controlVT = 0x000b; |
| 13091 |
t.copyright = 0x00a9; |
| 13092 |
t.copyrightsans = 0xf8e9; |
| 13093 |
t.copyrightserif = 0xf6d9; |
| 13094 |
t.cornerbracketleft = 0x300c; |
| 13095 |
t.cornerbracketlefthalfwidth = 0xff62; |
| 13096 |
t.cornerbracketleftvertical = 0xfe41; |
| 13097 |
t.cornerbracketright = 0x300d; |
| 13098 |
t.cornerbracketrighthalfwidth = 0xff63; |
| 13099 |
t.cornerbracketrightvertical = 0xfe42; |
| 13100 |
t.corporationsquare = 0x337f; |
| 13101 |
t.cosquare = 0x33c7; |
| 13102 |
t.coverkgsquare = 0x33c6; |
| 13103 |
t.cparen = 0x249e; |
| 13104 |
t.cruzeiro = 0x20a2; |
| 13105 |
t.cstretched = 0x0297; |
| 13106 |
t.curlyand = 0x22cf; |
| 13107 |
t.curlyor = 0x22ce; |
| 13108 |
t.currency = 0x00a4; |
| 13109 |
t.cyrBreve = 0xf6d1; |
| 13110 |
t.cyrFlex = 0xf6d2; |
| 13111 |
t.cyrbreve = 0xf6d4; |
| 13112 |
t.cyrflex = 0xf6d5; |
| 13113 |
t.d = 0x0064; |
| 13114 |
t.daarmenian = 0x0564; |
| 13115 |
t.dabengali = 0x09a6; |
| 13116 |
t.dadarabic = 0x0636; |
| 13117 |
t.dadeva = 0x0926; |
| 13118 |
t.dadfinalarabic = 0xfebe; |
| 13119 |
t.dadinitialarabic = 0xfebf; |
| 13120 |
t.dadmedialarabic = 0xfec0; |
| 13121 |
t.dagesh = 0x05bc; |
| 13122 |
t.dageshhebrew = 0x05bc; |
| 13123 |
t.dagger = 0x2020; |
| 13124 |
t.daggerdbl = 0x2021; |
| 13125 |
t.dagujarati = 0x0aa6; |
| 13126 |
t.dagurmukhi = 0x0a26; |
| 13127 |
t.dahiragana = 0x3060; |
| 13128 |
t.dakatakana = 0x30c0; |
| 13129 |
t.dalarabic = 0x062f; |
| 13130 |
t.dalet = 0x05d3; |
| 13131 |
t.daletdagesh = 0xfb33; |
| 13132 |
t.daletdageshhebrew = 0xfb33; |
| 13133 |
t.dalethebrew = 0x05d3; |
| 13134 |
t.dalfinalarabic = 0xfeaa; |
| 13135 |
t.dammaarabic = 0x064f; |
| 13136 |
t.dammalowarabic = 0x064f; |
| 13137 |
t.dammatanaltonearabic = 0x064c; |
| 13138 |
t.dammatanarabic = 0x064c; |
| 13139 |
t.danda = 0x0964; |
| 13140 |
t.dargahebrew = 0x05a7; |
| 13141 |
t.dargalefthebrew = 0x05a7; |
| 13142 |
t.dasiapneumatacyrilliccmb = 0x0485; |
| 13143 |
t.dblGrave = 0xf6d3; |
| 13144 |
t.dblanglebracketleft = 0x300a; |
| 13145 |
t.dblanglebracketleftvertical = 0xfe3d; |
| 13146 |
t.dblanglebracketright = 0x300b; |
| 13147 |
t.dblanglebracketrightvertical = 0xfe3e; |
| 13148 |
t.dblarchinvertedbelowcmb = 0x032b; |
| 13149 |
t.dblarrowleft = 0x21d4; |
| 13150 |
t.dblarrowright = 0x21d2; |
| 13151 |
t.dbldanda = 0x0965; |
| 13152 |
t.dblgrave = 0xf6d6; |
| 13153 |
t.dblgravecmb = 0x030f; |
| 13154 |
t.dblintegral = 0x222c; |
| 13155 |
t.dbllowline = 0x2017; |
| 13156 |
t.dbllowlinecmb = 0x0333; |
| 13157 |
t.dbloverlinecmb = 0x033f; |
| 13158 |
t.dblprimemod = 0x02ba; |
| 13159 |
t.dblverticalbar = 0x2016; |
| 13160 |
t.dblverticallineabovecmb = 0x030e; |
| 13161 |
t.dbopomofo = 0x3109; |
| 13162 |
t.dbsquare = 0x33c8; |
| 13163 |
t.dcaron = 0x010f; |
| 13164 |
t.dcedilla = 0x1e11; |
| 13165 |
t.dcircle = 0x24d3; |
| 13166 |
t.dcircumflexbelow = 0x1e13; |
| 13167 |
t.dcroat = 0x0111; |
| 13168 |
t.ddabengali = 0x09a1; |
| 13169 |
t.ddadeva = 0x0921; |
| 13170 |
t.ddagujarati = 0x0aa1; |
| 13171 |
t.ddagurmukhi = 0x0a21; |
| 13172 |
t.ddalarabic = 0x0688; |
| 13173 |
t.ddalfinalarabic = 0xfb89; |
| 13174 |
t.dddhadeva = 0x095c; |
| 13175 |
t.ddhabengali = 0x09a2; |
| 13176 |
t.ddhadeva = 0x0922; |
| 13177 |
t.ddhagujarati = 0x0aa2; |
| 13178 |
t.ddhagurmukhi = 0x0a22; |
| 13179 |
t.ddotaccent = 0x1e0b; |
| 13180 |
t.ddotbelow = 0x1e0d; |
| 13181 |
t.decimalseparatorarabic = 0x066b; |
| 13182 |
t.decimalseparatorpersian = 0x066b; |
| 13183 |
t.decyrillic = 0x0434; |
| 13184 |
t.degree = 0x00b0; |
| 13185 |
t.dehihebrew = 0x05ad; |
| 13186 |
t.dehiragana = 0x3067; |
| 13187 |
t.deicoptic = 0x03ef; |
| 13188 |
t.dekatakana = 0x30c7; |
| 13189 |
t.deleteleft = 0x232b; |
| 13190 |
t.deleteright = 0x2326; |
| 13191 |
t.delta = 0x03b4; |
| 13192 |
t.deltaturned = 0x018d; |
| 13193 |
t.denominatorminusonenumeratorbengali = 0x09f8; |
| 13194 |
t.dezh = 0x02a4; |
| 13195 |
t.dhabengali = 0x09a7; |
| 13196 |
t.dhadeva = 0x0927; |
| 13197 |
t.dhagujarati = 0x0aa7; |
| 13198 |
t.dhagurmukhi = 0x0a27; |
| 13199 |
t.dhook = 0x0257; |
| 13200 |
t.dialytikatonos = 0x0385; |
| 13201 |
t.dialytikatonoscmb = 0x0344; |
| 13202 |
t.diamond = 0x2666; |
| 13203 |
t.diamondsuitwhite = 0x2662; |
| 13204 |
t.dieresis = 0x00a8; |
| 13205 |
t.dieresisacute = 0xf6d7; |
| 13206 |
t.dieresisbelowcmb = 0x0324; |
| 13207 |
t.dieresiscmb = 0x0308; |
| 13208 |
t.dieresisgrave = 0xf6d8; |
| 13209 |
t.dieresistonos = 0x0385; |
| 13210 |
t.dihiragana = 0x3062; |
| 13211 |
t.dikatakana = 0x30c2; |
| 13212 |
t.dittomark = 0x3003; |
| 13213 |
t.divide = 0x00f7; |
| 13214 |
t.divides = 0x2223; |
| 13215 |
t.divisionslash = 0x2215; |
| 13216 |
t.djecyrillic = 0x0452; |
| 13217 |
t.dkshade = 0x2593; |
| 13218 |
t.dlinebelow = 0x1e0f; |
| 13219 |
t.dlsquare = 0x3397; |
| 13220 |
t.dmacron = 0x0111; |
| 13221 |
t.dmonospace = 0xff44; |
| 13222 |
t.dnblock = 0x2584; |
| 13223 |
t.dochadathai = 0x0e0e; |
| 13224 |
t.dodekthai = 0x0e14; |
| 13225 |
t.dohiragana = 0x3069; |
| 13226 |
t.dokatakana = 0x30c9; |
| 13227 |
t.dollar = 0x0024; |
| 13228 |
t.dollarinferior = 0xf6e3; |
| 13229 |
t.dollarmonospace = 0xff04; |
| 13230 |
t.dollaroldstyle = 0xf724; |
| 13231 |
t.dollarsmall = 0xfe69; |
| 13232 |
t.dollarsuperior = 0xf6e4; |
| 13233 |
t.dong = 0x20ab; |
| 13234 |
t.dorusquare = 0x3326; |
| 13235 |
t.dotaccent = 0x02d9; |
| 13236 |
t.dotaccentcmb = 0x0307; |
| 13237 |
t.dotbelowcmb = 0x0323; |
| 13238 |
t.dotbelowcomb = 0x0323; |
| 13239 |
t.dotkatakana = 0x30fb; |
| 13240 |
t.dotlessi = 0x0131; |
| 13241 |
t.dotlessj = 0xf6be; |
| 13242 |
t.dotlessjstrokehook = 0x0284; |
| 13243 |
t.dotmath = 0x22c5; |
| 13244 |
t.dottedcircle = 0x25cc; |
| 13245 |
t.doubleyodpatah = 0xfb1f; |
| 13246 |
t.doubleyodpatahhebrew = 0xfb1f; |
| 13247 |
t.downtackbelowcmb = 0x031e; |
| 13248 |
t.downtackmod = 0x02d5; |
| 13249 |
t.dparen = 0x249f; |
| 13250 |
t.dsuperior = 0xf6eb; |
| 13251 |
t.dtail = 0x0256; |
| 13252 |
t.dtopbar = 0x018c; |
| 13253 |
t.duhiragana = 0x3065; |
| 13254 |
t.dukatakana = 0x30c5; |
| 13255 |
t.dz = 0x01f3; |
| 13256 |
t.dzaltone = 0x02a3; |
| 13257 |
t.dzcaron = 0x01c6; |
| 13258 |
t.dzcurl = 0x02a5; |
| 13259 |
t.dzeabkhasiancyrillic = 0x04e1; |
| 13260 |
t.dzecyrillic = 0x0455; |
| 13261 |
t.dzhecyrillic = 0x045f; |
| 13262 |
t.e = 0x0065; |
| 13263 |
t.eacute = 0x00e9; |
| 13264 |
t.earth = 0x2641; |
| 13265 |
t.ebengali = 0x098f; |
| 13266 |
t.ebopomofo = 0x311c; |
| 13267 |
t.ebreve = 0x0115; |
| 13268 |
t.ecandradeva = 0x090d; |
| 13269 |
t.ecandragujarati = 0x0a8d; |
| 13270 |
t.ecandravowelsigndeva = 0x0945; |
| 13271 |
t.ecandravowelsigngujarati = 0x0ac5; |
| 13272 |
t.ecaron = 0x011b; |
| 13273 |
t.ecedillabreve = 0x1e1d; |
| 13274 |
t.echarmenian = 0x0565; |
| 13275 |
t.echyiwnarmenian = 0x0587; |
| 13276 |
t.ecircle = 0x24d4; |
| 13277 |
t.ecircumflex = 0x00ea; |
| 13278 |
t.ecircumflexacute = 0x1ebf; |
| 13279 |
t.ecircumflexbelow = 0x1e19; |
| 13280 |
t.ecircumflexdotbelow = 0x1ec7; |
| 13281 |
t.ecircumflexgrave = 0x1ec1; |
| 13282 |
t.ecircumflexhookabove = 0x1ec3; |
| 13283 |
t.ecircumflextilde = 0x1ec5; |
| 13284 |
t.ecyrillic = 0x0454; |
| 13285 |
t.edblgrave = 0x0205; |
| 13286 |
t.edeva = 0x090f; |
| 13287 |
t.edieresis = 0x00eb; |
| 13288 |
t.edot = 0x0117; |
| 13289 |
t.edotaccent = 0x0117; |
| 13290 |
t.edotbelow = 0x1eb9; |
| 13291 |
t.eegurmukhi = 0x0a0f; |
| 13292 |
t.eematragurmukhi = 0x0a47; |
| 13293 |
t.efcyrillic = 0x0444; |
| 13294 |
t.egrave = 0x00e8; |
| 13295 |
t.egujarati = 0x0a8f; |
| 13296 |
t.eharmenian = 0x0567; |
| 13297 |
t.ehbopomofo = 0x311d; |
| 13298 |
t.ehiragana = 0x3048; |
| 13299 |
t.ehookabove = 0x1ebb; |
| 13300 |
t.eibopomofo = 0x311f; |
| 13301 |
t.eight = 0x0038; |
| 13302 |
t.eightarabic = 0x0668; |
| 13303 |
t.eightbengali = 0x09ee; |
| 13304 |
t.eightcircle = 0x2467; |
| 13305 |
t.eightcircleinversesansserif = 0x2791; |
| 13306 |
t.eightdeva = 0x096e; |
| 13307 |
t.eighteencircle = 0x2471; |
| 13308 |
t.eighteenparen = 0x2485; |
| 13309 |
t.eighteenperiod = 0x2499; |
| 13310 |
t.eightgujarati = 0x0aee; |
| 13311 |
t.eightgurmukhi = 0x0a6e; |
| 13312 |
t.eighthackarabic = 0x0668; |
| 13313 |
t.eighthangzhou = 0x3028; |
| 13314 |
t.eighthnotebeamed = 0x266b; |
| 13315 |
t.eightideographicparen = 0x3227; |
| 13316 |
t.eightinferior = 0x2088; |
| 13317 |
t.eightmonospace = 0xff18; |
| 13318 |
t.eightoldstyle = 0xf738; |
| 13319 |
t.eightparen = 0x247b; |
| 13320 |
t.eightperiod = 0x248f; |
| 13321 |
t.eightpersian = 0x06f8; |
| 13322 |
t.eightroman = 0x2177; |
| 13323 |
t.eightsuperior = 0x2078; |
| 13324 |
t.eightthai = 0x0e58; |
| 13325 |
t.einvertedbreve = 0x0207; |
| 13326 |
t.eiotifiedcyrillic = 0x0465; |
| 13327 |
t.ekatakana = 0x30a8; |
| 13328 |
t.ekatakanahalfwidth = 0xff74; |
| 13329 |
t.ekonkargurmukhi = 0x0a74; |
| 13330 |
t.ekorean = 0x3154; |
| 13331 |
t.elcyrillic = 0x043b; |
| 13332 |
t.element = 0x2208; |
| 13333 |
t.elevencircle = 0x246a; |
| 13334 |
t.elevenparen = 0x247e; |
| 13335 |
t.elevenperiod = 0x2492; |
| 13336 |
t.elevenroman = 0x217a; |
| 13337 |
t.ellipsis = 0x2026; |
| 13338 |
t.ellipsisvertical = 0x22ee; |
| 13339 |
t.emacron = 0x0113; |
| 13340 |
t.emacronacute = 0x1e17; |
| 13341 |
t.emacrongrave = 0x1e15; |
| 13342 |
t.emcyrillic = 0x043c; |
| 13343 |
t.emdash = 0x2014; |
| 13344 |
t.emdashvertical = 0xfe31; |
| 13345 |
t.emonospace = 0xff45; |
| 13346 |
t.emphasismarkarmenian = 0x055b; |
| 13347 |
t.emptyset = 0x2205; |
| 13348 |
t.enbopomofo = 0x3123; |
| 13349 |
t.encyrillic = 0x043d; |
| 13350 |
t.endash = 0x2013; |
| 13351 |
t.endashvertical = 0xfe32; |
| 13352 |
t.endescendercyrillic = 0x04a3; |
| 13353 |
t.eng = 0x014b; |
| 13354 |
t.engbopomofo = 0x3125; |
| 13355 |
t.enghecyrillic = 0x04a5; |
| 13356 |
t.enhookcyrillic = 0x04c8; |
| 13357 |
t.enspace = 0x2002; |
| 13358 |
t.eogonek = 0x0119; |
| 13359 |
t.eokorean = 0x3153; |
| 13360 |
t.eopen = 0x025b; |
| 13361 |
t.eopenclosed = 0x029a; |
| 13362 |
t.eopenreversed = 0x025c; |
| 13363 |
t.eopenreversedclosed = 0x025e; |
| 13364 |
t.eopenreversedhook = 0x025d; |
| 13365 |
t.eparen = 0x24a0; |
| 13366 |
t.epsilon = 0x03b5; |
| 13367 |
t.epsilontonos = 0x03ad; |
| 13368 |
t.equal = 0x003d; |
| 13369 |
t.equalmonospace = 0xff1d; |
| 13370 |
t.equalsmall = 0xfe66; |
| 13371 |
t.equalsuperior = 0x207c; |
| 13372 |
t.equivalence = 0x2261; |
| 13373 |
t.erbopomofo = 0x3126; |
| 13374 |
t.ercyrillic = 0x0440; |
| 13375 |
t.ereversed = 0x0258; |
| 13376 |
t.ereversedcyrillic = 0x044d; |
| 13377 |
t.escyrillic = 0x0441; |
| 13378 |
t.esdescendercyrillic = 0x04ab; |
| 13379 |
t.esh = 0x0283; |
| 13380 |
t.eshcurl = 0x0286; |
| 13381 |
t.eshortdeva = 0x090e; |
| 13382 |
t.eshortvowelsigndeva = 0x0946; |
| 13383 |
t.eshreversedloop = 0x01aa; |
| 13384 |
t.eshsquatreversed = 0x0285; |
| 13385 |
t.esmallhiragana = 0x3047; |
| 13386 |
t.esmallkatakana = 0x30a7; |
| 13387 |
t.esmallkatakanahalfwidth = 0xff6a; |
| 13388 |
t.estimated = 0x212e; |
| 13389 |
t.esuperior = 0xf6ec; |
| 13390 |
t.eta = 0x03b7; |
| 13391 |
t.etarmenian = 0x0568; |
| 13392 |
t.etatonos = 0x03ae; |
| 13393 |
t.eth = 0x00f0; |
| 13394 |
t.etilde = 0x1ebd; |
| 13395 |
t.etildebelow = 0x1e1b; |
| 13396 |
t.etnahtafoukhhebrew = 0x0591; |
| 13397 |
t.etnahtafoukhlefthebrew = 0x0591; |
| 13398 |
t.etnahtahebrew = 0x0591; |
| 13399 |
t.etnahtalefthebrew = 0x0591; |
| 13400 |
t.eturned = 0x01dd; |
| 13401 |
t.eukorean = 0x3161; |
| 13402 |
t.euro = 0x20ac; |
| 13403 |
t.evowelsignbengali = 0x09c7; |
| 13404 |
t.evowelsigndeva = 0x0947; |
| 13405 |
t.evowelsigngujarati = 0x0ac7; |
| 13406 |
t.exclam = 0x0021; |
| 13407 |
t.exclamarmenian = 0x055c; |
| 13408 |
t.exclamdbl = 0x203c; |
| 13409 |
t.exclamdown = 0x00a1; |
| 13410 |
t.exclamdownsmall = 0xf7a1; |
| 13411 |
t.exclammonospace = 0xff01; |
| 13412 |
t.exclamsmall = 0xf721; |
| 13413 |
t.existential = 0x2203; |
| 13414 |
t.ezh = 0x0292; |
| 13415 |
t.ezhcaron = 0x01ef; |
| 13416 |
t.ezhcurl = 0x0293; |
| 13417 |
t.ezhreversed = 0x01b9; |
| 13418 |
t.ezhtail = 0x01ba; |
| 13419 |
t.f = 0x0066; |
| 13420 |
t.fadeva = 0x095e; |
| 13421 |
t.fagurmukhi = 0x0a5e; |
| 13422 |
t.fahrenheit = 0x2109; |
| 13423 |
t.fathaarabic = 0x064e; |
| 13424 |
t.fathalowarabic = 0x064e; |
| 13425 |
t.fathatanarabic = 0x064b; |
| 13426 |
t.fbopomofo = 0x3108; |
| 13427 |
t.fcircle = 0x24d5; |
| 13428 |
t.fdotaccent = 0x1e1f; |
| 13429 |
t.feharabic = 0x0641; |
| 13430 |
t.feharmenian = 0x0586; |
| 13431 |
t.fehfinalarabic = 0xfed2; |
| 13432 |
t.fehinitialarabic = 0xfed3; |
| 13433 |
t.fehmedialarabic = 0xfed4; |
| 13434 |
t.feicoptic = 0x03e5; |
| 13435 |
t.female = 0x2640; |
| 13436 |
t.ff = 0xfb00; |
| 13437 |
t.f_f = 0xfb00; |
| 13438 |
t.ffi = 0xfb03; |
| 13439 |
t.f_f_i = 0xfb03; |
| 13440 |
t.ffl = 0xfb04; |
| 13441 |
t.f_f_l = 0xfb04; |
| 13442 |
t.fi = 0xfb01; |
| 13443 |
t.f_i = 0xfb01; |
| 13444 |
t.fifteencircle = 0x246e; |
| 13445 |
t.fifteenparen = 0x2482; |
| 13446 |
t.fifteenperiod = 0x2496; |
| 13447 |
t.figuredash = 0x2012; |
| 13448 |
t.filledbox = 0x25a0; |
| 13449 |
t.filledrect = 0x25ac; |
| 13450 |
t.finalkaf = 0x05da; |
| 13451 |
t.finalkafdagesh = 0xfb3a; |
| 13452 |
t.finalkafdageshhebrew = 0xfb3a; |
| 13453 |
t.finalkafhebrew = 0x05da; |
| 13454 |
t.finalmem = 0x05dd; |
| 13455 |
t.finalmemhebrew = 0x05dd; |
| 13456 |
t.finalnun = 0x05df; |
| 13457 |
t.finalnunhebrew = 0x05df; |
| 13458 |
t.finalpe = 0x05e3; |
| 13459 |
t.finalpehebrew = 0x05e3; |
| 13460 |
t.finaltsadi = 0x05e5; |
| 13461 |
t.finaltsadihebrew = 0x05e5; |
| 13462 |
t.firsttonechinese = 0x02c9; |
| 13463 |
t.fisheye = 0x25c9; |
| 13464 |
t.fitacyrillic = 0x0473; |
| 13465 |
t.five = 0x0035; |
| 13466 |
t.fivearabic = 0x0665; |
| 13467 |
t.fivebengali = 0x09eb; |
| 13468 |
t.fivecircle = 0x2464; |
| 13469 |
t.fivecircleinversesansserif = 0x278e; |
| 13470 |
t.fivedeva = 0x096b; |
| 13471 |
t.fiveeighths = 0x215d; |
| 13472 |
t.fivegujarati = 0x0aeb; |
| 13473 |
t.fivegurmukhi = 0x0a6b; |
| 13474 |
t.fivehackarabic = 0x0665; |
| 13475 |
t.fivehangzhou = 0x3025; |
| 13476 |
t.fiveideographicparen = 0x3224; |
| 13477 |
t.fiveinferior = 0x2085; |
| 13478 |
t.fivemonospace = 0xff15; |
| 13479 |
t.fiveoldstyle = 0xf735; |
| 13480 |
t.fiveparen = 0x2478; |
| 13481 |
t.fiveperiod = 0x248c; |
| 13482 |
t.fivepersian = 0x06f5; |
| 13483 |
t.fiveroman = 0x2174; |
| 13484 |
t.fivesuperior = 0x2075; |
| 13485 |
t.fivethai = 0x0e55; |
| 13486 |
t.fl = 0xfb02; |
| 13487 |
t.f_l = 0xfb02; |
| 13488 |
t.florin = 0x0192; |
| 13489 |
t.fmonospace = 0xff46; |
| 13490 |
t.fmsquare = 0x3399; |
| 13491 |
t.fofanthai = 0x0e1f; |
| 13492 |
t.fofathai = 0x0e1d; |
| 13493 |
t.fongmanthai = 0x0e4f; |
| 13494 |
t.forall = 0x2200; |
| 13495 |
t.four = 0x0034; |
| 13496 |
t.fourarabic = 0x0664; |
| 13497 |
t.fourbengali = 0x09ea; |
| 13498 |
t.fourcircle = 0x2463; |
| 13499 |
t.fourcircleinversesansserif = 0x278d; |
| 13500 |
t.fourdeva = 0x096a; |
| 13501 |
t.fourgujarati = 0x0aea; |
| 13502 |
t.fourgurmukhi = 0x0a6a; |
| 13503 |
t.fourhackarabic = 0x0664; |
| 13504 |
t.fourhangzhou = 0x3024; |
| 13505 |
t.fourideographicparen = 0x3223; |
| 13506 |
t.fourinferior = 0x2084; |
| 13507 |
t.fourmonospace = 0xff14; |
| 13508 |
t.fournumeratorbengali = 0x09f7; |
| 13509 |
t.fouroldstyle = 0xf734; |
| 13510 |
t.fourparen = 0x2477; |
| 13511 |
t.fourperiod = 0x248b; |
| 13512 |
t.fourpersian = 0x06f4; |
| 13513 |
t.fourroman = 0x2173; |
| 13514 |
t.foursuperior = 0x2074; |
| 13515 |
t.fourteencircle = 0x246d; |
| 13516 |
t.fourteenparen = 0x2481; |
| 13517 |
t.fourteenperiod = 0x2495; |
| 13518 |
t.fourthai = 0x0e54; |
| 13519 |
t.fourthtonechinese = 0x02cb; |
| 13520 |
t.fparen = 0x24a1; |
| 13521 |
t.fraction = 0x2044; |
| 13522 |
t.franc = 0x20a3; |
| 13523 |
t.g = 0x0067; |
| 13524 |
t.gabengali = 0x0997; |
| 13525 |
t.gacute = 0x01f5; |
| 13526 |
t.gadeva = 0x0917; |
| 13527 |
t.gafarabic = 0x06af; |
| 13528 |
t.gaffinalarabic = 0xfb93; |
| 13529 |
t.gafinitialarabic = 0xfb94; |
| 13530 |
t.gafmedialarabic = 0xfb95; |
| 13531 |
t.gagujarati = 0x0a97; |
| 13532 |
t.gagurmukhi = 0x0a17; |
| 13533 |
t.gahiragana = 0x304c; |
| 13534 |
t.gakatakana = 0x30ac; |
| 13535 |
t.gamma = 0x03b3; |
| 13536 |
t.gammalatinsmall = 0x0263; |
| 13537 |
t.gammasuperior = 0x02e0; |
| 13538 |
t.gangiacoptic = 0x03eb; |
| 13539 |
t.gbopomofo = 0x310d; |
| 13540 |
t.gbreve = 0x011f; |
| 13541 |
t.gcaron = 0x01e7; |
| 13542 |
t.gcedilla = 0x0123; |
| 13543 |
t.gcircle = 0x24d6; |
| 13544 |
t.gcircumflex = 0x011d; |
| 13545 |
t.gcommaaccent = 0x0123; |
| 13546 |
t.gdot = 0x0121; |
| 13547 |
t.gdotaccent = 0x0121; |
| 13548 |
t.gecyrillic = 0x0433; |
| 13549 |
t.gehiragana = 0x3052; |
| 13550 |
t.gekatakana = 0x30b2; |
| 13551 |
t.geometricallyequal = 0x2251; |
| 13552 |
t.gereshaccenthebrew = 0x059c; |
| 13553 |
t.gereshhebrew = 0x05f3; |
| 13554 |
t.gereshmuqdamhebrew = 0x059d; |
| 13555 |
t.germandbls = 0x00df; |
| 13556 |
t.gershayimaccenthebrew = 0x059e; |
| 13557 |
t.gershayimhebrew = 0x05f4; |
| 13558 |
t.getamark = 0x3013; |
| 13559 |
t.ghabengali = 0x0998; |
| 13560 |
t.ghadarmenian = 0x0572; |
| 13561 |
t.ghadeva = 0x0918; |
| 13562 |
t.ghagujarati = 0x0a98; |
| 13563 |
t.ghagurmukhi = 0x0a18; |
| 13564 |
t.ghainarabic = 0x063a; |
| 13565 |
t.ghainfinalarabic = 0xfece; |
| 13566 |
t.ghaininitialarabic = 0xfecf; |
| 13567 |
t.ghainmedialarabic = 0xfed0; |
| 13568 |
t.ghemiddlehookcyrillic = 0x0495; |
| 13569 |
t.ghestrokecyrillic = 0x0493; |
| 13570 |
t.gheupturncyrillic = 0x0491; |
| 13571 |
t.ghhadeva = 0x095a; |
| 13572 |
t.ghhagurmukhi = 0x0a5a; |
| 13573 |
t.ghook = 0x0260; |
| 13574 |
t.ghzsquare = 0x3393; |
| 13575 |
t.gihiragana = 0x304e; |
| 13576 |
t.gikatakana = 0x30ae; |
| 13577 |
t.gimarmenian = 0x0563; |
| 13578 |
t.gimel = 0x05d2; |
| 13579 |
t.gimeldagesh = 0xfb32; |
| 13580 |
t.gimeldageshhebrew = 0xfb32; |
| 13581 |
t.gimelhebrew = 0x05d2; |
| 13582 |
t.gjecyrillic = 0x0453; |
| 13583 |
t.glottalinvertedstroke = 0x01be; |
| 13584 |
t.glottalstop = 0x0294; |
| 13585 |
t.glottalstopinverted = 0x0296; |
| 13586 |
t.glottalstopmod = 0x02c0; |
| 13587 |
t.glottalstopreversed = 0x0295; |
| 13588 |
t.glottalstopreversedmod = 0x02c1; |
| 13589 |
t.glottalstopreversedsuperior = 0x02e4; |
| 13590 |
t.glottalstopstroke = 0x02a1; |
| 13591 |
t.glottalstopstrokereversed = 0x02a2; |
| 13592 |
t.gmacron = 0x1e21; |
| 13593 |
t.gmonospace = 0xff47; |
| 13594 |
t.gohiragana = 0x3054; |
| 13595 |
t.gokatakana = 0x30b4; |
| 13596 |
t.gparen = 0x24a2; |
| 13597 |
t.gpasquare = 0x33ac; |
| 13598 |
t.gradient = 0x2207; |
| 13599 |
t.grave = 0x0060; |
| 13600 |
t.gravebelowcmb = 0x0316; |
| 13601 |
t.gravecmb = 0x0300; |
| 13602 |
t.gravecomb = 0x0300; |
| 13603 |
t.gravedeva = 0x0953; |
| 13604 |
t.gravelowmod = 0x02ce; |
| 13605 |
t.gravemonospace = 0xff40; |
| 13606 |
t.gravetonecmb = 0x0340; |
| 13607 |
t.greater = 0x003e; |
| 13608 |
t.greaterequal = 0x2265; |
| 13609 |
t.greaterequalorless = 0x22db; |
| 13610 |
t.greatermonospace = 0xff1e; |
| 13611 |
t.greaterorequivalent = 0x2273; |
| 13612 |
t.greaterorless = 0x2277; |
| 13613 |
t.greateroverequal = 0x2267; |
| 13614 |
t.greatersmall = 0xfe65; |
| 13615 |
t.gscript = 0x0261; |
| 13616 |
t.gstroke = 0x01e5; |
| 13617 |
t.guhiragana = 0x3050; |
| 13618 |
t.guillemotleft = 0x00ab; |
| 13619 |
t.guillemotright = 0x00bb; |
| 13620 |
t.guilsinglleft = 0x2039; |
| 13621 |
t.guilsinglright = 0x203a; |
| 13622 |
t.gukatakana = 0x30b0; |
| 13623 |
t.guramusquare = 0x3318; |
| 13624 |
t.gysquare = 0x33c9; |
| 13625 |
t.h = 0x0068; |
| 13626 |
t.haabkhasiancyrillic = 0x04a9; |
| 13627 |
t.haaltonearabic = 0x06c1; |
| 13628 |
t.habengali = 0x09b9; |
| 13629 |
t.hadescendercyrillic = 0x04b3; |
| 13630 |
t.hadeva = 0x0939; |
| 13631 |
t.hagujarati = 0x0ab9; |
| 13632 |
t.hagurmukhi = 0x0a39; |
| 13633 |
t.haharabic = 0x062d; |
| 13634 |
t.hahfinalarabic = 0xfea2; |
| 13635 |
t.hahinitialarabic = 0xfea3; |
| 13636 |
t.hahiragana = 0x306f; |
| 13637 |
t.hahmedialarabic = 0xfea4; |
| 13638 |
t.haitusquare = 0x332a; |
| 13639 |
t.hakatakana = 0x30cf; |
| 13640 |
t.hakatakanahalfwidth = 0xff8a; |
| 13641 |
t.halantgurmukhi = 0x0a4d; |
| 13642 |
t.hamzaarabic = 0x0621; |
| 13643 |
t.hamzalowarabic = 0x0621; |
| 13644 |
t.hangulfiller = 0x3164; |
| 13645 |
t.hardsigncyrillic = 0x044a; |
| 13646 |
t.harpoonleftbarbup = 0x21bc; |
| 13647 |
t.harpoonrightbarbup = 0x21c0; |
| 13648 |
t.hasquare = 0x33ca; |
| 13649 |
t.hatafpatah = 0x05b2; |
| 13650 |
t.hatafpatah16 = 0x05b2; |
| 13651 |
t.hatafpatah23 = 0x05b2; |
| 13652 |
t.hatafpatah2f = 0x05b2; |
| 13653 |
t.hatafpatahhebrew = 0x05b2; |
| 13654 |
t.hatafpatahnarrowhebrew = 0x05b2; |
| 13655 |
t.hatafpatahquarterhebrew = 0x05b2; |
| 13656 |
t.hatafpatahwidehebrew = 0x05b2; |
| 13657 |
t.hatafqamats = 0x05b3; |
| 13658 |
t.hatafqamats1b = 0x05b3; |
| 13659 |
t.hatafqamats28 = 0x05b3; |
| 13660 |
t.hatafqamats34 = 0x05b3; |
| 13661 |
t.hatafqamatshebrew = 0x05b3; |
| 13662 |
t.hatafqamatsnarrowhebrew = 0x05b3; |
| 13663 |
t.hatafqamatsquarterhebrew = 0x05b3; |
| 13664 |
t.hatafqamatswidehebrew = 0x05b3; |
| 13665 |
t.hatafsegol = 0x05b1; |
| 13666 |
t.hatafsegol17 = 0x05b1; |
| 13667 |
t.hatafsegol24 = 0x05b1; |
| 13668 |
t.hatafsegol30 = 0x05b1; |
| 13669 |
t.hatafsegolhebrew = 0x05b1; |
| 13670 |
t.hatafsegolnarrowhebrew = 0x05b1; |
| 13671 |
t.hatafsegolquarterhebrew = 0x05b1; |
| 13672 |
t.hatafsegolwidehebrew = 0x05b1; |
| 13673 |
t.hbar = 0x0127; |
| 13674 |
t.hbopomofo = 0x310f; |
| 13675 |
t.hbrevebelow = 0x1e2b; |
| 13676 |
t.hcedilla = 0x1e29; |
| 13677 |
t.hcircle = 0x24d7; |
| 13678 |
t.hcircumflex = 0x0125; |
| 13679 |
t.hdieresis = 0x1e27; |
| 13680 |
t.hdotaccent = 0x1e23; |
| 13681 |
t.hdotbelow = 0x1e25; |
| 13682 |
t.he = 0x05d4; |
| 13683 |
t.heart = 0x2665; |
| 13684 |
t.heartsuitblack = 0x2665; |
| 13685 |
t.heartsuitwhite = 0x2661; |
| 13686 |
t.hedagesh = 0xfb34; |
| 13687 |
t.hedageshhebrew = 0xfb34; |
| 13688 |
t.hehaltonearabic = 0x06c1; |
| 13689 |
t.heharabic = 0x0647; |
| 13690 |
t.hehebrew = 0x05d4; |
| 13691 |
t.hehfinalaltonearabic = 0xfba7; |
| 13692 |
t.hehfinalalttwoarabic = 0xfeea; |
| 13693 |
t.hehfinalarabic = 0xfeea; |
| 13694 |
t.hehhamzaabovefinalarabic = 0xfba5; |
| 13695 |
t.hehhamzaaboveisolatedarabic = 0xfba4; |
| 13696 |
t.hehinitialaltonearabic = 0xfba8; |
| 13697 |
t.hehinitialarabic = 0xfeeb; |
| 13698 |
t.hehiragana = 0x3078; |
| 13699 |
t.hehmedialaltonearabic = 0xfba9; |
| 13700 |
t.hehmedialarabic = 0xfeec; |
| 13701 |
t.heiseierasquare = 0x337b; |
| 13702 |
t.hekatakana = 0x30d8; |
| 13703 |
t.hekatakanahalfwidth = 0xff8d; |
| 13704 |
t.hekutaarusquare = 0x3336; |
| 13705 |
t.henghook = 0x0267; |
| 13706 |
t.herutusquare = 0x3339; |
| 13707 |
t.het = 0x05d7; |
| 13708 |
t.hethebrew = 0x05d7; |
| 13709 |
t.hhook = 0x0266; |
| 13710 |
t.hhooksuperior = 0x02b1; |
| 13711 |
t.hieuhacirclekorean = 0x327b; |
| 13712 |
t.hieuhaparenkorean = 0x321b; |
| 13713 |
t.hieuhcirclekorean = 0x326d; |
| 13714 |
t.hieuhkorean = 0x314e; |
| 13715 |
t.hieuhparenkorean = 0x320d; |
| 13716 |
t.hihiragana = 0x3072; |
| 13717 |
t.hikatakana = 0x30d2; |
| 13718 |
t.hikatakanahalfwidth = 0xff8b; |
| 13719 |
t.hiriq = 0x05b4; |
| 13720 |
t.hiriq14 = 0x05b4; |
| 13721 |
t.hiriq21 = 0x05b4; |
| 13722 |
t.hiriq2d = 0x05b4; |
| 13723 |
t.hiriqhebrew = 0x05b4; |
| 13724 |
t.hiriqnarrowhebrew = 0x05b4; |
| 13725 |
t.hiriqquarterhebrew = 0x05b4; |
| 13726 |
t.hiriqwidehebrew = 0x05b4; |
| 13727 |
t.hlinebelow = 0x1e96; |
| 13728 |
t.hmonospace = 0xff48; |
| 13729 |
t.hoarmenian = 0x0570; |
| 13730 |
t.hohipthai = 0x0e2b; |
| 13731 |
t.hohiragana = 0x307b; |
| 13732 |
t.hokatakana = 0x30db; |
| 13733 |
t.hokatakanahalfwidth = 0xff8e; |
| 13734 |
t.holam = 0x05b9; |
| 13735 |
t.holam19 = 0x05b9; |
| 13736 |
t.holam26 = 0x05b9; |
| 13737 |
t.holam32 = 0x05b9; |
| 13738 |
t.holamhebrew = 0x05b9; |
| 13739 |
t.holamnarrowhebrew = 0x05b9; |
| 13740 |
t.holamquarterhebrew = 0x05b9; |
| 13741 |
t.holamwidehebrew = 0x05b9; |
| 13742 |
t.honokhukthai = 0x0e2e; |
| 13743 |
t.hookabovecomb = 0x0309; |
| 13744 |
t.hookcmb = 0x0309; |
| 13745 |
t.hookpalatalizedbelowcmb = 0x0321; |
| 13746 |
t.hookretroflexbelowcmb = 0x0322; |
| 13747 |
t.hoonsquare = 0x3342; |
| 13748 |
t.horicoptic = 0x03e9; |
| 13749 |
t.horizontalbar = 0x2015; |
| 13750 |
t.horncmb = 0x031b; |
| 13751 |
t.hotsprings = 0x2668; |
| 13752 |
t.house = 0x2302; |
| 13753 |
t.hparen = 0x24a3; |
| 13754 |
t.hsuperior = 0x02b0; |
| 13755 |
t.hturned = 0x0265; |
| 13756 |
t.huhiragana = 0x3075; |
| 13757 |
t.huiitosquare = 0x3333; |
| 13758 |
t.hukatakana = 0x30d5; |
| 13759 |
t.hukatakanahalfwidth = 0xff8c; |
| 13760 |
t.hungarumlaut = 0x02dd; |
| 13761 |
t.hungarumlautcmb = 0x030b; |
| 13762 |
t.hv = 0x0195; |
| 13763 |
t.hyphen = 0x002d; |
| 13764 |
t.hypheninferior = 0xf6e5; |
| 13765 |
t.hyphenmonospace = 0xff0d; |
| 13766 |
t.hyphensmall = 0xfe63; |
| 13767 |
t.hyphensuperior = 0xf6e6; |
| 13768 |
t.hyphentwo = 0x2010; |
| 13769 |
t.i = 0x0069; |
| 13770 |
t.iacute = 0x00ed; |
| 13771 |
t.iacyrillic = 0x044f; |
| 13772 |
t.ibengali = 0x0987; |
| 13773 |
t.ibopomofo = 0x3127; |
| 13774 |
t.ibreve = 0x012d; |
| 13775 |
t.icaron = 0x01d0; |
| 13776 |
t.icircle = 0x24d8; |
| 13777 |
t.icircumflex = 0x00ee; |
| 13778 |
t.icyrillic = 0x0456; |
| 13779 |
t.idblgrave = 0x0209; |
| 13780 |
t.ideographearthcircle = 0x328f; |
| 13781 |
t.ideographfirecircle = 0x328b; |
| 13782 |
t.ideographicallianceparen = 0x323f; |
| 13783 |
t.ideographiccallparen = 0x323a; |
| 13784 |
t.ideographiccentrecircle = 0x32a5; |
| 13785 |
t.ideographicclose = 0x3006; |
| 13786 |
t.ideographiccomma = 0x3001; |
| 13787 |
t.ideographiccommaleft = 0xff64; |
| 13788 |
t.ideographiccongratulationparen = 0x3237; |
| 13789 |
t.ideographiccorrectcircle = 0x32a3; |
| 13790 |
t.ideographicearthparen = 0x322f; |
| 13791 |
t.ideographicenterpriseparen = 0x323d; |
| 13792 |
t.ideographicexcellentcircle = 0x329d; |
| 13793 |
t.ideographicfestivalparen = 0x3240; |
| 13794 |
t.ideographicfinancialcircle = 0x3296; |
| 13795 |
t.ideographicfinancialparen = 0x3236; |
| 13796 |
t.ideographicfireparen = 0x322b; |
| 13797 |
t.ideographichaveparen = 0x3232; |
| 13798 |
t.ideographichighcircle = 0x32a4; |
| 13799 |
t.ideographiciterationmark = 0x3005; |
| 13800 |
t.ideographiclaborcircle = 0x3298; |
| 13801 |
t.ideographiclaborparen = 0x3238; |
| 13802 |
t.ideographicleftcircle = 0x32a7; |
| 13803 |
t.ideographiclowcircle = 0x32a6; |
| 13804 |
t.ideographicmedicinecircle = 0x32a9; |
| 13805 |
t.ideographicmetalparen = 0x322e; |
| 13806 |
t.ideographicmoonparen = 0x322a; |
| 13807 |
t.ideographicnameparen = 0x3234; |
| 13808 |
t.ideographicperiod = 0x3002; |
| 13809 |
t.ideographicprintcircle = 0x329e; |
| 13810 |
t.ideographicreachparen = 0x3243; |
| 13811 |
t.ideographicrepresentparen = 0x3239; |
| 13812 |
t.ideographicresourceparen = 0x323e; |
| 13813 |
t.ideographicrightcircle = 0x32a8; |
| 13814 |
t.ideographicsecretcircle = 0x3299; |
| 13815 |
t.ideographicselfparen = 0x3242; |
| 13816 |
t.ideographicsocietyparen = 0x3233; |
| 13817 |
t.ideographicspace = 0x3000; |
| 13818 |
t.ideographicspecialparen = 0x3235; |
| 13819 |
t.ideographicstockparen = 0x3231; |
| 13820 |
t.ideographicstudyparen = 0x323b; |
| 13821 |
t.ideographicsunparen = 0x3230; |
| 13822 |
t.ideographicsuperviseparen = 0x323c; |
| 13823 |
t.ideographicwaterparen = 0x322c; |
| 13824 |
t.ideographicwoodparen = 0x322d; |
| 13825 |
t.ideographiczero = 0x3007; |
| 13826 |
t.ideographmetalcircle = 0x328e; |
| 13827 |
t.ideographmooncircle = 0x328a; |
| 13828 |
t.ideographnamecircle = 0x3294; |
| 13829 |
t.ideographsuncircle = 0x3290; |
| 13830 |
t.ideographwatercircle = 0x328c; |
| 13831 |
t.ideographwoodcircle = 0x328d; |
| 13832 |
t.ideva = 0x0907; |
| 13833 |
t.idieresis = 0x00ef; |
| 13834 |
t.idieresisacute = 0x1e2f; |
| 13835 |
t.idieresiscyrillic = 0x04e5; |
| 13836 |
t.idotbelow = 0x1ecb; |
| 13837 |
t.iebrevecyrillic = 0x04d7; |
| 13838 |
t.iecyrillic = 0x0435; |
| 13839 |
t.ieungacirclekorean = 0x3275; |
| 13840 |
t.ieungaparenkorean = 0x3215; |
| 13841 |
t.ieungcirclekorean = 0x3267; |
| 13842 |
t.ieungkorean = 0x3147; |
| 13843 |
t.ieungparenkorean = 0x3207; |
| 13844 |
t.igrave = 0x00ec; |
| 13845 |
t.igujarati = 0x0a87; |
| 13846 |
t.igurmukhi = 0x0a07; |
| 13847 |
t.ihiragana = 0x3044; |
| 13848 |
t.ihookabove = 0x1ec9; |
| 13849 |
t.iibengali = 0x0988; |
| 13850 |
t.iicyrillic = 0x0438; |
| 13851 |
t.iideva = 0x0908; |
| 13852 |
t.iigujarati = 0x0a88; |
| 13853 |
t.iigurmukhi = 0x0a08; |
| 13854 |
t.iimatragurmukhi = 0x0a40; |
| 13855 |
t.iinvertedbreve = 0x020b; |
| 13856 |
t.iishortcyrillic = 0x0439; |
| 13857 |
t.iivowelsignbengali = 0x09c0; |
| 13858 |
t.iivowelsigndeva = 0x0940; |
| 13859 |
t.iivowelsigngujarati = 0x0ac0; |
| 13860 |
t.ij = 0x0133; |
| 13861 |
t.ikatakana = 0x30a4; |
| 13862 |
t.ikatakanahalfwidth = 0xff72; |
| 13863 |
t.ikorean = 0x3163; |
| 13864 |
t.ilde = 0x02dc; |
| 13865 |
t.iluyhebrew = 0x05ac; |
| 13866 |
t.imacron = 0x012b; |
| 13867 |
t.imacroncyrillic = 0x04e3; |
| 13868 |
t.imageorapproximatelyequal = 0x2253; |
| 13869 |
t.imatragurmukhi = 0x0a3f; |
| 13870 |
t.imonospace = 0xff49; |
| 13871 |
t.increment = 0x2206; |
| 13872 |
t.infinity = 0x221e; |
| 13873 |
t.iniarmenian = 0x056b; |
| 13874 |
t.integral = 0x222b; |
| 13875 |
t.integralbottom = 0x2321; |
| 13876 |
t.integralbt = 0x2321; |
| 13877 |
t.integralex = 0xf8f5; |
| 13878 |
t.integraltop = 0x2320; |
| 13879 |
t.integraltp = 0x2320; |
| 13880 |
t.intersection = 0x2229; |
| 13881 |
t.intisquare = 0x3305; |
| 13882 |
t.invbullet = 0x25d8; |
| 13883 |
t.invcircle = 0x25d9; |
| 13884 |
t.invsmileface = 0x263b; |
| 13885 |
t.iocyrillic = 0x0451; |
| 13886 |
t.iogonek = 0x012f; |
| 13887 |
t.iota = 0x03b9; |
| 13888 |
t.iotadieresis = 0x03ca; |
| 13889 |
t.iotadieresistonos = 0x0390; |
| 13890 |
t.iotalatin = 0x0269; |
| 13891 |
t.iotatonos = 0x03af; |
| 13892 |
t.iparen = 0x24a4; |
| 13893 |
t.irigurmukhi = 0x0a72; |
| 13894 |
t.ismallhiragana = 0x3043; |
| 13895 |
t.ismallkatakana = 0x30a3; |
| 13896 |
t.ismallkatakanahalfwidth = 0xff68; |
| 13897 |
t.issharbengali = 0x09fa; |
| 13898 |
t.istroke = 0x0268; |
| 13899 |
t.isuperior = 0xf6ed; |
| 13900 |
t.iterationhiragana = 0x309d; |
| 13901 |
t.iterationkatakana = 0x30fd; |
| 13902 |
t.itilde = 0x0129; |
| 13903 |
t.itildebelow = 0x1e2d; |
| 13904 |
t.iubopomofo = 0x3129; |
| 13905 |
t.iucyrillic = 0x044e; |
| 13906 |
t.ivowelsignbengali = 0x09bf; |
| 13907 |
t.ivowelsigndeva = 0x093f; |
| 13908 |
t.ivowelsigngujarati = 0x0abf; |
| 13909 |
t.izhitsacyrillic = 0x0475; |
| 13910 |
t.izhitsadblgravecyrillic = 0x0477; |
| 13911 |
t.j = 0x006a; |
| 13912 |
t.jaarmenian = 0x0571; |
| 13913 |
t.jabengali = 0x099c; |
| 13914 |
t.jadeva = 0x091c; |
| 13915 |
t.jagujarati = 0x0a9c; |
| 13916 |
t.jagurmukhi = 0x0a1c; |
| 13917 |
t.jbopomofo = 0x3110; |
| 13918 |
t.jcaron = 0x01f0; |
| 13919 |
t.jcircle = 0x24d9; |
| 13920 |
t.jcircumflex = 0x0135; |
| 13921 |
t.jcrossedtail = 0x029d; |
| 13922 |
t.jdotlessstroke = 0x025f; |
| 13923 |
t.jecyrillic = 0x0458; |
| 13924 |
t.jeemarabic = 0x062c; |
| 13925 |
t.jeemfinalarabic = 0xfe9e; |
| 13926 |
t.jeeminitialarabic = 0xfe9f; |
| 13927 |
t.jeemmedialarabic = 0xfea0; |
| 13928 |
t.jeharabic = 0x0698; |
| 13929 |
t.jehfinalarabic = 0xfb8b; |
| 13930 |
t.jhabengali = 0x099d; |
| 13931 |
t.jhadeva = 0x091d; |
| 13932 |
t.jhagujarati = 0x0a9d; |
| 13933 |
t.jhagurmukhi = 0x0a1d; |
| 13934 |
t.jheharmenian = 0x057b; |
| 13935 |
t.jis = 0x3004; |
| 13936 |
t.jmonospace = 0xff4a; |
| 13937 |
t.jparen = 0x24a5; |
| 13938 |
t.jsuperior = 0x02b2; |
| 13939 |
t.k = 0x006b; |
| 13940 |
t.kabashkircyrillic = 0x04a1; |
| 13941 |
t.kabengali = 0x0995; |
| 13942 |
t.kacute = 0x1e31; |
| 13943 |
t.kacyrillic = 0x043a; |
| 13944 |
t.kadescendercyrillic = 0x049b; |
| 13945 |
t.kadeva = 0x0915; |
| 13946 |
t.kaf = 0x05db; |
| 13947 |
t.kafarabic = 0x0643; |
| 13948 |
t.kafdagesh = 0xfb3b; |
| 13949 |
t.kafdageshhebrew = 0xfb3b; |
| 13950 |
t.kaffinalarabic = 0xfeda; |
| 13951 |
t.kafhebrew = 0x05db; |
| 13952 |
t.kafinitialarabic = 0xfedb; |
| 13953 |
t.kafmedialarabic = 0xfedc; |
| 13954 |
t.kafrafehebrew = 0xfb4d; |
| 13955 |
t.kagujarati = 0x0a95; |
| 13956 |
t.kagurmukhi = 0x0a15; |
| 13957 |
t.kahiragana = 0x304b; |
| 13958 |
t.kahookcyrillic = 0x04c4; |
| 13959 |
t.kakatakana = 0x30ab; |
| 13960 |
t.kakatakanahalfwidth = 0xff76; |
| 13961 |
t.kappa = 0x03ba; |
| 13962 |
t.kappasymbolgreek = 0x03f0; |
| 13963 |
t.kapyeounmieumkorean = 0x3171; |
| 13964 |
t.kapyeounphieuphkorean = 0x3184; |
| 13965 |
t.kapyeounpieupkorean = 0x3178; |
| 13966 |
t.kapyeounssangpieupkorean = 0x3179; |
| 13967 |
t.karoriisquare = 0x330d; |
| 13968 |
t.kashidaautoarabic = 0x0640; |
| 13969 |
t.kashidaautonosidebearingarabic = 0x0640; |
| 13970 |
t.kasmallkatakana = 0x30f5; |
| 13971 |
t.kasquare = 0x3384; |
| 13972 |
t.kasraarabic = 0x0650; |
| 13973 |
t.kasratanarabic = 0x064d; |
| 13974 |
t.kastrokecyrillic = 0x049f; |
| 13975 |
t.katahiraprolongmarkhalfwidth = 0xff70; |
| 13976 |
t.kaverticalstrokecyrillic = 0x049d; |
| 13977 |
t.kbopomofo = 0x310e; |
| 13978 |
t.kcalsquare = 0x3389; |
| 13979 |
t.kcaron = 0x01e9; |
| 13980 |
t.kcedilla = 0x0137; |
| 13981 |
t.kcircle = 0x24da; |
| 13982 |
t.kcommaaccent = 0x0137; |
| 13983 |
t.kdotbelow = 0x1e33; |
| 13984 |
t.keharmenian = 0x0584; |
| 13985 |
t.kehiragana = 0x3051; |
| 13986 |
t.kekatakana = 0x30b1; |
| 13987 |
t.kekatakanahalfwidth = 0xff79; |
| 13988 |
t.kenarmenian = 0x056f; |
| 13989 |
t.kesmallkatakana = 0x30f6; |
| 13990 |
t.kgreenlandic = 0x0138; |
| 13991 |
t.khabengali = 0x0996; |
| 13992 |
t.khacyrillic = 0x0445; |
| 13993 |
t.khadeva = 0x0916; |
| 13994 |
t.khagujarati = 0x0a96; |
| 13995 |
t.khagurmukhi = 0x0a16; |
| 13996 |
t.khaharabic = 0x062e; |
| 13997 |
t.khahfinalarabic = 0xfea6; |
| 13998 |
t.khahinitialarabic = 0xfea7; |
| 13999 |
t.khahmedialarabic = 0xfea8; |
| 14000 |
t.kheicoptic = 0x03e7; |
| 14001 |
t.khhadeva = 0x0959; |
| 14002 |
t.khhagurmukhi = 0x0a59; |
| 14003 |
t.khieukhacirclekorean = 0x3278; |
| 14004 |
t.khieukhaparenkorean = 0x3218; |
| 14005 |
t.khieukhcirclekorean = 0x326a; |
| 14006 |
t.khieukhkorean = 0x314b; |
| 14007 |
t.khieukhparenkorean = 0x320a; |
| 14008 |
t.khokhaithai = 0x0e02; |
| 14009 |
t.khokhonthai = 0x0e05; |
| 14010 |
t.khokhuatthai = 0x0e03; |
| 14011 |
t.khokhwaithai = 0x0e04; |
| 14012 |
t.khomutthai = 0x0e5b; |
| 14013 |
t.khook = 0x0199; |
| 14014 |
t.khorakhangthai = 0x0e06; |
| 14015 |
t.khzsquare = 0x3391; |
| 14016 |
t.kihiragana = 0x304d; |
| 14017 |
t.kikatakana = 0x30ad; |
| 14018 |
t.kikatakanahalfwidth = 0xff77; |
| 14019 |
t.kiroguramusquare = 0x3315; |
| 14020 |
t.kiromeetorusquare = 0x3316; |
| 14021 |
t.kirosquare = 0x3314; |
| 14022 |
t.kiyeokacirclekorean = 0x326e; |
| 14023 |
t.kiyeokaparenkorean = 0x320e; |
| 14024 |
t.kiyeokcirclekorean = 0x3260; |
| 14025 |
t.kiyeokkorean = 0x3131; |
| 14026 |
t.kiyeokparenkorean = 0x3200; |
| 14027 |
t.kiyeoksioskorean = 0x3133; |
| 14028 |
t.kjecyrillic = 0x045c; |
| 14029 |
t.klinebelow = 0x1e35; |
| 14030 |
t.klsquare = 0x3398; |
| 14031 |
t.kmcubedsquare = 0x33a6; |
| 14032 |
t.kmonospace = 0xff4b; |
| 14033 |
t.kmsquaredsquare = 0x33a2; |
| 14034 |
t.kohiragana = 0x3053; |
| 14035 |
t.kohmsquare = 0x33c0; |
| 14036 |
t.kokaithai = 0x0e01; |
| 14037 |
t.kokatakana = 0x30b3; |
| 14038 |
t.kokatakanahalfwidth = 0xff7a; |
| 14039 |
t.kooposquare = 0x331e; |
| 14040 |
t.koppacyrillic = 0x0481; |
| 14041 |
t.koreanstandardsymbol = 0x327f; |
| 14042 |
t.koroniscmb = 0x0343; |
| 14043 |
t.kparen = 0x24a6; |
| 14044 |
t.kpasquare = 0x33aa; |
| 14045 |
t.ksicyrillic = 0x046f; |
| 14046 |
t.ktsquare = 0x33cf; |
| 14047 |
t.kturned = 0x029e; |
| 14048 |
t.kuhiragana = 0x304f; |
| 14049 |
t.kukatakana = 0x30af; |
| 14050 |
t.kukatakanahalfwidth = 0xff78; |
| 14051 |
t.kvsquare = 0x33b8; |
| 14052 |
t.kwsquare = 0x33be; |
| 14053 |
t.l = 0x006c; |
| 14054 |
t.labengali = 0x09b2; |
| 14055 |
t.lacute = 0x013a; |
| 14056 |
t.ladeva = 0x0932; |
| 14057 |
t.lagujarati = 0x0ab2; |
| 14058 |
t.lagurmukhi = 0x0a32; |
| 14059 |
t.lakkhangyaothai = 0x0e45; |
| 14060 |
t.lamaleffinalarabic = 0xfefc; |
| 14061 |
t.lamalefhamzaabovefinalarabic = 0xfef8; |
| 14062 |
t.lamalefhamzaaboveisolatedarabic = 0xfef7; |
| 14063 |
t.lamalefhamzabelowfinalarabic = 0xfefa; |
| 14064 |
t.lamalefhamzabelowisolatedarabic = 0xfef9; |
| 14065 |
t.lamalefisolatedarabic = 0xfefb; |
| 14066 |
t.lamalefmaddaabovefinalarabic = 0xfef6; |
| 14067 |
t.lamalefmaddaaboveisolatedarabic = 0xfef5; |
| 14068 |
t.lamarabic = 0x0644; |
| 14069 |
t.lambda = 0x03bb; |
| 14070 |
t.lambdastroke = 0x019b; |
| 14071 |
t.lamed = 0x05dc; |
| 14072 |
t.lameddagesh = 0xfb3c; |
| 14073 |
t.lameddageshhebrew = 0xfb3c; |
| 14074 |
t.lamedhebrew = 0x05dc; |
| 14075 |
t.lamfinalarabic = 0xfede; |
| 14076 |
t.lamhahinitialarabic = 0xfcca; |
| 14077 |
t.laminitialarabic = 0xfedf; |
| 14078 |
t.lamjeeminitialarabic = 0xfcc9; |
| 14079 |
t.lamkhahinitialarabic = 0xfccb; |
| 14080 |
t.lamlamhehisolatedarabic = 0xfdf2; |
| 14081 |
t.lammedialarabic = 0xfee0; |
| 14082 |
t.lammeemhahinitialarabic = 0xfd88; |
| 14083 |
t.lammeeminitialarabic = 0xfccc; |
| 14084 |
t.largecircle = 0x25ef; |
| 14085 |
t.lbar = 0x019a; |
| 14086 |
t.lbelt = 0x026c; |
| 14087 |
t.lbopomofo = 0x310c; |
| 14088 |
t.lcaron = 0x013e; |
| 14089 |
t.lcedilla = 0x013c; |
| 14090 |
t.lcircle = 0x24db; |
| 14091 |
t.lcircumflexbelow = 0x1e3d; |
| 14092 |
t.lcommaaccent = 0x013c; |
| 14093 |
t.ldot = 0x0140; |
| 14094 |
t.ldotaccent = 0x0140; |
| 14095 |
t.ldotbelow = 0x1e37; |
| 14096 |
t.ldotbelowmacron = 0x1e39; |
| 14097 |
t.leftangleabovecmb = 0x031a; |
| 14098 |
t.lefttackbelowcmb = 0x0318; |
| 14099 |
t.less = 0x003c; |
| 14100 |
t.lessequal = 0x2264; |
| 14101 |
t.lessequalorgreater = 0x22da; |
| 14102 |
t.lessmonospace = 0xff1c; |
| 14103 |
t.lessorequivalent = 0x2272; |
| 14104 |
t.lessorgreater = 0x2276; |
| 14105 |
t.lessoverequal = 0x2266; |
| 14106 |
t.lesssmall = 0xfe64; |
| 14107 |
t.lezh = 0x026e; |
| 14108 |
t.lfblock = 0x258c; |
| 14109 |
t.lhookretroflex = 0x026d; |
| 14110 |
t.lira = 0x20a4; |
| 14111 |
t.liwnarmenian = 0x056c; |
| 14112 |
t.lj = 0x01c9; |
| 14113 |
t.ljecyrillic = 0x0459; |
| 14114 |
t.ll = 0xf6c0; |
| 14115 |
t.lladeva = 0x0933; |
| 14116 |
t.llagujarati = 0x0ab3; |
| 14117 |
t.llinebelow = 0x1e3b; |
| 14118 |
t.llladeva = 0x0934; |
| 14119 |
t.llvocalicbengali = 0x09e1; |
| 14120 |
t.llvocalicdeva = 0x0961; |
| 14121 |
t.llvocalicvowelsignbengali = 0x09e3; |
| 14122 |
t.llvocalicvowelsigndeva = 0x0963; |
| 14123 |
t.lmiddletilde = 0x026b; |
| 14124 |
t.lmonospace = 0xff4c; |
| 14125 |
t.lmsquare = 0x33d0; |
| 14126 |
t.lochulathai = 0x0e2c; |
| 14127 |
t.logicaland = 0x2227; |
| 14128 |
t.logicalnot = 0x00ac; |
| 14129 |
t.logicalnotreversed = 0x2310; |
| 14130 |
t.logicalor = 0x2228; |
| 14131 |
t.lolingthai = 0x0e25; |
| 14132 |
t.longs = 0x017f; |
| 14133 |
t.lowlinecenterline = 0xfe4e; |
| 14134 |
t.lowlinecmb = 0x0332; |
| 14135 |
t.lowlinedashed = 0xfe4d; |
| 14136 |
t.lozenge = 0x25ca; |
| 14137 |
t.lparen = 0x24a7; |
| 14138 |
t.lslash = 0x0142; |
| 14139 |
t.lsquare = 0x2113; |
| 14140 |
t.lsuperior = 0xf6ee; |
| 14141 |
t.ltshade = 0x2591; |
| 14142 |
t.luthai = 0x0e26; |
| 14143 |
t.lvocalicbengali = 0x098c; |
| 14144 |
t.lvocalicdeva = 0x090c; |
| 14145 |
t.lvocalicvowelsignbengali = 0x09e2; |
| 14146 |
t.lvocalicvowelsigndeva = 0x0962; |
| 14147 |
t.lxsquare = 0x33d3; |
| 14148 |
t.m = 0x006d; |
| 14149 |
t.mabengali = 0x09ae; |
| 14150 |
t.macron = 0x00af; |
| 14151 |
t.macronbelowcmb = 0x0331; |
| 14152 |
t.macroncmb = 0x0304; |
| 14153 |
t.macronlowmod = 0x02cd; |
| 14154 |
t.macronmonospace = 0xffe3; |
| 14155 |
t.macute = 0x1e3f; |
| 14156 |
t.madeva = 0x092e; |
| 14157 |
t.magujarati = 0x0aae; |
| 14158 |
t.magurmukhi = 0x0a2e; |
| 14159 |
t.mahapakhhebrew = 0x05a4; |
| 14160 |
t.mahapakhlefthebrew = 0x05a4; |
| 14161 |
t.mahiragana = 0x307e; |
| 14162 |
t.maichattawalowleftthai = 0xf895; |
| 14163 |
t.maichattawalowrightthai = 0xf894; |
| 14164 |
t.maichattawathai = 0x0e4b; |
| 14165 |
t.maichattawaupperleftthai = 0xf893; |
| 14166 |
t.maieklowleftthai = 0xf88c; |
| 14167 |
t.maieklowrightthai = 0xf88b; |
| 14168 |
t.maiekthai = 0x0e48; |
| 14169 |
t.maiekupperleftthai = 0xf88a; |
| 14170 |
t.maihanakatleftthai = 0xf884; |
| 14171 |
t.maihanakatthai = 0x0e31; |
| 14172 |
t.maitaikhuleftthai = 0xf889; |
| 14173 |
t.maitaikhuthai = 0x0e47; |
| 14174 |
t.maitholowleftthai = 0xf88f; |
| 14175 |
t.maitholowrightthai = 0xf88e; |
| 14176 |
t.maithothai = 0x0e49; |
| 14177 |
t.maithoupperleftthai = 0xf88d; |
| 14178 |
t.maitrilowleftthai = 0xf892; |
| 14179 |
t.maitrilowrightthai = 0xf891; |
| 14180 |
t.maitrithai = 0x0e4a; |
| 14181 |
t.maitriupperleftthai = 0xf890; |
| 14182 |
t.maiyamokthai = 0x0e46; |
| 14183 |
t.makatakana = 0x30de; |
| 14184 |
t.makatakanahalfwidth = 0xff8f; |
| 14185 |
t.male = 0x2642; |
| 14186 |
t.mansyonsquare = 0x3347; |
| 14187 |
t.maqafhebrew = 0x05be; |
| 14188 |
t.mars = 0x2642; |
| 14189 |
t.masoracirclehebrew = 0x05af; |
| 14190 |
t.masquare = 0x3383; |
| 14191 |
t.mbopomofo = 0x3107; |
| 14192 |
t.mbsquare = 0x33d4; |
| 14193 |
t.mcircle = 0x24dc; |
| 14194 |
t.mcubedsquare = 0x33a5; |
| 14195 |
t.mdotaccent = 0x1e41; |
| 14196 |
t.mdotbelow = 0x1e43; |
| 14197 |
t.meemarabic = 0x0645; |
| 14198 |
t.meemfinalarabic = 0xfee2; |
| 14199 |
t.meeminitialarabic = 0xfee3; |
| 14200 |
t.meemmedialarabic = 0xfee4; |
| 14201 |
t.meemmeeminitialarabic = 0xfcd1; |
| 14202 |
t.meemmeemisolatedarabic = 0xfc48; |
| 14203 |
t.meetorusquare = 0x334d; |
| 14204 |
t.mehiragana = 0x3081; |
| 14205 |
t.meizierasquare = 0x337e; |
| 14206 |
t.mekatakana = 0x30e1; |
| 14207 |
t.mekatakanahalfwidth = 0xff92; |
| 14208 |
t.mem = 0x05de; |
| 14209 |
t.memdagesh = 0xfb3e; |
| 14210 |
t.memdageshhebrew = 0xfb3e; |
| 14211 |
t.memhebrew = 0x05de; |
| 14212 |
t.menarmenian = 0x0574; |
| 14213 |
t.merkhahebrew = 0x05a5; |
| 14214 |
t.merkhakefulahebrew = 0x05a6; |
| 14215 |
t.merkhakefulalefthebrew = 0x05a6; |
| 14216 |
t.merkhalefthebrew = 0x05a5; |
| 14217 |
t.mhook = 0x0271; |
| 14218 |
t.mhzsquare = 0x3392; |
| 14219 |
t.middledotkatakanahalfwidth = 0xff65; |
| 14220 |
t.middot = 0x00b7; |
| 14221 |
t.mieumacirclekorean = 0x3272; |
| 14222 |
t.mieumaparenkorean = 0x3212; |
| 14223 |
t.mieumcirclekorean = 0x3264; |
| 14224 |
t.mieumkorean = 0x3141; |
| 14225 |
t.mieumpansioskorean = 0x3170; |
| 14226 |
t.mieumparenkorean = 0x3204; |
| 14227 |
t.mieumpieupkorean = 0x316e; |
| 14228 |
t.mieumsioskorean = 0x316f; |
| 14229 |
t.mihiragana = 0x307f; |
| 14230 |
t.mikatakana = 0x30df; |
| 14231 |
t.mikatakanahalfwidth = 0xff90; |
| 14232 |
t.minus = 0x2212; |
| 14233 |
t.minusbelowcmb = 0x0320; |
| 14234 |
t.minuscircle = 0x2296; |
| 14235 |
t.minusmod = 0x02d7; |
| 14236 |
t.minusplus = 0x2213; |
| 14237 |
t.minute = 0x2032; |
| 14238 |
t.miribaarusquare = 0x334a; |
| 14239 |
t.mirisquare = 0x3349; |
| 14240 |
t.mlonglegturned = 0x0270; |
| 14241 |
t.mlsquare = 0x3396; |
| 14242 |
t.mmcubedsquare = 0x33a3; |
| 14243 |
t.mmonospace = 0xff4d; |
| 14244 |
t.mmsquaredsquare = 0x339f; |
| 14245 |
t.mohiragana = 0x3082; |
| 14246 |
t.mohmsquare = 0x33c1; |
| 14247 |
t.mokatakana = 0x30e2; |
| 14248 |
t.mokatakanahalfwidth = 0xff93; |
| 14249 |
t.molsquare = 0x33d6; |
| 14250 |
t.momathai = 0x0e21; |
| 14251 |
t.moverssquare = 0x33a7; |
| 14252 |
t.moverssquaredsquare = 0x33a8; |
| 14253 |
t.mparen = 0x24a8; |
| 14254 |
t.mpasquare = 0x33ab; |
| 14255 |
t.mssquare = 0x33b3; |
| 14256 |
t.msuperior = 0xf6ef; |
| 14257 |
t.mturned = 0x026f; |
| 14258 |
t.mu = 0x00b5; |
| 14259 |
t.mu1 = 0x00b5; |
| 14260 |
t.muasquare = 0x3382; |
| 14261 |
t.muchgreater = 0x226b; |
| 14262 |
t.muchless = 0x226a; |
| 14263 |
t.mufsquare = 0x338c; |
| 14264 |
t.mugreek = 0x03bc; |
| 14265 |
t.mugsquare = 0x338d; |
| 14266 |
t.muhiragana = 0x3080; |
| 14267 |
t.mukatakana = 0x30e0; |
| 14268 |
t.mukatakanahalfwidth = 0xff91; |
| 14269 |
t.mulsquare = 0x3395; |
| 14270 |
t.multiply = 0x00d7; |
| 14271 |
t.mumsquare = 0x339b; |
| 14272 |
t.munahhebrew = 0x05a3; |
| 14273 |
t.munahlefthebrew = 0x05a3; |
| 14274 |
t.musicalnote = 0x266a; |
| 14275 |
t.musicalnotedbl = 0x266b; |
| 14276 |
t.musicflatsign = 0x266d; |
| 14277 |
t.musicsharpsign = 0x266f; |
| 14278 |
t.mussquare = 0x33b2; |
| 14279 |
t.muvsquare = 0x33b6; |
| 14280 |
t.muwsquare = 0x33bc; |
| 14281 |
t.mvmegasquare = 0x33b9; |
| 14282 |
t.mvsquare = 0x33b7; |
| 14283 |
t.mwmegasquare = 0x33bf; |
| 14284 |
t.mwsquare = 0x33bd; |
| 14285 |
t.n = 0x006e; |
| 14286 |
t.nabengali = 0x09a8; |
| 14287 |
t.nabla = 0x2207; |
| 14288 |
t.nacute = 0x0144; |
| 14289 |
t.nadeva = 0x0928; |
| 14290 |
t.nagujarati = 0x0aa8; |
| 14291 |
t.nagurmukhi = 0x0a28; |
| 14292 |
t.nahiragana = 0x306a; |
| 14293 |
t.nakatakana = 0x30ca; |
| 14294 |
t.nakatakanahalfwidth = 0xff85; |
| 14295 |
t.napostrophe = 0x0149; |
| 14296 |
t.nasquare = 0x3381; |
| 14297 |
t.nbopomofo = 0x310b; |
| 14298 |
t.nbspace = 0x00a0; |
| 14299 |
t.ncaron = 0x0148; |
| 14300 |
t.ncedilla = 0x0146; |
| 14301 |
t.ncircle = 0x24dd; |
| 14302 |
t.ncircumflexbelow = 0x1e4b; |
| 14303 |
t.ncommaaccent = 0x0146; |
| 14304 |
t.ndotaccent = 0x1e45; |
| 14305 |
t.ndotbelow = 0x1e47; |
| 14306 |
t.nehiragana = 0x306d; |
| 14307 |
t.nekatakana = 0x30cd; |
| 14308 |
t.nekatakanahalfwidth = 0xff88; |
| 14309 |
t.newsheqelsign = 0x20aa; |
| 14310 |
t.nfsquare = 0x338b; |
| 14311 |
t.ngabengali = 0x0999; |
| 14312 |
t.ngadeva = 0x0919; |
| 14313 |
t.ngagujarati = 0x0a99; |
| 14314 |
t.ngagurmukhi = 0x0a19; |
| 14315 |
t.ngonguthai = 0x0e07; |
| 14316 |
t.nhiragana = 0x3093; |
| 14317 |
t.nhookleft = 0x0272; |
| 14318 |
t.nhookretroflex = 0x0273; |
| 14319 |
t.nieunacirclekorean = 0x326f; |
| 14320 |
t.nieunaparenkorean = 0x320f; |
| 14321 |
t.nieuncieuckorean = 0x3135; |
| 14322 |
t.nieuncirclekorean = 0x3261; |
| 14323 |
t.nieunhieuhkorean = 0x3136; |
| 14324 |
t.nieunkorean = 0x3134; |
| 14325 |
t.nieunpansioskorean = 0x3168; |
| 14326 |
t.nieunparenkorean = 0x3201; |
| 14327 |
t.nieunsioskorean = 0x3167; |
| 14328 |
t.nieuntikeutkorean = 0x3166; |
| 14329 |
t.nihiragana = 0x306b; |
| 14330 |
t.nikatakana = 0x30cb; |
| 14331 |
t.nikatakanahalfwidth = 0xff86; |
| 14332 |
t.nikhahitleftthai = 0xf899; |
| 14333 |
t.nikhahitthai = 0x0e4d; |
| 14334 |
t.nine = 0x0039; |
| 14335 |
t.ninearabic = 0x0669; |
| 14336 |
t.ninebengali = 0x09ef; |
| 14337 |
t.ninecircle = 0x2468; |
| 14338 |
t.ninecircleinversesansserif = 0x2792; |
| 14339 |
t.ninedeva = 0x096f; |
| 14340 |
t.ninegujarati = 0x0aef; |
| 14341 |
t.ninegurmukhi = 0x0a6f; |
| 14342 |
t.ninehackarabic = 0x0669; |
| 14343 |
t.ninehangzhou = 0x3029; |
| 14344 |
t.nineideographicparen = 0x3228; |
| 14345 |
t.nineinferior = 0x2089; |
| 14346 |
t.ninemonospace = 0xff19; |
| 14347 |
t.nineoldstyle = 0xf739; |
| 14348 |
t.nineparen = 0x247c; |
| 14349 |
t.nineperiod = 0x2490; |
| 14350 |
t.ninepersian = 0x06f9; |
| 14351 |
t.nineroman = 0x2178; |
| 14352 |
t.ninesuperior = 0x2079; |
| 14353 |
t.nineteencircle = 0x2472; |
| 14354 |
t.nineteenparen = 0x2486; |
| 14355 |
t.nineteenperiod = 0x249a; |
| 14356 |
t.ninethai = 0x0e59; |
| 14357 |
t.nj = 0x01cc; |
| 14358 |
t.njecyrillic = 0x045a; |
| 14359 |
t.nkatakana = 0x30f3; |
| 14360 |
t.nkatakanahalfwidth = 0xff9d; |
| 14361 |
t.nlegrightlong = 0x019e; |
| 14362 |
t.nlinebelow = 0x1e49; |
| 14363 |
t.nmonospace = 0xff4e; |
| 14364 |
t.nmsquare = 0x339a; |
| 14365 |
t.nnabengali = 0x09a3; |
| 14366 |
t.nnadeva = 0x0923; |
| 14367 |
t.nnagujarati = 0x0aa3; |
| 14368 |
t.nnagurmukhi = 0x0a23; |
| 14369 |
t.nnnadeva = 0x0929; |
| 14370 |
t.nohiragana = 0x306e; |
| 14371 |
t.nokatakana = 0x30ce; |
| 14372 |
t.nokatakanahalfwidth = 0xff89; |
| 14373 |
t.nonbreakingspace = 0x00a0; |
| 14374 |
t.nonenthai = 0x0e13; |
| 14375 |
t.nonuthai = 0x0e19; |
| 14376 |
t.noonarabic = 0x0646; |
| 14377 |
t.noonfinalarabic = 0xfee6; |
| 14378 |
t.noonghunnaarabic = 0x06ba; |
| 14379 |
t.noonghunnafinalarabic = 0xfb9f; |
| 14380 |
t.nooninitialarabic = 0xfee7; |
| 14381 |
t.noonjeeminitialarabic = 0xfcd2; |
| 14382 |
t.noonjeemisolatedarabic = 0xfc4b; |
| 14383 |
t.noonmedialarabic = 0xfee8; |
| 14384 |
t.noonmeeminitialarabic = 0xfcd5; |
| 14385 |
t.noonmeemisolatedarabic = 0xfc4e; |
| 14386 |
t.noonnoonfinalarabic = 0xfc8d; |
| 14387 |
t.notcontains = 0x220c; |
| 14388 |
t.notelement = 0x2209; |
| 14389 |
t.notelementof = 0x2209; |
| 14390 |
t.notequal = 0x2260; |
| 14391 |
t.notgreater = 0x226f; |
| 14392 |
t.notgreaternorequal = 0x2271; |
| 14393 |
t.notgreaternorless = 0x2279; |
| 14394 |
t.notidentical = 0x2262; |
| 14395 |
t.notless = 0x226e; |
| 14396 |
t.notlessnorequal = 0x2270; |
| 14397 |
t.notparallel = 0x2226; |
| 14398 |
t.notprecedes = 0x2280; |
| 14399 |
t.notsubset = 0x2284; |
| 14400 |
t.notsucceeds = 0x2281; |
| 14401 |
t.notsuperset = 0x2285; |
| 14402 |
t.nowarmenian = 0x0576; |
| 14403 |
t.nparen = 0x24a9; |
| 14404 |
t.nssquare = 0x33b1; |
| 14405 |
t.nsuperior = 0x207f; |
| 14406 |
t.ntilde = 0x00f1; |
| 14407 |
t.nu = 0x03bd; |
| 14408 |
t.nuhiragana = 0x306c; |
| 14409 |
t.nukatakana = 0x30cc; |
| 14410 |
t.nukatakanahalfwidth = 0xff87; |
| 14411 |
t.nuktabengali = 0x09bc; |
| 14412 |
t.nuktadeva = 0x093c; |
| 14413 |
t.nuktagujarati = 0x0abc; |
| 14414 |
t.nuktagurmukhi = 0x0a3c; |
| 14415 |
t.numbersign = 0x0023; |
| 14416 |
t.numbersignmonospace = 0xff03; |
| 14417 |
t.numbersignsmall = 0xfe5f; |
| 14418 |
t.numeralsigngreek = 0x0374; |
| 14419 |
t.numeralsignlowergreek = 0x0375; |
| 14420 |
t.numero = 0x2116; |
| 14421 |
t.nun = 0x05e0; |
| 14422 |
t.nundagesh = 0xfb40; |
| 14423 |
t.nundageshhebrew = 0xfb40; |
| 14424 |
t.nunhebrew = 0x05e0; |
| 14425 |
t.nvsquare = 0x33b5; |
| 14426 |
t.nwsquare = 0x33bb; |
| 14427 |
t.nyabengali = 0x099e; |
| 14428 |
t.nyadeva = 0x091e; |
| 14429 |
t.nyagujarati = 0x0a9e; |
| 14430 |
t.nyagurmukhi = 0x0a1e; |
| 14431 |
t.o = 0x006f; |
| 14432 |
t.oacute = 0x00f3; |
| 14433 |
t.oangthai = 0x0e2d; |
| 14434 |
t.obarred = 0x0275; |
| 14435 |
t.obarredcyrillic = 0x04e9; |
| 14436 |
t.obarreddieresiscyrillic = 0x04eb; |
| 14437 |
t.obengali = 0x0993; |
| 14438 |
t.obopomofo = 0x311b; |
| 14439 |
t.obreve = 0x014f; |
| 14440 |
t.ocandradeva = 0x0911; |
| 14441 |
t.ocandragujarati = 0x0a91; |
| 14442 |
t.ocandravowelsigndeva = 0x0949; |
| 14443 |
t.ocandravowelsigngujarati = 0x0ac9; |
| 14444 |
t.ocaron = 0x01d2; |
| 14445 |
t.ocircle = 0x24de; |
| 14446 |
t.ocircumflex = 0x00f4; |
| 14447 |
t.ocircumflexacute = 0x1ed1; |
| 14448 |
t.ocircumflexdotbelow = 0x1ed9; |
| 14449 |
t.ocircumflexgrave = 0x1ed3; |
| 14450 |
t.ocircumflexhookabove = 0x1ed5; |
| 14451 |
t.ocircumflextilde = 0x1ed7; |
| 14452 |
t.ocyrillic = 0x043e; |
| 14453 |
t.odblacute = 0x0151; |
| 14454 |
t.odblgrave = 0x020d; |
| 14455 |
t.odeva = 0x0913; |
| 14456 |
t.odieresis = 0x00f6; |
| 14457 |
t.odieresiscyrillic = 0x04e7; |
| 14458 |
t.odotbelow = 0x1ecd; |
| 14459 |
t.oe = 0x0153; |
| 14460 |
t.oekorean = 0x315a; |
| 14461 |
t.ogonek = 0x02db; |
| 14462 |
t.ogonekcmb = 0x0328; |
| 14463 |
t.ograve = 0x00f2; |
| 14464 |
t.ogujarati = 0x0a93; |
| 14465 |
t.oharmenian = 0x0585; |
| 14466 |
t.ohiragana = 0x304a; |
| 14467 |
t.ohookabove = 0x1ecf; |
| 14468 |
t.ohorn = 0x01a1; |
| 14469 |
t.ohornacute = 0x1edb; |
| 14470 |
t.ohorndotbelow = 0x1ee3; |
| 14471 |
t.ohorngrave = 0x1edd; |
| 14472 |
t.ohornhookabove = 0x1edf; |
| 14473 |
t.ohorntilde = 0x1ee1; |
| 14474 |
t.ohungarumlaut = 0x0151; |
| 14475 |
t.oi = 0x01a3; |
| 14476 |
t.oinvertedbreve = 0x020f; |
| 14477 |
t.okatakana = 0x30aa; |
| 14478 |
t.okatakanahalfwidth = 0xff75; |
| 14479 |
t.okorean = 0x3157; |
| 14480 |
t.olehebrew = 0x05ab; |
| 14481 |
t.omacron = 0x014d; |
| 14482 |
t.omacronacute = 0x1e53; |
| 14483 |
t.omacrongrave = 0x1e51; |
| 14484 |
t.omdeva = 0x0950; |
| 14485 |
t.omega = 0x03c9; |
| 14486 |
t.omega1 = 0x03d6; |
| 14487 |
t.omegacyrillic = 0x0461; |
| 14488 |
t.omegalatinclosed = 0x0277; |
| 14489 |
t.omegaroundcyrillic = 0x047b; |
| 14490 |
t.omegatitlocyrillic = 0x047d; |
| 14491 |
t.omegatonos = 0x03ce; |
| 14492 |
t.omgujarati = 0x0ad0; |
| 14493 |
t.omicron = 0x03bf; |
| 14494 |
t.omicrontonos = 0x03cc; |
| 14495 |
t.omonospace = 0xff4f; |
| 14496 |
t.one = 0x0031; |
| 14497 |
t.onearabic = 0x0661; |
| 14498 |
t.onebengali = 0x09e7; |
| 14499 |
t.onecircle = 0x2460; |
| 14500 |
t.onecircleinversesansserif = 0x278a; |
| 14501 |
t.onedeva = 0x0967; |
| 14502 |
t.onedotenleader = 0x2024; |
| 14503 |
t.oneeighth = 0x215b; |
| 14504 |
t.onefitted = 0xf6dc; |
| 14505 |
t.onegujarati = 0x0ae7; |
| 14506 |
t.onegurmukhi = 0x0a67; |
| 14507 |
t.onehackarabic = 0x0661; |
| 14508 |
t.onehalf = 0x00bd; |
| 14509 |
t.onehangzhou = 0x3021; |
| 14510 |
t.oneideographicparen = 0x3220; |
| 14511 |
t.oneinferior = 0x2081; |
| 14512 |
t.onemonospace = 0xff11; |
| 14513 |
t.onenumeratorbengali = 0x09f4; |
| 14514 |
t.oneoldstyle = 0xf731; |
| 14515 |
t.oneparen = 0x2474; |
| 14516 |
t.oneperiod = 0x2488; |
| 14517 |
t.onepersian = 0x06f1; |
| 14518 |
t.onequarter = 0x00bc; |
| 14519 |
t.oneroman = 0x2170; |
| 14520 |
t.onesuperior = 0x00b9; |
| 14521 |
t.onethai = 0x0e51; |
| 14522 |
t.onethird = 0x2153; |
| 14523 |
t.oogonek = 0x01eb; |
| 14524 |
t.oogonekmacron = 0x01ed; |
| 14525 |
t.oogurmukhi = 0x0a13; |
| 14526 |
t.oomatragurmukhi = 0x0a4b; |
| 14527 |
t.oopen = 0x0254; |
| 14528 |
t.oparen = 0x24aa; |
| 14529 |
t.openbullet = 0x25e6; |
| 14530 |
t.option = 0x2325; |
| 14531 |
t.ordfeminine = 0x00aa; |
| 14532 |
t.ordmasculine = 0x00ba; |
| 14533 |
t.orthogonal = 0x221f; |
| 14534 |
t.oshortdeva = 0x0912; |
| 14535 |
t.oshortvowelsigndeva = 0x094a; |
| 14536 |
t.oslash = 0x00f8; |
| 14537 |
t.oslashacute = 0x01ff; |
| 14538 |
t.osmallhiragana = 0x3049; |
| 14539 |
t.osmallkatakana = 0x30a9; |
| 14540 |
t.osmallkatakanahalfwidth = 0xff6b; |
| 14541 |
t.ostrokeacute = 0x01ff; |
| 14542 |
t.osuperior = 0xf6f0; |
| 14543 |
t.otcyrillic = 0x047f; |
| 14544 |
t.otilde = 0x00f5; |
| 14545 |
t.otildeacute = 0x1e4d; |
| 14546 |
t.otildedieresis = 0x1e4f; |
| 14547 |
t.oubopomofo = 0x3121; |
| 14548 |
t.overline = 0x203e; |
| 14549 |
t.overlinecenterline = 0xfe4a; |
| 14550 |
t.overlinecmb = 0x0305; |
| 14551 |
t.overlinedashed = 0xfe49; |
| 14552 |
t.overlinedblwavy = 0xfe4c; |
| 14553 |
t.overlinewavy = 0xfe4b; |
| 14554 |
t.overscore = 0x00af; |
| 14555 |
t.ovowelsignbengali = 0x09cb; |
| 14556 |
t.ovowelsigndeva = 0x094b; |
| 14557 |
t.ovowelsigngujarati = 0x0acb; |
| 14558 |
t.p = 0x0070; |
| 14559 |
t.paampssquare = 0x3380; |
| 14560 |
t.paasentosquare = 0x332b; |
| 14561 |
t.pabengali = 0x09aa; |
| 14562 |
t.pacute = 0x1e55; |
| 14563 |
t.padeva = 0x092a; |
| 14564 |
t.pagedown = 0x21df; |
| 14565 |
t.pageup = 0x21de; |
| 14566 |
t.pagujarati = 0x0aaa; |
| 14567 |
t.pagurmukhi = 0x0a2a; |
| 14568 |
t.pahiragana = 0x3071; |
| 14569 |
t.paiyannoithai = 0x0e2f; |
| 14570 |
t.pakatakana = 0x30d1; |
| 14571 |
t.palatalizationcyrilliccmb = 0x0484; |
| 14572 |
t.palochkacyrillic = 0x04c0; |
| 14573 |
t.pansioskorean = 0x317f; |
| 14574 |
t.paragraph = 0x00b6; |
| 14575 |
t.parallel = 0x2225; |
| 14576 |
t.parenleft = 0x0028; |
| 14577 |
t.parenleftaltonearabic = 0xfd3e; |
| 14578 |
t.parenleftbt = 0xf8ed; |
| 14579 |
t.parenleftex = 0xf8ec; |
| 14580 |
t.parenleftinferior = 0x208d; |
| 14581 |
t.parenleftmonospace = 0xff08; |
| 14582 |
t.parenleftsmall = 0xfe59; |
| 14583 |
t.parenleftsuperior = 0x207d; |
| 14584 |
t.parenlefttp = 0xf8eb; |
| 14585 |
t.parenleftvertical = 0xfe35; |
| 14586 |
t.parenright = 0x0029; |
| 14587 |
t.parenrightaltonearabic = 0xfd3f; |
| 14588 |
t.parenrightbt = 0xf8f8; |
| 14589 |
t.parenrightex = 0xf8f7; |
| 14590 |
t.parenrightinferior = 0x208e; |
| 14591 |
t.parenrightmonospace = 0xff09; |
| 14592 |
t.parenrightsmall = 0xfe5a; |
| 14593 |
t.parenrightsuperior = 0x207e; |
| 14594 |
t.parenrighttp = 0xf8f6; |
| 14595 |
t.parenrightvertical = 0xfe36; |
| 14596 |
t.partialdiff = 0x2202; |
| 14597 |
t.paseqhebrew = 0x05c0; |
| 14598 |
t.pashtahebrew = 0x0599; |
| 14599 |
t.pasquare = 0x33a9; |
| 14600 |
t.patah = 0x05b7; |
| 14601 |
t.patah11 = 0x05b7; |
| 14602 |
t.patah1d = 0x05b7; |
| 14603 |
t.patah2a = 0x05b7; |
| 14604 |
t.patahhebrew = 0x05b7; |
| 14605 |
t.patahnarrowhebrew = 0x05b7; |
| 14606 |
t.patahquarterhebrew = 0x05b7; |
| 14607 |
t.patahwidehebrew = 0x05b7; |
| 14608 |
t.pazerhebrew = 0x05a1; |
| 14609 |
t.pbopomofo = 0x3106; |
| 14610 |
t.pcircle = 0x24df; |
| 14611 |
t.pdotaccent = 0x1e57; |
| 14612 |
t.pe = 0x05e4; |
| 14613 |
t.pecyrillic = 0x043f; |
| 14614 |
t.pedagesh = 0xfb44; |
| 14615 |
t.pedageshhebrew = 0xfb44; |
| 14616 |
t.peezisquare = 0x333b; |
| 14617 |
t.pefinaldageshhebrew = 0xfb43; |
| 14618 |
t.peharabic = 0x067e; |
| 14619 |
t.peharmenian = 0x057a; |
| 14620 |
t.pehebrew = 0x05e4; |
| 14621 |
t.pehfinalarabic = 0xfb57; |
| 14622 |
t.pehinitialarabic = 0xfb58; |
| 14623 |
t.pehiragana = 0x307a; |
| 14624 |
t.pehmedialarabic = 0xfb59; |
| 14625 |
t.pekatakana = 0x30da; |
| 14626 |
t.pemiddlehookcyrillic = 0x04a7; |
| 14627 |
t.perafehebrew = 0xfb4e; |
| 14628 |
t.percent = 0x0025; |
| 14629 |
t.percentarabic = 0x066a; |
| 14630 |
t.percentmonospace = 0xff05; |
| 14631 |
t.percentsmall = 0xfe6a; |
| 14632 |
t.period = 0x002e; |
| 14633 |
t.periodarmenian = 0x0589; |
| 14634 |
t.periodcentered = 0x00b7; |
| 14635 |
t.periodhalfwidth = 0xff61; |
| 14636 |
t.periodinferior = 0xf6e7; |
| 14637 |
t.periodmonospace = 0xff0e; |
| 14638 |
t.periodsmall = 0xfe52; |
| 14639 |
t.periodsuperior = 0xf6e8; |
| 14640 |
t.perispomenigreekcmb = 0x0342; |
| 14641 |
t.perpendicular = 0x22a5; |
| 14642 |
t.perthousand = 0x2030; |
| 14643 |
t.peseta = 0x20a7; |
| 14644 |
t.pfsquare = 0x338a; |
| 14645 |
t.phabengali = 0x09ab; |
| 14646 |
t.phadeva = 0x092b; |
| 14647 |
t.phagujarati = 0x0aab; |
| 14648 |
t.phagurmukhi = 0x0a2b; |
| 14649 |
t.phi = 0x03c6; |
| 14650 |
t.phi1 = 0x03d5; |
| 14651 |
t.phieuphacirclekorean = 0x327a; |
| 14652 |
t.phieuphaparenkorean = 0x321a; |
| 14653 |
t.phieuphcirclekorean = 0x326c; |
| 14654 |
t.phieuphkorean = 0x314d; |
| 14655 |
t.phieuphparenkorean = 0x320c; |
| 14656 |
t.philatin = 0x0278; |
| 14657 |
t.phinthuthai = 0x0e3a; |
| 14658 |
t.phisymbolgreek = 0x03d5; |
| 14659 |
t.phook = 0x01a5; |
| 14660 |
t.phophanthai = 0x0e1e; |
| 14661 |
t.phophungthai = 0x0e1c; |
| 14662 |
t.phosamphaothai = 0x0e20; |
| 14663 |
t.pi = 0x03c0; |
| 14664 |
t.pieupacirclekorean = 0x3273; |
| 14665 |
t.pieupaparenkorean = 0x3213; |
| 14666 |
t.pieupcieuckorean = 0x3176; |
| 14667 |
t.pieupcirclekorean = 0x3265; |
| 14668 |
t.pieupkiyeokkorean = 0x3172; |
| 14669 |
t.pieupkorean = 0x3142; |
| 14670 |
t.pieupparenkorean = 0x3205; |
| 14671 |
t.pieupsioskiyeokkorean = 0x3174; |
| 14672 |
t.pieupsioskorean = 0x3144; |
| 14673 |
t.pieupsiostikeutkorean = 0x3175; |
| 14674 |
t.pieupthieuthkorean = 0x3177; |
| 14675 |
t.pieuptikeutkorean = 0x3173; |
| 14676 |
t.pihiragana = 0x3074; |
| 14677 |
t.pikatakana = 0x30d4; |
| 14678 |
t.pisymbolgreek = 0x03d6; |
| 14679 |
t.piwrarmenian = 0x0583; |
| 14680 |
t.planckover2pi = 0x210f; |
| 14681 |
t.planckover2pi1 = 0x210f; |
| 14682 |
t.plus = 0x002b; |
| 14683 |
t.plusbelowcmb = 0x031f; |
| 14684 |
t.pluscircle = 0x2295; |
| 14685 |
t.plusminus = 0x00b1; |
| 14686 |
t.plusmod = 0x02d6; |
| 14687 |
t.plusmonospace = 0xff0b; |
| 14688 |
t.plussmall = 0xfe62; |
| 14689 |
t.plussuperior = 0x207a; |
| 14690 |
t.pmonospace = 0xff50; |
| 14691 |
t.pmsquare = 0x33d8; |
| 14692 |
t.pohiragana = 0x307d; |
| 14693 |
t.pointingindexdownwhite = 0x261f; |
| 14694 |
t.pointingindexleftwhite = 0x261c; |
| 14695 |
t.pointingindexrightwhite = 0x261e; |
| 14696 |
t.pointingindexupwhite = 0x261d; |
| 14697 |
t.pokatakana = 0x30dd; |
| 14698 |
t.poplathai = 0x0e1b; |
| 14699 |
t.postalmark = 0x3012; |
| 14700 |
t.postalmarkface = 0x3020; |
| 14701 |
t.pparen = 0x24ab; |
| 14702 |
t.precedes = 0x227a; |
| 14703 |
t.prescription = 0x211e; |
| 14704 |
t.primemod = 0x02b9; |
| 14705 |
t.primereversed = 0x2035; |
| 14706 |
t.product = 0x220f; |
| 14707 |
t.projective = 0x2305; |
| 14708 |
t.prolongedkana = 0x30fc; |
| 14709 |
t.propellor = 0x2318; |
| 14710 |
t.propersubset = 0x2282; |
| 14711 |
t.propersuperset = 0x2283; |
| 14712 |
t.proportion = 0x2237; |
| 14713 |
t.proportional = 0x221d; |
| 14714 |
t.psi = 0x03c8; |
| 14715 |
t.psicyrillic = 0x0471; |
| 14716 |
t.psilipneumatacyrilliccmb = 0x0486; |
| 14717 |
t.pssquare = 0x33b0; |
| 14718 |
t.puhiragana = 0x3077; |
| 14719 |
t.pukatakana = 0x30d7; |
| 14720 |
t.pvsquare = 0x33b4; |
| 14721 |
t.pwsquare = 0x33ba; |
| 14722 |
t.q = 0x0071; |
| 14723 |
t.qadeva = 0x0958; |
| 14724 |
t.qadmahebrew = 0x05a8; |
| 14725 |
t.qafarabic = 0x0642; |
| 14726 |
t.qaffinalarabic = 0xfed6; |
| 14727 |
t.qafinitialarabic = 0xfed7; |
| 14728 |
t.qafmedialarabic = 0xfed8; |
| 14729 |
t.qamats = 0x05b8; |
| 14730 |
t.qamats10 = 0x05b8; |
| 14731 |
t.qamats1a = 0x05b8; |
| 14732 |
t.qamats1c = 0x05b8; |
| 14733 |
t.qamats27 = 0x05b8; |
| 14734 |
t.qamats29 = 0x05b8; |
| 14735 |
t.qamats33 = 0x05b8; |
| 14736 |
t.qamatsde = 0x05b8; |
| 14737 |
t.qamatshebrew = 0x05b8; |
| 14738 |
t.qamatsnarrowhebrew = 0x05b8; |
| 14739 |
t.qamatsqatanhebrew = 0x05b8; |
| 14740 |
t.qamatsqatannarrowhebrew = 0x05b8; |
| 14741 |
t.qamatsqatanquarterhebrew = 0x05b8; |
| 14742 |
t.qamatsqatanwidehebrew = 0x05b8; |
| 14743 |
t.qamatsquarterhebrew = 0x05b8; |
| 14744 |
t.qamatswidehebrew = 0x05b8; |
| 14745 |
t.qarneyparahebrew = 0x059f; |
| 14746 |
t.qbopomofo = 0x3111; |
| 14747 |
t.qcircle = 0x24e0; |
| 14748 |
t.qhook = 0x02a0; |
| 14749 |
t.qmonospace = 0xff51; |
| 14750 |
t.qof = 0x05e7; |
| 14751 |
t.qofdagesh = 0xfb47; |
| 14752 |
t.qofdageshhebrew = 0xfb47; |
| 14753 |
t.qofhebrew = 0x05e7; |
| 14754 |
t.qparen = 0x24ac; |
| 14755 |
t.quarternote = 0x2669; |
| 14756 |
t.qubuts = 0x05bb; |
| 14757 |
t.qubuts18 = 0x05bb; |
| 14758 |
t.qubuts25 = 0x05bb; |
| 14759 |
t.qubuts31 = 0x05bb; |
| 14760 |
t.qubutshebrew = 0x05bb; |
| 14761 |
t.qubutsnarrowhebrew = 0x05bb; |
| 14762 |
t.qubutsquarterhebrew = 0x05bb; |
| 14763 |
t.qubutswidehebrew = 0x05bb; |
| 14764 |
t.question = 0x003f; |
| 14765 |
t.questionarabic = 0x061f; |
| 14766 |
t.questionarmenian = 0x055e; |
| 14767 |
t.questiondown = 0x00bf; |
| 14768 |
t.questiondownsmall = 0xf7bf; |
| 14769 |
t.questiongreek = 0x037e; |
| 14770 |
t.questionmonospace = 0xff1f; |
| 14771 |
t.questionsmall = 0xf73f; |
| 14772 |
t.quotedbl = 0x0022; |
| 14773 |
t.quotedblbase = 0x201e; |
| 14774 |
t.quotedblleft = 0x201c; |
| 14775 |
t.quotedblmonospace = 0xff02; |
| 14776 |
t.quotedblprime = 0x301e; |
| 14777 |
t.quotedblprimereversed = 0x301d; |
| 14778 |
t.quotedblright = 0x201d; |
| 14779 |
t.quoteleft = 0x2018; |
| 14780 |
t.quoteleftreversed = 0x201b; |
| 14781 |
t.quotereversed = 0x201b; |
| 14782 |
t.quoteright = 0x2019; |
| 14783 |
t.quoterightn = 0x0149; |
| 14784 |
t.quotesinglbase = 0x201a; |
| 14785 |
t.quotesingle = 0x0027; |
| 14786 |
t.quotesinglemonospace = 0xff07; |
| 14787 |
t.r = 0x0072; |
| 14788 |
t.raarmenian = 0x057c; |
| 14789 |
t.rabengali = 0x09b0; |
| 14790 |
t.racute = 0x0155; |
| 14791 |
t.radeva = 0x0930; |
| 14792 |
t.radical = 0x221a; |
| 14793 |
t.radicalex = 0xf8e5; |
| 14794 |
t.radoverssquare = 0x33ae; |
| 14795 |
t.radoverssquaredsquare = 0x33af; |
| 14796 |
t.radsquare = 0x33ad; |
| 14797 |
t.rafe = 0x05bf; |
| 14798 |
t.rafehebrew = 0x05bf; |
| 14799 |
t.ragujarati = 0x0ab0; |
| 14800 |
t.ragurmukhi = 0x0a30; |
| 14801 |
t.rahiragana = 0x3089; |
| 14802 |
t.rakatakana = 0x30e9; |
| 14803 |
t.rakatakanahalfwidth = 0xff97; |
| 14804 |
t.ralowerdiagonalbengali = 0x09f1; |
| 14805 |
t.ramiddlediagonalbengali = 0x09f0; |
| 14806 |
t.ramshorn = 0x0264; |
| 14807 |
t.ratio = 0x2236; |
| 14808 |
t.rbopomofo = 0x3116; |
| 14809 |
t.rcaron = 0x0159; |
| 14810 |
t.rcedilla = 0x0157; |
| 14811 |
t.rcircle = 0x24e1; |
| 14812 |
t.rcommaaccent = 0x0157; |
| 14813 |
t.rdblgrave = 0x0211; |
| 14814 |
t.rdotaccent = 0x1e59; |
| 14815 |
t.rdotbelow = 0x1e5b; |
| 14816 |
t.rdotbelowmacron = 0x1e5d; |
| 14817 |
t.referencemark = 0x203b; |
| 14818 |
t.reflexsubset = 0x2286; |
| 14819 |
t.reflexsuperset = 0x2287; |
| 14820 |
t.registered = 0x00ae; |
| 14821 |
t.registersans = 0xf8e8; |
| 14822 |
t.registerserif = 0xf6da; |
| 14823 |
t.reharabic = 0x0631; |
| 14824 |
t.reharmenian = 0x0580; |
| 14825 |
t.rehfinalarabic = 0xfeae; |
| 14826 |
t.rehiragana = 0x308c; |
| 14827 |
t.rekatakana = 0x30ec; |
| 14828 |
t.rekatakanahalfwidth = 0xff9a; |
| 14829 |
t.resh = 0x05e8; |
| 14830 |
t.reshdageshhebrew = 0xfb48; |
| 14831 |
t.reshhebrew = 0x05e8; |
| 14832 |
t.reversedtilde = 0x223d; |
| 14833 |
t.reviahebrew = 0x0597; |
| 14834 |
t.reviamugrashhebrew = 0x0597; |
| 14835 |
t.revlogicalnot = 0x2310; |
| 14836 |
t.rfishhook = 0x027e; |
| 14837 |
t.rfishhookreversed = 0x027f; |
| 14838 |
t.rhabengali = 0x09dd; |
| 14839 |
t.rhadeva = 0x095d; |
| 14840 |
t.rho = 0x03c1; |
| 14841 |
t.rhook = 0x027d; |
| 14842 |
t.rhookturned = 0x027b; |
| 14843 |
t.rhookturnedsuperior = 0x02b5; |
| 14844 |
t.rhosymbolgreek = 0x03f1; |
| 14845 |
t.rhotichookmod = 0x02de; |
| 14846 |
t.rieulacirclekorean = 0x3271; |
| 14847 |
t.rieulaparenkorean = 0x3211; |
| 14848 |
t.rieulcirclekorean = 0x3263; |
| 14849 |
t.rieulhieuhkorean = 0x3140; |
| 14850 |
t.rieulkiyeokkorean = 0x313a; |
| 14851 |
t.rieulkiyeoksioskorean = 0x3169; |
| 14852 |
t.rieulkorean = 0x3139; |
| 14853 |
t.rieulmieumkorean = 0x313b; |
| 14854 |
t.rieulpansioskorean = 0x316c; |
| 14855 |
t.rieulparenkorean = 0x3203; |
| 14856 |
t.rieulphieuphkorean = 0x313f; |
| 14857 |
t.rieulpieupkorean = 0x313c; |
| 14858 |
t.rieulpieupsioskorean = 0x316b; |
| 14859 |
t.rieulsioskorean = 0x313d; |
| 14860 |
t.rieulthieuthkorean = 0x313e; |
| 14861 |
t.rieultikeutkorean = 0x316a; |
| 14862 |
t.rieulyeorinhieuhkorean = 0x316d; |
| 14863 |
t.rightangle = 0x221f; |
| 14864 |
t.righttackbelowcmb = 0x0319; |
| 14865 |
t.righttriangle = 0x22bf; |
| 14866 |
t.rihiragana = 0x308a; |
| 14867 |
t.rikatakana = 0x30ea; |
| 14868 |
t.rikatakanahalfwidth = 0xff98; |
| 14869 |
t.ring = 0x02da; |
| 14870 |
t.ringbelowcmb = 0x0325; |
| 14871 |
t.ringcmb = 0x030a; |
| 14872 |
t.ringhalfleft = 0x02bf; |
| 14873 |
t.ringhalfleftarmenian = 0x0559; |
| 14874 |
t.ringhalfleftbelowcmb = 0x031c; |
| 14875 |
t.ringhalfleftcentered = 0x02d3; |
| 14876 |
t.ringhalfright = 0x02be; |
| 14877 |
t.ringhalfrightbelowcmb = 0x0339; |
| 14878 |
t.ringhalfrightcentered = 0x02d2; |
| 14879 |
t.rinvertedbreve = 0x0213; |
| 14880 |
t.rittorusquare = 0x3351; |
| 14881 |
t.rlinebelow = 0x1e5f; |
| 14882 |
t.rlongleg = 0x027c; |
| 14883 |
t.rlonglegturned = 0x027a; |
| 14884 |
t.rmonospace = 0xff52; |
| 14885 |
t.rohiragana = 0x308d; |
| 14886 |
t.rokatakana = 0x30ed; |
| 14887 |
t.rokatakanahalfwidth = 0xff9b; |
| 14888 |
t.roruathai = 0x0e23; |
| 14889 |
t.rparen = 0x24ad; |
| 14890 |
t.rrabengali = 0x09dc; |
| 14891 |
t.rradeva = 0x0931; |
| 14892 |
t.rragurmukhi = 0x0a5c; |
| 14893 |
t.rreharabic = 0x0691; |
| 14894 |
t.rrehfinalarabic = 0xfb8d; |
| 14895 |
t.rrvocalicbengali = 0x09e0; |
| 14896 |
t.rrvocalicdeva = 0x0960; |
| 14897 |
t.rrvocalicgujarati = 0x0ae0; |
| 14898 |
t.rrvocalicvowelsignbengali = 0x09c4; |
| 14899 |
t.rrvocalicvowelsigndeva = 0x0944; |
| 14900 |
t.rrvocalicvowelsigngujarati = 0x0ac4; |
| 14901 |
t.rsuperior = 0xf6f1; |
| 14902 |
t.rtblock = 0x2590; |
| 14903 |
t.rturned = 0x0279; |
| 14904 |
t.rturnedsuperior = 0x02b4; |
| 14905 |
t.ruhiragana = 0x308b; |
| 14906 |
t.rukatakana = 0x30eb; |
| 14907 |
t.rukatakanahalfwidth = 0xff99; |
| 14908 |
t.rupeemarkbengali = 0x09f2; |
| 14909 |
t.rupeesignbengali = 0x09f3; |
| 14910 |
t.rupiah = 0xf6dd; |
| 14911 |
t.ruthai = 0x0e24; |
| 14912 |
t.rvocalicbengali = 0x098b; |
| 14913 |
t.rvocalicdeva = 0x090b; |
| 14914 |
t.rvocalicgujarati = 0x0a8b; |
| 14915 |
t.rvocalicvowelsignbengali = 0x09c3; |
| 14916 |
t.rvocalicvowelsigndeva = 0x0943; |
| 14917 |
t.rvocalicvowelsigngujarati = 0x0ac3; |
| 14918 |
t.s = 0x0073; |
| 14919 |
t.sabengali = 0x09b8; |
| 14920 |
t.sacute = 0x015b; |
| 14921 |
t.sacutedotaccent = 0x1e65; |
| 14922 |
t.sadarabic = 0x0635; |
| 14923 |
t.sadeva = 0x0938; |
| 14924 |
t.sadfinalarabic = 0xfeba; |
| 14925 |
t.sadinitialarabic = 0xfebb; |
| 14926 |
t.sadmedialarabic = 0xfebc; |
| 14927 |
t.sagujarati = 0x0ab8; |
| 14928 |
t.sagurmukhi = 0x0a38; |
| 14929 |
t.sahiragana = 0x3055; |
| 14930 |
t.sakatakana = 0x30b5; |
| 14931 |
t.sakatakanahalfwidth = 0xff7b; |
| 14932 |
t.sallallahoualayhewasallamarabic = 0xfdfa; |
| 14933 |
t.samekh = 0x05e1; |
| 14934 |
t.samekhdagesh = 0xfb41; |
| 14935 |
t.samekhdageshhebrew = 0xfb41; |
| 14936 |
t.samekhhebrew = 0x05e1; |
| 14937 |
t.saraaathai = 0x0e32; |
| 14938 |
t.saraaethai = 0x0e41; |
| 14939 |
t.saraaimaimalaithai = 0x0e44; |
| 14940 |
t.saraaimaimuanthai = 0x0e43; |
| 14941 |
t.saraamthai = 0x0e33; |
| 14942 |
t.saraathai = 0x0e30; |
| 14943 |
t.saraethai = 0x0e40; |
| 14944 |
t.saraiileftthai = 0xf886; |
| 14945 |
t.saraiithai = 0x0e35; |
| 14946 |
t.saraileftthai = 0xf885; |
| 14947 |
t.saraithai = 0x0e34; |
| 14948 |
t.saraothai = 0x0e42; |
| 14949 |
t.saraueeleftthai = 0xf888; |
| 14950 |
t.saraueethai = 0x0e37; |
| 14951 |
t.saraueleftthai = 0xf887; |
| 14952 |
t.sarauethai = 0x0e36; |
| 14953 |
t.sarauthai = 0x0e38; |
| 14954 |
t.sarauuthai = 0x0e39; |
| 14955 |
t.sbopomofo = 0x3119; |
| 14956 |
t.scaron = 0x0161; |
| 14957 |
t.scarondotaccent = 0x1e67; |
| 14958 |
t.scedilla = 0x015f; |
| 14959 |
t.schwa = 0x0259; |
| 14960 |
t.schwacyrillic = 0x04d9; |
| 14961 |
t.schwadieresiscyrillic = 0x04db; |
| 14962 |
t.schwahook = 0x025a; |
| 14963 |
t.scircle = 0x24e2; |
| 14964 |
t.scircumflex = 0x015d; |
| 14965 |
t.scommaaccent = 0x0219; |
| 14966 |
t.sdotaccent = 0x1e61; |
| 14967 |
t.sdotbelow = 0x1e63; |
| 14968 |
t.sdotbelowdotaccent = 0x1e69; |
| 14969 |
t.seagullbelowcmb = 0x033c; |
| 14970 |
t.second = 0x2033; |
| 14971 |
t.secondtonechinese = 0x02ca; |
| 14972 |
t.section = 0x00a7; |
| 14973 |
t.seenarabic = 0x0633; |
| 14974 |
t.seenfinalarabic = 0xfeb2; |
| 14975 |
t.seeninitialarabic = 0xfeb3; |
| 14976 |
t.seenmedialarabic = 0xfeb4; |
| 14977 |
t.segol = 0x05b6; |
| 14978 |
t.segol13 = 0x05b6; |
| 14979 |
t.segol1f = 0x05b6; |
| 14980 |
t.segol2c = 0x05b6; |
| 14981 |
t.segolhebrew = 0x05b6; |
| 14982 |
t.segolnarrowhebrew = 0x05b6; |
| 14983 |
t.segolquarterhebrew = 0x05b6; |
| 14984 |
t.segoltahebrew = 0x0592; |
| 14985 |
t.segolwidehebrew = 0x05b6; |
| 14986 |
t.seharmenian = 0x057d; |
| 14987 |
t.sehiragana = 0x305b; |
| 14988 |
t.sekatakana = 0x30bb; |
| 14989 |
t.sekatakanahalfwidth = 0xff7e; |
| 14990 |
t.semicolon = 0x003b; |
| 14991 |
t.semicolonarabic = 0x061b; |
| 14992 |
t.semicolonmonospace = 0xff1b; |
| 14993 |
t.semicolonsmall = 0xfe54; |
| 14994 |
t.semivoicedmarkkana = 0x309c; |
| 14995 |
t.semivoicedmarkkanahalfwidth = 0xff9f; |
| 14996 |
t.sentisquare = 0x3322; |
| 14997 |
t.sentosquare = 0x3323; |
| 14998 |
t.seven = 0x0037; |
| 14999 |
t.sevenarabic = 0x0667; |
| 15000 |
t.sevenbengali = 0x09ed; |
| 15001 |
t.sevencircle = 0x2466; |
| 15002 |
t.sevencircleinversesansserif = 0x2790; |
| 15003 |
t.sevendeva = 0x096d; |
| 15004 |
t.seveneighths = 0x215e; |
| 15005 |
t.sevengujarati = 0x0aed; |
| 15006 |
t.sevengurmukhi = 0x0a6d; |
| 15007 |
t.sevenhackarabic = 0x0667; |
| 15008 |
t.sevenhangzhou = 0x3027; |
| 15009 |
t.sevenideographicparen = 0x3226; |
| 15010 |
t.seveninferior = 0x2087; |
| 15011 |
t.sevenmonospace = 0xff17; |
| 15012 |
t.sevenoldstyle = 0xf737; |
| 15013 |
t.sevenparen = 0x247a; |
| 15014 |
t.sevenperiod = 0x248e; |
| 15015 |
t.sevenpersian = 0x06f7; |
| 15016 |
t.sevenroman = 0x2176; |
| 15017 |
t.sevensuperior = 0x2077; |
| 15018 |
t.seventeencircle = 0x2470; |
| 15019 |
t.seventeenparen = 0x2484; |
| 15020 |
t.seventeenperiod = 0x2498; |
| 15021 |
t.seventhai = 0x0e57; |
| 15022 |
t.sfthyphen = 0x00ad; |
| 15023 |
t.shaarmenian = 0x0577; |
| 15024 |
t.shabengali = 0x09b6; |
| 15025 |
t.shacyrillic = 0x0448; |
| 15026 |
t.shaddaarabic = 0x0651; |
| 15027 |
t.shaddadammaarabic = 0xfc61; |
| 15028 |
t.shaddadammatanarabic = 0xfc5e; |
| 15029 |
t.shaddafathaarabic = 0xfc60; |
| 15030 |
t.shaddakasraarabic = 0xfc62; |
| 15031 |
t.shaddakasratanarabic = 0xfc5f; |
| 15032 |
t.shade = 0x2592; |
| 15033 |
t.shadedark = 0x2593; |
| 15034 |
t.shadelight = 0x2591; |
| 15035 |
t.shademedium = 0x2592; |
| 15036 |
t.shadeva = 0x0936; |
| 15037 |
t.shagujarati = 0x0ab6; |
| 15038 |
t.shagurmukhi = 0x0a36; |
| 15039 |
t.shalshelethebrew = 0x0593; |
| 15040 |
t.shbopomofo = 0x3115; |
| 15041 |
t.shchacyrillic = 0x0449; |
| 15042 |
t.sheenarabic = 0x0634; |
| 15043 |
t.sheenfinalarabic = 0xfeb6; |
| 15044 |
t.sheeninitialarabic = 0xfeb7; |
| 15045 |
t.sheenmedialarabic = 0xfeb8; |
| 15046 |
t.sheicoptic = 0x03e3; |
| 15047 |
t.sheqel = 0x20aa; |
| 15048 |
t.sheqelhebrew = 0x20aa; |
| 15049 |
t.sheva = 0x05b0; |
| 15050 |
t.sheva115 = 0x05b0; |
| 15051 |
t.sheva15 = 0x05b0; |
| 15052 |
t.sheva22 = 0x05b0; |
| 15053 |
t.sheva2e = 0x05b0; |
| 15054 |
t.shevahebrew = 0x05b0; |
| 15055 |
t.shevanarrowhebrew = 0x05b0; |
| 15056 |
t.shevaquarterhebrew = 0x05b0; |
| 15057 |
t.shevawidehebrew = 0x05b0; |
| 15058 |
t.shhacyrillic = 0x04bb; |
| 15059 |
t.shimacoptic = 0x03ed; |
| 15060 |
t.shin = 0x05e9; |
| 15061 |
t.shindagesh = 0xfb49; |
| 15062 |
t.shindageshhebrew = 0xfb49; |
| 15063 |
t.shindageshshindot = 0xfb2c; |
| 15064 |
t.shindageshshindothebrew = 0xfb2c; |
| 15065 |
t.shindageshsindot = 0xfb2d; |
| 15066 |
t.shindageshsindothebrew = 0xfb2d; |
| 15067 |
t.shindothebrew = 0x05c1; |
| 15068 |
t.shinhebrew = 0x05e9; |
| 15069 |
t.shinshindot = 0xfb2a; |
| 15070 |
t.shinshindothebrew = 0xfb2a; |
| 15071 |
t.shinsindot = 0xfb2b; |
| 15072 |
t.shinsindothebrew = 0xfb2b; |
| 15073 |
t.shook = 0x0282; |
| 15074 |
t.sigma = 0x03c3; |
| 15075 |
t.sigma1 = 0x03c2; |
| 15076 |
t.sigmafinal = 0x03c2; |
| 15077 |
t.sigmalunatesymbolgreek = 0x03f2; |
| 15078 |
t.sihiragana = 0x3057; |
| 15079 |
t.sikatakana = 0x30b7; |
| 15080 |
t.sikatakanahalfwidth = 0xff7c; |
| 15081 |
t.siluqhebrew = 0x05bd; |
| 15082 |
t.siluqlefthebrew = 0x05bd; |
| 15083 |
t.similar = 0x223c; |
| 15084 |
t.sindothebrew = 0x05c2; |
| 15085 |
t.siosacirclekorean = 0x3274; |
| 15086 |
t.siosaparenkorean = 0x3214; |
| 15087 |
t.sioscieuckorean = 0x317e; |
| 15088 |
t.sioscirclekorean = 0x3266; |
| 15089 |
t.sioskiyeokkorean = 0x317a; |
| 15090 |
t.sioskorean = 0x3145; |
| 15091 |
t.siosnieunkorean = 0x317b; |
| 15092 |
t.siosparenkorean = 0x3206; |
| 15093 |
t.siospieupkorean = 0x317d; |
| 15094 |
t.siostikeutkorean = 0x317c; |
| 15095 |
t.six = 0x0036; |
| 15096 |
t.sixarabic = 0x0666; |
| 15097 |
t.sixbengali = 0x09ec; |
| 15098 |
t.sixcircle = 0x2465; |
| 15099 |
t.sixcircleinversesansserif = 0x278f; |
| 15100 |
t.sixdeva = 0x096c; |
| 15101 |
t.sixgujarati = 0x0aec; |
| 15102 |
t.sixgurmukhi = 0x0a6c; |
| 15103 |
t.sixhackarabic = 0x0666; |
| 15104 |
t.sixhangzhou = 0x3026; |
| 15105 |
t.sixideographicparen = 0x3225; |
| 15106 |
t.sixinferior = 0x2086; |
| 15107 |
t.sixmonospace = 0xff16; |
| 15108 |
t.sixoldstyle = 0xf736; |
| 15109 |
t.sixparen = 0x2479; |
| 15110 |
t.sixperiod = 0x248d; |
| 15111 |
t.sixpersian = 0x06f6; |
| 15112 |
t.sixroman = 0x2175; |
| 15113 |
t.sixsuperior = 0x2076; |
| 15114 |
t.sixteencircle = 0x246f; |
| 15115 |
t.sixteencurrencydenominatorbengali = 0x09f9; |
| 15116 |
t.sixteenparen = 0x2483; |
| 15117 |
t.sixteenperiod = 0x2497; |
| 15118 |
t.sixthai = 0x0e56; |
| 15119 |
t.slash = 0x002f; |
| 15120 |
t.slashmonospace = 0xff0f; |
| 15121 |
t.slong = 0x017f; |
| 15122 |
t.slongdotaccent = 0x1e9b; |
| 15123 |
t.smileface = 0x263a; |
| 15124 |
t.smonospace = 0xff53; |
| 15125 |
t.sofpasuqhebrew = 0x05c3; |
| 15126 |
t.softhyphen = 0x00ad; |
| 15127 |
t.softsigncyrillic = 0x044c; |
| 15128 |
t.sohiragana = 0x305d; |
| 15129 |
t.sokatakana = 0x30bd; |
| 15130 |
t.sokatakanahalfwidth = 0xff7f; |
| 15131 |
t.soliduslongoverlaycmb = 0x0338; |
| 15132 |
t.solidusshortoverlaycmb = 0x0337; |
| 15133 |
t.sorusithai = 0x0e29; |
| 15134 |
t.sosalathai = 0x0e28; |
| 15135 |
t.sosothai = 0x0e0b; |
| 15136 |
t.sosuathai = 0x0e2a; |
| 15137 |
t.space = 0x0020; |
| 15138 |
t.spacehackarabic = 0x0020; |
| 15139 |
t.spade = 0x2660; |
| 15140 |
t.spadesuitblack = 0x2660; |
| 15141 |
t.spadesuitwhite = 0x2664; |
| 15142 |
t.sparen = 0x24ae; |
| 15143 |
t.squarebelowcmb = 0x033b; |
| 15144 |
t.squarecc = 0x33c4; |
| 15145 |
t.squarecm = 0x339d; |
| 15146 |
t.squarediagonalcrosshatchfill = 0x25a9; |
| 15147 |
t.squarehorizontalfill = 0x25a4; |
| 15148 |
t.squarekg = 0x338f; |
| 15149 |
t.squarekm = 0x339e; |
| 15150 |
t.squarekmcapital = 0x33ce; |
| 15151 |
t.squareln = 0x33d1; |
| 15152 |
t.squarelog = 0x33d2; |
| 15153 |
t.squaremg = 0x338e; |
| 15154 |
t.squaremil = 0x33d5; |
| 15155 |
t.squaremm = 0x339c; |
| 15156 |
t.squaremsquared = 0x33a1; |
| 15157 |
t.squareorthogonalcrosshatchfill = 0x25a6; |
| 15158 |
t.squareupperlefttolowerrightfill = 0x25a7; |
| 15159 |
t.squareupperrighttolowerleftfill = 0x25a8; |
| 15160 |
t.squareverticalfill = 0x25a5; |
| 15161 |
t.squarewhitewithsmallblack = 0x25a3; |
| 15162 |
t.srsquare = 0x33db; |
| 15163 |
t.ssabengali = 0x09b7; |
| 15164 |
t.ssadeva = 0x0937; |
| 15165 |
t.ssagujarati = 0x0ab7; |
| 15166 |
t.ssangcieuckorean = 0x3149; |
| 15167 |
t.ssanghieuhkorean = 0x3185; |
| 15168 |
t.ssangieungkorean = 0x3180; |
| 15169 |
t.ssangkiyeokkorean = 0x3132; |
| 15170 |
t.ssangnieunkorean = 0x3165; |
| 15171 |
t.ssangpieupkorean = 0x3143; |
| 15172 |
t.ssangsioskorean = 0x3146; |
| 15173 |
t.ssangtikeutkorean = 0x3138; |
| 15174 |
t.ssuperior = 0xf6f2; |
| 15175 |
t.sterling = 0x00a3; |
| 15176 |
t.sterlingmonospace = 0xffe1; |
| 15177 |
t.strokelongoverlaycmb = 0x0336; |
| 15178 |
t.strokeshortoverlaycmb = 0x0335; |
| 15179 |
t.subset = 0x2282; |
| 15180 |
t.subsetnotequal = 0x228a; |
| 15181 |
t.subsetorequal = 0x2286; |
| 15182 |
t.succeeds = 0x227b; |
| 15183 |
t.suchthat = 0x220b; |
| 15184 |
t.suhiragana = 0x3059; |
| 15185 |
t.sukatakana = 0x30b9; |
| 15186 |
t.sukatakanahalfwidth = 0xff7d; |
| 15187 |
t.sukunarabic = 0x0652; |
| 15188 |
t.summation = 0x2211; |
| 15189 |
t.sun = 0x263c; |
| 15190 |
t.superset = 0x2283; |
| 15191 |
t.supersetnotequal = 0x228b; |
| 15192 |
t.supersetorequal = 0x2287; |
| 15193 |
t.svsquare = 0x33dc; |
| 15194 |
t.syouwaerasquare = 0x337c; |
| 15195 |
t.t = 0x0074; |
| 15196 |
t.tabengali = 0x09a4; |
| 15197 |
t.tackdown = 0x22a4; |
| 15198 |
t.tackleft = 0x22a3; |
| 15199 |
t.tadeva = 0x0924; |
| 15200 |
t.tagujarati = 0x0aa4; |
| 15201 |
t.tagurmukhi = 0x0a24; |
| 15202 |
t.taharabic = 0x0637; |
| 15203 |
t.tahfinalarabic = 0xfec2; |
| 15204 |
t.tahinitialarabic = 0xfec3; |
| 15205 |
t.tahiragana = 0x305f; |
| 15206 |
t.tahmedialarabic = 0xfec4; |
| 15207 |
t.taisyouerasquare = 0x337d; |
| 15208 |
t.takatakana = 0x30bf; |
| 15209 |
t.takatakanahalfwidth = 0xff80; |
| 15210 |
t.tatweelarabic = 0x0640; |
| 15211 |
t.tau = 0x03c4; |
| 15212 |
t.tav = 0x05ea; |
| 15213 |
t.tavdages = 0xfb4a; |
| 15214 |
t.tavdagesh = 0xfb4a; |
| 15215 |
t.tavdageshhebrew = 0xfb4a; |
| 15216 |
t.tavhebrew = 0x05ea; |
| 15217 |
t.tbar = 0x0167; |
| 15218 |
t.tbopomofo = 0x310a; |
| 15219 |
t.tcaron = 0x0165; |
| 15220 |
t.tccurl = 0x02a8; |
| 15221 |
t.tcedilla = 0x0163; |
| 15222 |
t.tcheharabic = 0x0686; |
| 15223 |
t.tchehfinalarabic = 0xfb7b; |
| 15224 |
t.tchehinitialarabic = 0xfb7c; |
| 15225 |
t.tchehmedialarabic = 0xfb7d; |
| 15226 |
t.tcircle = 0x24e3; |
| 15227 |
t.tcircumflexbelow = 0x1e71; |
| 15228 |
t.tcommaaccent = 0x0163; |
| 15229 |
t.tdieresis = 0x1e97; |
| 15230 |
t.tdotaccent = 0x1e6b; |
| 15231 |
t.tdotbelow = 0x1e6d; |
| 15232 |
t.tecyrillic = 0x0442; |
| 15233 |
t.tedescendercyrillic = 0x04ad; |
| 15234 |
t.teharabic = 0x062a; |
| 15235 |
t.tehfinalarabic = 0xfe96; |
| 15236 |
t.tehhahinitialarabic = 0xfca2; |
| 15237 |
t.tehhahisolatedarabic = 0xfc0c; |
| 15238 |
t.tehinitialarabic = 0xfe97; |
| 15239 |
t.tehiragana = 0x3066; |
| 15240 |
t.tehjeeminitialarabic = 0xfca1; |
| 15241 |
t.tehjeemisolatedarabic = 0xfc0b; |
| 15242 |
t.tehmarbutaarabic = 0x0629; |
| 15243 |
t.tehmarbutafinalarabic = 0xfe94; |
| 15244 |
t.tehmedialarabic = 0xfe98; |
| 15245 |
t.tehmeeminitialarabic = 0xfca4; |
| 15246 |
t.tehmeemisolatedarabic = 0xfc0e; |
| 15247 |
t.tehnoonfinalarabic = 0xfc73; |
| 15248 |
t.tekatakana = 0x30c6; |
| 15249 |
t.tekatakanahalfwidth = 0xff83; |
| 15250 |
t.telephone = 0x2121; |
| 15251 |
t.telephoneblack = 0x260e; |
| 15252 |
t.telishagedolahebrew = 0x05a0; |
| 15253 |
t.telishaqetanahebrew = 0x05a9; |
| 15254 |
t.tencircle = 0x2469; |
| 15255 |
t.tenideographicparen = 0x3229; |
| 15256 |
t.tenparen = 0x247d; |
| 15257 |
t.tenperiod = 0x2491; |
| 15258 |
t.tenroman = 0x2179; |
| 15259 |
t.tesh = 0x02a7; |
| 15260 |
t.tet = 0x05d8; |
| 15261 |
t.tetdagesh = 0xfb38; |
| 15262 |
t.tetdageshhebrew = 0xfb38; |
| 15263 |
t.tethebrew = 0x05d8; |
| 15264 |
t.tetsecyrillic = 0x04b5; |
| 15265 |
t.tevirhebrew = 0x059b; |
| 15266 |
t.tevirlefthebrew = 0x059b; |
| 15267 |
t.thabengali = 0x09a5; |
| 15268 |
t.thadeva = 0x0925; |
| 15269 |
t.thagujarati = 0x0aa5; |
| 15270 |
t.thagurmukhi = 0x0a25; |
| 15271 |
t.thalarabic = 0x0630; |
| 15272 |
t.thalfinalarabic = 0xfeac; |
| 15273 |
t.thanthakhatlowleftthai = 0xf898; |
| 15274 |
t.thanthakhatlowrightthai = 0xf897; |
| 15275 |
t.thanthakhatthai = 0x0e4c; |
| 15276 |
t.thanthakhatupperleftthai = 0xf896; |
| 15277 |
t.theharabic = 0x062b; |
| 15278 |
t.thehfinalarabic = 0xfe9a; |
| 15279 |
t.thehinitialarabic = 0xfe9b; |
| 15280 |
t.thehmedialarabic = 0xfe9c; |
| 15281 |
t.thereexists = 0x2203; |
| 15282 |
t.therefore = 0x2234; |
| 15283 |
t.theta = 0x03b8; |
| 15284 |
t.theta1 = 0x03d1; |
| 15285 |
t.thetasymbolgreek = 0x03d1; |
| 15286 |
t.thieuthacirclekorean = 0x3279; |
| 15287 |
t.thieuthaparenkorean = 0x3219; |
| 15288 |
t.thieuthcirclekorean = 0x326b; |
| 15289 |
t.thieuthkorean = 0x314c; |
| 15290 |
t.thieuthparenkorean = 0x320b; |
| 15291 |
t.thirteencircle = 0x246c; |
| 15292 |
t.thirteenparen = 0x2480; |
| 15293 |
t.thirteenperiod = 0x2494; |
| 15294 |
t.thonangmonthothai = 0x0e11; |
| 15295 |
t.thook = 0x01ad; |
| 15296 |
t.thophuthaothai = 0x0e12; |
| 15297 |
t.thorn = 0x00fe; |
| 15298 |
t.thothahanthai = 0x0e17; |
| 15299 |
t.thothanthai = 0x0e10; |
| 15300 |
t.thothongthai = 0x0e18; |
| 15301 |
t.thothungthai = 0x0e16; |
| 15302 |
t.thousandcyrillic = 0x0482; |
| 15303 |
t.thousandsseparatorarabic = 0x066c; |
| 15304 |
t.thousandsseparatorpersian = 0x066c; |
| 15305 |
t.three = 0x0033; |
| 15306 |
t.threearabic = 0x0663; |
| 15307 |
t.threebengali = 0x09e9; |
| 15308 |
t.threecircle = 0x2462; |
| 15309 |
t.threecircleinversesansserif = 0x278c; |
| 15310 |
t.threedeva = 0x0969; |
| 15311 |
t.threeeighths = 0x215c; |
| 15312 |
t.threegujarati = 0x0ae9; |
| 15313 |
t.threegurmukhi = 0x0a69; |
| 15314 |
t.threehackarabic = 0x0663; |
| 15315 |
t.threehangzhou = 0x3023; |
| 15316 |
t.threeideographicparen = 0x3222; |
| 15317 |
t.threeinferior = 0x2083; |
| 15318 |
t.threemonospace = 0xff13; |
| 15319 |
t.threenumeratorbengali = 0x09f6; |
| 15320 |
t.threeoldstyle = 0xf733; |
| 15321 |
t.threeparen = 0x2476; |
| 15322 |
t.threeperiod = 0x248a; |
| 15323 |
t.threepersian = 0x06f3; |
| 15324 |
t.threequarters = 0x00be; |
| 15325 |
t.threequartersemdash = 0xf6de; |
| 15326 |
t.threeroman = 0x2172; |
| 15327 |
t.threesuperior = 0x00b3; |
| 15328 |
t.threethai = 0x0e53; |
| 15329 |
t.thzsquare = 0x3394; |
| 15330 |
t.tihiragana = 0x3061; |
| 15331 |
t.tikatakana = 0x30c1; |
| 15332 |
t.tikatakanahalfwidth = 0xff81; |
| 15333 |
t.tikeutacirclekorean = 0x3270; |
| 15334 |
t.tikeutaparenkorean = 0x3210; |
| 15335 |
t.tikeutcirclekorean = 0x3262; |
| 15336 |
t.tikeutkorean = 0x3137; |
| 15337 |
t.tikeutparenkorean = 0x3202; |
| 15338 |
t.tilde = 0x02dc; |
| 15339 |
t.tildebelowcmb = 0x0330; |
| 15340 |
t.tildecmb = 0x0303; |
| 15341 |
t.tildecomb = 0x0303; |
| 15342 |
t.tildedoublecmb = 0x0360; |
| 15343 |
t.tildeoperator = 0x223c; |
| 15344 |
t.tildeoverlaycmb = 0x0334; |
| 15345 |
t.tildeverticalcmb = 0x033e; |
| 15346 |
t.timescircle = 0x2297; |
| 15347 |
t.tipehahebrew = 0x0596; |
| 15348 |
t.tipehalefthebrew = 0x0596; |
| 15349 |
t.tippigurmukhi = 0x0a70; |
| 15350 |
t.titlocyrilliccmb = 0x0483; |
| 15351 |
t.tiwnarmenian = 0x057f; |
| 15352 |
t.tlinebelow = 0x1e6f; |
| 15353 |
t.tmonospace = 0xff54; |
| 15354 |
t.toarmenian = 0x0569; |
| 15355 |
t.tohiragana = 0x3068; |
| 15356 |
t.tokatakana = 0x30c8; |
| 15357 |
t.tokatakanahalfwidth = 0xff84; |
| 15358 |
t.tonebarextrahighmod = 0x02e5; |
| 15359 |
t.tonebarextralowmod = 0x02e9; |
| 15360 |
t.tonebarhighmod = 0x02e6; |
| 15361 |
t.tonebarlowmod = 0x02e8; |
| 15362 |
t.tonebarmidmod = 0x02e7; |
| 15363 |
t.tonefive = 0x01bd; |
| 15364 |
t.tonesix = 0x0185; |
| 15365 |
t.tonetwo = 0x01a8; |
| 15366 |
t.tonos = 0x0384; |
| 15367 |
t.tonsquare = 0x3327; |
| 15368 |
t.topatakthai = 0x0e0f; |
| 15369 |
t.tortoiseshellbracketleft = 0x3014; |
| 15370 |
t.tortoiseshellbracketleftsmall = 0xfe5d; |
| 15371 |
t.tortoiseshellbracketleftvertical = 0xfe39; |
| 15372 |
t.tortoiseshellbracketright = 0x3015; |
| 15373 |
t.tortoiseshellbracketrightsmall = 0xfe5e; |
| 15374 |
t.tortoiseshellbracketrightvertical = 0xfe3a; |
| 15375 |
t.totaothai = 0x0e15; |
| 15376 |
t.tpalatalhook = 0x01ab; |
| 15377 |
t.tparen = 0x24af; |
| 15378 |
t.trademark = 0x2122; |
| 15379 |
t.trademarksans = 0xf8ea; |
| 15380 |
t.trademarkserif = 0xf6db; |
| 15381 |
t.tretroflexhook = 0x0288; |
| 15382 |
t.triagdn = 0x25bc; |
| 15383 |
t.triaglf = 0x25c4; |
| 15384 |
t.triagrt = 0x25ba; |
| 15385 |
t.triagup = 0x25b2; |
| 15386 |
t.ts = 0x02a6; |
| 15387 |
t.tsadi = 0x05e6; |
| 15388 |
t.tsadidagesh = 0xfb46; |
| 15389 |
t.tsadidageshhebrew = 0xfb46; |
| 15390 |
t.tsadihebrew = 0x05e6; |
| 15391 |
t.tsecyrillic = 0x0446; |
| 15392 |
t.tsere = 0x05b5; |
| 15393 |
t.tsere12 = 0x05b5; |
| 15394 |
t.tsere1e = 0x05b5; |
| 15395 |
t.tsere2b = 0x05b5; |
| 15396 |
t.tserehebrew = 0x05b5; |
| 15397 |
t.tserenarrowhebrew = 0x05b5; |
| 15398 |
t.tserequarterhebrew = 0x05b5; |
| 15399 |
t.tserewidehebrew = 0x05b5; |
| 15400 |
t.tshecyrillic = 0x045b; |
| 15401 |
t.tsuperior = 0xf6f3; |
| 15402 |
t.ttabengali = 0x099f; |
| 15403 |
t.ttadeva = 0x091f; |
| 15404 |
t.ttagujarati = 0x0a9f; |
| 15405 |
t.ttagurmukhi = 0x0a1f; |
| 15406 |
t.tteharabic = 0x0679; |
| 15407 |
t.ttehfinalarabic = 0xfb67; |
| 15408 |
t.ttehinitialarabic = 0xfb68; |
| 15409 |
t.ttehmedialarabic = 0xfb69; |
| 15410 |
t.tthabengali = 0x09a0; |
| 15411 |
t.tthadeva = 0x0920; |
| 15412 |
t.tthagujarati = 0x0aa0; |
| 15413 |
t.tthagurmukhi = 0x0a20; |
| 15414 |
t.tturned = 0x0287; |
| 15415 |
t.tuhiragana = 0x3064; |
| 15416 |
t.tukatakana = 0x30c4; |
| 15417 |
t.tukatakanahalfwidth = 0xff82; |
| 15418 |
t.tusmallhiragana = 0x3063; |
| 15419 |
t.tusmallkatakana = 0x30c3; |
| 15420 |
t.tusmallkatakanahalfwidth = 0xff6f; |
| 15421 |
t.twelvecircle = 0x246b; |
| 15422 |
t.twelveparen = 0x247f; |
| 15423 |
t.twelveperiod = 0x2493; |
| 15424 |
t.twelveroman = 0x217b; |
| 15425 |
t.twentycircle = 0x2473; |
| 15426 |
t.twentyhangzhou = 0x5344; |
| 15427 |
t.twentyparen = 0x2487; |
| 15428 |
t.twentyperiod = 0x249b; |
| 15429 |
t.two = 0x0032; |
| 15430 |
t.twoarabic = 0x0662; |
| 15431 |
t.twobengali = 0x09e8; |
| 15432 |
t.twocircle = 0x2461; |
| 15433 |
t.twocircleinversesansserif = 0x278b; |
| 15434 |
t.twodeva = 0x0968; |
| 15435 |
t.twodotenleader = 0x2025; |
| 15436 |
t.twodotleader = 0x2025; |
| 15437 |
t.twodotleadervertical = 0xfe30; |
| 15438 |
t.twogujarati = 0x0ae8; |
| 15439 |
t.twogurmukhi = 0x0a68; |
| 15440 |
t.twohackarabic = 0x0662; |
| 15441 |
t.twohangzhou = 0x3022; |
| 15442 |
t.twoideographicparen = 0x3221; |
| 15443 |
t.twoinferior = 0x2082; |
| 15444 |
t.twomonospace = 0xff12; |
| 15445 |
t.twonumeratorbengali = 0x09f5; |
| 15446 |
t.twooldstyle = 0xf732; |
| 15447 |
t.twoparen = 0x2475; |
| 15448 |
t.twoperiod = 0x2489; |
| 15449 |
t.twopersian = 0x06f2; |
| 15450 |
t.tworoman = 0x2171; |
| 15451 |
t.twostroke = 0x01bb; |
| 15452 |
t.twosuperior = 0x00b2; |
| 15453 |
t.twothai = 0x0e52; |
| 15454 |
t.twothirds = 0x2154; |
| 15455 |
t.u = 0x0075; |
| 15456 |
t.uacute = 0x00fa; |
| 15457 |
t.ubar = 0x0289; |
| 15458 |
t.ubengali = 0x0989; |
| 15459 |
t.ubopomofo = 0x3128; |
| 15460 |
t.ubreve = 0x016d; |
| 15461 |
t.ucaron = 0x01d4; |
| 15462 |
t.ucircle = 0x24e4; |
| 15463 |
t.ucircumflex = 0x00fb; |
| 15464 |
t.ucircumflexbelow = 0x1e77; |
| 15465 |
t.ucyrillic = 0x0443; |
| 15466 |
t.udattadeva = 0x0951; |
| 15467 |
t.udblacute = 0x0171; |
| 15468 |
t.udblgrave = 0x0215; |
| 15469 |
t.udeva = 0x0909; |
| 15470 |
t.udieresis = 0x00fc; |
| 15471 |
t.udieresisacute = 0x01d8; |
| 15472 |
t.udieresisbelow = 0x1e73; |
| 15473 |
t.udieresiscaron = 0x01da; |
| 15474 |
t.udieresiscyrillic = 0x04f1; |
| 15475 |
t.udieresisgrave = 0x01dc; |
| 15476 |
t.udieresismacron = 0x01d6; |
| 15477 |
t.udotbelow = 0x1ee5; |
| 15478 |
t.ugrave = 0x00f9; |
| 15479 |
t.ugujarati = 0x0a89; |
| 15480 |
t.ugurmukhi = 0x0a09; |
| 15481 |
t.uhiragana = 0x3046; |
| 15482 |
t.uhookabove = 0x1ee7; |
| 15483 |
t.uhorn = 0x01b0; |
| 15484 |
t.uhornacute = 0x1ee9; |
| 15485 |
t.uhorndotbelow = 0x1ef1; |
| 15486 |
t.uhorngrave = 0x1eeb; |
| 15487 |
t.uhornhookabove = 0x1eed; |
| 15488 |
t.uhorntilde = 0x1eef; |
| 15489 |
t.uhungarumlaut = 0x0171; |
| 15490 |
t.uhungarumlautcyrillic = 0x04f3; |
| 15491 |
t.uinvertedbreve = 0x0217; |
| 15492 |
t.ukatakana = 0x30a6; |
| 15493 |
t.ukatakanahalfwidth = 0xff73; |
| 15494 |
t.ukcyrillic = 0x0479; |
| 15495 |
t.ukorean = 0x315c; |
| 15496 |
t.umacron = 0x016b; |
| 15497 |
t.umacroncyrillic = 0x04ef; |
| 15498 |
t.umacrondieresis = 0x1e7b; |
| 15499 |
t.umatragurmukhi = 0x0a41; |
| 15500 |
t.umonospace = 0xff55; |
| 15501 |
t.underscore = 0x005f; |
| 15502 |
t.underscoredbl = 0x2017; |
| 15503 |
t.underscoremonospace = 0xff3f; |
| 15504 |
t.underscorevertical = 0xfe33; |
| 15505 |
t.underscorewavy = 0xfe4f; |
| 15506 |
t.union = 0x222a; |
| 15507 |
t.universal = 0x2200; |
| 15508 |
t.uogonek = 0x0173; |
| 15509 |
t.uparen = 0x24b0; |
| 15510 |
t.upblock = 0x2580; |
| 15511 |
t.upperdothebrew = 0x05c4; |
| 15512 |
t.upsilon = 0x03c5; |
| 15513 |
t.upsilondieresis = 0x03cb; |
| 15514 |
t.upsilondieresistonos = 0x03b0; |
| 15515 |
t.upsilonlatin = 0x028a; |
| 15516 |
t.upsilontonos = 0x03cd; |
| 15517 |
t.uptackbelowcmb = 0x031d; |
| 15518 |
t.uptackmod = 0x02d4; |
| 15519 |
t.uragurmukhi = 0x0a73; |
| 15520 |
t.uring = 0x016f; |
| 15521 |
t.ushortcyrillic = 0x045e; |
| 15522 |
t.usmallhiragana = 0x3045; |
| 15523 |
t.usmallkatakana = 0x30a5; |
| 15524 |
t.usmallkatakanahalfwidth = 0xff69; |
| 15525 |
t.ustraightcyrillic = 0x04af; |
| 15526 |
t.ustraightstrokecyrillic = 0x04b1; |
| 15527 |
t.utilde = 0x0169; |
| 15528 |
t.utildeacute = 0x1e79; |
| 15529 |
t.utildebelow = 0x1e75; |
| 15530 |
t.uubengali = 0x098a; |
| 15531 |
t.uudeva = 0x090a; |
| 15532 |
t.uugujarati = 0x0a8a; |
| 15533 |
t.uugurmukhi = 0x0a0a; |
| 15534 |
t.uumatragurmukhi = 0x0a42; |
| 15535 |
t.uuvowelsignbengali = 0x09c2; |
| 15536 |
t.uuvowelsigndeva = 0x0942; |
| 15537 |
t.uuvowelsigngujarati = 0x0ac2; |
| 15538 |
t.uvowelsignbengali = 0x09c1; |
| 15539 |
t.uvowelsigndeva = 0x0941; |
| 15540 |
t.uvowelsigngujarati = 0x0ac1; |
| 15541 |
t.v = 0x0076; |
| 15542 |
t.vadeva = 0x0935; |
| 15543 |
t.vagujarati = 0x0ab5; |
| 15544 |
t.vagurmukhi = 0x0a35; |
| 15545 |
t.vakatakana = 0x30f7; |
| 15546 |
t.vav = 0x05d5; |
| 15547 |
t.vavdagesh = 0xfb35; |
| 15548 |
t.vavdagesh65 = 0xfb35; |
| 15549 |
t.vavdageshhebrew = 0xfb35; |
| 15550 |
t.vavhebrew = 0x05d5; |
| 15551 |
t.vavholam = 0xfb4b; |
| 15552 |
t.vavholamhebrew = 0xfb4b; |
| 15553 |
t.vavvavhebrew = 0x05f0; |
| 15554 |
t.vavyodhebrew = 0x05f1; |
| 15555 |
t.vcircle = 0x24e5; |
| 15556 |
t.vdotbelow = 0x1e7f; |
| 15557 |
t.vecyrillic = 0x0432; |
| 15558 |
t.veharabic = 0x06a4; |
| 15559 |
t.vehfinalarabic = 0xfb6b; |
| 15560 |
t.vehinitialarabic = 0xfb6c; |
| 15561 |
t.vehmedialarabic = 0xfb6d; |
| 15562 |
t.vekatakana = 0x30f9; |
| 15563 |
t.venus = 0x2640; |
| 15564 |
t.verticalbar = 0x007c; |
| 15565 |
t.verticallineabovecmb = 0x030d; |
| 15566 |
t.verticallinebelowcmb = 0x0329; |
| 15567 |
t.verticallinelowmod = 0x02cc; |
| 15568 |
t.verticallinemod = 0x02c8; |
| 15569 |
t.vewarmenian = 0x057e; |
| 15570 |
t.vhook = 0x028b; |
| 15571 |
t.vikatakana = 0x30f8; |
| 15572 |
t.viramabengali = 0x09cd; |
| 15573 |
t.viramadeva = 0x094d; |
| 15574 |
t.viramagujarati = 0x0acd; |
| 15575 |
t.visargabengali = 0x0983; |
| 15576 |
t.visargadeva = 0x0903; |
| 15577 |
t.visargagujarati = 0x0a83; |
| 15578 |
t.vmonospace = 0xff56; |
| 15579 |
t.voarmenian = 0x0578; |
| 15580 |
t.voicediterationhiragana = 0x309e; |
| 15581 |
t.voicediterationkatakana = 0x30fe; |
| 15582 |
t.voicedmarkkana = 0x309b; |
| 15583 |
t.voicedmarkkanahalfwidth = 0xff9e; |
| 15584 |
t.vokatakana = 0x30fa; |
| 15585 |
t.vparen = 0x24b1; |
| 15586 |
t.vtilde = 0x1e7d; |
| 15587 |
t.vturned = 0x028c; |
| 15588 |
t.vuhiragana = 0x3094; |
| 15589 |
t.vukatakana = 0x30f4; |
| 15590 |
t.w = 0x0077; |
| 15591 |
t.wacute = 0x1e83; |
| 15592 |
t.waekorean = 0x3159; |
| 15593 |
t.wahiragana = 0x308f; |
| 15594 |
t.wakatakana = 0x30ef; |
| 15595 |
t.wakatakanahalfwidth = 0xff9c; |
| 15596 |
t.wakorean = 0x3158; |
| 15597 |
t.wasmallhiragana = 0x308e; |
| 15598 |
t.wasmallkatakana = 0x30ee; |
| 15599 |
t.wattosquare = 0x3357; |
| 15600 |
t.wavedash = 0x301c; |
| 15601 |
t.wavyunderscorevertical = 0xfe34; |
| 15602 |
t.wawarabic = 0x0648; |
| 15603 |
t.wawfinalarabic = 0xfeee; |
| 15604 |
t.wawhamzaabovearabic = 0x0624; |
| 15605 |
t.wawhamzaabovefinalarabic = 0xfe86; |
| 15606 |
t.wbsquare = 0x33dd; |
| 15607 |
t.wcircle = 0x24e6; |
| 15608 |
t.wcircumflex = 0x0175; |
| 15609 |
t.wdieresis = 0x1e85; |
| 15610 |
t.wdotaccent = 0x1e87; |
| 15611 |
t.wdotbelow = 0x1e89; |
| 15612 |
t.wehiragana = 0x3091; |
| 15613 |
t.weierstrass = 0x2118; |
| 15614 |
t.wekatakana = 0x30f1; |
| 15615 |
t.wekorean = 0x315e; |
| 15616 |
t.weokorean = 0x315d; |
| 15617 |
t.wgrave = 0x1e81; |
| 15618 |
t.whitebullet = 0x25e6; |
| 15619 |
t.whitecircle = 0x25cb; |
| 15620 |
t.whitecircleinverse = 0x25d9; |
| 15621 |
t.whitecornerbracketleft = 0x300e; |
| 15622 |
t.whitecornerbracketleftvertical = 0xfe43; |
| 15623 |
t.whitecornerbracketright = 0x300f; |
| 15624 |
t.whitecornerbracketrightvertical = 0xfe44; |
| 15625 |
t.whitediamond = 0x25c7; |
| 15626 |
t.whitediamondcontainingblacksmalldiamond = 0x25c8; |
| 15627 |
t.whitedownpointingsmalltriangle = 0x25bf; |
| 15628 |
t.whitedownpointingtriangle = 0x25bd; |
| 15629 |
t.whiteleftpointingsmalltriangle = 0x25c3; |
| 15630 |
t.whiteleftpointingtriangle = 0x25c1; |
| 15631 |
t.whitelenticularbracketleft = 0x3016; |
| 15632 |
t.whitelenticularbracketright = 0x3017; |
| 15633 |
t.whiterightpointingsmalltriangle = 0x25b9; |
| 15634 |
t.whiterightpointingtriangle = 0x25b7; |
| 15635 |
t.whitesmallsquare = 0x25ab; |
| 15636 |
t.whitesmilingface = 0x263a; |
| 15637 |
t.whitesquare = 0x25a1; |
| 15638 |
t.whitestar = 0x2606; |
| 15639 |
t.whitetelephone = 0x260f; |
| 15640 |
t.whitetortoiseshellbracketleft = 0x3018; |
| 15641 |
t.whitetortoiseshellbracketright = 0x3019; |
| 15642 |
t.whiteuppointingsmalltriangle = 0x25b5; |
| 15643 |
t.whiteuppointingtriangle = 0x25b3; |
| 15644 |
t.wihiragana = 0x3090; |
| 15645 |
t.wikatakana = 0x30f0; |
| 15646 |
t.wikorean = 0x315f; |
| 15647 |
t.wmonospace = 0xff57; |
| 15648 |
t.wohiragana = 0x3092; |
| 15649 |
t.wokatakana = 0x30f2; |
| 15650 |
t.wokatakanahalfwidth = 0xff66; |
| 15651 |
t.won = 0x20a9; |
| 15652 |
t.wonmonospace = 0xffe6; |
| 15653 |
t.wowaenthai = 0x0e27; |
| 15654 |
t.wparen = 0x24b2; |
| 15655 |
t.wring = 0x1e98; |
| 15656 |
t.wsuperior = 0x02b7; |
| 15657 |
t.wturned = 0x028d; |
| 15658 |
t.wynn = 0x01bf; |
| 15659 |
t.x = 0x0078; |
| 15660 |
t.xabovecmb = 0x033d; |
| 15661 |
t.xbopomofo = 0x3112; |
| 15662 |
t.xcircle = 0x24e7; |
| 15663 |
t.xdieresis = 0x1e8d; |
| 15664 |
t.xdotaccent = 0x1e8b; |
| 15665 |
t.xeharmenian = 0x056d; |
| 15666 |
t.xi = 0x03be; |
| 15667 |
t.xmonospace = 0xff58; |
| 15668 |
t.xparen = 0x24b3; |
| 15669 |
t.xsuperior = 0x02e3; |
| 15670 |
t.y = 0x0079; |
| 15671 |
t.yaadosquare = 0x334e; |
| 15672 |
t.yabengali = 0x09af; |
| 15673 |
t.yacute = 0x00fd; |
| 15674 |
t.yadeva = 0x092f; |
| 15675 |
t.yaekorean = 0x3152; |
| 15676 |
t.yagujarati = 0x0aaf; |
| 15677 |
t.yagurmukhi = 0x0a2f; |
| 15678 |
t.yahiragana = 0x3084; |
| 15679 |
t.yakatakana = 0x30e4; |
| 15680 |
t.yakatakanahalfwidth = 0xff94; |
| 15681 |
t.yakorean = 0x3151; |
| 15682 |
t.yamakkanthai = 0x0e4e; |
| 15683 |
t.yasmallhiragana = 0x3083; |
| 15684 |
t.yasmallkatakana = 0x30e3; |
| 15685 |
t.yasmallkatakanahalfwidth = 0xff6c; |
| 15686 |
t.yatcyrillic = 0x0463; |
| 15687 |
t.ycircle = 0x24e8; |
| 15688 |
t.ycircumflex = 0x0177; |
| 15689 |
t.ydieresis = 0x00ff; |
| 15690 |
t.ydotaccent = 0x1e8f; |
| 15691 |
t.ydotbelow = 0x1ef5; |
| 15692 |
t.yeharabic = 0x064a; |
| 15693 |
t.yehbarreearabic = 0x06d2; |
| 15694 |
t.yehbarreefinalarabic = 0xfbaf; |
| 15695 |
t.yehfinalarabic = 0xfef2; |
| 15696 |
t.yehhamzaabovearabic = 0x0626; |
| 15697 |
t.yehhamzaabovefinalarabic = 0xfe8a; |
| 15698 |
t.yehhamzaaboveinitialarabic = 0xfe8b; |
| 15699 |
t.yehhamzaabovemedialarabic = 0xfe8c; |
| 15700 |
t.yehinitialarabic = 0xfef3; |
| 15701 |
t.yehmedialarabic = 0xfef4; |
| 15702 |
t.yehmeeminitialarabic = 0xfcdd; |
| 15703 |
t.yehmeemisolatedarabic = 0xfc58; |
| 15704 |
t.yehnoonfinalarabic = 0xfc94; |
| 15705 |
t.yehthreedotsbelowarabic = 0x06d1; |
| 15706 |
t.yekorean = 0x3156; |
| 15707 |
t.yen = 0x00a5; |
| 15708 |
t.yenmonospace = 0xffe5; |
| 15709 |
t.yeokorean = 0x3155; |
| 15710 |
t.yeorinhieuhkorean = 0x3186; |
| 15711 |
t.yerahbenyomohebrew = 0x05aa; |
| 15712 |
t.yerahbenyomolefthebrew = 0x05aa; |
| 15713 |
t.yericyrillic = 0x044b; |
| 15714 |
t.yerudieresiscyrillic = 0x04f9; |
| 15715 |
t.yesieungkorean = 0x3181; |
| 15716 |
t.yesieungpansioskorean = 0x3183; |
| 15717 |
t.yesieungsioskorean = 0x3182; |
| 15718 |
t.yetivhebrew = 0x059a; |
| 15719 |
t.ygrave = 0x1ef3; |
| 15720 |
t.yhook = 0x01b4; |
| 15721 |
t.yhookabove = 0x1ef7; |
| 15722 |
t.yiarmenian = 0x0575; |
| 15723 |
t.yicyrillic = 0x0457; |
| 15724 |
t.yikorean = 0x3162; |
| 15725 |
t.yinyang = 0x262f; |
| 15726 |
t.yiwnarmenian = 0x0582; |
| 15727 |
t.ymonospace = 0xff59; |
| 15728 |
t.yod = 0x05d9; |
| 15729 |
t.yoddagesh = 0xfb39; |
| 15730 |
t.yoddageshhebrew = 0xfb39; |
| 15731 |
t.yodhebrew = 0x05d9; |
| 15732 |
t.yodyodhebrew = 0x05f2; |
| 15733 |
t.yodyodpatahhebrew = 0xfb1f; |
| 15734 |
t.yohiragana = 0x3088; |
| 15735 |
t.yoikorean = 0x3189; |
| 15736 |
t.yokatakana = 0x30e8; |
| 15737 |
t.yokatakanahalfwidth = 0xff96; |
| 15738 |
t.yokorean = 0x315b; |
| 15739 |
t.yosmallhiragana = 0x3087; |
| 15740 |
t.yosmallkatakana = 0x30e7; |
| 15741 |
t.yosmallkatakanahalfwidth = 0xff6e; |
| 15742 |
t.yotgreek = 0x03f3; |
| 15743 |
t.yoyaekorean = 0x3188; |
| 15744 |
t.yoyakorean = 0x3187; |
| 15745 |
t.yoyakthai = 0x0e22; |
| 15746 |
t.yoyingthai = 0x0e0d; |
| 15747 |
t.yparen = 0x24b4; |
| 15748 |
t.ypogegrammeni = 0x037a; |
| 15749 |
t.ypogegrammenigreekcmb = 0x0345; |
| 15750 |
t.yr = 0x01a6; |
| 15751 |
t.yring = 0x1e99; |
| 15752 |
t.ysuperior = 0x02b8; |
| 15753 |
t.ytilde = 0x1ef9; |
| 15754 |
t.yturned = 0x028e; |
| 15755 |
t.yuhiragana = 0x3086; |
| 15756 |
t.yuikorean = 0x318c; |
| 15757 |
t.yukatakana = 0x30e6; |
| 15758 |
t.yukatakanahalfwidth = 0xff95; |
| 15759 |
t.yukorean = 0x3160; |
| 15760 |
t.yusbigcyrillic = 0x046b; |
| 15761 |
t.yusbigiotifiedcyrillic = 0x046d; |
| 15762 |
t.yuslittlecyrillic = 0x0467; |
| 15763 |
t.yuslittleiotifiedcyrillic = 0x0469; |
| 15764 |
t.yusmallhiragana = 0x3085; |
| 15765 |
t.yusmallkatakana = 0x30e5; |
| 15766 |
t.yusmallkatakanahalfwidth = 0xff6d; |
| 15767 |
t.yuyekorean = 0x318b; |
| 15768 |
t.yuyeokorean = 0x318a; |
| 15769 |
t.yyabengali = 0x09df; |
| 15770 |
t.yyadeva = 0x095f; |
| 15771 |
t.z = 0x007a; |
| 15772 |
t.zaarmenian = 0x0566; |
| 15773 |
t.zacute = 0x017a; |
| 15774 |
t.zadeva = 0x095b; |
| 15775 |
t.zagurmukhi = 0x0a5b; |
| 15776 |
t.zaharabic = 0x0638; |
| 15777 |
t.zahfinalarabic = 0xfec6; |
| 15778 |
t.zahinitialarabic = 0xfec7; |
| 15779 |
t.zahiragana = 0x3056; |
| 15780 |
t.zahmedialarabic = 0xfec8; |
| 15781 |
t.zainarabic = 0x0632; |
| 15782 |
t.zainfinalarabic = 0xfeb0; |
| 15783 |
t.zakatakana = 0x30b6; |
| 15784 |
t.zaqefgadolhebrew = 0x0595; |
| 15785 |
t.zaqefqatanhebrew = 0x0594; |
| 15786 |
t.zarqahebrew = 0x0598; |
| 15787 |
t.zayin = 0x05d6; |
| 15788 |
t.zayindagesh = 0xfb36; |
| 15789 |
t.zayindageshhebrew = 0xfb36; |
| 15790 |
t.zayinhebrew = 0x05d6; |
| 15791 |
t.zbopomofo = 0x3117; |
| 15792 |
t.zcaron = 0x017e; |
| 15793 |
t.zcircle = 0x24e9; |
| 15794 |
t.zcircumflex = 0x1e91; |
| 15795 |
t.zcurl = 0x0291; |
| 15796 |
t.zdot = 0x017c; |
| 15797 |
t.zdotaccent = 0x017c; |
| 15798 |
t.zdotbelow = 0x1e93; |
| 15799 |
t.zecyrillic = 0x0437; |
| 15800 |
t.zedescendercyrillic = 0x0499; |
| 15801 |
t.zedieresiscyrillic = 0x04df; |
| 15802 |
t.zehiragana = 0x305c; |
| 15803 |
t.zekatakana = 0x30bc; |
| 15804 |
t.zero = 0x0030; |
| 15805 |
t.zeroarabic = 0x0660; |
| 15806 |
t.zerobengali = 0x09e6; |
| 15807 |
t.zerodeva = 0x0966; |
| 15808 |
t.zerogujarati = 0x0ae6; |
| 15809 |
t.zerogurmukhi = 0x0a66; |
| 15810 |
t.zerohackarabic = 0x0660; |
| 15811 |
t.zeroinferior = 0x2080; |
| 15812 |
t.zeromonospace = 0xff10; |
| 15813 |
t.zerooldstyle = 0xf730; |
| 15814 |
t.zeropersian = 0x06f0; |
| 15815 |
t.zerosuperior = 0x2070; |
| 15816 |
t.zerothai = 0x0e50; |
| 15817 |
t.zerowidthjoiner = 0xfeff; |
| 15818 |
t.zerowidthnonjoiner = 0x200c; |
| 15819 |
t.zerowidthspace = 0x200b; |
| 15820 |
t.zeta = 0x03b6; |
| 15821 |
t.zhbopomofo = 0x3113; |
| 15822 |
t.zhearmenian = 0x056a; |
| 15823 |
t.zhebrevecyrillic = 0x04c2; |
| 15824 |
t.zhecyrillic = 0x0436; |
| 15825 |
t.zhedescendercyrillic = 0x0497; |
| 15826 |
t.zhedieresiscyrillic = 0x04dd; |
| 15827 |
t.zihiragana = 0x3058; |
| 15828 |
t.zikatakana = 0x30b8; |
| 15829 |
t.zinorhebrew = 0x05ae; |
| 15830 |
t.zlinebelow = 0x1e95; |
| 15831 |
t.zmonospace = 0xff5a; |
| 15832 |
t.zohiragana = 0x305e; |
| 15833 |
t.zokatakana = 0x30be; |
| 15834 |
t.zparen = 0x24b5; |
| 15835 |
t.zretroflexhook = 0x0290; |
| 15836 |
t.zstroke = 0x01b6; |
| 15837 |
t.zuhiragana = 0x305a; |
| 15838 |
t.zukatakana = 0x30ba; |
| 15839 |
t[".notdef"] = 0x0000; |
| 15840 |
t.angbracketleftbig = 0x2329; |
| 15841 |
t.angbracketleftBig = 0x2329; |
| 15842 |
t.angbracketleftbigg = 0x2329; |
| 15843 |
t.angbracketleftBigg = 0x2329; |
| 15844 |
t.angbracketrightBig = 0x232a; |
| 15845 |
t.angbracketrightbig = 0x232a; |
| 15846 |
t.angbracketrightBigg = 0x232a; |
| 15847 |
t.angbracketrightbigg = 0x232a; |
| 15848 |
t.arrowhookleft = 0x21aa; |
| 15849 |
t.arrowhookright = 0x21a9; |
| 15850 |
t.arrowlefttophalf = 0x21bc; |
| 15851 |
t.arrowleftbothalf = 0x21bd; |
| 15852 |
t.arrownortheast = 0x2197; |
| 15853 |
t.arrownorthwest = 0x2196; |
| 15854 |
t.arrowrighttophalf = 0x21c0; |
| 15855 |
t.arrowrightbothalf = 0x21c1; |
| 15856 |
t.arrowsoutheast = 0x2198; |
| 15857 |
t.arrowsouthwest = 0x2199; |
| 15858 |
t.backslashbig = 0x2216; |
| 15859 |
t.backslashBig = 0x2216; |
| 15860 |
t.backslashBigg = 0x2216; |
| 15861 |
t.backslashbigg = 0x2216; |
| 15862 |
t.bardbl = 0x2016; |
| 15863 |
t.bracehtipdownleft = 0xfe37; |
| 15864 |
t.bracehtipdownright = 0xfe37; |
| 15865 |
t.bracehtipupleft = 0xfe38; |
| 15866 |
t.bracehtipupright = 0xfe38; |
| 15867 |
t.braceleftBig = 0x007b; |
| 15868 |
t.braceleftbig = 0x007b; |
| 15869 |
t.braceleftbigg = 0x007b; |
| 15870 |
t.braceleftBigg = 0x007b; |
| 15871 |
t.bracerightBig = 0x007d; |
| 15872 |
t.bracerightbig = 0x007d; |
| 15873 |
t.bracerightbigg = 0x007d; |
| 15874 |
t.bracerightBigg = 0x007d; |
| 15875 |
t.bracketleftbig = 0x005b; |
| 15876 |
t.bracketleftBig = 0x005b; |
| 15877 |
t.bracketleftbigg = 0x005b; |
| 15878 |
t.bracketleftBigg = 0x005b; |
| 15879 |
t.bracketrightBig = 0x005d; |
| 15880 |
t.bracketrightbig = 0x005d; |
| 15881 |
t.bracketrightbigg = 0x005d; |
| 15882 |
t.bracketrightBigg = 0x005d; |
| 15883 |
t.ceilingleftbig = 0x2308; |
| 15884 |
t.ceilingleftBig = 0x2308; |
| 15885 |
t.ceilingleftBigg = 0x2308; |
| 15886 |
t.ceilingleftbigg = 0x2308; |
| 15887 |
t.ceilingrightbig = 0x2309; |
| 15888 |
t.ceilingrightBig = 0x2309; |
| 15889 |
t.ceilingrightbigg = 0x2309; |
| 15890 |
t.ceilingrightBigg = 0x2309; |
| 15891 |
t.circledotdisplay = 0x2299; |
| 15892 |
t.circledottext = 0x2299; |
| 15893 |
t.circlemultiplydisplay = 0x2297; |
| 15894 |
t.circlemultiplytext = 0x2297; |
| 15895 |
t.circleplusdisplay = 0x2295; |
| 15896 |
t.circleplustext = 0x2295; |
| 15897 |
t.contintegraldisplay = 0x222e; |
| 15898 |
t.contintegraltext = 0x222e; |
| 15899 |
t.coproductdisplay = 0x2210; |
| 15900 |
t.coproducttext = 0x2210; |
| 15901 |
t.floorleftBig = 0x230a; |
| 15902 |
t.floorleftbig = 0x230a; |
| 15903 |
t.floorleftbigg = 0x230a; |
| 15904 |
t.floorleftBigg = 0x230a; |
| 15905 |
t.floorrightbig = 0x230b; |
| 15906 |
t.floorrightBig = 0x230b; |
| 15907 |
t.floorrightBigg = 0x230b; |
| 15908 |
t.floorrightbigg = 0x230b; |
| 15909 |
t.hatwide = 0x0302; |
| 15910 |
t.hatwider = 0x0302; |
| 15911 |
t.hatwidest = 0x0302; |
| 15912 |
t.intercal = 0x1d40; |
| 15913 |
t.integraldisplay = 0x222b; |
| 15914 |
t.integraltext = 0x222b; |
| 15915 |
t.intersectiondisplay = 0x22c2; |
| 15916 |
t.intersectiontext = 0x22c2; |
| 15917 |
t.logicalanddisplay = 0x2227; |
| 15918 |
t.logicalandtext = 0x2227; |
| 15919 |
t.logicalordisplay = 0x2228; |
| 15920 |
t.logicalortext = 0x2228; |
| 15921 |
t.parenleftBig = 0x0028; |
| 15922 |
t.parenleftbig = 0x0028; |
| 15923 |
t.parenleftBigg = 0x0028; |
| 15924 |
t.parenleftbigg = 0x0028; |
| 15925 |
t.parenrightBig = 0x0029; |
| 15926 |
t.parenrightbig = 0x0029; |
| 15927 |
t.parenrightBigg = 0x0029; |
| 15928 |
t.parenrightbigg = 0x0029; |
| 15929 |
t.prime = 0x2032; |
| 15930 |
t.productdisplay = 0x220f; |
| 15931 |
t.producttext = 0x220f; |
| 15932 |
t.radicalbig = 0x221a; |
| 15933 |
t.radicalBig = 0x221a; |
| 15934 |
t.radicalBigg = 0x221a; |
| 15935 |
t.radicalbigg = 0x221a; |
| 15936 |
t.radicalbt = 0x221a; |
| 15937 |
t.radicaltp = 0x221a; |
| 15938 |
t.radicalvertex = 0x221a; |
| 15939 |
t.slashbig = 0x002f; |
| 15940 |
t.slashBig = 0x002f; |
| 15941 |
t.slashBigg = 0x002f; |
| 15942 |
t.slashbigg = 0x002f; |
| 15943 |
t.summationdisplay = 0x2211; |
| 15944 |
t.summationtext = 0x2211; |
| 15945 |
t.tildewide = 0x02dc; |
| 15946 |
t.tildewider = 0x02dc; |
| 15947 |
t.tildewidest = 0x02dc; |
| 15948 |
t.uniondisplay = 0x22c3; |
| 15949 |
t.unionmultidisplay = 0x228e; |
| 15950 |
t.unionmultitext = 0x228e; |
| 15951 |
t.unionsqdisplay = 0x2294; |
| 15952 |
t.unionsqtext = 0x2294; |
| 15953 |
t.uniontext = 0x22c3; |
| 15954 |
t.vextenddouble = 0x2225; |
| 15955 |
t.vextendsingle = 0x2223; |
| 15956 |
}); |
| 15957 |
const getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) { |
| 15958 |
t.space = 0x0020; |
| 15959 |
t.a1 = 0x2701; |
| 15960 |
t.a2 = 0x2702; |
| 15961 |
t.a202 = 0x2703; |
| 15962 |
t.a3 = 0x2704; |
| 15963 |
t.a4 = 0x260e; |
| 15964 |
t.a5 = 0x2706; |
| 15965 |
t.a119 = 0x2707; |
| 15966 |
t.a118 = 0x2708; |
| 15967 |
t.a117 = 0x2709; |
| 15968 |
t.a11 = 0x261b; |
| 15969 |
t.a12 = 0x261e; |
| 15970 |
t.a13 = 0x270c; |
| 15971 |
t.a14 = 0x270d; |
| 15972 |
t.a15 = 0x270e; |
| 15973 |
t.a16 = 0x270f; |
| 15974 |
t.a105 = 0x2710; |
| 15975 |
t.a17 = 0x2711; |
| 15976 |
t.a18 = 0x2712; |
| 15977 |
t.a19 = 0x2713; |
| 15978 |
t.a20 = 0x2714; |
| 15979 |
t.a21 = 0x2715; |
| 15980 |
t.a22 = 0x2716; |
| 15981 |
t.a23 = 0x2717; |
| 15982 |
t.a24 = 0x2718; |
| 15983 |
t.a25 = 0x2719; |
| 15984 |
t.a26 = 0x271a; |
| 15985 |
t.a27 = 0x271b; |
| 15986 |
t.a28 = 0x271c; |
| 15987 |
t.a6 = 0x271d; |
| 15988 |
t.a7 = 0x271e; |
| 15989 |
t.a8 = 0x271f; |
| 15990 |
t.a9 = 0x2720; |
| 15991 |
t.a10 = 0x2721; |
| 15992 |
t.a29 = 0x2722; |
| 15993 |
t.a30 = 0x2723; |
| 15994 |
t.a31 = 0x2724; |
| 15995 |
t.a32 = 0x2725; |
| 15996 |
t.a33 = 0x2726; |
| 15997 |
t.a34 = 0x2727; |
| 15998 |
t.a35 = 0x2605; |
| 15999 |
t.a36 = 0x2729; |
| 16000 |
t.a37 = 0x272a; |
| 16001 |
t.a38 = 0x272b; |
| 16002 |
t.a39 = 0x272c; |
| 16003 |
t.a40 = 0x272d; |
| 16004 |
t.a41 = 0x272e; |
| 16005 |
t.a42 = 0x272f; |
| 16006 |
t.a43 = 0x2730; |
| 16007 |
t.a44 = 0x2731; |
| 16008 |
t.a45 = 0x2732; |
| 16009 |
t.a46 = 0x2733; |
| 16010 |
t.a47 = 0x2734; |
| 16011 |
t.a48 = 0x2735; |
| 16012 |
t.a49 = 0x2736; |
| 16013 |
t.a50 = 0x2737; |
| 16014 |
t.a51 = 0x2738; |
| 16015 |
t.a52 = 0x2739; |
| 16016 |
t.a53 = 0x273a; |
| 16017 |
t.a54 = 0x273b; |
| 16018 |
t.a55 = 0x273c; |
| 16019 |
t.a56 = 0x273d; |
| 16020 |
t.a57 = 0x273e; |
| 16021 |
t.a58 = 0x273f; |
| 16022 |
t.a59 = 0x2740; |
| 16023 |
t.a60 = 0x2741; |
| 16024 |
t.a61 = 0x2742; |
| 16025 |
t.a62 = 0x2743; |
| 16026 |
t.a63 = 0x2744; |
| 16027 |
t.a64 = 0x2745; |
| 16028 |
t.a65 = 0x2746; |
| 16029 |
t.a66 = 0x2747; |
| 16030 |
t.a67 = 0x2748; |
| 16031 |
t.a68 = 0x2749; |
| 16032 |
t.a69 = 0x274a; |
| 16033 |
t.a70 = 0x274b; |
| 16034 |
t.a71 = 0x25cf; |
| 16035 |
t.a72 = 0x274d; |
| 16036 |
t.a73 = 0x25a0; |
| 16037 |
t.a74 = 0x274f; |
| 16038 |
t.a203 = 0x2750; |
| 16039 |
t.a75 = 0x2751; |
| 16040 |
t.a204 = 0x2752; |
| 16041 |
t.a76 = 0x25b2; |
| 16042 |
t.a77 = 0x25bc; |
| 16043 |
t.a78 = 0x25c6; |
| 16044 |
t.a79 = 0x2756; |
| 16045 |
t.a81 = 0x25d7; |
| 16046 |
t.a82 = 0x2758; |
| 16047 |
t.a83 = 0x2759; |
| 16048 |
t.a84 = 0x275a; |
| 16049 |
t.a97 = 0x275b; |
| 16050 |
t.a98 = 0x275c; |
| 16051 |
t.a99 = 0x275d; |
| 16052 |
t.a100 = 0x275e; |
| 16053 |
t.a101 = 0x2761; |
| 16054 |
t.a102 = 0x2762; |
| 16055 |
t.a103 = 0x2763; |
| 16056 |
t.a104 = 0x2764; |
| 16057 |
t.a106 = 0x2765; |
| 16058 |
t.a107 = 0x2766; |
| 16059 |
t.a108 = 0x2767; |
| 16060 |
t.a112 = 0x2663; |
| 16061 |
t.a111 = 0x2666; |
| 16062 |
t.a110 = 0x2665; |
| 16063 |
t.a109 = 0x2660; |
| 16064 |
t.a120 = 0x2460; |
| 16065 |
t.a121 = 0x2461; |
| 16066 |
t.a122 = 0x2462; |
| 16067 |
t.a123 = 0x2463; |
| 16068 |
t.a124 = 0x2464; |
| 16069 |
t.a125 = 0x2465; |
| 16070 |
t.a126 = 0x2466; |
| 16071 |
t.a127 = 0x2467; |
| 16072 |
t.a128 = 0x2468; |
| 16073 |
t.a129 = 0x2469; |
| 16074 |
t.a130 = 0x2776; |
| 16075 |
t.a131 = 0x2777; |
| 16076 |
t.a132 = 0x2778; |
| 16077 |
t.a133 = 0x2779; |
| 16078 |
t.a134 = 0x277a; |
| 16079 |
t.a135 = 0x277b; |
| 16080 |
t.a136 = 0x277c; |
| 16081 |
t.a137 = 0x277d; |
| 16082 |
t.a138 = 0x277e; |
| 16083 |
t.a139 = 0x277f; |
| 16084 |
t.a140 = 0x2780; |
| 16085 |
t.a141 = 0x2781; |
| 16086 |
t.a142 = 0x2782; |
| 16087 |
t.a143 = 0x2783; |
| 16088 |
t.a144 = 0x2784; |
| 16089 |
t.a145 = 0x2785; |
| 16090 |
t.a146 = 0x2786; |
| 16091 |
t.a147 = 0x2787; |
| 16092 |
t.a148 = 0x2788; |
| 16093 |
t.a149 = 0x2789; |
| 16094 |
t.a150 = 0x278a; |
| 16095 |
t.a151 = 0x278b; |
| 16096 |
t.a152 = 0x278c; |
| 16097 |
t.a153 = 0x278d; |
| 16098 |
t.a154 = 0x278e; |
| 16099 |
t.a155 = 0x278f; |
| 16100 |
t.a156 = 0x2790; |
| 16101 |
t.a157 = 0x2791; |
| 16102 |
t.a158 = 0x2792; |
| 16103 |
t.a159 = 0x2793; |
| 16104 |
t.a160 = 0x2794; |
| 16105 |
t.a161 = 0x2192; |
| 16106 |
t.a163 = 0x2194; |
| 16107 |
t.a164 = 0x2195; |
| 16108 |
t.a196 = 0x2798; |
| 16109 |
t.a165 = 0x2799; |
| 16110 |
t.a192 = 0x279a; |
| 16111 |
t.a166 = 0x279b; |
| 16112 |
t.a167 = 0x279c; |
| 16113 |
t.a168 = 0x279d; |
| 16114 |
t.a169 = 0x279e; |
| 16115 |
t.a170 = 0x279f; |
| 16116 |
t.a171 = 0x27a0; |
| 16117 |
t.a172 = 0x27a1; |
| 16118 |
t.a173 = 0x27a2; |
| 16119 |
t.a162 = 0x27a3; |
| 16120 |
t.a174 = 0x27a4; |
| 16121 |
t.a175 = 0x27a5; |
| 16122 |
t.a176 = 0x27a6; |
| 16123 |
t.a177 = 0x27a7; |
| 16124 |
t.a178 = 0x27a8; |
| 16125 |
t.a179 = 0x27a9; |
| 16126 |
t.a193 = 0x27aa; |
| 16127 |
t.a180 = 0x27ab; |
| 16128 |
t.a199 = 0x27ac; |
| 16129 |
t.a181 = 0x27ad; |
| 16130 |
t.a200 = 0x27ae; |
| 16131 |
t.a182 = 0x27af; |
| 16132 |
t.a201 = 0x27b1; |
| 16133 |
t.a183 = 0x27b2; |
| 16134 |
t.a184 = 0x27b3; |
| 16135 |
t.a197 = 0x27b4; |
| 16136 |
t.a185 = 0x27b5; |
| 16137 |
t.a194 = 0x27b6; |
| 16138 |
t.a198 = 0x27b7; |
| 16139 |
t.a186 = 0x27b8; |
| 16140 |
t.a195 = 0x27b9; |
| 16141 |
t.a187 = 0x27ba; |
| 16142 |
t.a188 = 0x27bb; |
| 16143 |
t.a189 = 0x27bc; |
| 16144 |
t.a190 = 0x27bd; |
| 16145 |
t.a191 = 0x27be; |
| 16146 |
t.a89 = 0x2768; |
| 16147 |
t.a90 = 0x2769; |
| 16148 |
t.a93 = 0x276a; |
| 16149 |
t.a94 = 0x276b; |
| 16150 |
t.a91 = 0x276c; |
| 16151 |
t.a92 = 0x276d; |
| 16152 |
t.a205 = 0x276e; |
| 16153 |
t.a85 = 0x276f; |
| 16154 |
t.a206 = 0x2770; |
| 16155 |
t.a86 = 0x2771; |
| 16156 |
t.a87 = 0x2772; |
| 16157 |
t.a88 = 0x2773; |
| 16158 |
t.a95 = 0x2774; |
| 16159 |
t.a96 = 0x2775; |
| 16160 |
t[".notdef"] = 0x0000; |
| 16161 |
}); |
| 16162 |
|
| 16163 |
;// ./src/core/unicode.js |
| 16164 |
|
| 16165 |
const getSpecialPUASymbols = getLookupTableFactory(function (t) { |
| 16166 |
t[63721] = 0x00a9; |
| 16167 |
t[63193] = 0x00a9; |
| 16168 |
t[63720] = 0x00ae; |
| 16169 |
t[63194] = 0x00ae; |
| 16170 |
t[63722] = 0x2122; |
| 16171 |
t[63195] = 0x2122; |
| 16172 |
t[63729] = 0x23a7; |
| 16173 |
t[63730] = 0x23a8; |
| 16174 |
t[63731] = 0x23a9; |
| 16175 |
t[63740] = 0x23ab; |
| 16176 |
t[63741] = 0x23ac; |
| 16177 |
t[63742] = 0x23ad; |
| 16178 |
t[63726] = 0x23a1; |
| 16179 |
t[63727] = 0x23a2; |
| 16180 |
t[63728] = 0x23a3; |
| 16181 |
t[63737] = 0x23a4; |
| 16182 |
t[63738] = 0x23a5; |
| 16183 |
t[63739] = 0x23a6; |
| 16184 |
t[63723] = 0x239b; |
| 16185 |
t[63724] = 0x239c; |
| 16186 |
t[63725] = 0x239d; |
| 16187 |
t[63734] = 0x239e; |
| 16188 |
t[63735] = 0x239f; |
| 16189 |
t[63736] = 0x23a0; |
| 16190 |
}); |
| 16191 |
function mapSpecialUnicodeValues(code) { |
| 16192 |
if (code >= 0xfff0 && code <= 0xffff) { |
| 16193 |
return 0; |
| 16194 |
} else if (code >= 0xf600 && code <= 0xf8ff) { |
| 16195 |
return getSpecialPUASymbols()[code] || code; |
| 16196 |
} else if (code === 0x00ad) { |
| 16197 |
return 0x002d; |
| 16198 |
} |
| 16199 |
return code; |
| 16200 |
} |
| 16201 |
function getUnicodeForGlyph(name, glyphsUnicodeMap) { |
| 16202 |
let unicode = glyphsUnicodeMap[name]; |
| 16203 |
if (unicode !== undefined) { |
| 16204 |
return unicode; |
| 16205 |
} |
| 16206 |
if (!name) { |
| 16207 |
return -1; |
| 16208 |
} |
| 16209 |
if (name[0] === "u") { |
| 16210 |
const nameLen = name.length; |
| 16211 |
let hexStr; |
| 16212 |
if (nameLen === 7 && name[1] === "n" && name[2] === "i") { |
| 16213 |
hexStr = name.substring(3); |
| 16214 |
} else if (nameLen >= 5 && nameLen <= 7) { |
| 16215 |
hexStr = name.substring(1); |
| 16216 |
} else { |
| 16217 |
return -1; |
| 16218 |
} |
| 16219 |
if (hexStr === hexStr.toUpperCase()) { |
| 16220 |
unicode = parseInt(hexStr, 16); |
| 16221 |
if (unicode >= 0) { |
| 16222 |
return unicode; |
| 16223 |
} |
| 16224 |
} |
| 16225 |
} |
| 16226 |
return -1; |
| 16227 |
} |
| 16228 |
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]]; |
| 16229 |
function getUnicodeRangeFor(value, lastPosition = -1) { |
| 16230 |
if (lastPosition !== -1) { |
| 16231 |
const range = UnicodeRanges[lastPosition]; |
| 16232 |
for (let i = 0, ii = range.length; i < ii; i += 2) { |
| 16233 |
if (value >= range[i] && value <= range[i + 1]) { |
| 16234 |
return lastPosition; |
| 16235 |
} |
| 16236 |
} |
| 16237 |
} |
| 16238 |
for (let i = 0, ii = UnicodeRanges.length; i < ii; i++) { |
| 16239 |
const range = UnicodeRanges[i]; |
| 16240 |
for (let j = 0, jj = range.length; j < jj; j += 2) { |
| 16241 |
if (value >= range[j] && value <= range[j + 1]) { |
| 16242 |
return i; |
| 16243 |
} |
| 16244 |
} |
| 16245 |
} |
| 16246 |
return -1; |
| 16247 |
} |
| 16248 |
const SpecialCharRegExp = new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$", "u"); |
| 16249 |
const CategoryCache = new Map(); |
| 16250 |
function getCharUnicodeCategory(char) { |
| 16251 |
const cachedCategory = CategoryCache.get(char); |
| 16252 |
if (cachedCategory) { |
| 16253 |
return cachedCategory; |
| 16254 |
} |
| 16255 |
const groups = char.match(SpecialCharRegExp); |
| 16256 |
const category = { |
| 16257 |
isWhitespace: !!groups?.[1], |
| 16258 |
isZeroWidthDiacritic: !!groups?.[2], |
| 16259 |
isInvisibleFormatMark: !!groups?.[3] |
| 16260 |
}; |
| 16261 |
CategoryCache.set(char, category); |
| 16262 |
return category; |
| 16263 |
} |
| 16264 |
function clearUnicodeCaches() { |
| 16265 |
CategoryCache.clear(); |
| 16266 |
} |
| 16267 |
|
| 16268 |
;// ./src/core/fonts_utils.js |
| 16269 |
|
| 16270 |
|
| 16271 |
|
| 16272 |
|
| 16273 |
|
| 16274 |
const SEAC_ANALYSIS_ENABLED = true; |
| 16275 |
const FontFlags = { |
| 16276 |
FixedPitch: 1, |
| 16277 |
Serif: 2, |
| 16278 |
Symbolic: 4, |
| 16279 |
Script: 8, |
| 16280 |
Nonsymbolic: 32, |
| 16281 |
Italic: 64, |
| 16282 |
AllCap: 65536, |
| 16283 |
SmallCap: 131072, |
| 16284 |
ForceBold: 262144 |
| 16285 |
}; |
| 16286 |
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"]; |
| 16287 |
function recoverGlyphName(name, glyphsUnicodeMap) { |
| 16288 |
if (glyphsUnicodeMap[name] !== undefined) { |
| 16289 |
return name; |
| 16290 |
} |
| 16291 |
const unicode = getUnicodeForGlyph(name, glyphsUnicodeMap); |
| 16292 |
if (unicode !== -1) { |
| 16293 |
for (const key in glyphsUnicodeMap) { |
| 16294 |
if (glyphsUnicodeMap[key] === unicode) { |
| 16295 |
return key; |
| 16296 |
} |
| 16297 |
} |
| 16298 |
} |
| 16299 |
info("Unable to recover a standard glyph name for: " + name); |
| 16300 |
return name; |
| 16301 |
} |
| 16302 |
function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) { |
| 16303 |
const charCodeToGlyphId = Object.create(null); |
| 16304 |
let glyphId, charCode, baseEncoding; |
| 16305 |
const isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); |
| 16306 |
if (properties.isInternalFont) { |
| 16307 |
baseEncoding = builtInEncoding; |
| 16308 |
for (charCode = 0; charCode < baseEncoding.length; charCode++) { |
| 16309 |
glyphId = glyphNames.indexOf(baseEncoding[charCode]); |
| 16310 |
charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0; |
| 16311 |
} |
| 16312 |
} else if (properties.baseEncodingName) { |
| 16313 |
baseEncoding = getEncoding(properties.baseEncodingName); |
| 16314 |
for (charCode = 0; charCode < baseEncoding.length; charCode++) { |
| 16315 |
glyphId = glyphNames.indexOf(baseEncoding[charCode]); |
| 16316 |
charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0; |
| 16317 |
} |
| 16318 |
} else if (isSymbolicFont) { |
| 16319 |
for (charCode in builtInEncoding) { |
| 16320 |
charCodeToGlyphId[charCode] = builtInEncoding[charCode]; |
| 16321 |
} |
| 16322 |
} else { |
| 16323 |
baseEncoding = StandardEncoding; |
| 16324 |
for (charCode = 0; charCode < baseEncoding.length; charCode++) { |
| 16325 |
glyphId = glyphNames.indexOf(baseEncoding[charCode]); |
| 16326 |
charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0; |
| 16327 |
} |
| 16328 |
} |
| 16329 |
const differences = properties.differences; |
| 16330 |
let glyphsUnicodeMap; |
| 16331 |
if (differences) { |
| 16332 |
for (charCode in differences) { |
| 16333 |
const glyphName = differences[charCode]; |
| 16334 |
glyphId = glyphNames.indexOf(glyphName); |
| 16335 |
if (glyphId === -1) { |
| 16336 |
if (!glyphsUnicodeMap) { |
| 16337 |
glyphsUnicodeMap = getGlyphsUnicode(); |
| 16338 |
} |
| 16339 |
const standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); |
| 16340 |
if (standardGlyphName !== glyphName) { |
| 16341 |
glyphId = glyphNames.indexOf(standardGlyphName); |
| 16342 |
} |
| 16343 |
} |
| 16344 |
charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0; |
| 16345 |
} |
| 16346 |
} |
| 16347 |
return charCodeToGlyphId; |
| 16348 |
} |
| 16349 |
function normalizeFontName(name) { |
| 16350 |
return name.replaceAll(/[,_]/g, "-").replaceAll(/\s/g, ""); |
| 16351 |
} |
| 16352 |
const getVerticalPresentationForm = getLookupTableFactory(t => { |
| 16353 |
t[0x2013] = 0xfe32; |
| 16354 |
t[0x2014] = 0xfe31; |
| 16355 |
t[0x2025] = 0xfe30; |
| 16356 |
t[0x2026] = 0xfe19; |
| 16357 |
t[0x3001] = 0xfe11; |
| 16358 |
t[0x3002] = 0xfe12; |
| 16359 |
t[0x3008] = 0xfe3f; |
| 16360 |
t[0x3009] = 0xfe40; |
| 16361 |
t[0x300a] = 0xfe3d; |
| 16362 |
t[0x300b] = 0xfe3e; |
| 16363 |
t[0x300c] = 0xfe41; |
| 16364 |
t[0x300d] = 0xfe42; |
| 16365 |
t[0x300e] = 0xfe43; |
| 16366 |
t[0x300f] = 0xfe44; |
| 16367 |
t[0x3010] = 0xfe3b; |
| 16368 |
t[0x3011] = 0xfe3c; |
| 16369 |
t[0x3014] = 0xfe39; |
| 16370 |
t[0x3015] = 0xfe3a; |
| 16371 |
t[0x3016] = 0xfe17; |
| 16372 |
t[0x3017] = 0xfe18; |
| 16373 |
t[0xfe4f] = 0xfe34; |
| 16374 |
t[0xff01] = 0xfe15; |
| 16375 |
t[0xff08] = 0xfe35; |
| 16376 |
t[0xff09] = 0xfe36; |
| 16377 |
t[0xff0c] = 0xfe10; |
| 16378 |
t[0xff1a] = 0xfe13; |
| 16379 |
t[0xff1b] = 0xfe14; |
| 16380 |
t[0xff1f] = 0xfe16; |
| 16381 |
t[0xff3b] = 0xfe47; |
| 16382 |
t[0xff3d] = 0xfe48; |
| 16383 |
t[0xff3f] = 0xfe33; |
| 16384 |
t[0xff5b] = 0xfe37; |
| 16385 |
t[0xff5d] = 0xfe38; |
| 16386 |
}); |
| 16387 |
|
| 16388 |
;// ./src/core/standard_fonts.js |
| 16389 |
|
| 16390 |
|
| 16391 |
const getStdFontMap = getLookupTableFactory(function (t) { |
| 16392 |
t["Times-Roman"] = "Times-Roman"; |
| 16393 |
t.Helvetica = "Helvetica"; |
| 16394 |
t.Courier = "Courier"; |
| 16395 |
t.Symbol = "Symbol"; |
| 16396 |
t["Times-Bold"] = "Times-Bold"; |
| 16397 |
t["Helvetica-Bold"] = "Helvetica-Bold"; |
| 16398 |
t["Courier-Bold"] = "Courier-Bold"; |
| 16399 |
t.ZapfDingbats = "ZapfDingbats"; |
| 16400 |
t["Times-Italic"] = "Times-Italic"; |
| 16401 |
t["Helvetica-Oblique"] = "Helvetica-Oblique"; |
| 16402 |
t["Courier-Oblique"] = "Courier-Oblique"; |
| 16403 |
t["Times-BoldItalic"] = "Times-BoldItalic"; |
| 16404 |
t["Helvetica-BoldOblique"] = "Helvetica-BoldOblique"; |
| 16405 |
t["Courier-BoldOblique"] = "Courier-BoldOblique"; |
| 16406 |
t.ArialNarrow = "Helvetica"; |
| 16407 |
t["ArialNarrow-Bold"] = "Helvetica-Bold"; |
| 16408 |
t["ArialNarrow-BoldItalic"] = "Helvetica-BoldOblique"; |
| 16409 |
t["ArialNarrow-Italic"] = "Helvetica-Oblique"; |
| 16410 |
t.ArialBlack = "Helvetica"; |
| 16411 |
t["ArialBlack-Bold"] = "Helvetica-Bold"; |
| 16412 |
t["ArialBlack-BoldItalic"] = "Helvetica-BoldOblique"; |
| 16413 |
t["ArialBlack-Italic"] = "Helvetica-Oblique"; |
| 16414 |
t["Arial-Black"] = "Helvetica"; |
| 16415 |
t["Arial-Black-Bold"] = "Helvetica-Bold"; |
| 16416 |
t["Arial-Black-BoldItalic"] = "Helvetica-BoldOblique"; |
| 16417 |
t["Arial-Black-Italic"] = "Helvetica-Oblique"; |
| 16418 |
t.Arial = "Helvetica"; |
| 16419 |
t["Arial-Bold"] = "Helvetica-Bold"; |
| 16420 |
t["Arial-BoldItalic"] = "Helvetica-BoldOblique"; |
| 16421 |
t["Arial-Italic"] = "Helvetica-Oblique"; |
| 16422 |
t.ArialMT = "Helvetica"; |
| 16423 |
t["Arial-BoldItalicMT"] = "Helvetica-BoldOblique"; |
| 16424 |
t["Arial-BoldMT"] = "Helvetica-Bold"; |
| 16425 |
t["Arial-ItalicMT"] = "Helvetica-Oblique"; |
| 16426 |
t["Arial-BoldItalicMT-BoldItalic"] = "Helvetica-BoldOblique"; |
| 16427 |
t["Arial-BoldMT-Bold"] = "Helvetica-Bold"; |
| 16428 |
t["Arial-ItalicMT-Italic"] = "Helvetica-Oblique"; |
| 16429 |
t.ArialUnicodeMS = "Helvetica"; |
| 16430 |
t["ArialUnicodeMS-Bold"] = "Helvetica-Bold"; |
| 16431 |
t["ArialUnicodeMS-BoldItalic"] = "Helvetica-BoldOblique"; |
| 16432 |
t["ArialUnicodeMS-Italic"] = "Helvetica-Oblique"; |
| 16433 |
t["Courier-BoldItalic"] = "Courier-BoldOblique"; |
| 16434 |
t["Courier-Italic"] = "Courier-Oblique"; |
| 16435 |
t.CourierNew = "Courier"; |
| 16436 |
t["CourierNew-Bold"] = "Courier-Bold"; |
| 16437 |
t["CourierNew-BoldItalic"] = "Courier-BoldOblique"; |
| 16438 |
t["CourierNew-Italic"] = "Courier-Oblique"; |
| 16439 |
t["CourierNewPS-BoldItalicMT"] = "Courier-BoldOblique"; |
| 16440 |
t["CourierNewPS-BoldMT"] = "Courier-Bold"; |
| 16441 |
t["CourierNewPS-ItalicMT"] = "Courier-Oblique"; |
| 16442 |
t.CourierNewPSMT = "Courier"; |
| 16443 |
t["Helvetica-BoldItalic"] = "Helvetica-BoldOblique"; |
| 16444 |
t["Helvetica-Italic"] = "Helvetica-Oblique"; |
| 16445 |
t["Symbol-Bold"] = "Symbol"; |
| 16446 |
t["Symbol-BoldItalic"] = "Symbol"; |
| 16447 |
t["Symbol-Italic"] = "Symbol"; |
| 16448 |
t.TimesNewRoman = "Times-Roman"; |
| 16449 |
t["TimesNewRoman-Bold"] = "Times-Bold"; |
| 16450 |
t["TimesNewRoman-BoldItalic"] = "Times-BoldItalic"; |
| 16451 |
t["TimesNewRoman-Italic"] = "Times-Italic"; |
| 16452 |
t.TimesNewRomanPS = "Times-Roman"; |
| 16453 |
t["TimesNewRomanPS-Bold"] = "Times-Bold"; |
| 16454 |
t["TimesNewRomanPS-BoldItalic"] = "Times-BoldItalic"; |
| 16455 |
t["TimesNewRomanPS-BoldItalicMT"] = "Times-BoldItalic"; |
| 16456 |
t["TimesNewRomanPS-BoldMT"] = "Times-Bold"; |
| 16457 |
t["TimesNewRomanPS-Italic"] = "Times-Italic"; |
| 16458 |
t["TimesNewRomanPS-ItalicMT"] = "Times-Italic"; |
| 16459 |
t.TimesNewRomanPSMT = "Times-Roman"; |
| 16460 |
t["TimesNewRomanPSMT-Bold"] = "Times-Bold"; |
| 16461 |
t["TimesNewRomanPSMT-BoldItalic"] = "Times-BoldItalic"; |
| 16462 |
t["TimesNewRomanPSMT-Italic"] = "Times-Italic"; |
| 16463 |
}); |
| 16464 |
const getFontNameToFileMap = getLookupTableFactory(function (t) { |
| 16465 |
t.Courier = "FoxitFixed.pfb"; |
| 16466 |
t["Courier-Bold"] = "FoxitFixedBold.pfb"; |
| 16467 |
t["Courier-BoldOblique"] = "FoxitFixedBoldItalic.pfb"; |
| 16468 |
t["Courier-Oblique"] = "FoxitFixedItalic.pfb"; |
| 16469 |
t.Helvetica = "LiberationSans-Regular.ttf"; |
| 16470 |
t["Helvetica-Bold"] = "LiberationSans-Bold.ttf"; |
| 16471 |
t["Helvetica-BoldOblique"] = "LiberationSans-BoldItalic.ttf"; |
| 16472 |
t["Helvetica-Oblique"] = "LiberationSans-Italic.ttf"; |
| 16473 |
t["Times-Roman"] = "FoxitSerif.pfb"; |
| 16474 |
t["Times-Bold"] = "FoxitSerifBold.pfb"; |
| 16475 |
t["Times-BoldItalic"] = "FoxitSerifBoldItalic.pfb"; |
| 16476 |
t["Times-Italic"] = "FoxitSerifItalic.pfb"; |
| 16477 |
t.Symbol = "FoxitSymbol.pfb"; |
| 16478 |
t.ZapfDingbats = "FoxitDingbats.pfb"; |
| 16479 |
t["LiberationSans-Regular"] = "LiberationSans-Regular.ttf"; |
| 16480 |
t["LiberationSans-Bold"] = "LiberationSans-Bold.ttf"; |
| 16481 |
t["LiberationSans-Italic"] = "LiberationSans-Italic.ttf"; |
| 16482 |
t["LiberationSans-BoldItalic"] = "LiberationSans-BoldItalic.ttf"; |
| 16483 |
}); |
| 16484 |
const getNonStdFontMap = getLookupTableFactory(function (t) { |
| 16485 |
t.Calibri = "Helvetica"; |
| 16486 |
t["Calibri-Bold"] = "Helvetica-Bold"; |
| 16487 |
t["Calibri-BoldItalic"] = "Helvetica-BoldOblique"; |
| 16488 |
t["Calibri-Italic"] = "Helvetica-Oblique"; |
| 16489 |
t.CenturyGothic = "Helvetica"; |
| 16490 |
t["CenturyGothic-Bold"] = "Helvetica-Bold"; |
| 16491 |
t["CenturyGothic-BoldItalic"] = "Helvetica-BoldOblique"; |
| 16492 |
t["CenturyGothic-Italic"] = "Helvetica-Oblique"; |
| 16493 |
t.ComicSansMS = "Comic Sans MS"; |
| 16494 |
t["ComicSansMS-Bold"] = "Comic Sans MS-Bold"; |
| 16495 |
t["ComicSansMS-BoldItalic"] = "Comic Sans MS-BoldItalic"; |
| 16496 |
t["ComicSansMS-Italic"] = "Comic Sans MS-Italic"; |
| 16497 |
t.GillSansMT = "Helvetica"; |
| 16498 |
t["GillSansMT-Bold"] = "Helvetica-Bold"; |
| 16499 |
t["GillSansMT-BoldItalic"] = "Helvetica-BoldOblique"; |
| 16500 |
t["GillSansMT-Italic"] = "Helvetica-Oblique"; |
| 16501 |
t.Impact = "Helvetica"; |
| 16502 |
t["ItcSymbol-Bold"] = "Helvetica-Bold"; |
| 16503 |
t["ItcSymbol-BoldItalic"] = "Helvetica-BoldOblique"; |
| 16504 |
t["ItcSymbol-Book"] = "Helvetica"; |
| 16505 |
t["ItcSymbol-BookItalic"] = "Helvetica-Oblique"; |
| 16506 |
t["ItcSymbol-Medium"] = "Helvetica"; |
| 16507 |
t["ItcSymbol-MediumItalic"] = "Helvetica-Oblique"; |
| 16508 |
t.LucidaConsole = "Courier"; |
| 16509 |
t["LucidaConsole-Bold"] = "Courier-Bold"; |
| 16510 |
t["LucidaConsole-BoldItalic"] = "Courier-BoldOblique"; |
| 16511 |
t["LucidaConsole-Italic"] = "Courier-Oblique"; |
| 16512 |
t["LucidaSans-Demi"] = "Helvetica-Bold"; |
| 16513 |
t["MS-Gothic"] = "MS Gothic"; |
| 16514 |
t["MS-Gothic-Bold"] = "MS Gothic-Bold"; |
| 16515 |
t["MS-Gothic-BoldItalic"] = "MS Gothic-BoldItalic"; |
| 16516 |
t["MS-Gothic-Italic"] = "MS Gothic-Italic"; |
| 16517 |
t["MS-Mincho"] = "MS Mincho"; |
| 16518 |
t["MS-Mincho-Bold"] = "MS Mincho-Bold"; |
| 16519 |
t["MS-Mincho-BoldItalic"] = "MS Mincho-BoldItalic"; |
| 16520 |
t["MS-Mincho-Italic"] = "MS Mincho-Italic"; |
| 16521 |
t["MS-PGothic"] = "MS PGothic"; |
| 16522 |
t["MS-PGothic-Bold"] = "MS PGothic-Bold"; |
| 16523 |
t["MS-PGothic-BoldItalic"] = "MS PGothic-BoldItalic"; |
| 16524 |
t["MS-PGothic-Italic"] = "MS PGothic-Italic"; |
| 16525 |
t["MS-PMincho"] = "MS PMincho"; |
| 16526 |
t["MS-PMincho-Bold"] = "MS PMincho-Bold"; |
| 16527 |
t["MS-PMincho-BoldItalic"] = "MS PMincho-BoldItalic"; |
| 16528 |
t["MS-PMincho-Italic"] = "MS PMincho-Italic"; |
| 16529 |
t.NuptialScript = "Times-Italic"; |
| 16530 |
t.SegoeUISymbol = "Helvetica"; |
| 16531 |
}); |
| 16532 |
const getSerifFonts = getLookupTableFactory(function (t) { |
| 16533 |
t["Adobe Jenson"] = true; |
| 16534 |
t["Adobe Text"] = true; |
| 16535 |
t.Albertus = true; |
| 16536 |
t.Aldus = true; |
| 16537 |
t.Alexandria = true; |
| 16538 |
t.Algerian = true; |
| 16539 |
t["American Typewriter"] = true; |
| 16540 |
t.Antiqua = true; |
| 16541 |
t.Apex = true; |
| 16542 |
t.Arno = true; |
| 16543 |
t.Aster = true; |
| 16544 |
t.Aurora = true; |
| 16545 |
t.Baskerville = true; |
| 16546 |
t.Bell = true; |
| 16547 |
t.Bembo = true; |
| 16548 |
t["Bembo Schoolbook"] = true; |
| 16549 |
t.Benguiat = true; |
| 16550 |
t["Berkeley Old Style"] = true; |
| 16551 |
t["Bernhard Modern"] = true; |
| 16552 |
t["Berthold City"] = true; |
| 16553 |
t.Bodoni = true; |
| 16554 |
t["Bauer Bodoni"] = true; |
| 16555 |
t["Book Antiqua"] = true; |
| 16556 |
t.Bookman = true; |
| 16557 |
t["Bordeaux Roman"] = true; |
| 16558 |
t["Californian FB"] = true; |
| 16559 |
t.Calisto = true; |
| 16560 |
t.Calvert = true; |
| 16561 |
t.Capitals = true; |
| 16562 |
t.Cambria = true; |
| 16563 |
t.Cartier = true; |
| 16564 |
t.Caslon = true; |
| 16565 |
t.Catull = true; |
| 16566 |
t.Centaur = true; |
| 16567 |
t["Century Old Style"] = true; |
| 16568 |
t["Century Schoolbook"] = true; |
| 16569 |
t.Chaparral = true; |
| 16570 |
t["Charis SIL"] = true; |
| 16571 |
t.Cheltenham = true; |
| 16572 |
t["Cholla Slab"] = true; |
| 16573 |
t.Clarendon = true; |
| 16574 |
t.Clearface = true; |
| 16575 |
t.Cochin = true; |
| 16576 |
t.Colonna = true; |
| 16577 |
t["Computer Modern"] = true; |
| 16578 |
t["Concrete Roman"] = true; |
| 16579 |
t.Constantia = true; |
| 16580 |
t["Cooper Black"] = true; |
| 16581 |
t.Corona = true; |
| 16582 |
t.Ecotype = true; |
| 16583 |
t.Egyptienne = true; |
| 16584 |
t.Elephant = true; |
| 16585 |
t.Excelsior = true; |
| 16586 |
t.Fairfield = true; |
| 16587 |
t["FF Scala"] = true; |
| 16588 |
t.Folkard = true; |
| 16589 |
t.Footlight = true; |
| 16590 |
t.FreeSerif = true; |
| 16591 |
t["Friz Quadrata"] = true; |
| 16592 |
t.Garamond = true; |
| 16593 |
t.Gentium = true; |
| 16594 |
t.Georgia = true; |
| 16595 |
t.Gloucester = true; |
| 16596 |
t["Goudy Old Style"] = true; |
| 16597 |
t["Goudy Schoolbook"] = true; |
| 16598 |
t["Goudy Pro Font"] = true; |
| 16599 |
t.Granjon = true; |
| 16600 |
t["Guardian Egyptian"] = true; |
| 16601 |
t.Heather = true; |
| 16602 |
t.Hercules = true; |
| 16603 |
t["High Tower Text"] = true; |
| 16604 |
t.Hiroshige = true; |
| 16605 |
t["Hoefler Text"] = true; |
| 16606 |
t["Humana Serif"] = true; |
| 16607 |
t.Imprint = true; |
| 16608 |
t["Ionic No. 5"] = true; |
| 16609 |
t.Janson = true; |
| 16610 |
t.Joanna = true; |
| 16611 |
t.Korinna = true; |
| 16612 |
t.Lexicon = true; |
| 16613 |
t.LiberationSerif = true; |
| 16614 |
t["Liberation Serif"] = true; |
| 16615 |
t["Linux Libertine"] = true; |
| 16616 |
t.Literaturnaya = true; |
| 16617 |
t.Lucida = true; |
| 16618 |
t["Lucida Bright"] = true; |
| 16619 |
t.Melior = true; |
| 16620 |
t.Memphis = true; |
| 16621 |
t.Miller = true; |
| 16622 |
t.Minion = true; |
| 16623 |
t.Modern = true; |
| 16624 |
t["Mona Lisa"] = true; |
| 16625 |
t["Mrs Eaves"] = true; |
| 16626 |
t["MS Serif"] = true; |
| 16627 |
t["Museo Slab"] = true; |
| 16628 |
t["New York"] = true; |
| 16629 |
t["Nimbus Roman"] = true; |
| 16630 |
t["NPS Rawlinson Roadway"] = true; |
| 16631 |
t.NuptialScript = true; |
| 16632 |
t.Palatino = true; |
| 16633 |
t.Perpetua = true; |
| 16634 |
t.Plantin = true; |
| 16635 |
t["Plantin Schoolbook"] = true; |
| 16636 |
t.Playbill = true; |
| 16637 |
t["Poor Richard"] = true; |
| 16638 |
t["Rawlinson Roadway"] = true; |
| 16639 |
t.Renault = true; |
| 16640 |
t.Requiem = true; |
| 16641 |
t.Rockwell = true; |
| 16642 |
t.Roman = true; |
| 16643 |
t["Rotis Serif"] = true; |
| 16644 |
t.Sabon = true; |
| 16645 |
t.Scala = true; |
| 16646 |
t.Seagull = true; |
| 16647 |
t.Sistina = true; |
| 16648 |
t.Souvenir = true; |
| 16649 |
t.STIX = true; |
| 16650 |
t["Stone Informal"] = true; |
| 16651 |
t["Stone Serif"] = true; |
| 16652 |
t.Sylfaen = true; |
| 16653 |
t.Times = true; |
| 16654 |
t.Trajan = true; |
| 16655 |
t["Trinité"] = true; |
| 16656 |
t["Trump Mediaeval"] = true; |
| 16657 |
t.Utopia = true; |
| 16658 |
t["Vale Type"] = true; |
| 16659 |
t["Bitstream Vera"] = true; |
| 16660 |
t["Vera Serif"] = true; |
| 16661 |
t.Versailles = true; |
| 16662 |
t.Wanted = true; |
| 16663 |
t.Weiss = true; |
| 16664 |
t["Wide Latin"] = true; |
| 16665 |
t.Windsor = true; |
| 16666 |
t.XITS = true; |
| 16667 |
}); |
| 16668 |
const getSymbolsFonts = getLookupTableFactory(function (t) { |
| 16669 |
t.Dingbats = true; |
| 16670 |
t.Symbol = true; |
| 16671 |
t.ZapfDingbats = true; |
| 16672 |
t.Wingdings = true; |
| 16673 |
t["Wingdings-Bold"] = true; |
| 16674 |
t["Wingdings-Regular"] = true; |
| 16675 |
}); |
| 16676 |
const getGlyphMapForStandardFonts = getLookupTableFactory(function (t) { |
| 16677 |
t[2] = 10; |
| 16678 |
t[3] = 32; |
| 16679 |
t[4] = 33; |
| 16680 |
t[5] = 34; |
| 16681 |
t[6] = 35; |
| 16682 |
t[7] = 36; |
| 16683 |
t[8] = 37; |
| 16684 |
t[9] = 38; |
| 16685 |
t[10] = 39; |
| 16686 |
t[11] = 40; |
| 16687 |
t[12] = 41; |
| 16688 |
t[13] = 42; |
| 16689 |
t[14] = 43; |
| 16690 |
t[15] = 44; |
| 16691 |
t[16] = 45; |
| 16692 |
t[17] = 46; |
| 16693 |
t[18] = 47; |
| 16694 |
t[19] = 48; |
| 16695 |
t[20] = 49; |
| 16696 |
t[21] = 50; |
| 16697 |
t[22] = 51; |
| 16698 |
t[23] = 52; |
| 16699 |
t[24] = 53; |
| 16700 |
t[25] = 54; |
| 16701 |
t[26] = 55; |
| 16702 |
t[27] = 56; |
| 16703 |
t[28] = 57; |
| 16704 |
t[29] = 58; |
| 16705 |
t[30] = 894; |
| 16706 |
t[31] = 60; |
| 16707 |
t[32] = 61; |
| 16708 |
t[33] = 62; |
| 16709 |
t[34] = 63; |
| 16710 |
t[35] = 64; |
| 16711 |
t[36] = 65; |
| 16712 |
t[37] = 66; |
| 16713 |
t[38] = 67; |
| 16714 |
t[39] = 68; |
| 16715 |
t[40] = 69; |
| 16716 |
t[41] = 70; |
| 16717 |
t[42] = 71; |
| 16718 |
t[43] = 72; |
| 16719 |
t[44] = 73; |
| 16720 |
t[45] = 74; |
| 16721 |
t[46] = 75; |
| 16722 |
t[47] = 76; |
| 16723 |
t[48] = 77; |
| 16724 |
t[49] = 78; |
| 16725 |
t[50] = 79; |
| 16726 |
t[51] = 80; |
| 16727 |
t[52] = 81; |
| 16728 |
t[53] = 82; |
| 16729 |
t[54] = 83; |
| 16730 |
t[55] = 84; |
| 16731 |
t[56] = 85; |
| 16732 |
t[57] = 86; |
| 16733 |
t[58] = 87; |
| 16734 |
t[59] = 88; |
| 16735 |
t[60] = 89; |
| 16736 |
t[61] = 90; |
| 16737 |
t[62] = 91; |
| 16738 |
t[63] = 92; |
| 16739 |
t[64] = 93; |
| 16740 |
t[65] = 94; |
| 16741 |
t[66] = 95; |
| 16742 |
t[67] = 96; |
| 16743 |
t[68] = 97; |
| 16744 |
t[69] = 98; |
| 16745 |
t[70] = 99; |
| 16746 |
t[71] = 100; |
| 16747 |
t[72] = 101; |
| 16748 |
t[73] = 102; |
| 16749 |
t[74] = 103; |
| 16750 |
t[75] = 104; |
| 16751 |
t[76] = 105; |
| 16752 |
t[77] = 106; |
| 16753 |
t[78] = 107; |
| 16754 |
t[79] = 108; |
| 16755 |
t[80] = 109; |
| 16756 |
t[81] = 110; |
| 16757 |
t[82] = 111; |
| 16758 |
t[83] = 112; |
| 16759 |
t[84] = 113; |
| 16760 |
t[85] = 114; |
| 16761 |
t[86] = 115; |
| 16762 |
t[87] = 116; |
| 16763 |
t[88] = 117; |
| 16764 |
t[89] = 118; |
| 16765 |
t[90] = 119; |
| 16766 |
t[91] = 120; |
| 16767 |
t[92] = 121; |
| 16768 |
t[93] = 122; |
| 16769 |
t[94] = 123; |
| 16770 |
t[95] = 124; |
| 16771 |
t[96] = 125; |
| 16772 |
t[97] = 126; |
| 16773 |
t[98] = 196; |
| 16774 |
t[99] = 197; |
| 16775 |
t[100] = 199; |
| 16776 |
t[101] = 201; |
| 16777 |
t[102] = 209; |
| 16778 |
t[103] = 214; |
| 16779 |
t[104] = 220; |
| 16780 |
t[105] = 225; |
| 16781 |
t[106] = 224; |
| 16782 |
t[107] = 226; |
| 16783 |
t[108] = 228; |
| 16784 |
t[109] = 227; |
| 16785 |
t[110] = 229; |
| 16786 |
t[111] = 231; |
| 16787 |
t[112] = 233; |
| 16788 |
t[113] = 232; |
| 16789 |
t[114] = 234; |
| 16790 |
t[115] = 235; |
| 16791 |
t[116] = 237; |
| 16792 |
t[117] = 236; |
| 16793 |
t[118] = 238; |
| 16794 |
t[119] = 239; |
| 16795 |
t[120] = 241; |
| 16796 |
t[121] = 243; |
| 16797 |
t[122] = 242; |
| 16798 |
t[123] = 244; |
| 16799 |
t[124] = 246; |
| 16800 |
t[125] = 245; |
| 16801 |
t[126] = 250; |
| 16802 |
t[127] = 249; |
| 16803 |
t[128] = 251; |
| 16804 |
t[129] = 252; |
| 16805 |
t[130] = 8224; |
| 16806 |
t[131] = 176; |
| 16807 |
t[132] = 162; |
| 16808 |
t[133] = 163; |
| 16809 |
t[134] = 167; |
| 16810 |
t[135] = 8226; |
| 16811 |
t[136] = 182; |
| 16812 |
t[137] = 223; |
| 16813 |
t[138] = 174; |
| 16814 |
t[139] = 169; |
| 16815 |
t[140] = 8482; |
| 16816 |
t[141] = 180; |
| 16817 |
t[142] = 168; |
| 16818 |
t[143] = 8800; |
| 16819 |
t[144] = 198; |
| 16820 |
t[145] = 216; |
| 16821 |
t[146] = 8734; |
| 16822 |
t[147] = 177; |
| 16823 |
t[148] = 8804; |
| 16824 |
t[149] = 8805; |
| 16825 |
t[150] = 165; |
| 16826 |
t[151] = 181; |
| 16827 |
t[152] = 8706; |
| 16828 |
t[153] = 8721; |
| 16829 |
t[154] = 8719; |
| 16830 |
t[156] = 8747; |
| 16831 |
t[157] = 170; |
| 16832 |
t[158] = 186; |
| 16833 |
t[159] = 8486; |
| 16834 |
t[160] = 230; |
| 16835 |
t[161] = 248; |
| 16836 |
t[162] = 191; |
| 16837 |
t[163] = 161; |
| 16838 |
t[164] = 172; |
| 16839 |
t[165] = 8730; |
| 16840 |
t[166] = 402; |
| 16841 |
t[167] = 8776; |
| 16842 |
t[168] = 8710; |
| 16843 |
t[169] = 171; |
| 16844 |
t[170] = 187; |
| 16845 |
t[171] = 8230; |
| 16846 |
t[179] = 8220; |
| 16847 |
t[180] = 8221; |
| 16848 |
t[181] = 8216; |
| 16849 |
t[182] = 8217; |
| 16850 |
t[200] = 193; |
| 16851 |
t[203] = 205; |
| 16852 |
t[207] = 211; |
| 16853 |
t[210] = 218; |
| 16854 |
t[223] = 711; |
| 16855 |
t[224] = 321; |
| 16856 |
t[225] = 322; |
| 16857 |
t[226] = 352; |
| 16858 |
t[227] = 353; |
| 16859 |
t[228] = 381; |
| 16860 |
t[229] = 382; |
| 16861 |
t[233] = 221; |
| 16862 |
t[234] = 253; |
| 16863 |
t[252] = 263; |
| 16864 |
t[253] = 268; |
| 16865 |
t[254] = 269; |
| 16866 |
t[258] = 258; |
| 16867 |
t[260] = 260; |
| 16868 |
t[261] = 261; |
| 16869 |
t[265] = 280; |
| 16870 |
t[266] = 281; |
| 16871 |
t[267] = 282; |
| 16872 |
t[268] = 283; |
| 16873 |
t[269] = 313; |
| 16874 |
t[275] = 323; |
| 16875 |
t[276] = 324; |
| 16876 |
t[278] = 328; |
| 16877 |
t[283] = 344; |
| 16878 |
t[284] = 345; |
| 16879 |
t[285] = 346; |
| 16880 |
t[286] = 347; |
| 16881 |
t[292] = 367; |
| 16882 |
t[295] = 377; |
| 16883 |
t[296] = 378; |
| 16884 |
t[298] = 380; |
| 16885 |
t[305] = 963; |
| 16886 |
t[306] = 964; |
| 16887 |
t[307] = 966; |
| 16888 |
t[308] = 8215; |
| 16889 |
t[309] = 8252; |
| 16890 |
t[310] = 8319; |
| 16891 |
t[311] = 8359; |
| 16892 |
t[312] = 8592; |
| 16893 |
t[313] = 8593; |
| 16894 |
t[337] = 9552; |
| 16895 |
t[493] = 1039; |
| 16896 |
t[494] = 1040; |
| 16897 |
t[672] = 1488; |
| 16898 |
t[673] = 1489; |
| 16899 |
t[674] = 1490; |
| 16900 |
t[675] = 1491; |
| 16901 |
t[676] = 1492; |
| 16902 |
t[677] = 1493; |
| 16903 |
t[678] = 1494; |
| 16904 |
t[679] = 1495; |
| 16905 |
t[680] = 1496; |
| 16906 |
t[681] = 1497; |
| 16907 |
t[682] = 1498; |
| 16908 |
t[683] = 1499; |
| 16909 |
t[684] = 1500; |
| 16910 |
t[685] = 1501; |
| 16911 |
t[686] = 1502; |
| 16912 |
t[687] = 1503; |
| 16913 |
t[688] = 1504; |
| 16914 |
t[689] = 1505; |
| 16915 |
t[690] = 1506; |
| 16916 |
t[691] = 1507; |
| 16917 |
t[692] = 1508; |
| 16918 |
t[693] = 1509; |
| 16919 |
t[694] = 1510; |
| 16920 |
t[695] = 1511; |
| 16921 |
t[696] = 1512; |
| 16922 |
t[697] = 1513; |
| 16923 |
t[698] = 1514; |
| 16924 |
t[705] = 1524; |
| 16925 |
t[706] = 8362; |
| 16926 |
t[710] = 64288; |
| 16927 |
t[711] = 64298; |
| 16928 |
t[759] = 1617; |
| 16929 |
t[761] = 1776; |
| 16930 |
t[763] = 1778; |
| 16931 |
t[775] = 1652; |
| 16932 |
t[777] = 1764; |
| 16933 |
t[778] = 1780; |
| 16934 |
t[779] = 1781; |
| 16935 |
t[780] = 1782; |
| 16936 |
t[782] = 771; |
| 16937 |
t[783] = 64726; |
| 16938 |
t[786] = 8363; |
| 16939 |
t[788] = 8532; |
| 16940 |
t[790] = 768; |
| 16941 |
t[791] = 769; |
| 16942 |
t[792] = 768; |
| 16943 |
t[795] = 803; |
| 16944 |
t[797] = 64336; |
| 16945 |
t[798] = 64337; |
| 16946 |
t[799] = 64342; |
| 16947 |
t[800] = 64343; |
| 16948 |
t[801] = 64344; |
| 16949 |
t[802] = 64345; |
| 16950 |
t[803] = 64362; |
| 16951 |
t[804] = 64363; |
| 16952 |
t[805] = 64364; |
| 16953 |
t[2424] = 7821; |
| 16954 |
t[2425] = 7822; |
| 16955 |
t[2426] = 7823; |
| 16956 |
t[2427] = 7824; |
| 16957 |
t[2428] = 7825; |
| 16958 |
t[2429] = 7826; |
| 16959 |
t[2430] = 7827; |
| 16960 |
t[2433] = 7682; |
| 16961 |
t[2678] = 8045; |
| 16962 |
t[2679] = 8046; |
| 16963 |
t[2830] = 1552; |
| 16964 |
t[2838] = 686; |
| 16965 |
t[2840] = 751; |
| 16966 |
t[2842] = 753; |
| 16967 |
t[2843] = 754; |
| 16968 |
t[2844] = 755; |
| 16969 |
t[2846] = 757; |
| 16970 |
t[2856] = 767; |
| 16971 |
t[2857] = 848; |
| 16972 |
t[2858] = 849; |
| 16973 |
t[2862] = 853; |
| 16974 |
t[2863] = 854; |
| 16975 |
t[2864] = 855; |
| 16976 |
t[2865] = 861; |
| 16977 |
t[2866] = 862; |
| 16978 |
t[2906] = 7460; |
| 16979 |
t[2908] = 7462; |
| 16980 |
t[2909] = 7463; |
| 16981 |
t[2910] = 7464; |
| 16982 |
t[2912] = 7466; |
| 16983 |
t[2913] = 7467; |
| 16984 |
t[2914] = 7468; |
| 16985 |
t[2916] = 7470; |
| 16986 |
t[2917] = 7471; |
| 16987 |
t[2918] = 7472; |
| 16988 |
t[2920] = 7474; |
| 16989 |
t[2921] = 7475; |
| 16990 |
t[2922] = 7476; |
| 16991 |
t[2924] = 7478; |
| 16992 |
t[2925] = 7479; |
| 16993 |
t[2926] = 7480; |
| 16994 |
t[2928] = 7482; |
| 16995 |
t[2929] = 7483; |
| 16996 |
t[2930] = 7484; |
| 16997 |
t[2932] = 7486; |
| 16998 |
t[2933] = 7487; |
| 16999 |
t[2934] = 7488; |
| 17000 |
t[2936] = 7490; |
| 17001 |
t[2937] = 7491; |
| 17002 |
t[2938] = 7492; |
| 17003 |
t[2940] = 7494; |
| 17004 |
t[2941] = 7495; |
| 17005 |
t[2942] = 7496; |
| 17006 |
t[2944] = 7498; |
| 17007 |
t[2946] = 7500; |
| 17008 |
t[2948] = 7502; |
| 17009 |
t[2950] = 7504; |
| 17010 |
t[2951] = 7505; |
| 17011 |
t[2952] = 7506; |
| 17012 |
t[2954] = 7508; |
| 17013 |
t[2955] = 7509; |
| 17014 |
t[2956] = 7510; |
| 17015 |
t[2958] = 7512; |
| 17016 |
t[2959] = 7513; |
| 17017 |
t[2960] = 7514; |
| 17018 |
t[2962] = 7516; |
| 17019 |
t[2963] = 7517; |
| 17020 |
t[2964] = 7518; |
| 17021 |
t[2966] = 7520; |
| 17022 |
t[2967] = 7521; |
| 17023 |
t[2968] = 7522; |
| 17024 |
t[2970] = 7524; |
| 17025 |
t[2971] = 7525; |
| 17026 |
t[2972] = 7526; |
| 17027 |
t[2974] = 7528; |
| 17028 |
t[2975] = 7529; |
| 17029 |
t[2976] = 7530; |
| 17030 |
t[2978] = 1537; |
| 17031 |
t[2979] = 1538; |
| 17032 |
t[2980] = 1539; |
| 17033 |
t[2982] = 1549; |
| 17034 |
t[2983] = 1551; |
| 17035 |
t[2984] = 1552; |
| 17036 |
t[2986] = 1554; |
| 17037 |
t[2987] = 1555; |
| 17038 |
t[2988] = 1556; |
| 17039 |
t[2990] = 1623; |
| 17040 |
t[2991] = 1624; |
| 17041 |
t[2995] = 1775; |
| 17042 |
t[2999] = 1791; |
| 17043 |
t[3002] = 64290; |
| 17044 |
t[3003] = 64291; |
| 17045 |
t[3004] = 64292; |
| 17046 |
t[3006] = 64294; |
| 17047 |
t[3007] = 64295; |
| 17048 |
t[3008] = 64296; |
| 17049 |
t[3011] = 1900; |
| 17050 |
t[3014] = 8223; |
| 17051 |
t[3015] = 8244; |
| 17052 |
t[3017] = 7532; |
| 17053 |
t[3018] = 7533; |
| 17054 |
t[3019] = 7534; |
| 17055 |
t[3075] = 7590; |
| 17056 |
t[3076] = 7591; |
| 17057 |
t[3079] = 7594; |
| 17058 |
t[3080] = 7595; |
| 17059 |
t[3083] = 7598; |
| 17060 |
t[3084] = 7599; |
| 17061 |
t[3087] = 7602; |
| 17062 |
t[3088] = 7603; |
| 17063 |
t[3091] = 7606; |
| 17064 |
t[3092] = 7607; |
| 17065 |
t[3095] = 7610; |
| 17066 |
t[3096] = 7611; |
| 17067 |
t[3099] = 7614; |
| 17068 |
t[3100] = 7615; |
| 17069 |
t[3103] = 7618; |
| 17070 |
t[3104] = 7619; |
| 17071 |
t[3107] = 8337; |
| 17072 |
t[3108] = 8338; |
| 17073 |
t[3116] = 1884; |
| 17074 |
t[3119] = 1885; |
| 17075 |
t[3120] = 1885; |
| 17076 |
t[3123] = 1886; |
| 17077 |
t[3124] = 1886; |
| 17078 |
t[3127] = 1887; |
| 17079 |
t[3128] = 1887; |
| 17080 |
t[3131] = 1888; |
| 17081 |
t[3132] = 1888; |
| 17082 |
t[3135] = 1889; |
| 17083 |
t[3136] = 1889; |
| 17084 |
t[3139] = 1890; |
| 17085 |
t[3140] = 1890; |
| 17086 |
t[3143] = 1891; |
| 17087 |
t[3144] = 1891; |
| 17088 |
t[3147] = 1892; |
| 17089 |
t[3148] = 1892; |
| 17090 |
t[3153] = 580; |
| 17091 |
t[3154] = 581; |
| 17092 |
t[3157] = 584; |
| 17093 |
t[3158] = 585; |
| 17094 |
t[3161] = 588; |
| 17095 |
t[3162] = 589; |
| 17096 |
t[3165] = 891; |
| 17097 |
t[3166] = 892; |
| 17098 |
t[3169] = 1274; |
| 17099 |
t[3170] = 1275; |
| 17100 |
t[3173] = 1278; |
| 17101 |
t[3174] = 1279; |
| 17102 |
t[3181] = 7622; |
| 17103 |
t[3182] = 7623; |
| 17104 |
t[3282] = 11799; |
| 17105 |
t[3316] = 578; |
| 17106 |
t[3379] = 42785; |
| 17107 |
t[3393] = 1159; |
| 17108 |
t[3416] = 8377; |
| 17109 |
}); |
| 17110 |
const getSupplementalGlyphMapForArialBlack = getLookupTableFactory(function (t) { |
| 17111 |
t[227] = 322; |
| 17112 |
t[264] = 261; |
| 17113 |
t[291] = 346; |
| 17114 |
}); |
| 17115 |
const getSupplementalGlyphMapForCalibri = getLookupTableFactory(function (t) { |
| 17116 |
t[1] = 32; |
| 17117 |
t[4] = 65; |
| 17118 |
t[5] = 192; |
| 17119 |
t[6] = 193; |
| 17120 |
t[9] = 196; |
| 17121 |
t[17] = 66; |
| 17122 |
t[18] = 67; |
| 17123 |
t[21] = 268; |
| 17124 |
t[24] = 68; |
| 17125 |
t[28] = 69; |
| 17126 |
t[29] = 200; |
| 17127 |
t[30] = 201; |
| 17128 |
t[32] = 282; |
| 17129 |
t[38] = 70; |
| 17130 |
t[39] = 71; |
| 17131 |
t[44] = 72; |
| 17132 |
t[47] = 73; |
| 17133 |
t[48] = 204; |
| 17134 |
t[49] = 205; |
| 17135 |
t[58] = 74; |
| 17136 |
t[60] = 75; |
| 17137 |
t[62] = 76; |
| 17138 |
t[68] = 77; |
| 17139 |
t[69] = 78; |
| 17140 |
t[75] = 79; |
| 17141 |
t[76] = 210; |
| 17142 |
t[80] = 214; |
| 17143 |
t[87] = 80; |
| 17144 |
t[89] = 81; |
| 17145 |
t[90] = 82; |
| 17146 |
t[92] = 344; |
| 17147 |
t[94] = 83; |
| 17148 |
t[97] = 352; |
| 17149 |
t[100] = 84; |
| 17150 |
t[104] = 85; |
| 17151 |
t[109] = 220; |
| 17152 |
t[115] = 86; |
| 17153 |
t[116] = 87; |
| 17154 |
t[121] = 88; |
| 17155 |
t[122] = 89; |
| 17156 |
t[124] = 221; |
| 17157 |
t[127] = 90; |
| 17158 |
t[129] = 381; |
| 17159 |
t[258] = 97; |
| 17160 |
t[259] = 224; |
| 17161 |
t[260] = 225; |
| 17162 |
t[263] = 228; |
| 17163 |
t[268] = 261; |
| 17164 |
t[271] = 98; |
| 17165 |
t[272] = 99; |
| 17166 |
t[273] = 263; |
| 17167 |
t[275] = 269; |
| 17168 |
t[282] = 100; |
| 17169 |
t[286] = 101; |
| 17170 |
t[287] = 232; |
| 17171 |
t[288] = 233; |
| 17172 |
t[290] = 283; |
| 17173 |
t[295] = 281; |
| 17174 |
t[296] = 102; |
| 17175 |
t[336] = 103; |
| 17176 |
t[346] = 104; |
| 17177 |
t[349] = 105; |
| 17178 |
t[350] = 236; |
| 17179 |
t[351] = 237; |
| 17180 |
t[361] = 106; |
| 17181 |
t[364] = 107; |
| 17182 |
t[367] = 108; |
| 17183 |
t[371] = 322; |
| 17184 |
t[373] = 109; |
| 17185 |
t[374] = 110; |
| 17186 |
t[381] = 111; |
| 17187 |
t[382] = 242; |
| 17188 |
t[383] = 243; |
| 17189 |
t[386] = 246; |
| 17190 |
t[393] = 112; |
| 17191 |
t[395] = 113; |
| 17192 |
t[396] = 114; |
| 17193 |
t[398] = 345; |
| 17194 |
t[400] = 115; |
| 17195 |
t[401] = 347; |
| 17196 |
t[403] = 353; |
| 17197 |
t[410] = 116; |
| 17198 |
t[437] = 117; |
| 17199 |
t[442] = 252; |
| 17200 |
t[448] = 118; |
| 17201 |
t[449] = 119; |
| 17202 |
t[454] = 120; |
| 17203 |
t[455] = 121; |
| 17204 |
t[457] = 253; |
| 17205 |
t[460] = 122; |
| 17206 |
t[462] = 382; |
| 17207 |
t[463] = 380; |
| 17208 |
t[853] = 44; |
| 17209 |
t[855] = 58; |
| 17210 |
t[856] = 46; |
| 17211 |
t[876] = 47; |
| 17212 |
t[878] = 45; |
| 17213 |
t[882] = 45; |
| 17214 |
t[894] = 40; |
| 17215 |
t[895] = 41; |
| 17216 |
t[896] = 91; |
| 17217 |
t[897] = 93; |
| 17218 |
t[923] = 64; |
| 17219 |
t[1004] = 48; |
| 17220 |
t[1005] = 49; |
| 17221 |
t[1006] = 50; |
| 17222 |
t[1007] = 51; |
| 17223 |
t[1008] = 52; |
| 17224 |
t[1009] = 53; |
| 17225 |
t[1010] = 54; |
| 17226 |
t[1011] = 55; |
| 17227 |
t[1012] = 56; |
| 17228 |
t[1013] = 57; |
| 17229 |
t[1081] = 37; |
| 17230 |
t[1085] = 43; |
| 17231 |
t[1086] = 45; |
| 17232 |
}); |
| 17233 |
function getStandardFontName(name) { |
| 17234 |
const fontName = normalizeFontName(name); |
| 17235 |
const stdFontMap = getStdFontMap(); |
| 17236 |
return stdFontMap[fontName]; |
| 17237 |
} |
| 17238 |
function isKnownFontName(name) { |
| 17239 |
const fontName = normalizeFontName(name); |
| 17240 |
return !!(getStdFontMap()[fontName] || getNonStdFontMap()[fontName] || getSerifFonts()[fontName] || getSymbolsFonts()[fontName]); |
| 17241 |
} |
| 17242 |
|
| 17243 |
;// ./src/core/to_unicode_map.js |
| 17244 |
|
| 17245 |
class ToUnicodeMap { |
| 17246 |
constructor(cmap = []) { |
| 17247 |
this._map = cmap; |
| 17248 |
} |
| 17249 |
get length() { |
| 17250 |
return this._map.length; |
| 17251 |
} |
| 17252 |
forEach(callback) { |
| 17253 |
for (const charCode in this._map) { |
| 17254 |
callback(charCode, this._map[charCode].charCodeAt(0)); |
| 17255 |
} |
| 17256 |
} |
| 17257 |
has(i) { |
| 17258 |
return this._map[i] !== undefined; |
| 17259 |
} |
| 17260 |
get(i) { |
| 17261 |
return this._map[i]; |
| 17262 |
} |
| 17263 |
charCodeOf(value) { |
| 17264 |
const map = this._map; |
| 17265 |
if (map.length <= 0x10000) { |
| 17266 |
return map.indexOf(value); |
| 17267 |
} |
| 17268 |
for (const charCode in map) { |
| 17269 |
if (map[charCode] === value) { |
| 17270 |
return charCode | 0; |
| 17271 |
} |
| 17272 |
} |
| 17273 |
return -1; |
| 17274 |
} |
| 17275 |
amend(map) { |
| 17276 |
for (const charCode in map) { |
| 17277 |
this._map[charCode] = map[charCode]; |
| 17278 |
} |
| 17279 |
} |
| 17280 |
} |
| 17281 |
class IdentityToUnicodeMap { |
| 17282 |
constructor(firstChar, lastChar) { |
| 17283 |
this.firstChar = firstChar; |
| 17284 |
this.lastChar = lastChar; |
| 17285 |
} |
| 17286 |
get length() { |
| 17287 |
return this.lastChar + 1 - this.firstChar; |
| 17288 |
} |
| 17289 |
forEach(callback) { |
| 17290 |
for (let i = this.firstChar, ii = this.lastChar; i <= ii; i++) { |
| 17291 |
callback(i, i); |
| 17292 |
} |
| 17293 |
} |
| 17294 |
has(i) { |
| 17295 |
return this.firstChar <= i && i <= this.lastChar; |
| 17296 |
} |
| 17297 |
get(i) { |
| 17298 |
if (this.firstChar <= i && i <= this.lastChar) { |
| 17299 |
return String.fromCharCode(i); |
| 17300 |
} |
| 17301 |
return undefined; |
| 17302 |
} |
| 17303 |
charCodeOf(v) { |
| 17304 |
return Number.isInteger(v) && v >= this.firstChar && v <= this.lastChar ? v : -1; |
| 17305 |
} |
| 17306 |
amend(map) { |
| 17307 |
unreachable("Should not call amend()"); |
| 17308 |
} |
| 17309 |
} |
| 17310 |
|
| 17311 |
;// ./src/core/cff_font.js |
| 17312 |
|
| 17313 |
|
| 17314 |
|
| 17315 |
class CFFFont { |
| 17316 |
constructor(file, properties) { |
| 17317 |
this.properties = properties; |
| 17318 |
const parser = new CFFParser(file, properties, SEAC_ANALYSIS_ENABLED); |
| 17319 |
this.cff = parser.parse(); |
| 17320 |
this.cff.duplicateFirstGlyph(); |
| 17321 |
const compiler = new CFFCompiler(this.cff); |
| 17322 |
this.seacs = this.cff.seacs; |
| 17323 |
try { |
| 17324 |
this.data = compiler.compile(); |
| 17325 |
} catch { |
| 17326 |
warn("Failed to compile font " + properties.loadedName); |
| 17327 |
this.data = file; |
| 17328 |
} |
| 17329 |
this._createBuiltInEncoding(); |
| 17330 |
} |
| 17331 |
get numGlyphs() { |
| 17332 |
return this.cff.charStrings.count; |
| 17333 |
} |
| 17334 |
getCharset() { |
| 17335 |
return this.cff.charset.charset; |
| 17336 |
} |
| 17337 |
getGlyphMapping() { |
| 17338 |
const cff = this.cff; |
| 17339 |
const properties = this.properties; |
| 17340 |
const { |
| 17341 |
cidToGidMap, |
| 17342 |
cMap |
| 17343 |
} = properties; |
| 17344 |
const charsets = cff.charset.charset; |
| 17345 |
let charCodeToGlyphId; |
| 17346 |
let glyphId; |
| 17347 |
if (properties.composite) { |
| 17348 |
let invCidToGidMap; |
| 17349 |
if (cidToGidMap?.length > 0) { |
| 17350 |
invCidToGidMap = Object.create(null); |
| 17351 |
for (let i = 0, ii = cidToGidMap.length; i < ii; i++) { |
| 17352 |
const gid = cidToGidMap[i]; |
| 17353 |
if (gid !== undefined) { |
| 17354 |
invCidToGidMap[gid] = i; |
| 17355 |
} |
| 17356 |
} |
| 17357 |
} |
| 17358 |
charCodeToGlyphId = Object.create(null); |
| 17359 |
let charCode; |
| 17360 |
if (cff.isCIDFont) { |
| 17361 |
for (glyphId = 0; glyphId < charsets.length; glyphId++) { |
| 17362 |
const cid = charsets[glyphId]; |
| 17363 |
charCode = cMap.charCodeOf(cid); |
| 17364 |
if (invCidToGidMap?.[charCode] !== undefined) { |
| 17365 |
charCode = invCidToGidMap[charCode]; |
| 17366 |
} |
| 17367 |
charCodeToGlyphId[charCode] = glyphId; |
| 17368 |
} |
| 17369 |
} else { |
| 17370 |
for (glyphId = 0; glyphId < cff.charStrings.count; glyphId++) { |
| 17371 |
charCode = cMap.charCodeOf(glyphId); |
| 17372 |
charCodeToGlyphId[charCode] = glyphId; |
| 17373 |
} |
| 17374 |
} |
| 17375 |
return charCodeToGlyphId; |
| 17376 |
} |
| 17377 |
let encoding = cff.encoding ? cff.encoding.encoding : null; |
| 17378 |
if (properties.isInternalFont) { |
| 17379 |
encoding = properties.defaultEncoding; |
| 17380 |
} |
| 17381 |
charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets); |
| 17382 |
return charCodeToGlyphId; |
| 17383 |
} |
| 17384 |
hasGlyphId(id) { |
| 17385 |
return this.cff.hasGlyphId(id); |
| 17386 |
} |
| 17387 |
_createBuiltInEncoding() { |
| 17388 |
const { |
| 17389 |
charset, |
| 17390 |
encoding |
| 17391 |
} = this.cff; |
| 17392 |
if (!charset || !encoding) { |
| 17393 |
return; |
| 17394 |
} |
| 17395 |
const charsets = charset.charset, |
| 17396 |
encodings = encoding.encoding; |
| 17397 |
const map = []; |
| 17398 |
for (const charCode in encodings) { |
| 17399 |
const glyphId = encodings[charCode]; |
| 17400 |
if (glyphId >= 0) { |
| 17401 |
const glyphName = charsets[glyphId]; |
| 17402 |
if (glyphName) { |
| 17403 |
map[charCode] = glyphName; |
| 17404 |
} |
| 17405 |
} |
| 17406 |
} |
| 17407 |
if (map.length > 0) { |
| 17408 |
this.properties.builtInEncoding = map; |
| 17409 |
} |
| 17410 |
} |
| 17411 |
} |
| 17412 |
|
| 17413 |
;// ./src/core/font_renderer.js |
| 17414 |
|
| 17415 |
|
| 17416 |
|
| 17417 |
|
| 17418 |
|
| 17419 |
|
| 17420 |
function getUint32(data, offset) { |
| 17421 |
return (data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]) >>> 0; |
| 17422 |
} |
| 17423 |
function getUint16(data, offset) { |
| 17424 |
return data[offset] << 8 | data[offset + 1]; |
| 17425 |
} |
| 17426 |
function getInt16(data, offset) { |
| 17427 |
return (data[offset] << 24 | data[offset + 1] << 16) >> 16; |
| 17428 |
} |
| 17429 |
function getInt8(data, offset) { |
| 17430 |
return data[offset] << 24 >> 24; |
| 17431 |
} |
| 17432 |
function getFloat214(data, offset) { |
| 17433 |
return getInt16(data, offset) / 16384; |
| 17434 |
} |
| 17435 |
function getSubroutineBias(subrs) { |
| 17436 |
const numSubrs = subrs.length; |
| 17437 |
let bias = 32768; |
| 17438 |
if (numSubrs < 1240) { |
| 17439 |
bias = 107; |
| 17440 |
} else if (numSubrs < 33900) { |
| 17441 |
bias = 1131; |
| 17442 |
} |
| 17443 |
return bias; |
| 17444 |
} |
| 17445 |
function parseCmap(data, start, end) { |
| 17446 |
const offset = getUint16(data, start + 2) === 1 ? getUint32(data, start + 8) : getUint32(data, start + 16); |
| 17447 |
const format = getUint16(data, start + offset); |
| 17448 |
let ranges, p, i; |
| 17449 |
if (format === 4) { |
| 17450 |
getUint16(data, start + offset + 2); |
| 17451 |
const segCount = getUint16(data, start + offset + 6) >> 1; |
| 17452 |
p = start + offset + 14; |
| 17453 |
ranges = []; |
| 17454 |
for (i = 0; i < segCount; i++, p += 2) { |
| 17455 |
ranges[i] = { |
| 17456 |
end: getUint16(data, p) |
| 17457 |
}; |
| 17458 |
} |
| 17459 |
p += 2; |
| 17460 |
for (i = 0; i < segCount; i++, p += 2) { |
| 17461 |
ranges[i].start = getUint16(data, p); |
| 17462 |
} |
| 17463 |
for (i = 0; i < segCount; i++, p += 2) { |
| 17464 |
ranges[i].idDelta = getUint16(data, p); |
| 17465 |
} |
| 17466 |
for (i = 0; i < segCount; i++, p += 2) { |
| 17467 |
let idOffset = getUint16(data, p); |
| 17468 |
if (idOffset === 0) { |
| 17469 |
continue; |
| 17470 |
} |
| 17471 |
ranges[i].ids = []; |
| 17472 |
for (let j = 0, jj = ranges[i].end - ranges[i].start + 1; j < jj; j++) { |
| 17473 |
ranges[i].ids[j] = getUint16(data, p + idOffset); |
| 17474 |
idOffset += 2; |
| 17475 |
} |
| 17476 |
} |
| 17477 |
return ranges; |
| 17478 |
} else if (format === 12) { |
| 17479 |
const groups = getUint32(data, start + offset + 12); |
| 17480 |
p = start + offset + 16; |
| 17481 |
ranges = []; |
| 17482 |
for (i = 0; i < groups; i++) { |
| 17483 |
start = getUint32(data, p); |
| 17484 |
ranges.push({ |
| 17485 |
start, |
| 17486 |
end: getUint32(data, p + 4), |
| 17487 |
idDelta: getUint32(data, p + 8) - start |
| 17488 |
}); |
| 17489 |
p += 12; |
| 17490 |
} |
| 17491 |
return ranges; |
| 17492 |
} |
| 17493 |
throw new FormatError(`unsupported cmap: ${format}`); |
| 17494 |
} |
| 17495 |
function parseCff(data, start, end, seacAnalysisEnabled) { |
| 17496 |
const properties = {}; |
| 17497 |
const parser = new CFFParser(new Stream(data, start, end - start), properties, seacAnalysisEnabled); |
| 17498 |
const cff = parser.parse(); |
| 17499 |
return { |
| 17500 |
glyphs: cff.charStrings.objects, |
| 17501 |
subrs: cff.topDict.privateDict?.subrsIndex?.objects, |
| 17502 |
gsubrs: cff.globalSubrIndex?.objects, |
| 17503 |
isCFFCIDFont: cff.isCIDFont, |
| 17504 |
fdSelect: cff.fdSelect, |
| 17505 |
fdArray: cff.fdArray |
| 17506 |
}; |
| 17507 |
} |
| 17508 |
function parseGlyfTable(glyf, loca, isGlyphLocationsLong) { |
| 17509 |
let itemSize, itemDecode; |
| 17510 |
if (isGlyphLocationsLong) { |
| 17511 |
itemSize = 4; |
| 17512 |
itemDecode = getUint32; |
| 17513 |
} else { |
| 17514 |
itemSize = 2; |
| 17515 |
itemDecode = (data, offset) => 2 * getUint16(data, offset); |
| 17516 |
} |
| 17517 |
const glyphs = []; |
| 17518 |
let startOffset = itemDecode(loca, 0); |
| 17519 |
for (let j = itemSize; j < loca.length; j += itemSize) { |
| 17520 |
const endOffset = itemDecode(loca, j); |
| 17521 |
glyphs.push(glyf.subarray(startOffset, endOffset)); |
| 17522 |
startOffset = endOffset; |
| 17523 |
} |
| 17524 |
return glyphs; |
| 17525 |
} |
| 17526 |
function lookupCmap(ranges, unicode) { |
| 17527 |
const code = unicode.codePointAt(0); |
| 17528 |
let gid = 0, |
| 17529 |
l = 0, |
| 17530 |
r = ranges.length - 1; |
| 17531 |
while (l < r) { |
| 17532 |
const c = l + r + 1 >> 1; |
| 17533 |
if (code < ranges[c].start) { |
| 17534 |
r = c - 1; |
| 17535 |
} else { |
| 17536 |
l = c; |
| 17537 |
} |
| 17538 |
} |
| 17539 |
if (ranges[l].start <= code && code <= ranges[l].end) { |
| 17540 |
gid = ranges[l].idDelta + (ranges[l].ids ? ranges[l].ids[code - ranges[l].start] : code) & 0xffff; |
| 17541 |
} |
| 17542 |
return { |
| 17543 |
charCode: code, |
| 17544 |
glyphId: gid |
| 17545 |
}; |
| 17546 |
} |
| 17547 |
function compileGlyf(code, cmds, font) { |
| 17548 |
function moveTo(x, y) { |
| 17549 |
cmds.add(FontRenderOps.MOVE_TO, [x, y]); |
| 17550 |
} |
| 17551 |
function lineTo(x, y) { |
| 17552 |
cmds.add(FontRenderOps.LINE_TO, [x, y]); |
| 17553 |
} |
| 17554 |
function quadraticCurveTo(xa, ya, x, y) { |
| 17555 |
cmds.add(FontRenderOps.QUADRATIC_CURVE_TO, [xa, ya, x, y]); |
| 17556 |
} |
| 17557 |
let i = 0; |
| 17558 |
const numberOfContours = getInt16(code, i); |
| 17559 |
let flags; |
| 17560 |
let x = 0, |
| 17561 |
y = 0; |
| 17562 |
i += 10; |
| 17563 |
if (numberOfContours < 0) { |
| 17564 |
do { |
| 17565 |
flags = getUint16(code, i); |
| 17566 |
const glyphIndex = getUint16(code, i + 2); |
| 17567 |
i += 4; |
| 17568 |
let arg1, arg2; |
| 17569 |
if (flags & 0x01) { |
| 17570 |
if (flags & 0x02) { |
| 17571 |
arg1 = getInt16(code, i); |
| 17572 |
arg2 = getInt16(code, i + 2); |
| 17573 |
} else { |
| 17574 |
arg1 = getUint16(code, i); |
| 17575 |
arg2 = getUint16(code, i + 2); |
| 17576 |
} |
| 17577 |
i += 4; |
| 17578 |
} else if (flags & 0x02) { |
| 17579 |
arg1 = getInt8(code, i++); |
| 17580 |
arg2 = getInt8(code, i++); |
| 17581 |
} else { |
| 17582 |
arg1 = code[i++]; |
| 17583 |
arg2 = code[i++]; |
| 17584 |
} |
| 17585 |
if (flags & 0x02) { |
| 17586 |
x = arg1; |
| 17587 |
y = arg2; |
| 17588 |
} else { |
| 17589 |
x = 0; |
| 17590 |
y = 0; |
| 17591 |
} |
| 17592 |
let scaleX = 1, |
| 17593 |
scaleY = 1, |
| 17594 |
scale01 = 0, |
| 17595 |
scale10 = 0; |
| 17596 |
if (flags & 0x08) { |
| 17597 |
scaleX = scaleY = getFloat214(code, i); |
| 17598 |
i += 2; |
| 17599 |
} else if (flags & 0x40) { |
| 17600 |
scaleX = getFloat214(code, i); |
| 17601 |
scaleY = getFloat214(code, i + 2); |
| 17602 |
i += 4; |
| 17603 |
} else if (flags & 0x80) { |
| 17604 |
scaleX = getFloat214(code, i); |
| 17605 |
scale01 = getFloat214(code, i + 2); |
| 17606 |
scale10 = getFloat214(code, i + 4); |
| 17607 |
scaleY = getFloat214(code, i + 6); |
| 17608 |
i += 8; |
| 17609 |
} |
| 17610 |
const subglyph = font.glyphs[glyphIndex]; |
| 17611 |
if (subglyph) { |
| 17612 |
cmds.add(FontRenderOps.SAVE); |
| 17613 |
cmds.add(FontRenderOps.TRANSFORM, [scaleX, scale01, scale10, scaleY, x, y]); |
| 17614 |
if (!(flags & 0x02)) {} |
| 17615 |
compileGlyf(subglyph, cmds, font); |
| 17616 |
cmds.add(FontRenderOps.RESTORE); |
| 17617 |
} |
| 17618 |
} while (flags & 0x20); |
| 17619 |
} else { |
| 17620 |
const endPtsOfContours = []; |
| 17621 |
let j, jj; |
| 17622 |
for (j = 0; j < numberOfContours; j++) { |
| 17623 |
endPtsOfContours.push(getUint16(code, i)); |
| 17624 |
i += 2; |
| 17625 |
} |
| 17626 |
const instructionLength = getUint16(code, i); |
| 17627 |
i += 2 + instructionLength; |
| 17628 |
const numberOfPoints = endPtsOfContours.at(-1) + 1; |
| 17629 |
const points = []; |
| 17630 |
while (points.length < numberOfPoints) { |
| 17631 |
flags = code[i++]; |
| 17632 |
let repeat = 1; |
| 17633 |
if (flags & 0x08) { |
| 17634 |
repeat += code[i++]; |
| 17635 |
} |
| 17636 |
while (repeat-- > 0) { |
| 17637 |
points.push({ |
| 17638 |
flags |
| 17639 |
}); |
| 17640 |
} |
| 17641 |
} |
| 17642 |
for (j = 0; j < numberOfPoints; j++) { |
| 17643 |
switch (points[j].flags & 0x12) { |
| 17644 |
case 0x00: |
| 17645 |
x += getInt16(code, i); |
| 17646 |
i += 2; |
| 17647 |
break; |
| 17648 |
case 0x02: |
| 17649 |
x -= code[i++]; |
| 17650 |
break; |
| 17651 |
case 0x12: |
| 17652 |
x += code[i++]; |
| 17653 |
break; |
| 17654 |
} |
| 17655 |
points[j].x = x; |
| 17656 |
} |
| 17657 |
for (j = 0; j < numberOfPoints; j++) { |
| 17658 |
switch (points[j].flags & 0x24) { |
| 17659 |
case 0x00: |
| 17660 |
y += getInt16(code, i); |
| 17661 |
i += 2; |
| 17662 |
break; |
| 17663 |
case 0x04: |
| 17664 |
y -= code[i++]; |
| 17665 |
break; |
| 17666 |
case 0x24: |
| 17667 |
y += code[i++]; |
| 17668 |
break; |
| 17669 |
} |
| 17670 |
points[j].y = y; |
| 17671 |
} |
| 17672 |
let startPoint = 0; |
| 17673 |
for (i = 0; i < numberOfContours; i++) { |
| 17674 |
const endPoint = endPtsOfContours[i]; |
| 17675 |
const contour = points.slice(startPoint, endPoint + 1); |
| 17676 |
if (contour[0].flags & 1) { |
| 17677 |
contour.push(contour[0]); |
| 17678 |
} else if (contour.at(-1).flags & 1) { |
| 17679 |
contour.unshift(contour.at(-1)); |
| 17680 |
} else { |
| 17681 |
const p = { |
| 17682 |
flags: 1, |
| 17683 |
x: (contour[0].x + contour.at(-1).x) / 2, |
| 17684 |
y: (contour[0].y + contour.at(-1).y) / 2 |
| 17685 |
}; |
| 17686 |
contour.unshift(p); |
| 17687 |
contour.push(p); |
| 17688 |
} |
| 17689 |
moveTo(contour[0].x, contour[0].y); |
| 17690 |
for (j = 1, jj = contour.length; j < jj; j++) { |
| 17691 |
if (contour[j].flags & 1) { |
| 17692 |
lineTo(contour[j].x, contour[j].y); |
| 17693 |
} else if (contour[j + 1].flags & 1) { |
| 17694 |
quadraticCurveTo(contour[j].x, contour[j].y, contour[j + 1].x, contour[j + 1].y); |
| 17695 |
j++; |
| 17696 |
} else { |
| 17697 |
quadraticCurveTo(contour[j].x, contour[j].y, (contour[j].x + contour[j + 1].x) / 2, (contour[j].y + contour[j + 1].y) / 2); |
| 17698 |
} |
| 17699 |
} |
| 17700 |
startPoint = endPoint + 1; |
| 17701 |
} |
| 17702 |
} |
| 17703 |
} |
| 17704 |
function compileCharString(charStringCode, cmds, font, glyphId) { |
| 17705 |
function moveTo(x, y) { |
| 17706 |
cmds.add(FontRenderOps.MOVE_TO, [x, y]); |
| 17707 |
} |
| 17708 |
function lineTo(x, y) { |
| 17709 |
cmds.add(FontRenderOps.LINE_TO, [x, y]); |
| 17710 |
} |
| 17711 |
function bezierCurveTo(x1, y1, x2, y2, x, y) { |
| 17712 |
cmds.add(FontRenderOps.BEZIER_CURVE_TO, [x1, y1, x2, y2, x, y]); |
| 17713 |
} |
| 17714 |
const stack = []; |
| 17715 |
let x = 0, |
| 17716 |
y = 0; |
| 17717 |
let stems = 0; |
| 17718 |
function parse(code) { |
| 17719 |
let i = 0; |
| 17720 |
while (i < code.length) { |
| 17721 |
let stackClean = false; |
| 17722 |
let v = code[i++]; |
| 17723 |
let xa, xb, ya, yb, y1, y2, y3, n, subrCode; |
| 17724 |
switch (v) { |
| 17725 |
case 1: |
| 17726 |
stems += stack.length >> 1; |
| 17727 |
stackClean = true; |
| 17728 |
break; |
| 17729 |
case 3: |
| 17730 |
stems += stack.length >> 1; |
| 17731 |
stackClean = true; |
| 17732 |
break; |
| 17733 |
case 4: |
| 17734 |
y += stack.pop(); |
| 17735 |
moveTo(x, y); |
| 17736 |
stackClean = true; |
| 17737 |
break; |
| 17738 |
case 5: |
| 17739 |
while (stack.length > 0) { |
| 17740 |
x += stack.shift(); |
| 17741 |
y += stack.shift(); |
| 17742 |
lineTo(x, y); |
| 17743 |
} |
| 17744 |
break; |
| 17745 |
case 6: |
| 17746 |
while (stack.length > 0) { |
| 17747 |
x += stack.shift(); |
| 17748 |
lineTo(x, y); |
| 17749 |
if (stack.length === 0) { |
| 17750 |
break; |
| 17751 |
} |
| 17752 |
y += stack.shift(); |
| 17753 |
lineTo(x, y); |
| 17754 |
} |
| 17755 |
break; |
| 17756 |
case 7: |
| 17757 |
while (stack.length > 0) { |
| 17758 |
y += stack.shift(); |
| 17759 |
lineTo(x, y); |
| 17760 |
if (stack.length === 0) { |
| 17761 |
break; |
| 17762 |
} |
| 17763 |
x += stack.shift(); |
| 17764 |
lineTo(x, y); |
| 17765 |
} |
| 17766 |
break; |
| 17767 |
case 8: |
| 17768 |
while (stack.length > 0) { |
| 17769 |
xa = x + stack.shift(); |
| 17770 |
ya = y + stack.shift(); |
| 17771 |
xb = xa + stack.shift(); |
| 17772 |
yb = ya + stack.shift(); |
| 17773 |
x = xb + stack.shift(); |
| 17774 |
y = yb + stack.shift(); |
| 17775 |
bezierCurveTo(xa, ya, xb, yb, x, y); |
| 17776 |
} |
| 17777 |
break; |
| 17778 |
case 10: |
| 17779 |
n = stack.pop(); |
| 17780 |
subrCode = null; |
| 17781 |
if (font.isCFFCIDFont) { |
| 17782 |
const fdIndex = font.fdSelect.getFDIndex(glyphId); |
| 17783 |
if (fdIndex >= 0 && fdIndex < font.fdArray.length) { |
| 17784 |
const fontDict = font.fdArray[fdIndex]; |
| 17785 |
let subrs; |
| 17786 |
if (fontDict.privateDict?.subrsIndex) { |
| 17787 |
subrs = fontDict.privateDict.subrsIndex.objects; |
| 17788 |
} |
| 17789 |
if (subrs) { |
| 17790 |
n += getSubroutineBias(subrs); |
| 17791 |
subrCode = subrs[n]; |
| 17792 |
} |
| 17793 |
} else { |
| 17794 |
warn("Invalid fd index for glyph index."); |
| 17795 |
} |
| 17796 |
} else { |
| 17797 |
subrCode = font.subrs[n + font.subrsBias]; |
| 17798 |
} |
| 17799 |
if (subrCode) { |
| 17800 |
parse(subrCode); |
| 17801 |
} |
| 17802 |
break; |
| 17803 |
case 11: |
| 17804 |
return; |
| 17805 |
case 12: |
| 17806 |
v = code[i++]; |
| 17807 |
switch (v) { |
| 17808 |
case 34: |
| 17809 |
xa = x + stack.shift(); |
| 17810 |
xb = xa + stack.shift(); |
| 17811 |
y1 = y + stack.shift(); |
| 17812 |
x = xb + stack.shift(); |
| 17813 |
bezierCurveTo(xa, y, xb, y1, x, y1); |
| 17814 |
xa = x + stack.shift(); |
| 17815 |
xb = xa + stack.shift(); |
| 17816 |
x = xb + stack.shift(); |
| 17817 |
bezierCurveTo(xa, y1, xb, y, x, y); |
| 17818 |
break; |
| 17819 |
case 35: |
| 17820 |
xa = x + stack.shift(); |
| 17821 |
ya = y + stack.shift(); |
| 17822 |
xb = xa + stack.shift(); |
| 17823 |
yb = ya + stack.shift(); |
| 17824 |
x = xb + stack.shift(); |
| 17825 |
y = yb + stack.shift(); |
| 17826 |
bezierCurveTo(xa, ya, xb, yb, x, y); |
| 17827 |
xa = x + stack.shift(); |
| 17828 |
ya = y + stack.shift(); |
| 17829 |
xb = xa + stack.shift(); |
| 17830 |
yb = ya + stack.shift(); |
| 17831 |
x = xb + stack.shift(); |
| 17832 |
y = yb + stack.shift(); |
| 17833 |
bezierCurveTo(xa, ya, xb, yb, x, y); |
| 17834 |
stack.pop(); |
| 17835 |
break; |
| 17836 |
case 36: |
| 17837 |
xa = x + stack.shift(); |
| 17838 |
y1 = y + stack.shift(); |
| 17839 |
xb = xa + stack.shift(); |
| 17840 |
y2 = y1 + stack.shift(); |
| 17841 |
x = xb + stack.shift(); |
| 17842 |
bezierCurveTo(xa, y1, xb, y2, x, y2); |
| 17843 |
xa = x + stack.shift(); |
| 17844 |
xb = xa + stack.shift(); |
| 17845 |
y3 = y2 + stack.shift(); |
| 17846 |
x = xb + stack.shift(); |
| 17847 |
bezierCurveTo(xa, y2, xb, y3, x, y); |
| 17848 |
break; |
| 17849 |
case 37: |
| 17850 |
const x0 = x, |
| 17851 |
y0 = y; |
| 17852 |
xa = x + stack.shift(); |
| 17853 |
ya = y + stack.shift(); |
| 17854 |
xb = xa + stack.shift(); |
| 17855 |
yb = ya + stack.shift(); |
| 17856 |
x = xb + stack.shift(); |
| 17857 |
y = yb + stack.shift(); |
| 17858 |
bezierCurveTo(xa, ya, xb, yb, x, y); |
| 17859 |
xa = x + stack.shift(); |
| 17860 |
ya = y + stack.shift(); |
| 17861 |
xb = xa + stack.shift(); |
| 17862 |
yb = ya + stack.shift(); |
| 17863 |
x = xb; |
| 17864 |
y = yb; |
| 17865 |
if (Math.abs(x - x0) > Math.abs(y - y0)) { |
| 17866 |
x += stack.shift(); |
| 17867 |
} else { |
| 17868 |
y += stack.shift(); |
| 17869 |
} |
| 17870 |
bezierCurveTo(xa, ya, xb, yb, x, y); |
| 17871 |
break; |
| 17872 |
default: |
| 17873 |
throw new FormatError(`unknown operator: 12 ${v}`); |
| 17874 |
} |
| 17875 |
break; |
| 17876 |
case 14: |
| 17877 |
if (stack.length >= 4) { |
| 17878 |
const achar = stack.pop(); |
| 17879 |
const bchar = stack.pop(); |
| 17880 |
y = stack.pop(); |
| 17881 |
x = stack.pop(); |
| 17882 |
cmds.add(FontRenderOps.SAVE); |
| 17883 |
cmds.add(FontRenderOps.TRANSLATE, [x, y]); |
| 17884 |
let cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[StandardEncoding[achar]])); |
| 17885 |
compileCharString(font.glyphs[cmap.glyphId], cmds, font, cmap.glyphId); |
| 17886 |
cmds.add(FontRenderOps.RESTORE); |
| 17887 |
cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[StandardEncoding[bchar]])); |
| 17888 |
compileCharString(font.glyphs[cmap.glyphId], cmds, font, cmap.glyphId); |
| 17889 |
} |
| 17890 |
return; |
| 17891 |
case 18: |
| 17892 |
stems += stack.length >> 1; |
| 17893 |
stackClean = true; |
| 17894 |
break; |
| 17895 |
case 19: |
| 17896 |
stems += stack.length >> 1; |
| 17897 |
i += stems + 7 >> 3; |
| 17898 |
stackClean = true; |
| 17899 |
break; |
| 17900 |
case 20: |
| 17901 |
stems += stack.length >> 1; |
| 17902 |
i += stems + 7 >> 3; |
| 17903 |
stackClean = true; |
| 17904 |
break; |
| 17905 |
case 21: |
| 17906 |
y += stack.pop(); |
| 17907 |
x += stack.pop(); |
| 17908 |
moveTo(x, y); |
| 17909 |
stackClean = true; |
| 17910 |
break; |
| 17911 |
case 22: |
| 17912 |
x += stack.pop(); |
| 17913 |
moveTo(x, y); |
| 17914 |
stackClean = true; |
| 17915 |
break; |
| 17916 |
case 23: |
| 17917 |
stems += stack.length >> 1; |
| 17918 |
stackClean = true; |
| 17919 |
break; |
| 17920 |
case 24: |
| 17921 |
while (stack.length > 2) { |
| 17922 |
xa = x + stack.shift(); |
| 17923 |
ya = y + stack.shift(); |
| 17924 |
xb = xa + stack.shift(); |
| 17925 |
yb = ya + stack.shift(); |
| 17926 |
x = xb + stack.shift(); |
| 17927 |
y = yb + stack.shift(); |
| 17928 |
bezierCurveTo(xa, ya, xb, yb, x, y); |
| 17929 |
} |
| 17930 |
x += stack.shift(); |
| 17931 |
y += stack.shift(); |
| 17932 |
lineTo(x, y); |
| 17933 |
break; |
| 17934 |
case 25: |
| 17935 |
while (stack.length > 6) { |
| 17936 |
x += stack.shift(); |
| 17937 |
y += stack.shift(); |
| 17938 |
lineTo(x, y); |
| 17939 |
} |
| 17940 |
xa = x + stack.shift(); |
| 17941 |
ya = y + stack.shift(); |
| 17942 |
xb = xa + stack.shift(); |
| 17943 |
yb = ya + stack.shift(); |
| 17944 |
x = xb + stack.shift(); |
| 17945 |
y = yb + stack.shift(); |
| 17946 |
bezierCurveTo(xa, ya, xb, yb, x, y); |
| 17947 |
break; |
| 17948 |
case 26: |
| 17949 |
if (stack.length % 2) { |
| 17950 |
x += stack.shift(); |
| 17951 |
} |
| 17952 |
while (stack.length > 0) { |
| 17953 |
xa = x; |
| 17954 |
ya = y + stack.shift(); |
| 17955 |
xb = xa + stack.shift(); |
| 17956 |
yb = ya + stack.shift(); |
| 17957 |
x = xb; |
| 17958 |
y = yb + stack.shift(); |
| 17959 |
bezierCurveTo(xa, ya, xb, yb, x, y); |
| 17960 |
} |
| 17961 |
break; |
| 17962 |
case 27: |
| 17963 |
if (stack.length % 2) { |
| 17964 |
y += stack.shift(); |
| 17965 |
} |
| 17966 |
while (stack.length > 0) { |
| 17967 |
xa = x + stack.shift(); |
| 17968 |
ya = y; |
| 17969 |
xb = xa + stack.shift(); |
| 17970 |
yb = ya + stack.shift(); |
| 17971 |
x = xb + stack.shift(); |
| 17972 |
y = yb; |
| 17973 |
bezierCurveTo(xa, ya, xb, yb, x, y); |
| 17974 |
} |
| 17975 |
break; |
| 17976 |
case 28: |
| 17977 |
stack.push((code[i] << 24 | code[i + 1] << 16) >> 16); |
| 17978 |
i += 2; |
| 17979 |
break; |
| 17980 |
case 29: |
| 17981 |
n = stack.pop() + font.gsubrsBias; |
| 17982 |
subrCode = font.gsubrs[n]; |
| 17983 |
if (subrCode) { |
| 17984 |
parse(subrCode); |
| 17985 |
} |
| 17986 |
break; |
| 17987 |
case 30: |
| 17988 |
while (stack.length > 0) { |
| 17989 |
xa = x; |
| 17990 |
ya = y + stack.shift(); |
| 17991 |
xb = xa + stack.shift(); |
| 17992 |
yb = ya + stack.shift(); |
| 17993 |
x = xb + stack.shift(); |
| 17994 |
y = yb + (stack.length === 1 ? stack.shift() : 0); |
| 17995 |
bezierCurveTo(xa, ya, xb, yb, x, y); |
| 17996 |
if (stack.length === 0) { |
| 17997 |
break; |
| 17998 |
} |
| 17999 |
xa = x + stack.shift(); |
| 18000 |
ya = y; |
| 18001 |
xb = xa + stack.shift(); |
| 18002 |
yb = ya + stack.shift(); |
| 18003 |
y = yb + stack.shift(); |
| 18004 |
x = xb + (stack.length === 1 ? stack.shift() : 0); |
| 18005 |
bezierCurveTo(xa, ya, xb, yb, x, y); |
| 18006 |
} |
| 18007 |
break; |
| 18008 |
case 31: |
| 18009 |
while (stack.length > 0) { |
| 18010 |
xa = x + stack.shift(); |
| 18011 |
ya = y; |
| 18012 |
xb = xa + stack.shift(); |
| 18013 |
yb = ya + stack.shift(); |
| 18014 |
y = yb + stack.shift(); |
| 18015 |
x = xb + (stack.length === 1 ? stack.shift() : 0); |
| 18016 |
bezierCurveTo(xa, ya, xb, yb, x, y); |
| 18017 |
if (stack.length === 0) { |
| 18018 |
break; |
| 18019 |
} |
| 18020 |
xa = x; |
| 18021 |
ya = y + stack.shift(); |
| 18022 |
xb = xa + stack.shift(); |
| 18023 |
yb = ya + stack.shift(); |
| 18024 |
x = xb + stack.shift(); |
| 18025 |
y = yb + (stack.length === 1 ? stack.shift() : 0); |
| 18026 |
bezierCurveTo(xa, ya, xb, yb, x, y); |
| 18027 |
} |
| 18028 |
break; |
| 18029 |
default: |
| 18030 |
if (v < 32) { |
| 18031 |
throw new FormatError(`unknown operator: ${v}`); |
| 18032 |
} |
| 18033 |
if (v < 247) { |
| 18034 |
stack.push(v - 139); |
| 18035 |
} else if (v < 251) { |
| 18036 |
stack.push((v - 247) * 256 + code[i++] + 108); |
| 18037 |
} else if (v < 255) { |
| 18038 |
stack.push(-(v - 251) * 256 - code[i++] - 108); |
| 18039 |
} else { |
| 18040 |
stack.push((code[i] << 24 | code[i + 1] << 16 | code[i + 2] << 8 | code[i + 3]) / 65536); |
| 18041 |
i += 4; |
| 18042 |
} |
| 18043 |
break; |
| 18044 |
} |
| 18045 |
if (stackClean) { |
| 18046 |
stack.length = 0; |
| 18047 |
} |
| 18048 |
} |
| 18049 |
} |
| 18050 |
parse(charStringCode); |
| 18051 |
} |
| 18052 |
const NOOP = []; |
| 18053 |
class Commands { |
| 18054 |
cmds = []; |
| 18055 |
add(cmd, args) { |
| 18056 |
if (args) { |
| 18057 |
if (!isNumberArray(args, null)) { |
| 18058 |
warn(`Commands.add - "${cmd}" has at least one non-number arg: "${args}".`); |
| 18059 |
const newArgs = args.map(arg => typeof arg === "number" ? arg : 0); |
| 18060 |
this.cmds.push(cmd, ...newArgs); |
| 18061 |
} else { |
| 18062 |
this.cmds.push(cmd, ...args); |
| 18063 |
} |
| 18064 |
} else { |
| 18065 |
this.cmds.push(cmd); |
| 18066 |
} |
| 18067 |
} |
| 18068 |
} |
| 18069 |
class CompiledFont { |
| 18070 |
constructor(fontMatrix) { |
| 18071 |
this.fontMatrix = fontMatrix; |
| 18072 |
this.compiledGlyphs = Object.create(null); |
| 18073 |
this.compiledCharCodeToGlyphId = Object.create(null); |
| 18074 |
} |
| 18075 |
getPathJs(unicode) { |
| 18076 |
const { |
| 18077 |
charCode, |
| 18078 |
glyphId |
| 18079 |
} = lookupCmap(this.cmap, unicode); |
| 18080 |
let fn = this.compiledGlyphs[glyphId], |
| 18081 |
compileEx; |
| 18082 |
if (!fn) { |
| 18083 |
try { |
| 18084 |
fn = this.compileGlyph(this.glyphs[glyphId], glyphId); |
| 18085 |
} catch (ex) { |
| 18086 |
fn = NOOP; |
| 18087 |
compileEx = ex; |
| 18088 |
} |
| 18089 |
this.compiledGlyphs[glyphId] = fn; |
| 18090 |
} |
| 18091 |
this.compiledCharCodeToGlyphId[charCode] ??= glyphId; |
| 18092 |
if (compileEx) { |
| 18093 |
throw compileEx; |
| 18094 |
} |
| 18095 |
return fn; |
| 18096 |
} |
| 18097 |
compileGlyph(code, glyphId) { |
| 18098 |
if (!code || code.length === 0 || code[0] === 14) { |
| 18099 |
return NOOP; |
| 18100 |
} |
| 18101 |
let fontMatrix = this.fontMatrix; |
| 18102 |
if (this.isCFFCIDFont) { |
| 18103 |
const fdIndex = this.fdSelect.getFDIndex(glyphId); |
| 18104 |
if (fdIndex >= 0 && fdIndex < this.fdArray.length) { |
| 18105 |
const fontDict = this.fdArray[fdIndex]; |
| 18106 |
fontMatrix = fontDict.getByName("FontMatrix") || FONT_IDENTITY_MATRIX; |
| 18107 |
} else { |
| 18108 |
warn("Invalid fd index for glyph index."); |
| 18109 |
} |
| 18110 |
} |
| 18111 |
const cmds = new Commands(); |
| 18112 |
cmds.add(FontRenderOps.SAVE); |
| 18113 |
cmds.add(FontRenderOps.TRANSFORM, fontMatrix.slice()); |
| 18114 |
cmds.add(FontRenderOps.SCALE); |
| 18115 |
this.compileGlyphImpl(code, cmds, glyphId); |
| 18116 |
cmds.add(FontRenderOps.RESTORE); |
| 18117 |
return cmds.cmds; |
| 18118 |
} |
| 18119 |
compileGlyphImpl() { |
| 18120 |
unreachable("Children classes should implement this."); |
| 18121 |
} |
| 18122 |
hasBuiltPath(unicode) { |
| 18123 |
const { |
| 18124 |
charCode, |
| 18125 |
glyphId |
| 18126 |
} = lookupCmap(this.cmap, unicode); |
| 18127 |
return this.compiledGlyphs[glyphId] !== undefined && this.compiledCharCodeToGlyphId[charCode] !== undefined; |
| 18128 |
} |
| 18129 |
} |
| 18130 |
class TrueTypeCompiled extends CompiledFont { |
| 18131 |
constructor(glyphs, cmap, fontMatrix) { |
| 18132 |
super(fontMatrix || [0.000488, 0, 0, 0.000488, 0, 0]); |
| 18133 |
this.glyphs = glyphs; |
| 18134 |
this.cmap = cmap; |
| 18135 |
} |
| 18136 |
compileGlyphImpl(code, cmds) { |
| 18137 |
compileGlyf(code, cmds, this); |
| 18138 |
} |
| 18139 |
} |
| 18140 |
class Type2Compiled extends CompiledFont { |
| 18141 |
constructor(cffInfo, cmap, fontMatrix, glyphNameMap) { |
| 18142 |
super(fontMatrix || [0.001, 0, 0, 0.001, 0, 0]); |
| 18143 |
this.glyphs = cffInfo.glyphs; |
| 18144 |
this.gsubrs = cffInfo.gsubrs || []; |
| 18145 |
this.subrs = cffInfo.subrs || []; |
| 18146 |
this.cmap = cmap; |
| 18147 |
this.glyphNameMap = glyphNameMap || getGlyphsUnicode(); |
| 18148 |
this.gsubrsBias = getSubroutineBias(this.gsubrs); |
| 18149 |
this.subrsBias = getSubroutineBias(this.subrs); |
| 18150 |
this.isCFFCIDFont = cffInfo.isCFFCIDFont; |
| 18151 |
this.fdSelect = cffInfo.fdSelect; |
| 18152 |
this.fdArray = cffInfo.fdArray; |
| 18153 |
} |
| 18154 |
compileGlyphImpl(code, cmds, glyphId) { |
| 18155 |
compileCharString(code, cmds, this, glyphId); |
| 18156 |
} |
| 18157 |
} |
| 18158 |
class FontRendererFactory { |
| 18159 |
static create(font, seacAnalysisEnabled) { |
| 18160 |
const data = new Uint8Array(font.data); |
| 18161 |
let cmap, glyf, loca, cff, indexToLocFormat, unitsPerEm; |
| 18162 |
const numTables = getUint16(data, 4); |
| 18163 |
for (let i = 0, p = 12; i < numTables; i++, p += 16) { |
| 18164 |
const tag = bytesToString(data.subarray(p, p + 4)); |
| 18165 |
const offset = getUint32(data, p + 8); |
| 18166 |
const length = getUint32(data, p + 12); |
| 18167 |
switch (tag) { |
| 18168 |
case "cmap": |
| 18169 |
cmap = parseCmap(data, offset, offset + length); |
| 18170 |
break; |
| 18171 |
case "glyf": |
| 18172 |
glyf = data.subarray(offset, offset + length); |
| 18173 |
break; |
| 18174 |
case "loca": |
| 18175 |
loca = data.subarray(offset, offset + length); |
| 18176 |
break; |
| 18177 |
case "head": |
| 18178 |
unitsPerEm = getUint16(data, offset + 18); |
| 18179 |
indexToLocFormat = getUint16(data, offset + 50); |
| 18180 |
break; |
| 18181 |
case "CFF ": |
| 18182 |
cff = parseCff(data, offset, offset + length, seacAnalysisEnabled); |
| 18183 |
break; |
| 18184 |
} |
| 18185 |
} |
| 18186 |
if (glyf) { |
| 18187 |
const fontMatrix = !unitsPerEm ? font.fontMatrix : [1 / unitsPerEm, 0, 0, 1 / unitsPerEm, 0, 0]; |
| 18188 |
return new TrueTypeCompiled(parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix); |
| 18189 |
} |
| 18190 |
return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap); |
| 18191 |
} |
| 18192 |
} |
| 18193 |
|
| 18194 |
;// ./src/core/metrics.js |
| 18195 |
|
| 18196 |
const getMetrics = getLookupTableFactory(function (t) { |
| 18197 |
t.Courier = 600; |
| 18198 |
t["Courier-Bold"] = 600; |
| 18199 |
t["Courier-BoldOblique"] = 600; |
| 18200 |
t["Courier-Oblique"] = 600; |
| 18201 |
t.Helvetica = getLookupTableFactory(function (t) { |
| 18202 |
t.space = 278; |
| 18203 |
t.exclam = 278; |
| 18204 |
t.quotedbl = 355; |
| 18205 |
t.numbersign = 556; |
| 18206 |
t.dollar = 556; |
| 18207 |
t.percent = 889; |
| 18208 |
t.ampersand = 667; |
| 18209 |
t.quoteright = 222; |
| 18210 |
t.parenleft = 333; |
| 18211 |
t.parenright = 333; |
| 18212 |
t.asterisk = 389; |
| 18213 |
t.plus = 584; |
| 18214 |
t.comma = 278; |
| 18215 |
t.hyphen = 333; |
| 18216 |
t.period = 278; |
| 18217 |
t.slash = 278; |
| 18218 |
t.zero = 556; |
| 18219 |
t.one = 556; |
| 18220 |
t.two = 556; |
| 18221 |
t.three = 556; |
| 18222 |
t.four = 556; |
| 18223 |
t.five = 556; |
| 18224 |
t.six = 556; |
| 18225 |
t.seven = 556; |
| 18226 |
t.eight = 556; |
| 18227 |
t.nine = 556; |
| 18228 |
t.colon = 278; |
| 18229 |
t.semicolon = 278; |
| 18230 |
t.less = 584; |
| 18231 |
t.equal = 584; |
| 18232 |
t.greater = 584; |
| 18233 |
t.question = 556; |
| 18234 |
t.at = 1015; |
| 18235 |
t.A = 667; |
| 18236 |
t.B = 667; |
| 18237 |
t.C = 722; |
| 18238 |
t.D = 722; |
| 18239 |
t.E = 667; |
| 18240 |
t.F = 611; |
| 18241 |
t.G = 778; |
| 18242 |
t.H = 722; |
| 18243 |
t.I = 278; |
| 18244 |
t.J = 500; |
| 18245 |
t.K = 667; |
| 18246 |
t.L = 556; |
| 18247 |
t.M = 833; |
| 18248 |
t.N = 722; |
| 18249 |
t.O = 778; |
| 18250 |
t.P = 667; |
| 18251 |
t.Q = 778; |
| 18252 |
t.R = 722; |
| 18253 |
t.S = 667; |
| 18254 |
t.T = 611; |
| 18255 |
t.U = 722; |
| 18256 |
t.V = 667; |
| 18257 |
t.W = 944; |
| 18258 |
t.X = 667; |
| 18259 |
t.Y = 667; |
| 18260 |
t.Z = 611; |
| 18261 |
t.bracketleft = 278; |
| 18262 |
t.backslash = 278; |
| 18263 |
t.bracketright = 278; |
| 18264 |
t.asciicircum = 469; |
| 18265 |
t.underscore = 556; |
| 18266 |
t.quoteleft = 222; |
| 18267 |
t.a = 556; |
| 18268 |
t.b = 556; |
| 18269 |
t.c = 500; |
| 18270 |
t.d = 556; |
| 18271 |
t.e = 556; |
| 18272 |
t.f = 278; |
| 18273 |
t.g = 556; |
| 18274 |
t.h = 556; |
| 18275 |
t.i = 222; |
| 18276 |
t.j = 222; |
| 18277 |
t.k = 500; |
| 18278 |
t.l = 222; |
| 18279 |
t.m = 833; |
| 18280 |
t.n = 556; |
| 18281 |
t.o = 556; |
| 18282 |
t.p = 556; |
| 18283 |
t.q = 556; |
| 18284 |
t.r = 333; |
| 18285 |
t.s = 500; |
| 18286 |
t.t = 278; |
| 18287 |
t.u = 556; |
| 18288 |
t.v = 500; |
| 18289 |
t.w = 722; |
| 18290 |
t.x = 500; |
| 18291 |
t.y = 500; |
| 18292 |
t.z = 500; |
| 18293 |
t.braceleft = 334; |
| 18294 |
t.bar = 260; |
| 18295 |
t.braceright = 334; |
| 18296 |
t.asciitilde = 584; |
| 18297 |
t.exclamdown = 333; |
| 18298 |
t.cent = 556; |
| 18299 |
t.sterling = 556; |
| 18300 |
t.fraction = 167; |
| 18301 |
t.yen = 556; |
| 18302 |
t.florin = 556; |
| 18303 |
t.section = 556; |
| 18304 |
t.currency = 556; |
| 18305 |
t.quotesingle = 191; |
| 18306 |
t.quotedblleft = 333; |
| 18307 |
t.guillemotleft = 556; |
| 18308 |
t.guilsinglleft = 333; |
| 18309 |
t.guilsinglright = 333; |
| 18310 |
t.fi = 500; |
| 18311 |
t.fl = 500; |
| 18312 |
t.endash = 556; |
| 18313 |
t.dagger = 556; |
| 18314 |
t.daggerdbl = 556; |
| 18315 |
t.periodcentered = 278; |
| 18316 |
t.paragraph = 537; |
| 18317 |
t.bullet = 350; |
| 18318 |
t.quotesinglbase = 222; |
| 18319 |
t.quotedblbase = 333; |
| 18320 |
t.quotedblright = 333; |
| 18321 |
t.guillemotright = 556; |
| 18322 |
t.ellipsis = 1000; |
| 18323 |
t.perthousand = 1000; |
| 18324 |
t.questiondown = 611; |
| 18325 |
t.grave = 333; |
| 18326 |
t.acute = 333; |
| 18327 |
t.circumflex = 333; |
| 18328 |
t.tilde = 333; |
| 18329 |
t.macron = 333; |
| 18330 |
t.breve = 333; |
| 18331 |
t.dotaccent = 333; |
| 18332 |
t.dieresis = 333; |
| 18333 |
t.ring = 333; |
| 18334 |
t.cedilla = 333; |
| 18335 |
t.hungarumlaut = 333; |
| 18336 |
t.ogonek = 333; |
| 18337 |
t.caron = 333; |
| 18338 |
t.emdash = 1000; |
| 18339 |
t.AE = 1000; |
| 18340 |
t.ordfeminine = 370; |
| 18341 |
t.Lslash = 556; |
| 18342 |
t.Oslash = 778; |
| 18343 |
t.OE = 1000; |
| 18344 |
t.ordmasculine = 365; |
| 18345 |
t.ae = 889; |
| 18346 |
t.dotlessi = 278; |
| 18347 |
t.lslash = 222; |
| 18348 |
t.oslash = 611; |
| 18349 |
t.oe = 944; |
| 18350 |
t.germandbls = 611; |
| 18351 |
t.Idieresis = 278; |
| 18352 |
t.eacute = 556; |
| 18353 |
t.abreve = 556; |
| 18354 |
t.uhungarumlaut = 556; |
| 18355 |
t.ecaron = 556; |
| 18356 |
t.Ydieresis = 667; |
| 18357 |
t.divide = 584; |
| 18358 |
t.Yacute = 667; |
| 18359 |
t.Acircumflex = 667; |
| 18360 |
t.aacute = 556; |
| 18361 |
t.Ucircumflex = 722; |
| 18362 |
t.yacute = 500; |
| 18363 |
t.scommaaccent = 500; |
| 18364 |
t.ecircumflex = 556; |
| 18365 |
t.Uring = 722; |
| 18366 |
t.Udieresis = 722; |
| 18367 |
t.aogonek = 556; |
| 18368 |
t.Uacute = 722; |
| 18369 |
t.uogonek = 556; |
| 18370 |
t.Edieresis = 667; |
| 18371 |
t.Dcroat = 722; |
| 18372 |
t.commaaccent = 250; |
| 18373 |
t.copyright = 737; |
| 18374 |
t.Emacron = 667; |
| 18375 |
t.ccaron = 500; |
| 18376 |
t.aring = 556; |
| 18377 |
t.Ncommaaccent = 722; |
| 18378 |
t.lacute = 222; |
| 18379 |
t.agrave = 556; |
| 18380 |
t.Tcommaaccent = 611; |
| 18381 |
t.Cacute = 722; |
| 18382 |
t.atilde = 556; |
| 18383 |
t.Edotaccent = 667; |
| 18384 |
t.scaron = 500; |
| 18385 |
t.scedilla = 500; |
| 18386 |
t.iacute = 278; |
| 18387 |
t.lozenge = 471; |
| 18388 |
t.Rcaron = 722; |
| 18389 |
t.Gcommaaccent = 778; |
| 18390 |
t.ucircumflex = 556; |
| 18391 |
t.acircumflex = 556; |
| 18392 |
t.Amacron = 667; |
| 18393 |
t.rcaron = 333; |
| 18394 |
t.ccedilla = 500; |
| 18395 |
t.Zdotaccent = 611; |
| 18396 |
t.Thorn = 667; |
| 18397 |
t.Omacron = 778; |
| 18398 |
t.Racute = 722; |
| 18399 |
t.Sacute = 667; |
| 18400 |
t.dcaron = 643; |
| 18401 |
t.Umacron = 722; |
| 18402 |
t.uring = 556; |
| 18403 |
t.threesuperior = 333; |
| 18404 |
t.Ograve = 778; |
| 18405 |
t.Agrave = 667; |
| 18406 |
t.Abreve = 667; |
| 18407 |
t.multiply = 584; |
| 18408 |
t.uacute = 556; |
| 18409 |
t.Tcaron = 611; |
| 18410 |
t.partialdiff = 476; |
| 18411 |
t.ydieresis = 500; |
| 18412 |
t.Nacute = 722; |
| 18413 |
t.icircumflex = 278; |
| 18414 |
t.Ecircumflex = 667; |
| 18415 |
t.adieresis = 556; |
| 18416 |
t.edieresis = 556; |
| 18417 |
t.cacute = 500; |
| 18418 |
t.nacute = 556; |
| 18419 |
t.umacron = 556; |
| 18420 |
t.Ncaron = 722; |
| 18421 |
t.Iacute = 278; |
| 18422 |
t.plusminus = 584; |
| 18423 |
t.brokenbar = 260; |
| 18424 |
t.registered = 737; |
| 18425 |
t.Gbreve = 778; |
| 18426 |
t.Idotaccent = 278; |
| 18427 |
t.summation = 600; |
| 18428 |
t.Egrave = 667; |
| 18429 |
t.racute = 333; |
| 18430 |
t.omacron = 556; |
| 18431 |
t.Zacute = 611; |
| 18432 |
t.Zcaron = 611; |
| 18433 |
t.greaterequal = 549; |
| 18434 |
t.Eth = 722; |
| 18435 |
t.Ccedilla = 722; |
| 18436 |
t.lcommaaccent = 222; |
| 18437 |
t.tcaron = 317; |
| 18438 |
t.eogonek = 556; |
| 18439 |
t.Uogonek = 722; |
| 18440 |
t.Aacute = 667; |
| 18441 |
t.Adieresis = 667; |
| 18442 |
t.egrave = 556; |
| 18443 |
t.zacute = 500; |
| 18444 |
t.iogonek = 222; |
| 18445 |
t.Oacute = 778; |
| 18446 |
t.oacute = 556; |
| 18447 |
t.amacron = 556; |
| 18448 |
t.sacute = 500; |
| 18449 |
t.idieresis = 278; |
| 18450 |
t.Ocircumflex = 778; |
| 18451 |
t.Ugrave = 722; |
| 18452 |
t.Delta = 612; |
| 18453 |
t.thorn = 556; |
| 18454 |
t.twosuperior = 333; |
| 18455 |
t.Odieresis = 778; |
| 18456 |
t.mu = 556; |
| 18457 |
t.igrave = 278; |
| 18458 |
t.ohungarumlaut = 556; |
| 18459 |
t.Eogonek = 667; |
| 18460 |
t.dcroat = 556; |
| 18461 |
t.threequarters = 834; |
| 18462 |
t.Scedilla = 667; |
| 18463 |
t.lcaron = 299; |
| 18464 |
t.Kcommaaccent = 667; |
| 18465 |
t.Lacute = 556; |
| 18466 |
t.trademark = 1000; |
| 18467 |
t.edotaccent = 556; |
| 18468 |
t.Igrave = 278; |
| 18469 |
t.Imacron = 278; |
| 18470 |
t.Lcaron = 556; |
| 18471 |
t.onehalf = 834; |
| 18472 |
t.lessequal = 549; |
| 18473 |
t.ocircumflex = 556; |
| 18474 |
t.ntilde = 556; |
| 18475 |
t.Uhungarumlaut = 722; |
| 18476 |
t.Eacute = 667; |
| 18477 |
t.emacron = 556; |
| 18478 |
t.gbreve = 556; |
| 18479 |
t.onequarter = 834; |
| 18480 |
t.Scaron = 667; |
| 18481 |
t.Scommaaccent = 667; |
| 18482 |
t.Ohungarumlaut = 778; |
| 18483 |
t.degree = 400; |
| 18484 |
t.ograve = 556; |
| 18485 |
t.Ccaron = 722; |
| 18486 |
t.ugrave = 556; |
| 18487 |
t.radical = 453; |
| 18488 |
t.Dcaron = 722; |
| 18489 |
t.rcommaaccent = 333; |
| 18490 |
t.Ntilde = 722; |
| 18491 |
t.otilde = 556; |
| 18492 |
t.Rcommaaccent = 722; |
| 18493 |
t.Lcommaaccent = 556; |
| 18494 |
t.Atilde = 667; |
| 18495 |
t.Aogonek = 667; |
| 18496 |
t.Aring = 667; |
| 18497 |
t.Otilde = 778; |
| 18498 |
t.zdotaccent = 500; |
| 18499 |
t.Ecaron = 667; |
| 18500 |
t.Iogonek = 278; |
| 18501 |
t.kcommaaccent = 500; |
| 18502 |
t.minus = 584; |
| 18503 |
t.Icircumflex = 278; |
| 18504 |
t.ncaron = 556; |
| 18505 |
t.tcommaaccent = 278; |
| 18506 |
t.logicalnot = 584; |
| 18507 |
t.odieresis = 556; |
| 18508 |
t.udieresis = 556; |
| 18509 |
t.notequal = 549; |
| 18510 |
t.gcommaaccent = 556; |
| 18511 |
t.eth = 556; |
| 18512 |
t.zcaron = 500; |
| 18513 |
t.ncommaaccent = 556; |
| 18514 |
t.onesuperior = 333; |
| 18515 |
t.imacron = 278; |
| 18516 |
t.Euro = 556; |
| 18517 |
}); |
| 18518 |
t["Helvetica-Bold"] = getLookupTableFactory(function (t) { |
| 18519 |
t.space = 278; |
| 18520 |
t.exclam = 333; |
| 18521 |
t.quotedbl = 474; |
| 18522 |
t.numbersign = 556; |
| 18523 |
t.dollar = 556; |
| 18524 |
t.percent = 889; |
| 18525 |
t.ampersand = 722; |
| 18526 |
t.quoteright = 278; |
| 18527 |
t.parenleft = 333; |
| 18528 |
t.parenright = 333; |
| 18529 |
t.asterisk = 389; |
| 18530 |
t.plus = 584; |
| 18531 |
t.comma = 278; |
| 18532 |
t.hyphen = 333; |
| 18533 |
t.period = 278; |
| 18534 |
t.slash = 278; |
| 18535 |
t.zero = 556; |
| 18536 |
t.one = 556; |
| 18537 |
t.two = 556; |
| 18538 |
t.three = 556; |
| 18539 |
t.four = 556; |
| 18540 |
t.five = 556; |
| 18541 |
t.six = 556; |
| 18542 |
t.seven = 556; |
| 18543 |
t.eight = 556; |
| 18544 |
t.nine = 556; |
| 18545 |
t.colon = 333; |
| 18546 |
t.semicolon = 333; |
| 18547 |
t.less = 584; |
| 18548 |
t.equal = 584; |
| 18549 |
t.greater = 584; |
| 18550 |
t.question = 611; |
| 18551 |
t.at = 975; |
| 18552 |
t.A = 722; |
| 18553 |
t.B = 722; |
| 18554 |
t.C = 722; |
| 18555 |
t.D = 722; |
| 18556 |
t.E = 667; |
| 18557 |
t.F = 611; |
| 18558 |
t.G = 778; |
| 18559 |
t.H = 722; |
| 18560 |
t.I = 278; |
| 18561 |
t.J = 556; |
| 18562 |
t.K = 722; |
| 18563 |
t.L = 611; |
| 18564 |
t.M = 833; |
| 18565 |
t.N = 722; |
| 18566 |
t.O = 778; |
| 18567 |
t.P = 667; |
| 18568 |
t.Q = 778; |
| 18569 |
t.R = 722; |
| 18570 |
t.S = 667; |
| 18571 |
t.T = 611; |
| 18572 |
t.U = 722; |
| 18573 |
t.V = 667; |
| 18574 |
t.W = 944; |
| 18575 |
t.X = 667; |
| 18576 |
t.Y = 667; |
| 18577 |
t.Z = 611; |
| 18578 |
t.bracketleft = 333; |
| 18579 |
t.backslash = 278; |
| 18580 |
t.bracketright = 333; |
| 18581 |
t.asciicircum = 584; |
| 18582 |
t.underscore = 556; |
| 18583 |
t.quoteleft = 278; |
| 18584 |
t.a = 556; |
| 18585 |
t.b = 611; |
| 18586 |
t.c = 556; |
| 18587 |
t.d = 611; |
| 18588 |
t.e = 556; |
| 18589 |
t.f = 333; |
| 18590 |
t.g = 611; |
| 18591 |
t.h = 611; |
| 18592 |
t.i = 278; |
| 18593 |
t.j = 278; |
| 18594 |
t.k = 556; |
| 18595 |
t.l = 278; |
| 18596 |
t.m = 889; |
| 18597 |
t.n = 611; |
| 18598 |
t.o = 611; |
| 18599 |
t.p = 611; |
| 18600 |
t.q = 611; |
| 18601 |
t.r = 389; |
| 18602 |
t.s = 556; |
| 18603 |
t.t = 333; |
| 18604 |
t.u = 611; |
| 18605 |
t.v = 556; |
| 18606 |
t.w = 778; |
| 18607 |
t.x = 556; |
| 18608 |
t.y = 556; |
| 18609 |
t.z = 500; |
| 18610 |
t.braceleft = 389; |
| 18611 |
t.bar = 280; |
| 18612 |
t.braceright = 389; |
| 18613 |
t.asciitilde = 584; |
| 18614 |
t.exclamdown = 333; |
| 18615 |
t.cent = 556; |
| 18616 |
t.sterling = 556; |
| 18617 |
t.fraction = 167; |
| 18618 |
t.yen = 556; |
| 18619 |
t.florin = 556; |
| 18620 |
t.section = 556; |
| 18621 |
t.currency = 556; |
| 18622 |
t.quotesingle = 238; |
| 18623 |
t.quotedblleft = 500; |
| 18624 |
t.guillemotleft = 556; |
| 18625 |
t.guilsinglleft = 333; |
| 18626 |
t.guilsinglright = 333; |
| 18627 |
t.fi = 611; |
| 18628 |
t.fl = 611; |
| 18629 |
t.endash = 556; |
| 18630 |
t.dagger = 556; |
| 18631 |
t.daggerdbl = 556; |
| 18632 |
t.periodcentered = 278; |
| 18633 |
t.paragraph = 556; |
| 18634 |
t.bullet = 350; |
| 18635 |
t.quotesinglbase = 278; |
| 18636 |
t.quotedblbase = 500; |
| 18637 |
t.quotedblright = 500; |
| 18638 |
t.guillemotright = 556; |
| 18639 |
t.ellipsis = 1000; |
| 18640 |
t.perthousand = 1000; |
| 18641 |
t.questiondown = 611; |
| 18642 |
t.grave = 333; |
| 18643 |
t.acute = 333; |
| 18644 |
t.circumflex = 333; |
| 18645 |
t.tilde = 333; |
| 18646 |
t.macron = 333; |
| 18647 |
t.breve = 333; |
| 18648 |
t.dotaccent = 333; |
| 18649 |
t.dieresis = 333; |
| 18650 |
t.ring = 333; |
| 18651 |
t.cedilla = 333; |
| 18652 |
t.hungarumlaut = 333; |
| 18653 |
t.ogonek = 333; |
| 18654 |
t.caron = 333; |
| 18655 |
t.emdash = 1000; |
| 18656 |
t.AE = 1000; |
| 18657 |
t.ordfeminine = 370; |
| 18658 |
t.Lslash = 611; |
| 18659 |
t.Oslash = 778; |
| 18660 |
t.OE = 1000; |
| 18661 |
t.ordmasculine = 365; |
| 18662 |
t.ae = 889; |
| 18663 |
t.dotlessi = 278; |
| 18664 |
t.lslash = 278; |
| 18665 |
t.oslash = 611; |
| 18666 |
t.oe = 944; |
| 18667 |
t.germandbls = 611; |
| 18668 |
t.Idieresis = 278; |
| 18669 |
t.eacute = 556; |
| 18670 |
t.abreve = 556; |
| 18671 |
t.uhungarumlaut = 611; |
| 18672 |
t.ecaron = 556; |
| 18673 |
t.Ydieresis = 667; |
| 18674 |
t.divide = 584; |
| 18675 |
t.Yacute = 667; |
| 18676 |
t.Acircumflex = 722; |
| 18677 |
t.aacute = 556; |
| 18678 |
t.Ucircumflex = 722; |
| 18679 |
t.yacute = 556; |
| 18680 |
t.scommaaccent = 556; |
| 18681 |
t.ecircumflex = 556; |
| 18682 |
t.Uring = 722; |
| 18683 |
t.Udieresis = 722; |
| 18684 |
t.aogonek = 556; |
| 18685 |
t.Uacute = 722; |
| 18686 |
t.uogonek = 611; |
| 18687 |
t.Edieresis = 667; |
| 18688 |
t.Dcroat = 722; |
| 18689 |
t.commaaccent = 250; |
| 18690 |
t.copyright = 737; |
| 18691 |
t.Emacron = 667; |
| 18692 |
t.ccaron = 556; |
| 18693 |
t.aring = 556; |
| 18694 |
t.Ncommaaccent = 722; |
| 18695 |
t.lacute = 278; |
| 18696 |
t.agrave = 556; |
| 18697 |
t.Tcommaaccent = 611; |
| 18698 |
t.Cacute = 722; |
| 18699 |
t.atilde = 556; |
| 18700 |
t.Edotaccent = 667; |
| 18701 |
t.scaron = 556; |
| 18702 |
t.scedilla = 556; |
| 18703 |
t.iacute = 278; |
| 18704 |
t.lozenge = 494; |
| 18705 |
t.Rcaron = 722; |
| 18706 |
t.Gcommaaccent = 778; |
| 18707 |
t.ucircumflex = 611; |
| 18708 |
t.acircumflex = 556; |
| 18709 |
t.Amacron = 722; |
| 18710 |
t.rcaron = 389; |
| 18711 |
t.ccedilla = 556; |
| 18712 |
t.Zdotaccent = 611; |
| 18713 |
t.Thorn = 667; |
| 18714 |
t.Omacron = 778; |
| 18715 |
t.Racute = 722; |
| 18716 |
t.Sacute = 667; |
| 18717 |
t.dcaron = 743; |
| 18718 |
t.Umacron = 722; |
| 18719 |
t.uring = 611; |
| 18720 |
t.threesuperior = 333; |
| 18721 |
t.Ograve = 778; |
| 18722 |
t.Agrave = 722; |
| 18723 |
t.Abreve = 722; |
| 18724 |
t.multiply = 584; |
| 18725 |
t.uacute = 611; |
| 18726 |
t.Tcaron = 611; |
| 18727 |
t.partialdiff = 494; |
| 18728 |
t.ydieresis = 556; |
| 18729 |
t.Nacute = 722; |
| 18730 |
t.icircumflex = 278; |
| 18731 |
t.Ecircumflex = 667; |
| 18732 |
t.adieresis = 556; |
| 18733 |
t.edieresis = 556; |
| 18734 |
t.cacute = 556; |
| 18735 |
t.nacute = 611; |
| 18736 |
t.umacron = 611; |
| 18737 |
t.Ncaron = 722; |
| 18738 |
t.Iacute = 278; |
| 18739 |
t.plusminus = 584; |
| 18740 |
t.brokenbar = 280; |
| 18741 |
t.registered = 737; |
| 18742 |
t.Gbreve = 778; |
| 18743 |
t.Idotaccent = 278; |
| 18744 |
t.summation = 600; |
| 18745 |
t.Egrave = 667; |
| 18746 |
t.racute = 389; |
| 18747 |
t.omacron = 611; |
| 18748 |
t.Zacute = 611; |
| 18749 |
t.Zcaron = 611; |
| 18750 |
t.greaterequal = 549; |
| 18751 |
t.Eth = 722; |
| 18752 |
t.Ccedilla = 722; |
| 18753 |
t.lcommaaccent = 278; |
| 18754 |
t.tcaron = 389; |
| 18755 |
t.eogonek = 556; |
| 18756 |
t.Uogonek = 722; |
| 18757 |
t.Aacute = 722; |
| 18758 |
t.Adieresis = 722; |
| 18759 |
t.egrave = 556; |
| 18760 |
t.zacute = 500; |
| 18761 |
t.iogonek = 278; |
| 18762 |
t.Oacute = 778; |
| 18763 |
t.oacute = 611; |
| 18764 |
t.amacron = 556; |
| 18765 |
t.sacute = 556; |
| 18766 |
t.idieresis = 278; |
| 18767 |
t.Ocircumflex = 778; |
| 18768 |
t.Ugrave = 722; |
| 18769 |
t.Delta = 612; |
| 18770 |
t.thorn = 611; |
| 18771 |
t.twosuperior = 333; |
| 18772 |
t.Odieresis = 778; |
| 18773 |
t.mu = 611; |
| 18774 |
t.igrave = 278; |
| 18775 |
t.ohungarumlaut = 611; |
| 18776 |
t.Eogonek = 667; |
| 18777 |
t.dcroat = 611; |
| 18778 |
t.threequarters = 834; |
| 18779 |
t.Scedilla = 667; |
| 18780 |
t.lcaron = 400; |
| 18781 |
t.Kcommaaccent = 722; |
| 18782 |
t.Lacute = 611; |
| 18783 |
t.trademark = 1000; |
| 18784 |
t.edotaccent = 556; |
| 18785 |
t.Igrave = 278; |
| 18786 |
t.Imacron = 278; |
| 18787 |
t.Lcaron = 611; |
| 18788 |
t.onehalf = 834; |
| 18789 |
t.lessequal = 549; |
| 18790 |
t.ocircumflex = 611; |
| 18791 |
t.ntilde = 611; |
| 18792 |
t.Uhungarumlaut = 722; |
| 18793 |
t.Eacute = 667; |
| 18794 |
t.emacron = 556; |
| 18795 |
t.gbreve = 611; |
| 18796 |
t.onequarter = 834; |
| 18797 |
t.Scaron = 667; |
| 18798 |
t.Scommaaccent = 667; |
| 18799 |
t.Ohungarumlaut = 778; |
| 18800 |
t.degree = 400; |
| 18801 |
t.ograve = 611; |
| 18802 |
t.Ccaron = 722; |
| 18803 |
t.ugrave = 611; |
| 18804 |
t.radical = 549; |
| 18805 |
t.Dcaron = 722; |
| 18806 |
t.rcommaaccent = 389; |
| 18807 |
t.Ntilde = 722; |
| 18808 |
t.otilde = 611; |
| 18809 |
t.Rcommaaccent = 722; |
| 18810 |
t.Lcommaaccent = 611; |
| 18811 |
t.Atilde = 722; |
| 18812 |
t.Aogonek = 722; |
| 18813 |
t.Aring = 722; |
| 18814 |
t.Otilde = 778; |
| 18815 |
t.zdotaccent = 500; |
| 18816 |
t.Ecaron = 667; |
| 18817 |
t.Iogonek = 278; |
| 18818 |
t.kcommaaccent = 556; |
| 18819 |
t.minus = 584; |
| 18820 |
t.Icircumflex = 278; |
| 18821 |
t.ncaron = 611; |
| 18822 |
t.tcommaaccent = 333; |
| 18823 |
t.logicalnot = 584; |
| 18824 |
t.odieresis = 611; |
| 18825 |
t.udieresis = 611; |
| 18826 |
t.notequal = 549; |
| 18827 |
t.gcommaaccent = 611; |
| 18828 |
t.eth = 611; |
| 18829 |
t.zcaron = 500; |
| 18830 |
t.ncommaaccent = 611; |
| 18831 |
t.onesuperior = 333; |
| 18832 |
t.imacron = 278; |
| 18833 |
t.Euro = 556; |
| 18834 |
}); |
| 18835 |
t["Helvetica-BoldOblique"] = getLookupTableFactory(function (t) { |
| 18836 |
t.space = 278; |
| 18837 |
t.exclam = 333; |
| 18838 |
t.quotedbl = 474; |
| 18839 |
t.numbersign = 556; |
| 18840 |
t.dollar = 556; |
| 18841 |
t.percent = 889; |
| 18842 |
t.ampersand = 722; |
| 18843 |
t.quoteright = 278; |
| 18844 |
t.parenleft = 333; |
| 18845 |
t.parenright = 333; |
| 18846 |
t.asterisk = 389; |
| 18847 |
t.plus = 584; |
| 18848 |
t.comma = 278; |
| 18849 |
t.hyphen = 333; |
| 18850 |
t.period = 278; |
| 18851 |
t.slash = 278; |
| 18852 |
t.zero = 556; |
| 18853 |
t.one = 556; |
| 18854 |
t.two = 556; |
| 18855 |
t.three = 556; |
| 18856 |
t.four = 556; |
| 18857 |
t.five = 556; |
| 18858 |
t.six = 556; |
| 18859 |
t.seven = 556; |
| 18860 |
t.eight = 556; |
| 18861 |
t.nine = 556; |
| 18862 |
t.colon = 333; |
| 18863 |
t.semicolon = 333; |
| 18864 |
t.less = 584; |
| 18865 |
t.equal = 584; |
| 18866 |
t.greater = 584; |
| 18867 |
t.question = 611; |
| 18868 |
t.at = 975; |
| 18869 |
t.A = 722; |
| 18870 |
t.B = 722; |
| 18871 |
t.C = 722; |
| 18872 |
t.D = 722; |
| 18873 |
t.E = 667; |
| 18874 |
t.F = 611; |
| 18875 |
t.G = 778; |
| 18876 |
t.H = 722; |
| 18877 |
t.I = 278; |
| 18878 |
t.J = 556; |
| 18879 |
t.K = 722; |
| 18880 |
t.L = 611; |
| 18881 |
t.M = 833; |
| 18882 |
t.N = 722; |
| 18883 |
t.O = 778; |
| 18884 |
t.P = 667; |
| 18885 |
t.Q = 778; |
| 18886 |
t.R = 722; |
| 18887 |
t.S = 667; |
| 18888 |
t.T = 611; |
| 18889 |
t.U = 722; |
| 18890 |
t.V = 667; |
| 18891 |
t.W = 944; |
| 18892 |
t.X = 667; |
| 18893 |
t.Y = 667; |
| 18894 |
t.Z = 611; |
| 18895 |
t.bracketleft = 333; |
| 18896 |
t.backslash = 278; |
| 18897 |
t.bracketright = 333; |
| 18898 |
t.asciicircum = 584; |
| 18899 |
t.underscore = 556; |
| 18900 |
t.quoteleft = 278; |
| 18901 |
t.a = 556; |
| 18902 |
t.b = 611; |
| 18903 |
t.c = 556; |
| 18904 |
t.d = 611; |
| 18905 |
t.e = 556; |
| 18906 |
t.f = 333; |
| 18907 |
t.g = 611; |
| 18908 |
t.h = 611; |
| 18909 |
t.i = 278; |
| 18910 |
t.j = 278; |
| 18911 |
t.k = 556; |
| 18912 |
t.l = 278; |
| 18913 |
t.m = 889; |
| 18914 |
t.n = 611; |
| 18915 |
t.o = 611; |
| 18916 |
t.p = 611; |
| 18917 |
t.q = 611; |
| 18918 |
t.r = 389; |
| 18919 |
t.s = 556; |
| 18920 |
t.t = 333; |
| 18921 |
t.u = 611; |
| 18922 |
t.v = 556; |
| 18923 |
t.w = 778; |
| 18924 |
t.x = 556; |
| 18925 |
t.y = 556; |
| 18926 |
t.z = 500; |
| 18927 |
t.braceleft = 389; |
| 18928 |
t.bar = 280; |
| 18929 |
t.braceright = 389; |
| 18930 |
t.asciitilde = 584; |
| 18931 |
t.exclamdown = 333; |
| 18932 |
t.cent = 556; |
| 18933 |
t.sterling = 556; |
| 18934 |
t.fraction = 167; |
| 18935 |
t.yen = 556; |
| 18936 |
t.florin = 556; |
| 18937 |
t.section = 556; |
| 18938 |
t.currency = 556; |
| 18939 |
t.quotesingle = 238; |
| 18940 |
t.quotedblleft = 500; |
| 18941 |
t.guillemotleft = 556; |
| 18942 |
t.guilsinglleft = 333; |
| 18943 |
t.guilsinglright = 333; |
| 18944 |
t.fi = 611; |
| 18945 |
t.fl = 611; |
| 18946 |
t.endash = 556; |
| 18947 |
t.dagger = 556; |
| 18948 |
t.daggerdbl = 556; |
| 18949 |
t.periodcentered = 278; |
| 18950 |
t.paragraph = 556; |
| 18951 |
t.bullet = 350; |
| 18952 |
t.quotesinglbase = 278; |
| 18953 |
t.quotedblbase = 500; |
| 18954 |
t.quotedblright = 500; |
| 18955 |
t.guillemotright = 556; |
| 18956 |
t.ellipsis = 1000; |
| 18957 |
t.perthousand = 1000; |
| 18958 |
t.questiondown = 611; |
| 18959 |
t.grave = 333; |
| 18960 |
t.acute = 333; |
| 18961 |
t.circumflex = 333; |
| 18962 |
t.tilde = 333; |
| 18963 |
t.macron = 333; |
| 18964 |
t.breve = 333; |
| 18965 |
t.dotaccent = 333; |
| 18966 |
t.dieresis = 333; |
| 18967 |
t.ring = 333; |
| 18968 |
t.cedilla = 333; |
| 18969 |
t.hungarumlaut = 333; |
| 18970 |
t.ogonek = 333; |
| 18971 |
t.caron = 333; |
| 18972 |
t.emdash = 1000; |
| 18973 |
t.AE = 1000; |
| 18974 |
t.ordfeminine = 370; |
| 18975 |
t.Lslash = 611; |
| 18976 |
t.Oslash = 778; |
| 18977 |
t.OE = 1000; |
| 18978 |
t.ordmasculine = 365; |
| 18979 |
t.ae = 889; |
| 18980 |
t.dotlessi = 278; |
| 18981 |
t.lslash = 278; |
| 18982 |
t.oslash = 611; |
| 18983 |
t.oe = 944; |
| 18984 |
t.germandbls = 611; |
| 18985 |
t.Idieresis = 278; |
| 18986 |
t.eacute = 556; |
| 18987 |
t.abreve = 556; |
| 18988 |
t.uhungarumlaut = 611; |
| 18989 |
t.ecaron = 556; |
| 18990 |
t.Ydieresis = 667; |
| 18991 |
t.divide = 584; |
| 18992 |
t.Yacute = 667; |
| 18993 |
t.Acircumflex = 722; |
| 18994 |
t.aacute = 556; |
| 18995 |
t.Ucircumflex = 722; |
| 18996 |
t.yacute = 556; |
| 18997 |
t.scommaaccent = 556; |
| 18998 |
t.ecircumflex = 556; |
| 18999 |
t.Uring = 722; |
| 19000 |
t.Udieresis = 722; |
| 19001 |
t.aogonek = 556; |
| 19002 |
t.Uacute = 722; |
| 19003 |
t.uogonek = 611; |
| 19004 |
t.Edieresis = 667; |
| 19005 |
t.Dcroat = 722; |
| 19006 |
t.commaaccent = 250; |
| 19007 |
t.copyright = 737; |
| 19008 |
t.Emacron = 667; |
| 19009 |
t.ccaron = 556; |
| 19010 |
t.aring = 556; |
| 19011 |
t.Ncommaaccent = 722; |
| 19012 |
t.lacute = 278; |
| 19013 |
t.agrave = 556; |
| 19014 |
t.Tcommaaccent = 611; |
| 19015 |
t.Cacute = 722; |
| 19016 |
t.atilde = 556; |
| 19017 |
t.Edotaccent = 667; |
| 19018 |
t.scaron = 556; |
| 19019 |
t.scedilla = 556; |
| 19020 |
t.iacute = 278; |
| 19021 |
t.lozenge = 494; |
| 19022 |
t.Rcaron = 722; |
| 19023 |
t.Gcommaaccent = 778; |
| 19024 |
t.ucircumflex = 611; |
| 19025 |
t.acircumflex = 556; |
| 19026 |
t.Amacron = 722; |
| 19027 |
t.rcaron = 389; |
| 19028 |
t.ccedilla = 556; |
| 19029 |
t.Zdotaccent = 611; |
| 19030 |
t.Thorn = 667; |
| 19031 |
t.Omacron = 778; |
| 19032 |
t.Racute = 722; |
| 19033 |
t.Sacute = 667; |
| 19034 |
t.dcaron = 743; |
| 19035 |
t.Umacron = 722; |
| 19036 |
t.uring = 611; |
| 19037 |
t.threesuperior = 333; |
| 19038 |
t.Ograve = 778; |
| 19039 |
t.Agrave = 722; |
| 19040 |
t.Abreve = 722; |
| 19041 |
t.multiply = 584; |
| 19042 |
t.uacute = 611; |
| 19043 |
t.Tcaron = 611; |
| 19044 |
t.partialdiff = 494; |
| 19045 |
t.ydieresis = 556; |
| 19046 |
t.Nacute = 722; |
| 19047 |
t.icircumflex = 278; |
| 19048 |
t.Ecircumflex = 667; |
| 19049 |
t.adieresis = 556; |
| 19050 |
t.edieresis = 556; |
| 19051 |
t.cacute = 556; |
| 19052 |
t.nacute = 611; |
| 19053 |
t.umacron = 611; |
| 19054 |
t.Ncaron = 722; |
| 19055 |
t.Iacute = 278; |
| 19056 |
t.plusminus = 584; |
| 19057 |
t.brokenbar = 280; |
| 19058 |
t.registered = 737; |
| 19059 |
t.Gbreve = 778; |
| 19060 |
t.Idotaccent = 278; |
| 19061 |
t.summation = 600; |
| 19062 |
t.Egrave = 667; |
| 19063 |
t.racute = 389; |
| 19064 |
t.omacron = 611; |
| 19065 |
t.Zacute = 611; |
| 19066 |
t.Zcaron = 611; |
| 19067 |
t.greaterequal = 549; |
| 19068 |
t.Eth = 722; |
| 19069 |
t.Ccedilla = 722; |
| 19070 |
t.lcommaaccent = 278; |
| 19071 |
t.tcaron = 389; |
| 19072 |
t.eogonek = 556; |
| 19073 |
t.Uogonek = 722; |
| 19074 |
t.Aacute = 722; |
| 19075 |
t.Adieresis = 722; |
| 19076 |
t.egrave = 556; |
| 19077 |
t.zacute = 500; |
| 19078 |
t.iogonek = 278; |
| 19079 |
t.Oacute = 778; |
| 19080 |
t.oacute = 611; |
| 19081 |
t.amacron = 556; |
| 19082 |
t.sacute = 556; |
| 19083 |
t.idieresis = 278; |
| 19084 |
t.Ocircumflex = 778; |
| 19085 |
t.Ugrave = 722; |
| 19086 |
t.Delta = 612; |
| 19087 |
t.thorn = 611; |
| 19088 |
t.twosuperior = 333; |
| 19089 |
t.Odieresis = 778; |
| 19090 |
t.mu = 611; |
| 19091 |
t.igrave = 278; |
| 19092 |
t.ohungarumlaut = 611; |
| 19093 |
t.Eogonek = 667; |
| 19094 |
t.dcroat = 611; |
| 19095 |
t.threequarters = 834; |
| 19096 |
t.Scedilla = 667; |
| 19097 |
t.lcaron = 400; |
| 19098 |
t.Kcommaaccent = 722; |
| 19099 |
t.Lacute = 611; |
| 19100 |
t.trademark = 1000; |
| 19101 |
t.edotaccent = 556; |
| 19102 |
t.Igrave = 278; |
| 19103 |
t.Imacron = 278; |
| 19104 |
t.Lcaron = 611; |
| 19105 |
t.onehalf = 834; |
| 19106 |
t.lessequal = 549; |
| 19107 |
t.ocircumflex = 611; |
| 19108 |
t.ntilde = 611; |
| 19109 |
t.Uhungarumlaut = 722; |
| 19110 |
t.Eacute = 667; |
| 19111 |
t.emacron = 556; |
| 19112 |
t.gbreve = 611; |
| 19113 |
t.onequarter = 834; |
| 19114 |
t.Scaron = 667; |
| 19115 |
t.Scommaaccent = 667; |
| 19116 |
t.Ohungarumlaut = 778; |
| 19117 |
t.degree = 400; |
| 19118 |
t.ograve = 611; |
| 19119 |
t.Ccaron = 722; |
| 19120 |
t.ugrave = 611; |
| 19121 |
t.radical = 549; |
| 19122 |
t.Dcaron = 722; |
| 19123 |
t.rcommaaccent = 389; |
| 19124 |
t.Ntilde = 722; |
| 19125 |
t.otilde = 611; |
| 19126 |
t.Rcommaaccent = 722; |
| 19127 |
t.Lcommaaccent = 611; |
| 19128 |
t.Atilde = 722; |
| 19129 |
t.Aogonek = 722; |
| 19130 |
t.Aring = 722; |
| 19131 |
t.Otilde = 778; |
| 19132 |
t.zdotaccent = 500; |
| 19133 |
t.Ecaron = 667; |
| 19134 |
t.Iogonek = 278; |
| 19135 |
t.kcommaaccent = 556; |
| 19136 |
t.minus = 584; |
| 19137 |
t.Icircumflex = 278; |
| 19138 |
t.ncaron = 611; |
| 19139 |
t.tcommaaccent = 333; |
| 19140 |
t.logicalnot = 584; |
| 19141 |
t.odieresis = 611; |
| 19142 |
t.udieresis = 611; |
| 19143 |
t.notequal = 549; |
| 19144 |
t.gcommaaccent = 611; |
| 19145 |
t.eth = 611; |
| 19146 |
t.zcaron = 500; |
| 19147 |
t.ncommaaccent = 611; |
| 19148 |
t.onesuperior = 333; |
| 19149 |
t.imacron = 278; |
| 19150 |
t.Euro = 556; |
| 19151 |
}); |
| 19152 |
t["Helvetica-Oblique"] = getLookupTableFactory(function (t) { |
| 19153 |
t.space = 278; |
| 19154 |
t.exclam = 278; |
| 19155 |
t.quotedbl = 355; |
| 19156 |
t.numbersign = 556; |
| 19157 |
t.dollar = 556; |
| 19158 |
t.percent = 889; |
| 19159 |
t.ampersand = 667; |
| 19160 |
t.quoteright = 222; |
| 19161 |
t.parenleft = 333; |
| 19162 |
t.parenright = 333; |
| 19163 |
t.asterisk = 389; |
| 19164 |
t.plus = 584; |
| 19165 |
t.comma = 278; |
| 19166 |
t.hyphen = 333; |
| 19167 |
t.period = 278; |
| 19168 |
t.slash = 278; |
| 19169 |
t.zero = 556; |
| 19170 |
t.one = 556; |
| 19171 |
t.two = 556; |
| 19172 |
t.three = 556; |
| 19173 |
t.four = 556; |
| 19174 |
t.five = 556; |
| 19175 |
t.six = 556; |
| 19176 |
t.seven = 556; |
| 19177 |
t.eight = 556; |
| 19178 |
t.nine = 556; |
| 19179 |
t.colon = 278; |
| 19180 |
t.semicolon = 278; |
| 19181 |
t.less = 584; |
| 19182 |
t.equal = 584; |
| 19183 |
t.greater = 584; |
| 19184 |
t.question = 556; |
| 19185 |
t.at = 1015; |
| 19186 |
t.A = 667; |
| 19187 |
t.B = 667; |
| 19188 |
t.C = 722; |
| 19189 |
t.D = 722; |
| 19190 |
t.E = 667; |
| 19191 |
t.F = 611; |
| 19192 |
t.G = 778; |
| 19193 |
t.H = 722; |
| 19194 |
t.I = 278; |
| 19195 |
t.J = 500; |
| 19196 |
t.K = 667; |
| 19197 |
t.L = 556; |
| 19198 |
t.M = 833; |
| 19199 |
t.N = 722; |
| 19200 |
t.O = 778; |
| 19201 |
t.P = 667; |
| 19202 |
t.Q = 778; |
| 19203 |
t.R = 722; |
| 19204 |
t.S = 667; |
| 19205 |
t.T = 611; |
| 19206 |
t.U = 722; |
| 19207 |
t.V = 667; |
| 19208 |
t.W = 944; |
| 19209 |
t.X = 667; |
| 19210 |
t.Y = 667; |
| 19211 |
t.Z = 611; |
| 19212 |
t.bracketleft = 278; |
| 19213 |
t.backslash = 278; |
| 19214 |
t.bracketright = 278; |
| 19215 |
t.asciicircum = 469; |
| 19216 |
t.underscore = 556; |
| 19217 |
t.quoteleft = 222; |
| 19218 |
t.a = 556; |
| 19219 |
t.b = 556; |
| 19220 |
t.c = 500; |
| 19221 |
t.d = 556; |
| 19222 |
t.e = 556; |
| 19223 |
t.f = 278; |
| 19224 |
t.g = 556; |
| 19225 |
t.h = 556; |
| 19226 |
t.i = 222; |
| 19227 |
t.j = 222; |
| 19228 |
t.k = 500; |
| 19229 |
t.l = 222; |
| 19230 |
t.m = 833; |
| 19231 |
t.n = 556; |
| 19232 |
t.o = 556; |
| 19233 |
t.p = 556; |
| 19234 |
t.q = 556; |
| 19235 |
t.r = 333; |
| 19236 |
t.s = 500; |
| 19237 |
t.t = 278; |
| 19238 |
t.u = 556; |
| 19239 |
t.v = 500; |
| 19240 |
t.w = 722; |
| 19241 |
t.x = 500; |
| 19242 |
t.y = 500; |
| 19243 |
t.z = 500; |
| 19244 |
t.braceleft = 334; |
| 19245 |
t.bar = 260; |
| 19246 |
t.braceright = 334; |
| 19247 |
t.asciitilde = 584; |
| 19248 |
t.exclamdown = 333; |
| 19249 |
t.cent = 556; |
| 19250 |
t.sterling = 556; |
| 19251 |
t.fraction = 167; |
| 19252 |
t.yen = 556; |
| 19253 |
t.florin = 556; |
| 19254 |
t.section = 556; |
| 19255 |
t.currency = 556; |
| 19256 |
t.quotesingle = 191; |
| 19257 |
t.quotedblleft = 333; |
| 19258 |
t.guillemotleft = 556; |
| 19259 |
t.guilsinglleft = 333; |
| 19260 |
t.guilsinglright = 333; |
| 19261 |
t.fi = 500; |
| 19262 |
t.fl = 500; |
| 19263 |
t.endash = 556; |
| 19264 |
t.dagger = 556; |
| 19265 |
t.daggerdbl = 556; |
| 19266 |
t.periodcentered = 278; |
| 19267 |
t.paragraph = 537; |
| 19268 |
t.bullet = 350; |
| 19269 |
t.quotesinglbase = 222; |
| 19270 |
t.quotedblbase = 333; |
| 19271 |
t.quotedblright = 333; |
| 19272 |
t.guillemotright = 556; |
| 19273 |
t.ellipsis = 1000; |
| 19274 |
t.perthousand = 1000; |
| 19275 |
t.questiondown = 611; |
| 19276 |
t.grave = 333; |
| 19277 |
t.acute = 333; |
| 19278 |
t.circumflex = 333; |
| 19279 |
t.tilde = 333; |
| 19280 |
t.macron = 333; |
| 19281 |
t.breve = 333; |
| 19282 |
t.dotaccent = 333; |
| 19283 |
t.dieresis = 333; |
| 19284 |
t.ring = 333; |
| 19285 |
t.cedilla = 333; |
| 19286 |
t.hungarumlaut = 333; |
| 19287 |
t.ogonek = 333; |
| 19288 |
t.caron = 333; |
| 19289 |
t.emdash = 1000; |
| 19290 |
t.AE = 1000; |
| 19291 |
t.ordfeminine = 370; |
| 19292 |
t.Lslash = 556; |
| 19293 |
t.Oslash = 778; |
| 19294 |
t.OE = 1000; |
| 19295 |
t.ordmasculine = 365; |
| 19296 |
t.ae = 889; |
| 19297 |
t.dotlessi = 278; |
| 19298 |
t.lslash = 222; |
| 19299 |
t.oslash = 611; |
| 19300 |
t.oe = 944; |
| 19301 |
t.germandbls = 611; |
| 19302 |
t.Idieresis = 278; |
| 19303 |
t.eacute = 556; |
| 19304 |
t.abreve = 556; |
| 19305 |
t.uhungarumlaut = 556; |
| 19306 |
t.ecaron = 556; |
| 19307 |
t.Ydieresis = 667; |
| 19308 |
t.divide = 584; |
| 19309 |
t.Yacute = 667; |
| 19310 |
t.Acircumflex = 667; |
| 19311 |
t.aacute = 556; |
| 19312 |
t.Ucircumflex = 722; |
| 19313 |
t.yacute = 500; |
| 19314 |
t.scommaaccent = 500; |
| 19315 |
t.ecircumflex = 556; |
| 19316 |
t.Uring = 722; |
| 19317 |
t.Udieresis = 722; |
| 19318 |
t.aogonek = 556; |
| 19319 |
t.Uacute = 722; |
| 19320 |
t.uogonek = 556; |
| 19321 |
t.Edieresis = 667; |
| 19322 |
t.Dcroat = 722; |
| 19323 |
t.commaaccent = 250; |
| 19324 |
t.copyright = 737; |
| 19325 |
t.Emacron = 667; |
| 19326 |
t.ccaron = 500; |
| 19327 |
t.aring = 556; |
| 19328 |
t.Ncommaaccent = 722; |
| 19329 |
t.lacute = 222; |
| 19330 |
t.agrave = 556; |
| 19331 |
t.Tcommaaccent = 611; |
| 19332 |
t.Cacute = 722; |
| 19333 |
t.atilde = 556; |
| 19334 |
t.Edotaccent = 667; |
| 19335 |
t.scaron = 500; |
| 19336 |
t.scedilla = 500; |
| 19337 |
t.iacute = 278; |
| 19338 |
t.lozenge = 471; |
| 19339 |
t.Rcaron = 722; |
| 19340 |
t.Gcommaaccent = 778; |
| 19341 |
t.ucircumflex = 556; |
| 19342 |
t.acircumflex = 556; |
| 19343 |
t.Amacron = 667; |
| 19344 |
t.rcaron = 333; |
| 19345 |
t.ccedilla = 500; |
| 19346 |
t.Zdotaccent = 611; |
| 19347 |
t.Thorn = 667; |
| 19348 |
t.Omacron = 778; |
| 19349 |
t.Racute = 722; |
| 19350 |
t.Sacute = 667; |
| 19351 |
t.dcaron = 643; |
| 19352 |
t.Umacron = 722; |
| 19353 |
t.uring = 556; |
| 19354 |
t.threesuperior = 333; |
| 19355 |
t.Ograve = 778; |
| 19356 |
t.Agrave = 667; |
| 19357 |
t.Abreve = 667; |
| 19358 |
t.multiply = 584; |
| 19359 |
t.uacute = 556; |
| 19360 |
t.Tcaron = 611; |
| 19361 |
t.partialdiff = 476; |
| 19362 |
t.ydieresis = 500; |
| 19363 |
t.Nacute = 722; |
| 19364 |
t.icircumflex = 278; |
| 19365 |
t.Ecircumflex = 667; |
| 19366 |
t.adieresis = 556; |
| 19367 |
t.edieresis = 556; |
| 19368 |
t.cacute = 500; |
| 19369 |
t.nacute = 556; |
| 19370 |
t.umacron = 556; |
| 19371 |
t.Ncaron = 722; |
| 19372 |
t.Iacute = 278; |
| 19373 |
t.plusminus = 584; |
| 19374 |
t.brokenbar = 260; |
| 19375 |
t.registered = 737; |
| 19376 |
t.Gbreve = 778; |
| 19377 |
t.Idotaccent = 278; |
| 19378 |
t.summation = 600; |
| 19379 |
t.Egrave = 667; |
| 19380 |
t.racute = 333; |
| 19381 |
t.omacron = 556; |
| 19382 |
t.Zacute = 611; |
| 19383 |
t.Zcaron = 611; |
| 19384 |
t.greaterequal = 549; |
| 19385 |
t.Eth = 722; |
| 19386 |
t.Ccedilla = 722; |
| 19387 |
t.lcommaaccent = 222; |
| 19388 |
t.tcaron = 317; |
| 19389 |
t.eogonek = 556; |
| 19390 |
t.Uogonek = 722; |
| 19391 |
t.Aacute = 667; |
| 19392 |
t.Adieresis = 667; |
| 19393 |
t.egrave = 556; |
| 19394 |
t.zacute = 500; |
| 19395 |
t.iogonek = 222; |
| 19396 |
t.Oacute = 778; |
| 19397 |
t.oacute = 556; |
| 19398 |
t.amacron = 556; |
| 19399 |
t.sacute = 500; |
| 19400 |
t.idieresis = 278; |
| 19401 |
t.Ocircumflex = 778; |
| 19402 |
t.Ugrave = 722; |
| 19403 |
t.Delta = 612; |
| 19404 |
t.thorn = 556; |
| 19405 |
t.twosuperior = 333; |
| 19406 |
t.Odieresis = 778; |
| 19407 |
t.mu = 556; |
| 19408 |
t.igrave = 278; |
| 19409 |
t.ohungarumlaut = 556; |
| 19410 |
t.Eogonek = 667; |
| 19411 |
t.dcroat = 556; |
| 19412 |
t.threequarters = 834; |
| 19413 |
t.Scedilla = 667; |
| 19414 |
t.lcaron = 299; |
| 19415 |
t.Kcommaaccent = 667; |
| 19416 |
t.Lacute = 556; |
| 19417 |
t.trademark = 1000; |
| 19418 |
t.edotaccent = 556; |
| 19419 |
t.Igrave = 278; |
| 19420 |
t.Imacron = 278; |
| 19421 |
t.Lcaron = 556; |
| 19422 |
t.onehalf = 834; |
| 19423 |
t.lessequal = 549; |
| 19424 |
t.ocircumflex = 556; |
| 19425 |
t.ntilde = 556; |
| 19426 |
t.Uhungarumlaut = 722; |
| 19427 |
t.Eacute = 667; |
| 19428 |
t.emacron = 556; |
| 19429 |
t.gbreve = 556; |
| 19430 |
t.onequarter = 834; |
| 19431 |
t.Scaron = 667; |
| 19432 |
t.Scommaaccent = 667; |
| 19433 |
t.Ohungarumlaut = 778; |
| 19434 |
t.degree = 400; |
| 19435 |
t.ograve = 556; |
| 19436 |
t.Ccaron = 722; |
| 19437 |
t.ugrave = 556; |
| 19438 |
t.radical = 453; |
| 19439 |
t.Dcaron = 722; |
| 19440 |
t.rcommaaccent = 333; |
| 19441 |
t.Ntilde = 722; |
| 19442 |
t.otilde = 556; |
| 19443 |
t.Rcommaaccent = 722; |
| 19444 |
t.Lcommaaccent = 556; |
| 19445 |
t.Atilde = 667; |
| 19446 |
t.Aogonek = 667; |
| 19447 |
t.Aring = 667; |
| 19448 |
t.Otilde = 778; |
| 19449 |
t.zdotaccent = 500; |
| 19450 |
t.Ecaron = 667; |
| 19451 |
t.Iogonek = 278; |
| 19452 |
t.kcommaaccent = 500; |
| 19453 |
t.minus = 584; |
| 19454 |
t.Icircumflex = 278; |
| 19455 |
t.ncaron = 556; |
| 19456 |
t.tcommaaccent = 278; |
| 19457 |
t.logicalnot = 584; |
| 19458 |
t.odieresis = 556; |
| 19459 |
t.udieresis = 556; |
| 19460 |
t.notequal = 549; |
| 19461 |
t.gcommaaccent = 556; |
| 19462 |
t.eth = 556; |
| 19463 |
t.zcaron = 500; |
| 19464 |
t.ncommaaccent = 556; |
| 19465 |
t.onesuperior = 333; |
| 19466 |
t.imacron = 278; |
| 19467 |
t.Euro = 556; |
| 19468 |
}); |
| 19469 |
t.Symbol = getLookupTableFactory(function (t) { |
| 19470 |
t.space = 250; |
| 19471 |
t.exclam = 333; |
| 19472 |
t.universal = 713; |
| 19473 |
t.numbersign = 500; |
| 19474 |
t.existential = 549; |
| 19475 |
t.percent = 833; |
| 19476 |
t.ampersand = 778; |
| 19477 |
t.suchthat = 439; |
| 19478 |
t.parenleft = 333; |
| 19479 |
t.parenright = 333; |
| 19480 |
t.asteriskmath = 500; |
| 19481 |
t.plus = 549; |
| 19482 |
t.comma = 250; |
| 19483 |
t.minus = 549; |
| 19484 |
t.period = 250; |
| 19485 |
t.slash = 278; |
| 19486 |
t.zero = 500; |
| 19487 |
t.one = 500; |
| 19488 |
t.two = 500; |
| 19489 |
t.three = 500; |
| 19490 |
t.four = 500; |
| 19491 |
t.five = 500; |
| 19492 |
t.six = 500; |
| 19493 |
t.seven = 500; |
| 19494 |
t.eight = 500; |
| 19495 |
t.nine = 500; |
| 19496 |
t.colon = 278; |
| 19497 |
t.semicolon = 278; |
| 19498 |
t.less = 549; |
| 19499 |
t.equal = 549; |
| 19500 |
t.greater = 549; |
| 19501 |
t.question = 444; |
| 19502 |
t.congruent = 549; |
| 19503 |
t.Alpha = 722; |
| 19504 |
t.Beta = 667; |
| 19505 |
t.Chi = 722; |
| 19506 |
t.Delta = 612; |
| 19507 |
t.Epsilon = 611; |
| 19508 |
t.Phi = 763; |
| 19509 |
t.Gamma = 603; |
| 19510 |
t.Eta = 722; |
| 19511 |
t.Iota = 333; |
| 19512 |
t.theta1 = 631; |
| 19513 |
t.Kappa = 722; |
| 19514 |
t.Lambda = 686; |
| 19515 |
t.Mu = 889; |
| 19516 |
t.Nu = 722; |
| 19517 |
t.Omicron = 722; |
| 19518 |
t.Pi = 768; |
| 19519 |
t.Theta = 741; |
| 19520 |
t.Rho = 556; |
| 19521 |
t.Sigma = 592; |
| 19522 |
t.Tau = 611; |
| 19523 |
t.Upsilon = 690; |
| 19524 |
t.sigma1 = 439; |
| 19525 |
t.Omega = 768; |
| 19526 |
t.Xi = 645; |
| 19527 |
t.Psi = 795; |
| 19528 |
t.Zeta = 611; |
| 19529 |
t.bracketleft = 333; |
| 19530 |
t.therefore = 863; |
| 19531 |
t.bracketright = 333; |
| 19532 |
t.perpendicular = 658; |
| 19533 |
t.underscore = 500; |
| 19534 |
t.radicalex = 500; |
| 19535 |
t.alpha = 631; |
| 19536 |
t.beta = 549; |
| 19537 |
t.chi = 549; |
| 19538 |
t.delta = 494; |
| 19539 |
t.epsilon = 439; |
| 19540 |
t.phi = 521; |
| 19541 |
t.gamma = 411; |
| 19542 |
t.eta = 603; |
| 19543 |
t.iota = 329; |
| 19544 |
t.phi1 = 603; |
| 19545 |
t.kappa = 549; |
| 19546 |
t.lambda = 549; |
| 19547 |
t.mu = 576; |
| 19548 |
t.nu = 521; |
| 19549 |
t.omicron = 549; |
| 19550 |
t.pi = 549; |
| 19551 |
t.theta = 521; |
| 19552 |
t.rho = 549; |
| 19553 |
t.sigma = 603; |
| 19554 |
t.tau = 439; |
| 19555 |
t.upsilon = 576; |
| 19556 |
t.omega1 = 713; |
| 19557 |
t.omega = 686; |
| 19558 |
t.xi = 493; |
| 19559 |
t.psi = 686; |
| 19560 |
t.zeta = 494; |
| 19561 |
t.braceleft = 480; |
| 19562 |
t.bar = 200; |
| 19563 |
t.braceright = 480; |
| 19564 |
t.similar = 549; |
| 19565 |
t.Euro = 750; |
| 19566 |
t.Upsilon1 = 620; |
| 19567 |
t.minute = 247; |
| 19568 |
t.lessequal = 549; |
| 19569 |
t.fraction = 167; |
| 19570 |
t.infinity = 713; |
| 19571 |
t.florin = 500; |
| 19572 |
t.club = 753; |
| 19573 |
t.diamond = 753; |
| 19574 |
t.heart = 753; |
| 19575 |
t.spade = 753; |
| 19576 |
t.arrowboth = 1042; |
| 19577 |
t.arrowleft = 987; |
| 19578 |
t.arrowup = 603; |
| 19579 |
t.arrowright = 987; |
| 19580 |
t.arrowdown = 603; |
| 19581 |
t.degree = 400; |
| 19582 |
t.plusminus = 549; |
| 19583 |
t.second = 411; |
| 19584 |
t.greaterequal = 549; |
| 19585 |
t.multiply = 549; |
| 19586 |
t.proportional = 713; |
| 19587 |
t.partialdiff = 494; |
| 19588 |
t.bullet = 460; |
| 19589 |
t.divide = 549; |
| 19590 |
t.notequal = 549; |
| 19591 |
t.equivalence = 549; |
| 19592 |
t.approxequal = 549; |
| 19593 |
t.ellipsis = 1000; |
| 19594 |
t.arrowvertex = 603; |
| 19595 |
t.arrowhorizex = 1000; |
| 19596 |
t.carriagereturn = 658; |
| 19597 |
t.aleph = 823; |
| 19598 |
t.Ifraktur = 686; |
| 19599 |
t.Rfraktur = 795; |
| 19600 |
t.weierstrass = 987; |
| 19601 |
t.circlemultiply = 768; |
| 19602 |
t.circleplus = 768; |
| 19603 |
t.emptyset = 823; |
| 19604 |
t.intersection = 768; |
| 19605 |
t.union = 768; |
| 19606 |
t.propersuperset = 713; |
| 19607 |
t.reflexsuperset = 713; |
| 19608 |
t.notsubset = 713; |
| 19609 |
t.propersubset = 713; |
| 19610 |
t.reflexsubset = 713; |
| 19611 |
t.element = 713; |
| 19612 |
t.notelement = 713; |
| 19613 |
t.angle = 768; |
| 19614 |
t.gradient = 713; |
| 19615 |
t.registerserif = 790; |
| 19616 |
t.copyrightserif = 790; |
| 19617 |
t.trademarkserif = 890; |
| 19618 |
t.product = 823; |
| 19619 |
t.radical = 549; |
| 19620 |
t.dotmath = 250; |
| 19621 |
t.logicalnot = 713; |
| 19622 |
t.logicaland = 603; |
| 19623 |
t.logicalor = 603; |
| 19624 |
t.arrowdblboth = 1042; |
| 19625 |
t.arrowdblleft = 987; |
| 19626 |
t.arrowdblup = 603; |
| 19627 |
t.arrowdblright = 987; |
| 19628 |
t.arrowdbldown = 603; |
| 19629 |
t.lozenge = 494; |
| 19630 |
t.angleleft = 329; |
| 19631 |
t.registersans = 790; |
| 19632 |
t.copyrightsans = 790; |
| 19633 |
t.trademarksans = 786; |
| 19634 |
t.summation = 713; |
| 19635 |
t.parenlefttp = 384; |
| 19636 |
t.parenleftex = 384; |
| 19637 |
t.parenleftbt = 384; |
| 19638 |
t.bracketlefttp = 384; |
| 19639 |
t.bracketleftex = 384; |
| 19640 |
t.bracketleftbt = 384; |
| 19641 |
t.bracelefttp = 494; |
| 19642 |
t.braceleftmid = 494; |
| 19643 |
t.braceleftbt = 494; |
| 19644 |
t.braceex = 494; |
| 19645 |
t.angleright = 329; |
| 19646 |
t.integral = 274; |
| 19647 |
t.integraltp = 686; |
| 19648 |
t.integralex = 686; |
| 19649 |
t.integralbt = 686; |
| 19650 |
t.parenrighttp = 384; |
| 19651 |
t.parenrightex = 384; |
| 19652 |
t.parenrightbt = 384; |
| 19653 |
t.bracketrighttp = 384; |
| 19654 |
t.bracketrightex = 384; |
| 19655 |
t.bracketrightbt = 384; |
| 19656 |
t.bracerighttp = 494; |
| 19657 |
t.bracerightmid = 494; |
| 19658 |
t.bracerightbt = 494; |
| 19659 |
t.apple = 790; |
| 19660 |
}); |
| 19661 |
t["Times-Roman"] = getLookupTableFactory(function (t) { |
| 19662 |
t.space = 250; |
| 19663 |
t.exclam = 333; |
| 19664 |
t.quotedbl = 408; |
| 19665 |
t.numbersign = 500; |
| 19666 |
t.dollar = 500; |
| 19667 |
t.percent = 833; |
| 19668 |
t.ampersand = 778; |
| 19669 |
t.quoteright = 333; |
| 19670 |
t.parenleft = 333; |
| 19671 |
t.parenright = 333; |
| 19672 |
t.asterisk = 500; |
| 19673 |
t.plus = 564; |
| 19674 |
t.comma = 250; |
| 19675 |
t.hyphen = 333; |
| 19676 |
t.period = 250; |
| 19677 |
t.slash = 278; |
| 19678 |
t.zero = 500; |
| 19679 |
t.one = 500; |
| 19680 |
t.two = 500; |
| 19681 |
t.three = 500; |
| 19682 |
t.four = 500; |
| 19683 |
t.five = 500; |
| 19684 |
t.six = 500; |
| 19685 |
t.seven = 500; |
| 19686 |
t.eight = 500; |
| 19687 |
t.nine = 500; |
| 19688 |
t.colon = 278; |
| 19689 |
t.semicolon = 278; |
| 19690 |
t.less = 564; |
| 19691 |
t.equal = 564; |
| 19692 |
t.greater = 564; |
| 19693 |
t.question = 444; |
| 19694 |
t.at = 921; |
| 19695 |
t.A = 722; |
| 19696 |
t.B = 667; |
| 19697 |
t.C = 667; |
| 19698 |
t.D = 722; |
| 19699 |
t.E = 611; |
| 19700 |
t.F = 556; |
| 19701 |
t.G = 722; |
| 19702 |
t.H = 722; |
| 19703 |
t.I = 333; |
| 19704 |
t.J = 389; |
| 19705 |
t.K = 722; |
| 19706 |
t.L = 611; |
| 19707 |
t.M = 889; |
| 19708 |
t.N = 722; |
| 19709 |
t.O = 722; |
| 19710 |
t.P = 556; |
| 19711 |
t.Q = 722; |
| 19712 |
t.R = 667; |
| 19713 |
t.S = 556; |
| 19714 |
t.T = 611; |
| 19715 |
t.U = 722; |
| 19716 |
t.V = 722; |
| 19717 |
t.W = 944; |
| 19718 |
t.X = 722; |
| 19719 |
t.Y = 722; |
| 19720 |
t.Z = 611; |
| 19721 |
t.bracketleft = 333; |
| 19722 |
t.backslash = 278; |
| 19723 |
t.bracketright = 333; |
| 19724 |
t.asciicircum = 469; |
| 19725 |
t.underscore = 500; |
| 19726 |
t.quoteleft = 333; |
| 19727 |
t.a = 444; |
| 19728 |
t.b = 500; |
| 19729 |
t.c = 444; |
| 19730 |
t.d = 500; |
| 19731 |
t.e = 444; |
| 19732 |
t.f = 333; |
| 19733 |
t.g = 500; |
| 19734 |
t.h = 500; |
| 19735 |
t.i = 278; |
| 19736 |
t.j = 278; |
| 19737 |
t.k = 500; |
| 19738 |
t.l = 278; |
| 19739 |
t.m = 778; |
| 19740 |
t.n = 500; |
| 19741 |
t.o = 500; |
| 19742 |
t.p = 500; |
| 19743 |
t.q = 500; |
| 19744 |
t.r = 333; |
| 19745 |
t.s = 389; |
| 19746 |
t.t = 278; |
| 19747 |
t.u = 500; |
| 19748 |
t.v = 500; |
| 19749 |
t.w = 722; |
| 19750 |
t.x = 500; |
| 19751 |
t.y = 500; |
| 19752 |
t.z = 444; |
| 19753 |
t.braceleft = 480; |
| 19754 |
t.bar = 200; |
| 19755 |
t.braceright = 480; |
| 19756 |
t.asciitilde = 541; |
| 19757 |
t.exclamdown = 333; |
| 19758 |
t.cent = 500; |
| 19759 |
t.sterling = 500; |
| 19760 |
t.fraction = 167; |
| 19761 |
t.yen = 500; |
| 19762 |
t.florin = 500; |
| 19763 |
t.section = 500; |
| 19764 |
t.currency = 500; |
| 19765 |
t.quotesingle = 180; |
| 19766 |
t.quotedblleft = 444; |
| 19767 |
t.guillemotleft = 500; |
| 19768 |
t.guilsinglleft = 333; |
| 19769 |
t.guilsinglright = 333; |
| 19770 |
t.fi = 556; |
| 19771 |
t.fl = 556; |
| 19772 |
t.endash = 500; |
| 19773 |
t.dagger = 500; |
| 19774 |
t.daggerdbl = 500; |
| 19775 |
t.periodcentered = 250; |
| 19776 |
t.paragraph = 453; |
| 19777 |
t.bullet = 350; |
| 19778 |
t.quotesinglbase = 333; |
| 19779 |
t.quotedblbase = 444; |
| 19780 |
t.quotedblright = 444; |
| 19781 |
t.guillemotright = 500; |
| 19782 |
t.ellipsis = 1000; |
| 19783 |
t.perthousand = 1000; |
| 19784 |
t.questiondown = 444; |
| 19785 |
t.grave = 333; |
| 19786 |
t.acute = 333; |
| 19787 |
t.circumflex = 333; |
| 19788 |
t.tilde = 333; |
| 19789 |
t.macron = 333; |
| 19790 |
t.breve = 333; |
| 19791 |
t.dotaccent = 333; |
| 19792 |
t.dieresis = 333; |
| 19793 |
t.ring = 333; |
| 19794 |
t.cedilla = 333; |
| 19795 |
t.hungarumlaut = 333; |
| 19796 |
t.ogonek = 333; |
| 19797 |
t.caron = 333; |
| 19798 |
t.emdash = 1000; |
| 19799 |
t.AE = 889; |
| 19800 |
t.ordfeminine = 276; |
| 19801 |
t.Lslash = 611; |
| 19802 |
t.Oslash = 722; |
| 19803 |
t.OE = 889; |
| 19804 |
t.ordmasculine = 310; |
| 19805 |
t.ae = 667; |
| 19806 |
t.dotlessi = 278; |
| 19807 |
t.lslash = 278; |
| 19808 |
t.oslash = 500; |
| 19809 |
t.oe = 722; |
| 19810 |
t.germandbls = 500; |
| 19811 |
t.Idieresis = 333; |
| 19812 |
t.eacute = 444; |
| 19813 |
t.abreve = 444; |
| 19814 |
t.uhungarumlaut = 500; |
| 19815 |
t.ecaron = 444; |
| 19816 |
t.Ydieresis = 722; |
| 19817 |
t.divide = 564; |
| 19818 |
t.Yacute = 722; |
| 19819 |
t.Acircumflex = 722; |
| 19820 |
t.aacute = 444; |
| 19821 |
t.Ucircumflex = 722; |
| 19822 |
t.yacute = 500; |
| 19823 |
t.scommaaccent = 389; |
| 19824 |
t.ecircumflex = 444; |
| 19825 |
t.Uring = 722; |
| 19826 |
t.Udieresis = 722; |
| 19827 |
t.aogonek = 444; |
| 19828 |
t.Uacute = 722; |
| 19829 |
t.uogonek = 500; |
| 19830 |
t.Edieresis = 611; |
| 19831 |
t.Dcroat = 722; |
| 19832 |
t.commaaccent = 250; |
| 19833 |
t.copyright = 760; |
| 19834 |
t.Emacron = 611; |
| 19835 |
t.ccaron = 444; |
| 19836 |
t.aring = 444; |
| 19837 |
t.Ncommaaccent = 722; |
| 19838 |
t.lacute = 278; |
| 19839 |
t.agrave = 444; |
| 19840 |
t.Tcommaaccent = 611; |
| 19841 |
t.Cacute = 667; |
| 19842 |
t.atilde = 444; |
| 19843 |
t.Edotaccent = 611; |
| 19844 |
t.scaron = 389; |
| 19845 |
t.scedilla = 389; |
| 19846 |
t.iacute = 278; |
| 19847 |
t.lozenge = 471; |
| 19848 |
t.Rcaron = 667; |
| 19849 |
t.Gcommaaccent = 722; |
| 19850 |
t.ucircumflex = 500; |
| 19851 |
t.acircumflex = 444; |
| 19852 |
t.Amacron = 722; |
| 19853 |
t.rcaron = 333; |
| 19854 |
t.ccedilla = 444; |
| 19855 |
t.Zdotaccent = 611; |
| 19856 |
t.Thorn = 556; |
| 19857 |
t.Omacron = 722; |
| 19858 |
t.Racute = 667; |
| 19859 |
t.Sacute = 556; |
| 19860 |
t.dcaron = 588; |
| 19861 |
t.Umacron = 722; |
| 19862 |
t.uring = 500; |
| 19863 |
t.threesuperior = 300; |
| 19864 |
t.Ograve = 722; |
| 19865 |
t.Agrave = 722; |
| 19866 |
t.Abreve = 722; |
| 19867 |
t.multiply = 564; |
| 19868 |
t.uacute = 500; |
| 19869 |
t.Tcaron = 611; |
| 19870 |
t.partialdiff = 476; |
| 19871 |
t.ydieresis = 500; |
| 19872 |
t.Nacute = 722; |
| 19873 |
t.icircumflex = 278; |
| 19874 |
t.Ecircumflex = 611; |
| 19875 |
t.adieresis = 444; |
| 19876 |
t.edieresis = 444; |
| 19877 |
t.cacute = 444; |
| 19878 |
t.nacute = 500; |
| 19879 |
t.umacron = 500; |
| 19880 |
t.Ncaron = 722; |
| 19881 |
t.Iacute = 333; |
| 19882 |
t.plusminus = 564; |
| 19883 |
t.brokenbar = 200; |
| 19884 |
t.registered = 760; |
| 19885 |
t.Gbreve = 722; |
| 19886 |
t.Idotaccent = 333; |
| 19887 |
t.summation = 600; |
| 19888 |
t.Egrave = 611; |
| 19889 |
t.racute = 333; |
| 19890 |
t.omacron = 500; |
| 19891 |
t.Zacute = 611; |
| 19892 |
t.Zcaron = 611; |
| 19893 |
t.greaterequal = 549; |
| 19894 |
t.Eth = 722; |
| 19895 |
t.Ccedilla = 667; |
| 19896 |
t.lcommaaccent = 278; |
| 19897 |
t.tcaron = 326; |
| 19898 |
t.eogonek = 444; |
| 19899 |
t.Uogonek = 722; |
| 19900 |
t.Aacute = 722; |
| 19901 |
t.Adieresis = 722; |
| 19902 |
t.egrave = 444; |
| 19903 |
t.zacute = 444; |
| 19904 |
t.iogonek = 278; |
| 19905 |
t.Oacute = 722; |
| 19906 |
t.oacute = 500; |
| 19907 |
t.amacron = 444; |
| 19908 |
t.sacute = 389; |
| 19909 |
t.idieresis = 278; |
| 19910 |
t.Ocircumflex = 722; |
| 19911 |
t.Ugrave = 722; |
| 19912 |
t.Delta = 612; |
| 19913 |
t.thorn = 500; |
| 19914 |
t.twosuperior = 300; |
| 19915 |
t.Odieresis = 722; |
| 19916 |
t.mu = 500; |
| 19917 |
t.igrave = 278; |
| 19918 |
t.ohungarumlaut = 500; |
| 19919 |
t.Eogonek = 611; |
| 19920 |
t.dcroat = 500; |
| 19921 |
t.threequarters = 750; |
| 19922 |
t.Scedilla = 556; |
| 19923 |
t.lcaron = 344; |
| 19924 |
t.Kcommaaccent = 722; |
| 19925 |
t.Lacute = 611; |
| 19926 |
t.trademark = 980; |
| 19927 |
t.edotaccent = 444; |
| 19928 |
t.Igrave = 333; |
| 19929 |
t.Imacron = 333; |
| 19930 |
t.Lcaron = 611; |
| 19931 |
t.onehalf = 750; |
| 19932 |
t.lessequal = 549; |
| 19933 |
t.ocircumflex = 500; |
| 19934 |
t.ntilde = 500; |
| 19935 |
t.Uhungarumlaut = 722; |
| 19936 |
t.Eacute = 611; |
| 19937 |
t.emacron = 444; |
| 19938 |
t.gbreve = 500; |
| 19939 |
t.onequarter = 750; |
| 19940 |
t.Scaron = 556; |
| 19941 |
t.Scommaaccent = 556; |
| 19942 |
t.Ohungarumlaut = 722; |
| 19943 |
t.degree = 400; |
| 19944 |
t.ograve = 500; |
| 19945 |
t.Ccaron = 667; |
| 19946 |
t.ugrave = 500; |
| 19947 |
t.radical = 453; |
| 19948 |
t.Dcaron = 722; |
| 19949 |
t.rcommaaccent = 333; |
| 19950 |
t.Ntilde = 722; |
| 19951 |
t.otilde = 500; |
| 19952 |
t.Rcommaaccent = 667; |
| 19953 |
t.Lcommaaccent = 611; |
| 19954 |
t.Atilde = 722; |
| 19955 |
t.Aogonek = 722; |
| 19956 |
t.Aring = 722; |
| 19957 |
t.Otilde = 722; |
| 19958 |
t.zdotaccent = 444; |
| 19959 |
t.Ecaron = 611; |
| 19960 |
t.Iogonek = 333; |
| 19961 |
t.kcommaaccent = 500; |
| 19962 |
t.minus = 564; |
| 19963 |
t.Icircumflex = 333; |
| 19964 |
t.ncaron = 500; |
| 19965 |
t.tcommaaccent = 278; |
| 19966 |
t.logicalnot = 564; |
| 19967 |
t.odieresis = 500; |
| 19968 |
t.udieresis = 500; |
| 19969 |
t.notequal = 549; |
| 19970 |
t.gcommaaccent = 500; |
| 19971 |
t.eth = 500; |
| 19972 |
t.zcaron = 444; |
| 19973 |
t.ncommaaccent = 500; |
| 19974 |
t.onesuperior = 300; |
| 19975 |
t.imacron = 278; |
| 19976 |
t.Euro = 500; |
| 19977 |
}); |
| 19978 |
t["Times-Bold"] = getLookupTableFactory(function (t) { |
| 19979 |
t.space = 250; |
| 19980 |
t.exclam = 333; |
| 19981 |
t.quotedbl = 555; |
| 19982 |
t.numbersign = 500; |
| 19983 |
t.dollar = 500; |
| 19984 |
t.percent = 1000; |
| 19985 |
t.ampersand = 833; |
| 19986 |
t.quoteright = 333; |
| 19987 |
t.parenleft = 333; |
| 19988 |
t.parenright = 333; |
| 19989 |
t.asterisk = 500; |
| 19990 |
t.plus = 570; |
| 19991 |
t.comma = 250; |
| 19992 |
t.hyphen = 333; |
| 19993 |
t.period = 250; |
| 19994 |
t.slash = 278; |
| 19995 |
t.zero = 500; |
| 19996 |
t.one = 500; |
| 19997 |
t.two = 500; |
| 19998 |
t.three = 500; |
| 19999 |
t.four = 500; |
| 20000 |
t.five = 500; |
| 20001 |
t.six = 500; |
| 20002 |
t.seven = 500; |
| 20003 |
t.eight = 500; |
| 20004 |
t.nine = 500; |
| 20005 |
t.colon = 333; |
| 20006 |
t.semicolon = 333; |
| 20007 |
t.less = 570; |
| 20008 |
t.equal = 570; |
| 20009 |
t.greater = 570; |
| 20010 |
t.question = 500; |
| 20011 |
t.at = 930; |
| 20012 |
t.A = 722; |
| 20013 |
t.B = 667; |
| 20014 |
t.C = 722; |
| 20015 |
t.D = 722; |
| 20016 |
t.E = 667; |
| 20017 |
t.F = 611; |
| 20018 |
t.G = 778; |
| 20019 |
t.H = 778; |
| 20020 |
t.I = 389; |
| 20021 |
t.J = 500; |
| 20022 |
t.K = 778; |
| 20023 |
t.L = 667; |
| 20024 |
t.M = 944; |
| 20025 |
t.N = 722; |
| 20026 |
t.O = 778; |
| 20027 |
t.P = 611; |
| 20028 |
t.Q = 778; |
| 20029 |
t.R = 722; |
| 20030 |
t.S = 556; |
| 20031 |
t.T = 667; |
| 20032 |
t.U = 722; |
| 20033 |
t.V = 722; |
| 20034 |
t.W = 1000; |
| 20035 |
t.X = 722; |
| 20036 |
t.Y = 722; |
| 20037 |
t.Z = 667; |
| 20038 |
t.bracketleft = 333; |
| 20039 |
t.backslash = 278; |
| 20040 |
t.bracketright = 333; |
| 20041 |
t.asciicircum = 581; |
| 20042 |
t.underscore = 500; |
| 20043 |
t.quoteleft = 333; |
| 20044 |
t.a = 500; |
| 20045 |
t.b = 556; |
| 20046 |
t.c = 444; |
| 20047 |
t.d = 556; |
| 20048 |
t.e = 444; |
| 20049 |
t.f = 333; |
| 20050 |
t.g = 500; |
| 20051 |
t.h = 556; |
| 20052 |
t.i = 278; |
| 20053 |
t.j = 333; |
| 20054 |
t.k = 556; |
| 20055 |
t.l = 278; |
| 20056 |
t.m = 833; |
| 20057 |
t.n = 556; |
| 20058 |
t.o = 500; |
| 20059 |
t.p = 556; |
| 20060 |
t.q = 556; |
| 20061 |
t.r = 444; |
| 20062 |
t.s = 389; |
| 20063 |
t.t = 333; |
| 20064 |
t.u = 556; |
| 20065 |
t.v = 500; |
| 20066 |
t.w = 722; |
| 20067 |
t.x = 500; |
| 20068 |
t.y = 500; |
| 20069 |
t.z = 444; |
| 20070 |
t.braceleft = 394; |
| 20071 |
t.bar = 220; |
| 20072 |
t.braceright = 394; |
| 20073 |
t.asciitilde = 520; |
| 20074 |
t.exclamdown = 333; |
| 20075 |
t.cent = 500; |
| 20076 |
t.sterling = 500; |
| 20077 |
t.fraction = 167; |
| 20078 |
t.yen = 500; |
| 20079 |
t.florin = 500; |
| 20080 |
t.section = 500; |
| 20081 |
t.currency = 500; |
| 20082 |
t.quotesingle = 278; |
| 20083 |
t.quotedblleft = 500; |
| 20084 |
t.guillemotleft = 500; |
| 20085 |
t.guilsinglleft = 333; |
| 20086 |
t.guilsinglright = 333; |
| 20087 |
t.fi = 556; |
| 20088 |
t.fl = 556; |
| 20089 |
t.endash = 500; |
| 20090 |
t.dagger = 500; |
| 20091 |
t.daggerdbl = 500; |
| 20092 |
t.periodcentered = 250; |
| 20093 |
t.paragraph = 540; |
| 20094 |
t.bullet = 350; |
| 20095 |
t.quotesinglbase = 333; |
| 20096 |
t.quotedblbase = 500; |
| 20097 |
t.quotedblright = 500; |
| 20098 |
t.guillemotright = 500; |
| 20099 |
t.ellipsis = 1000; |
| 20100 |
t.perthousand = 1000; |
| 20101 |
t.questiondown = 500; |
| 20102 |
t.grave = 333; |
| 20103 |
t.acute = 333; |
| 20104 |
t.circumflex = 333; |
| 20105 |
t.tilde = 333; |
| 20106 |
t.macron = 333; |
| 20107 |
t.breve = 333; |
| 20108 |
t.dotaccent = 333; |
| 20109 |
t.dieresis = 333; |
| 20110 |
t.ring = 333; |
| 20111 |
t.cedilla = 333; |
| 20112 |
t.hungarumlaut = 333; |
| 20113 |
t.ogonek = 333; |
| 20114 |
t.caron = 333; |
| 20115 |
t.emdash = 1000; |
| 20116 |
t.AE = 1000; |
| 20117 |
t.ordfeminine = 300; |
| 20118 |
t.Lslash = 667; |
| 20119 |
t.Oslash = 778; |
| 20120 |
t.OE = 1000; |
| 20121 |
t.ordmasculine = 330; |
| 20122 |
t.ae = 722; |
| 20123 |
t.dotlessi = 278; |
| 20124 |
t.lslash = 278; |
| 20125 |
t.oslash = 500; |
| 20126 |
t.oe = 722; |
| 20127 |
t.germandbls = 556; |
| 20128 |
t.Idieresis = 389; |
| 20129 |
t.eacute = 444; |
| 20130 |
t.abreve = 500; |
| 20131 |
t.uhungarumlaut = 556; |
| 20132 |
t.ecaron = 444; |
| 20133 |
t.Ydieresis = 722; |
| 20134 |
t.divide = 570; |
| 20135 |
t.Yacute = 722; |
| 20136 |
t.Acircumflex = 722; |
| 20137 |
t.aacute = 500; |
| 20138 |
t.Ucircumflex = 722; |
| 20139 |
t.yacute = 500; |
| 20140 |
t.scommaaccent = 389; |
| 20141 |
t.ecircumflex = 444; |
| 20142 |
t.Uring = 722; |
| 20143 |
t.Udieresis = 722; |
| 20144 |
t.aogonek = 500; |
| 20145 |
t.Uacute = 722; |
| 20146 |
t.uogonek = 556; |
| 20147 |
t.Edieresis = 667; |
| 20148 |
t.Dcroat = 722; |
| 20149 |
t.commaaccent = 250; |
| 20150 |
t.copyright = 747; |
| 20151 |
t.Emacron = 667; |
| 20152 |
t.ccaron = 444; |
| 20153 |
t.aring = 500; |
| 20154 |
t.Ncommaaccent = 722; |
| 20155 |
t.lacute = 278; |
| 20156 |
t.agrave = 500; |
| 20157 |
t.Tcommaaccent = 667; |
| 20158 |
t.Cacute = 722; |
| 20159 |
t.atilde = 500; |
| 20160 |
t.Edotaccent = 667; |
| 20161 |
t.scaron = 389; |
| 20162 |
t.scedilla = 389; |
| 20163 |
t.iacute = 278; |
| 20164 |
t.lozenge = 494; |
| 20165 |
t.Rcaron = 722; |
| 20166 |
t.Gcommaaccent = 778; |
| 20167 |
t.ucircumflex = 556; |
| 20168 |
t.acircumflex = 500; |
| 20169 |
t.Amacron = 722; |
| 20170 |
t.rcaron = 444; |
| 20171 |
t.ccedilla = 444; |
| 20172 |
t.Zdotaccent = 667; |
| 20173 |
t.Thorn = 611; |
| 20174 |
t.Omacron = 778; |
| 20175 |
t.Racute = 722; |
| 20176 |
t.Sacute = 556; |
| 20177 |
t.dcaron = 672; |
| 20178 |
t.Umacron = 722; |
| 20179 |
t.uring = 556; |
| 20180 |
t.threesuperior = 300; |
| 20181 |
t.Ograve = 778; |
| 20182 |
t.Agrave = 722; |
| 20183 |
t.Abreve = 722; |
| 20184 |
t.multiply = 570; |
| 20185 |
t.uacute = 556; |
| 20186 |
t.Tcaron = 667; |
| 20187 |
t.partialdiff = 494; |
| 20188 |
t.ydieresis = 500; |
| 20189 |
t.Nacute = 722; |
| 20190 |
t.icircumflex = 278; |
| 20191 |
t.Ecircumflex = 667; |
| 20192 |
t.adieresis = 500; |
| 20193 |
t.edieresis = 444; |
| 20194 |
t.cacute = 444; |
| 20195 |
t.nacute = 556; |
| 20196 |
t.umacron = 556; |
| 20197 |
t.Ncaron = 722; |
| 20198 |
t.Iacute = 389; |
| 20199 |
t.plusminus = 570; |
| 20200 |
t.brokenbar = 220; |
| 20201 |
t.registered = 747; |
| 20202 |
t.Gbreve = 778; |
| 20203 |
t.Idotaccent = 389; |
| 20204 |
t.summation = 600; |
| 20205 |
t.Egrave = 667; |
| 20206 |
t.racute = 444; |
| 20207 |
t.omacron = 500; |
| 20208 |
t.Zacute = 667; |
| 20209 |
t.Zcaron = 667; |
| 20210 |
t.greaterequal = 549; |
| 20211 |
t.Eth = 722; |
| 20212 |
t.Ccedilla = 722; |
| 20213 |
t.lcommaaccent = 278; |
| 20214 |
t.tcaron = 416; |
| 20215 |
t.eogonek = 444; |
| 20216 |
t.Uogonek = 722; |
| 20217 |
t.Aacute = 722; |
| 20218 |
t.Adieresis = 722; |
| 20219 |
t.egrave = 444; |
| 20220 |
t.zacute = 444; |
| 20221 |
t.iogonek = 278; |
| 20222 |
t.Oacute = 778; |
| 20223 |
t.oacute = 500; |
| 20224 |
t.amacron = 500; |
| 20225 |
t.sacute = 389; |
| 20226 |
t.idieresis = 278; |
| 20227 |
t.Ocircumflex = 778; |
| 20228 |
t.Ugrave = 722; |
| 20229 |
t.Delta = 612; |
| 20230 |
t.thorn = 556; |
| 20231 |
t.twosuperior = 300; |
| 20232 |
t.Odieresis = 778; |
| 20233 |
t.mu = 556; |
| 20234 |
t.igrave = 278; |
| 20235 |
t.ohungarumlaut = 500; |
| 20236 |
t.Eogonek = 667; |
| 20237 |
t.dcroat = 556; |
| 20238 |
t.threequarters = 750; |
| 20239 |
t.Scedilla = 556; |
| 20240 |
t.lcaron = 394; |
| 20241 |
t.Kcommaaccent = 778; |
| 20242 |
t.Lacute = 667; |
| 20243 |
t.trademark = 1000; |
| 20244 |
t.edotaccent = 444; |
| 20245 |
t.Igrave = 389; |
| 20246 |
t.Imacron = 389; |
| 20247 |
t.Lcaron = 667; |
| 20248 |
t.onehalf = 750; |
| 20249 |
t.lessequal = 549; |
| 20250 |
t.ocircumflex = 500; |
| 20251 |
t.ntilde = 556; |
| 20252 |
t.Uhungarumlaut = 722; |
| 20253 |
t.Eacute = 667; |
| 20254 |
t.emacron = 444; |
| 20255 |
t.gbreve = 500; |
| 20256 |
t.onequarter = 750; |
| 20257 |
t.Scaron = 556; |
| 20258 |
t.Scommaaccent = 556; |
| 20259 |
t.Ohungarumlaut = 778; |
| 20260 |
t.degree = 400; |
| 20261 |
t.ograve = 500; |
| 20262 |
t.Ccaron = 722; |
| 20263 |
t.ugrave = 556; |
| 20264 |
t.radical = 549; |
| 20265 |
t.Dcaron = 722; |
| 20266 |
t.rcommaaccent = 444; |
| 20267 |
t.Ntilde = 722; |
| 20268 |
t.otilde = 500; |
| 20269 |
t.Rcommaaccent = 722; |
| 20270 |
t.Lcommaaccent = 667; |
| 20271 |
t.Atilde = 722; |
| 20272 |
t.Aogonek = 722; |
| 20273 |
t.Aring = 722; |
| 20274 |
t.Otilde = 778; |
| 20275 |
t.zdotaccent = 444; |
| 20276 |
t.Ecaron = 667; |
| 20277 |
t.Iogonek = 389; |
| 20278 |
t.kcommaaccent = 556; |
| 20279 |
t.minus = 570; |
| 20280 |
t.Icircumflex = 389; |
| 20281 |
t.ncaron = 556; |
| 20282 |
t.tcommaaccent = 333; |
| 20283 |
t.logicalnot = 570; |
| 20284 |
t.odieresis = 500; |
| 20285 |
t.udieresis = 556; |
| 20286 |
t.notequal = 549; |
| 20287 |
t.gcommaaccent = 500; |
| 20288 |
t.eth = 500; |
| 20289 |
t.zcaron = 444; |
| 20290 |
t.ncommaaccent = 556; |
| 20291 |
t.onesuperior = 300; |
| 20292 |
t.imacron = 278; |
| 20293 |
t.Euro = 500; |
| 20294 |
}); |
| 20295 |
t["Times-BoldItalic"] = getLookupTableFactory(function (t) { |
| 20296 |
t.space = 250; |
| 20297 |
t.exclam = 389; |
| 20298 |
t.quotedbl = 555; |
| 20299 |
t.numbersign = 500; |
| 20300 |
t.dollar = 500; |
| 20301 |
t.percent = 833; |
| 20302 |
t.ampersand = 778; |
| 20303 |
t.quoteright = 333; |
| 20304 |
t.parenleft = 333; |
| 20305 |
t.parenright = 333; |
| 20306 |
t.asterisk = 500; |
| 20307 |
t.plus = 570; |
| 20308 |
t.comma = 250; |
| 20309 |
t.hyphen = 333; |
| 20310 |
t.period = 250; |
| 20311 |
t.slash = 278; |
| 20312 |
t.zero = 500; |
| 20313 |
t.one = 500; |
| 20314 |
t.two = 500; |
| 20315 |
t.three = 500; |
| 20316 |
t.four = 500; |
| 20317 |
t.five = 500; |
| 20318 |
t.six = 500; |
| 20319 |
t.seven = 500; |
| 20320 |
t.eight = 500; |
| 20321 |
t.nine = 500; |
| 20322 |
t.colon = 333; |
| 20323 |
t.semicolon = 333; |
| 20324 |
t.less = 570; |
| 20325 |
t.equal = 570; |
| 20326 |
t.greater = 570; |
| 20327 |
t.question = 500; |
| 20328 |
t.at = 832; |
| 20329 |
t.A = 667; |
| 20330 |
t.B = 667; |
| 20331 |
t.C = 667; |
| 20332 |
t.D = 722; |
| 20333 |
t.E = 667; |
| 20334 |
t.F = 667; |
| 20335 |
t.G = 722; |
| 20336 |
t.H = 778; |
| 20337 |
t.I = 389; |
| 20338 |
t.J = 500; |
| 20339 |
t.K = 667; |
| 20340 |
t.L = 611; |
| 20341 |
t.M = 889; |
| 20342 |
t.N = 722; |
| 20343 |
t.O = 722; |
| 20344 |
t.P = 611; |
| 20345 |
t.Q = 722; |
| 20346 |
t.R = 667; |
| 20347 |
t.S = 556; |
| 20348 |
t.T = 611; |
| 20349 |
t.U = 722; |
| 20350 |
t.V = 667; |
| 20351 |
t.W = 889; |
| 20352 |
t.X = 667; |
| 20353 |
t.Y = 611; |
| 20354 |
t.Z = 611; |
| 20355 |
t.bracketleft = 333; |
| 20356 |
t.backslash = 278; |
| 20357 |
t.bracketright = 333; |
| 20358 |
t.asciicircum = 570; |
| 20359 |
t.underscore = 500; |
| 20360 |
t.quoteleft = 333; |
| 20361 |
t.a = 500; |
| 20362 |
t.b = 500; |
| 20363 |
t.c = 444; |
| 20364 |
t.d = 500; |
| 20365 |
t.e = 444; |
| 20366 |
t.f = 333; |
| 20367 |
t.g = 500; |
| 20368 |
t.h = 556; |
| 20369 |
t.i = 278; |
| 20370 |
t.j = 278; |
| 20371 |
t.k = 500; |
| 20372 |
t.l = 278; |
| 20373 |
t.m = 778; |
| 20374 |
t.n = 556; |
| 20375 |
t.o = 500; |
| 20376 |
t.p = 500; |
| 20377 |
t.q = 500; |
| 20378 |
t.r = 389; |
| 20379 |
t.s = 389; |
| 20380 |
t.t = 278; |
| 20381 |
t.u = 556; |
| 20382 |
t.v = 444; |
| 20383 |
t.w = 667; |
| 20384 |
t.x = 500; |
| 20385 |
t.y = 444; |
| 20386 |
t.z = 389; |
| 20387 |
t.braceleft = 348; |
| 20388 |
t.bar = 220; |
| 20389 |
t.braceright = 348; |
| 20390 |
t.asciitilde = 570; |
| 20391 |
t.exclamdown = 389; |
| 20392 |
t.cent = 500; |
| 20393 |
t.sterling = 500; |
| 20394 |
t.fraction = 167; |
| 20395 |
t.yen = 500; |
| 20396 |
t.florin = 500; |
| 20397 |
t.section = 500; |
| 20398 |
t.currency = 500; |
| 20399 |
t.quotesingle = 278; |
| 20400 |
t.quotedblleft = 500; |
| 20401 |
t.guillemotleft = 500; |
| 20402 |
t.guilsinglleft = 333; |
| 20403 |
t.guilsinglright = 333; |
| 20404 |
t.fi = 556; |
| 20405 |
t.fl = 556; |
| 20406 |
t.endash = 500; |
| 20407 |
t.dagger = 500; |
| 20408 |
t.daggerdbl = 500; |
| 20409 |
t.periodcentered = 250; |
| 20410 |
t.paragraph = 500; |
| 20411 |
t.bullet = 350; |
| 20412 |
t.quotesinglbase = 333; |
| 20413 |
t.quotedblbase = 500; |
| 20414 |
t.quotedblright = 500; |
| 20415 |
t.guillemotright = 500; |
| 20416 |
t.ellipsis = 1000; |
| 20417 |
t.perthousand = 1000; |
| 20418 |
t.questiondown = 500; |
| 20419 |
t.grave = 333; |
| 20420 |
t.acute = 333; |
| 20421 |
t.circumflex = 333; |
| 20422 |
t.tilde = 333; |
| 20423 |
t.macron = 333; |
| 20424 |
t.breve = 333; |
| 20425 |
t.dotaccent = 333; |
| 20426 |
t.dieresis = 333; |
| 20427 |
t.ring = 333; |
| 20428 |
t.cedilla = 333; |
| 20429 |
t.hungarumlaut = 333; |
| 20430 |
t.ogonek = 333; |
| 20431 |
t.caron = 333; |
| 20432 |
t.emdash = 1000; |
| 20433 |
t.AE = 944; |
| 20434 |
t.ordfeminine = 266; |
| 20435 |
t.Lslash = 611; |
| 20436 |
t.Oslash = 722; |
| 20437 |
t.OE = 944; |
| 20438 |
t.ordmasculine = 300; |
| 20439 |
t.ae = 722; |
| 20440 |
t.dotlessi = 278; |
| 20441 |
t.lslash = 278; |
| 20442 |
t.oslash = 500; |
| 20443 |
t.oe = 722; |
| 20444 |
t.germandbls = 500; |
| 20445 |
t.Idieresis = 389; |
| 20446 |
t.eacute = 444; |
| 20447 |
t.abreve = 500; |
| 20448 |
t.uhungarumlaut = 556; |
| 20449 |
t.ecaron = 444; |
| 20450 |
t.Ydieresis = 611; |
| 20451 |
t.divide = 570; |
| 20452 |
t.Yacute = 611; |
| 20453 |
t.Acircumflex = 667; |
| 20454 |
t.aacute = 500; |
| 20455 |
t.Ucircumflex = 722; |
| 20456 |
t.yacute = 444; |
| 20457 |
t.scommaaccent = 389; |
| 20458 |
t.ecircumflex = 444; |
| 20459 |
t.Uring = 722; |
| 20460 |
t.Udieresis = 722; |
| 20461 |
t.aogonek = 500; |
| 20462 |
t.Uacute = 722; |
| 20463 |
t.uogonek = 556; |
| 20464 |
t.Edieresis = 667; |
| 20465 |
t.Dcroat = 722; |
| 20466 |
t.commaaccent = 250; |
| 20467 |
t.copyright = 747; |
| 20468 |
t.Emacron = 667; |
| 20469 |
t.ccaron = 444; |
| 20470 |
t.aring = 500; |
| 20471 |
t.Ncommaaccent = 722; |
| 20472 |
t.lacute = 278; |
| 20473 |
t.agrave = 500; |
| 20474 |
t.Tcommaaccent = 611; |
| 20475 |
t.Cacute = 667; |
| 20476 |
t.atilde = 500; |
| 20477 |
t.Edotaccent = 667; |
| 20478 |
t.scaron = 389; |
| 20479 |
t.scedilla = 389; |
| 20480 |
t.iacute = 278; |
| 20481 |
t.lozenge = 494; |
| 20482 |
t.Rcaron = 667; |
| 20483 |
t.Gcommaaccent = 722; |
| 20484 |
t.ucircumflex = 556; |
| 20485 |
t.acircumflex = 500; |
| 20486 |
t.Amacron = 667; |
| 20487 |
t.rcaron = 389; |
| 20488 |
t.ccedilla = 444; |
| 20489 |
t.Zdotaccent = 611; |
| 20490 |
t.Thorn = 611; |
| 20491 |
t.Omacron = 722; |
| 20492 |
t.Racute = 667; |
| 20493 |
t.Sacute = 556; |
| 20494 |
t.dcaron = 608; |
| 20495 |
t.Umacron = 722; |
| 20496 |
t.uring = 556; |
| 20497 |
t.threesuperior = 300; |
| 20498 |
t.Ograve = 722; |
| 20499 |
t.Agrave = 667; |
| 20500 |
t.Abreve = 667; |
| 20501 |
t.multiply = 570; |
| 20502 |
t.uacute = 556; |
| 20503 |
t.Tcaron = 611; |
| 20504 |
t.partialdiff = 494; |
| 20505 |
t.ydieresis = 444; |
| 20506 |
t.Nacute = 722; |
| 20507 |
t.icircumflex = 278; |
| 20508 |
t.Ecircumflex = 667; |
| 20509 |
t.adieresis = 500; |
| 20510 |
t.edieresis = 444; |
| 20511 |
t.cacute = 444; |
| 20512 |
t.nacute = 556; |
| 20513 |
t.umacron = 556; |
| 20514 |
t.Ncaron = 722; |
| 20515 |
t.Iacute = 389; |
| 20516 |
t.plusminus = 570; |
| 20517 |
t.brokenbar = 220; |
| 20518 |
t.registered = 747; |
| 20519 |
t.Gbreve = 722; |
| 20520 |
t.Idotaccent = 389; |
| 20521 |
t.summation = 600; |
| 20522 |
t.Egrave = 667; |
| 20523 |
t.racute = 389; |
| 20524 |
t.omacron = 500; |
| 20525 |
t.Zacute = 611; |
| 20526 |
t.Zcaron = 611; |
| 20527 |
t.greaterequal = 549; |
| 20528 |
t.Eth = 722; |
| 20529 |
t.Ccedilla = 667; |
| 20530 |
t.lcommaaccent = 278; |
| 20531 |
t.tcaron = 366; |
| 20532 |
t.eogonek = 444; |
| 20533 |
t.Uogonek = 722; |
| 20534 |
t.Aacute = 667; |
| 20535 |
t.Adieresis = 667; |
| 20536 |
t.egrave = 444; |
| 20537 |
t.zacute = 389; |
| 20538 |
t.iogonek = 278; |
| 20539 |
t.Oacute = 722; |
| 20540 |
t.oacute = 500; |
| 20541 |
t.amacron = 500; |
| 20542 |
t.sacute = 389; |
| 20543 |
t.idieresis = 278; |
| 20544 |
t.Ocircumflex = 722; |
| 20545 |
t.Ugrave = 722; |
| 20546 |
t.Delta = 612; |
| 20547 |
t.thorn = 500; |
| 20548 |
t.twosuperior = 300; |
| 20549 |
t.Odieresis = 722; |
| 20550 |
t.mu = 576; |
| 20551 |
t.igrave = 278; |
| 20552 |
t.ohungarumlaut = 500; |
| 20553 |
t.Eogonek = 667; |
| 20554 |
t.dcroat = 500; |
| 20555 |
t.threequarters = 750; |
| 20556 |
t.Scedilla = 556; |
| 20557 |
t.lcaron = 382; |
| 20558 |
t.Kcommaaccent = 667; |
| 20559 |
t.Lacute = 611; |
| 20560 |
t.trademark = 1000; |
| 20561 |
t.edotaccent = 444; |
| 20562 |
t.Igrave = 389; |
| 20563 |
t.Imacron = 389; |
| 20564 |
t.Lcaron = 611; |
| 20565 |
t.onehalf = 750; |
| 20566 |
t.lessequal = 549; |
| 20567 |
t.ocircumflex = 500; |
| 20568 |
t.ntilde = 556; |
| 20569 |
t.Uhungarumlaut = 722; |
| 20570 |
t.Eacute = 667; |
| 20571 |
t.emacron = 444; |
| 20572 |
t.gbreve = 500; |
| 20573 |
t.onequarter = 750; |
| 20574 |
t.Scaron = 556; |
| 20575 |
t.Scommaaccent = 556; |
| 20576 |
t.Ohungarumlaut = 722; |
| 20577 |
t.degree = 400; |
| 20578 |
t.ograve = 500; |
| 20579 |
t.Ccaron = 667; |
| 20580 |
t.ugrave = 556; |
| 20581 |
t.radical = 549; |
| 20582 |
t.Dcaron = 722; |
| 20583 |
t.rcommaaccent = 389; |
| 20584 |
t.Ntilde = 722; |
| 20585 |
t.otilde = 500; |
| 20586 |
t.Rcommaaccent = 667; |
| 20587 |
t.Lcommaaccent = 611; |
| 20588 |
t.Atilde = 667; |
| 20589 |
t.Aogonek = 667; |
| 20590 |
t.Aring = 667; |
| 20591 |
t.Otilde = 722; |
| 20592 |
t.zdotaccent = 389; |
| 20593 |
t.Ecaron = 667; |
| 20594 |
t.Iogonek = 389; |
| 20595 |
t.kcommaaccent = 500; |
| 20596 |
t.minus = 606; |
| 20597 |
t.Icircumflex = 389; |
| 20598 |
t.ncaron = 556; |
| 20599 |
t.tcommaaccent = 278; |
| 20600 |
t.logicalnot = 606; |
| 20601 |
t.odieresis = 500; |
| 20602 |
t.udieresis = 556; |
| 20603 |
t.notequal = 549; |
| 20604 |
t.gcommaaccent = 500; |
| 20605 |
t.eth = 500; |
| 20606 |
t.zcaron = 389; |
| 20607 |
t.ncommaaccent = 556; |
| 20608 |
t.onesuperior = 300; |
| 20609 |
t.imacron = 278; |
| 20610 |
t.Euro = 500; |
| 20611 |
}); |
| 20612 |
t["Times-Italic"] = getLookupTableFactory(function (t) { |
| 20613 |
t.space = 250; |
| 20614 |
t.exclam = 333; |
| 20615 |
t.quotedbl = 420; |
| 20616 |
t.numbersign = 500; |
| 20617 |
t.dollar = 500; |
| 20618 |
t.percent = 833; |
| 20619 |
t.ampersand = 778; |
| 20620 |
t.quoteright = 333; |
| 20621 |
t.parenleft = 333; |
| 20622 |
t.parenright = 333; |
| 20623 |
t.asterisk = 500; |
| 20624 |
t.plus = 675; |
| 20625 |
t.comma = 250; |
| 20626 |
t.hyphen = 333; |
| 20627 |
t.period = 250; |
| 20628 |
t.slash = 278; |
| 20629 |
t.zero = 500; |
| 20630 |
t.one = 500; |
| 20631 |
t.two = 500; |
| 20632 |
t.three = 500; |
| 20633 |
t.four = 500; |
| 20634 |
t.five = 500; |
| 20635 |
t.six = 500; |
| 20636 |
t.seven = 500; |
| 20637 |
t.eight = 500; |
| 20638 |
t.nine = 500; |
| 20639 |
t.colon = 333; |
| 20640 |
t.semicolon = 333; |
| 20641 |
t.less = 675; |
| 20642 |
t.equal = 675; |
| 20643 |
t.greater = 675; |
| 20644 |
t.question = 500; |
| 20645 |
t.at = 920; |
| 20646 |
t.A = 611; |
| 20647 |
t.B = 611; |
| 20648 |
t.C = 667; |
| 20649 |
t.D = 722; |
| 20650 |
t.E = 611; |
| 20651 |
t.F = 611; |
| 20652 |
t.G = 722; |
| 20653 |
t.H = 722; |
| 20654 |
t.I = 333; |
| 20655 |
t.J = 444; |
| 20656 |
t.K = 667; |
| 20657 |
t.L = 556; |
| 20658 |
t.M = 833; |
| 20659 |
t.N = 667; |
| 20660 |
t.O = 722; |
| 20661 |
t.P = 611; |
| 20662 |
t.Q = 722; |
| 20663 |
t.R = 611; |
| 20664 |
t.S = 500; |
| 20665 |
t.T = 556; |
| 20666 |
t.U = 722; |
| 20667 |
t.V = 611; |
| 20668 |
t.W = 833; |
| 20669 |
t.X = 611; |
| 20670 |
t.Y = 556; |
| 20671 |
t.Z = 556; |
| 20672 |
t.bracketleft = 389; |
| 20673 |
t.backslash = 278; |
| 20674 |
t.bracketright = 389; |
| 20675 |
t.asciicircum = 422; |
| 20676 |
t.underscore = 500; |
| 20677 |
t.quoteleft = 333; |
| 20678 |
t.a = 500; |
| 20679 |
t.b = 500; |
| 20680 |
t.c = 444; |
| 20681 |
t.d = 500; |
| 20682 |
t.e = 444; |
| 20683 |
t.f = 278; |
| 20684 |
t.g = 500; |
| 20685 |
t.h = 500; |
| 20686 |
t.i = 278; |
| 20687 |
t.j = 278; |
| 20688 |
t.k = 444; |
| 20689 |
t.l = 278; |
| 20690 |
t.m = 722; |
| 20691 |
t.n = 500; |
| 20692 |
t.o = 500; |
| 20693 |
t.p = 500; |
| 20694 |
t.q = 500; |
| 20695 |
t.r = 389; |
| 20696 |
t.s = 389; |
| 20697 |
t.t = 278; |
| 20698 |
t.u = 500; |
| 20699 |
t.v = 444; |
| 20700 |
t.w = 667; |
| 20701 |
t.x = 444; |
| 20702 |
t.y = 444; |
| 20703 |
t.z = 389; |
| 20704 |
t.braceleft = 400; |
| 20705 |
t.bar = 275; |
| 20706 |
t.braceright = 400; |
| 20707 |
t.asciitilde = 541; |
| 20708 |
t.exclamdown = 389; |
| 20709 |
t.cent = 500; |
| 20710 |
t.sterling = 500; |
| 20711 |
t.fraction = 167; |
| 20712 |
t.yen = 500; |
| 20713 |
t.florin = 500; |
| 20714 |
t.section = 500; |
| 20715 |
t.currency = 500; |
| 20716 |
t.quotesingle = 214; |
| 20717 |
t.quotedblleft = 556; |
| 20718 |
t.guillemotleft = 500; |
| 20719 |
t.guilsinglleft = 333; |
| 20720 |
t.guilsinglright = 333; |
| 20721 |
t.fi = 500; |
| 20722 |
t.fl = 500; |
| 20723 |
t.endash = 500; |
| 20724 |
t.dagger = 500; |
| 20725 |
t.daggerdbl = 500; |
| 20726 |
t.periodcentered = 250; |
| 20727 |
t.paragraph = 523; |
| 20728 |
t.bullet = 350; |
| 20729 |
t.quotesinglbase = 333; |
| 20730 |
t.quotedblbase = 556; |
| 20731 |
t.quotedblright = 556; |
| 20732 |
t.guillemotright = 500; |
| 20733 |
t.ellipsis = 889; |
| 20734 |
t.perthousand = 1000; |
| 20735 |
t.questiondown = 500; |
| 20736 |
t.grave = 333; |
| 20737 |
t.acute = 333; |
| 20738 |
t.circumflex = 333; |
| 20739 |
t.tilde = 333; |
| 20740 |
t.macron = 333; |
| 20741 |
t.breve = 333; |
| 20742 |
t.dotaccent = 333; |
| 20743 |
t.dieresis = 333; |
| 20744 |
t.ring = 333; |
| 20745 |
t.cedilla = 333; |
| 20746 |
t.hungarumlaut = 333; |
| 20747 |
t.ogonek = 333; |
| 20748 |
t.caron = 333; |
| 20749 |
t.emdash = 889; |
| 20750 |
t.AE = 889; |
| 20751 |
t.ordfeminine = 276; |
| 20752 |
t.Lslash = 556; |
| 20753 |
t.Oslash = 722; |
| 20754 |
t.OE = 944; |
| 20755 |
t.ordmasculine = 310; |
| 20756 |
t.ae = 667; |
| 20757 |
t.dotlessi = 278; |
| 20758 |
t.lslash = 278; |
| 20759 |
t.oslash = 500; |
| 20760 |
t.oe = 667; |
| 20761 |
t.germandbls = 500; |
| 20762 |
t.Idieresis = 333; |
| 20763 |
t.eacute = 444; |
| 20764 |
t.abreve = 500; |
| 20765 |
t.uhungarumlaut = 500; |
| 20766 |
t.ecaron = 444; |
| 20767 |
t.Ydieresis = 556; |
| 20768 |
t.divide = 675; |
| 20769 |
t.Yacute = 556; |
| 20770 |
t.Acircumflex = 611; |
| 20771 |
t.aacute = 500; |
| 20772 |
t.Ucircumflex = 722; |
| 20773 |
t.yacute = 444; |
| 20774 |
t.scommaaccent = 389; |
| 20775 |
t.ecircumflex = 444; |
| 20776 |
t.Uring = 722; |
| 20777 |
t.Udieresis = 722; |
| 20778 |
t.aogonek = 500; |
| 20779 |
t.Uacute = 722; |
| 20780 |
t.uogonek = 500; |
| 20781 |
t.Edieresis = 611; |
| 20782 |
t.Dcroat = 722; |
| 20783 |
t.commaaccent = 250; |
| 20784 |
t.copyright = 760; |
| 20785 |
t.Emacron = 611; |
| 20786 |
t.ccaron = 444; |
| 20787 |
t.aring = 500; |
| 20788 |
t.Ncommaaccent = 667; |
| 20789 |
t.lacute = 278; |
| 20790 |
t.agrave = 500; |
| 20791 |
t.Tcommaaccent = 556; |
| 20792 |
t.Cacute = 667; |
| 20793 |
t.atilde = 500; |
| 20794 |
t.Edotaccent = 611; |
| 20795 |
t.scaron = 389; |
| 20796 |
t.scedilla = 389; |
| 20797 |
t.iacute = 278; |
| 20798 |
t.lozenge = 471; |
| 20799 |
t.Rcaron = 611; |
| 20800 |
t.Gcommaaccent = 722; |
| 20801 |
t.ucircumflex = 500; |
| 20802 |
t.acircumflex = 500; |
| 20803 |
t.Amacron = 611; |
| 20804 |
t.rcaron = 389; |
| 20805 |
t.ccedilla = 444; |
| 20806 |
t.Zdotaccent = 556; |
| 20807 |
t.Thorn = 611; |
| 20808 |
t.Omacron = 722; |
| 20809 |
t.Racute = 611; |
| 20810 |
t.Sacute = 500; |
| 20811 |
t.dcaron = 544; |
| 20812 |
t.Umacron = 722; |
| 20813 |
t.uring = 500; |
| 20814 |
t.threesuperior = 300; |
| 20815 |
t.Ograve = 722; |
| 20816 |
t.Agrave = 611; |
| 20817 |
t.Abreve = 611; |
| 20818 |
t.multiply = 675; |
| 20819 |
t.uacute = 500; |
| 20820 |
t.Tcaron = 556; |
| 20821 |
t.partialdiff = 476; |
| 20822 |
t.ydieresis = 444; |
| 20823 |
t.Nacute = 667; |
| 20824 |
t.icircumflex = 278; |
| 20825 |
t.Ecircumflex = 611; |
| 20826 |
t.adieresis = 500; |
| 20827 |
t.edieresis = 444; |
| 20828 |
t.cacute = 444; |
| 20829 |
t.nacute = 500; |
| 20830 |
t.umacron = 500; |
| 20831 |
t.Ncaron = 667; |
| 20832 |
t.Iacute = 333; |
| 20833 |
t.plusminus = 675; |
| 20834 |
t.brokenbar = 275; |
| 20835 |
t.registered = 760; |
| 20836 |
t.Gbreve = 722; |
| 20837 |
t.Idotaccent = 333; |
| 20838 |
t.summation = 600; |
| 20839 |
t.Egrave = 611; |
| 20840 |
t.racute = 389; |
| 20841 |
t.omacron = 500; |
| 20842 |
t.Zacute = 556; |
| 20843 |
t.Zcaron = 556; |
| 20844 |
t.greaterequal = 549; |
| 20845 |
t.Eth = 722; |
| 20846 |
t.Ccedilla = 667; |
| 20847 |
t.lcommaaccent = 278; |
| 20848 |
t.tcaron = 300; |
| 20849 |
t.eogonek = 444; |
| 20850 |
t.Uogonek = 722; |
| 20851 |
t.Aacute = 611; |
| 20852 |
t.Adieresis = 611; |
| 20853 |
t.egrave = 444; |
| 20854 |
t.zacute = 389; |
| 20855 |
t.iogonek = 278; |
| 20856 |
t.Oacute = 722; |
| 20857 |
t.oacute = 500; |
| 20858 |
t.amacron = 500; |
| 20859 |
t.sacute = 389; |
| 20860 |
t.idieresis = 278; |
| 20861 |
t.Ocircumflex = 722; |
| 20862 |
t.Ugrave = 722; |
| 20863 |
t.Delta = 612; |
| 20864 |
t.thorn = 500; |
| 20865 |
t.twosuperior = 300; |
| 20866 |
t.Odieresis = 722; |
| 20867 |
t.mu = 500; |
| 20868 |
t.igrave = 278; |
| 20869 |
t.ohungarumlaut = 500; |
| 20870 |
t.Eogonek = 611; |
| 20871 |
t.dcroat = 500; |
| 20872 |
t.threequarters = 750; |
| 20873 |
t.Scedilla = 500; |
| 20874 |
t.lcaron = 300; |
| 20875 |
t.Kcommaaccent = 667; |
| 20876 |
t.Lacute = 556; |
| 20877 |
t.trademark = 980; |
| 20878 |
t.edotaccent = 444; |
| 20879 |
t.Igrave = 333; |
| 20880 |
t.Imacron = 333; |
| 20881 |
t.Lcaron = 611; |
| 20882 |
t.onehalf = 750; |
| 20883 |
t.lessequal = 549; |
| 20884 |
t.ocircumflex = 500; |
| 20885 |
t.ntilde = 500; |
| 20886 |
t.Uhungarumlaut = 722; |
| 20887 |
t.Eacute = 611; |
| 20888 |
t.emacron = 444; |
| 20889 |
t.gbreve = 500; |
| 20890 |
t.onequarter = 750; |
| 20891 |
t.Scaron = 500; |
| 20892 |
t.Scommaaccent = 500; |
| 20893 |
t.Ohungarumlaut = 722; |
| 20894 |
t.degree = 400; |
| 20895 |
t.ograve = 500; |
| 20896 |
t.Ccaron = 667; |
| 20897 |
t.ugrave = 500; |
| 20898 |
t.radical = 453; |
| 20899 |
t.Dcaron = 722; |
| 20900 |
t.rcommaaccent = 389; |
| 20901 |
t.Ntilde = 667; |
| 20902 |
t.otilde = 500; |
| 20903 |
t.Rcommaaccent = 611; |
| 20904 |
t.Lcommaaccent = 556; |
| 20905 |
t.Atilde = 611; |
| 20906 |
t.Aogonek = 611; |
| 20907 |
t.Aring = 611; |
| 20908 |
t.Otilde = 722; |
| 20909 |
t.zdotaccent = 389; |
| 20910 |
t.Ecaron = 611; |
| 20911 |
t.Iogonek = 333; |
| 20912 |
t.kcommaaccent = 444; |
| 20913 |
t.minus = 675; |
| 20914 |
t.Icircumflex = 333; |
| 20915 |
t.ncaron = 500; |
| 20916 |
t.tcommaaccent = 278; |
| 20917 |
t.logicalnot = 675; |
| 20918 |
t.odieresis = 500; |
| 20919 |
t.udieresis = 500; |
| 20920 |
t.notequal = 549; |
| 20921 |
t.gcommaaccent = 500; |
| 20922 |
t.eth = 500; |
| 20923 |
t.zcaron = 389; |
| 20924 |
t.ncommaaccent = 500; |
| 20925 |
t.onesuperior = 300; |
| 20926 |
t.imacron = 278; |
| 20927 |
t.Euro = 500; |
| 20928 |
}); |
| 20929 |
t.ZapfDingbats = getLookupTableFactory(function (t) { |
| 20930 |
t.space = 278; |
| 20931 |
t.a1 = 974; |
| 20932 |
t.a2 = 961; |
| 20933 |
t.a202 = 974; |
| 20934 |
t.a3 = 980; |
| 20935 |
t.a4 = 719; |
| 20936 |
t.a5 = 789; |
| 20937 |
t.a119 = 790; |
| 20938 |
t.a118 = 791; |
| 20939 |
t.a117 = 690; |
| 20940 |
t.a11 = 960; |
| 20941 |
t.a12 = 939; |
| 20942 |
t.a13 = 549; |
| 20943 |
t.a14 = 855; |
| 20944 |
t.a15 = 911; |
| 20945 |
t.a16 = 933; |
| 20946 |
t.a105 = 911; |
| 20947 |
t.a17 = 945; |
| 20948 |
t.a18 = 974; |
| 20949 |
t.a19 = 755; |
| 20950 |
t.a20 = 846; |
| 20951 |
t.a21 = 762; |
| 20952 |
t.a22 = 761; |
| 20953 |
t.a23 = 571; |
| 20954 |
t.a24 = 677; |
| 20955 |
t.a25 = 763; |
| 20956 |
t.a26 = 760; |
| 20957 |
t.a27 = 759; |
| 20958 |
t.a28 = 754; |
| 20959 |
t.a6 = 494; |
| 20960 |
t.a7 = 552; |
| 20961 |
t.a8 = 537; |
| 20962 |
t.a9 = 577; |
| 20963 |
t.a10 = 692; |
| 20964 |
t.a29 = 786; |
| 20965 |
t.a30 = 788; |
| 20966 |
t.a31 = 788; |
| 20967 |
t.a32 = 790; |
| 20968 |
t.a33 = 793; |
| 20969 |
t.a34 = 794; |
| 20970 |
t.a35 = 816; |
| 20971 |
t.a36 = 823; |
| 20972 |
t.a37 = 789; |
| 20973 |
t.a38 = 841; |
| 20974 |
t.a39 = 823; |
| 20975 |
t.a40 = 833; |
| 20976 |
t.a41 = 816; |
| 20977 |
t.a42 = 831; |
| 20978 |
t.a43 = 923; |
| 20979 |
t.a44 = 744; |
| 20980 |
t.a45 = 723; |
| 20981 |
t.a46 = 749; |
| 20982 |
t.a47 = 790; |
| 20983 |
t.a48 = 792; |
| 20984 |
t.a49 = 695; |
| 20985 |
t.a50 = 776; |
| 20986 |
t.a51 = 768; |
| 20987 |
t.a52 = 792; |
| 20988 |
t.a53 = 759; |
| 20989 |
t.a54 = 707; |
| 20990 |
t.a55 = 708; |
| 20991 |
t.a56 = 682; |
| 20992 |
t.a57 = 701; |
| 20993 |
t.a58 = 826; |
| 20994 |
t.a59 = 815; |
| 20995 |
t.a60 = 789; |
| 20996 |
t.a61 = 789; |
| 20997 |
t.a62 = 707; |
| 20998 |
t.a63 = 687; |
| 20999 |
t.a64 = 696; |
| 21000 |
t.a65 = 689; |
| 21001 |
t.a66 = 786; |
| 21002 |
t.a67 = 787; |
| 21003 |
t.a68 = 713; |
| 21004 |
t.a69 = 791; |
| 21005 |
t.a70 = 785; |
| 21006 |
t.a71 = 791; |
| 21007 |
t.a72 = 873; |
| 21008 |
t.a73 = 761; |
| 21009 |
t.a74 = 762; |
| 21010 |
t.a203 = 762; |
| 21011 |
t.a75 = 759; |
| 21012 |
t.a204 = 759; |
| 21013 |
t.a76 = 892; |
| 21014 |
t.a77 = 892; |
| 21015 |
t.a78 = 788; |
| 21016 |
t.a79 = 784; |
| 21017 |
t.a81 = 438; |
| 21018 |
t.a82 = 138; |
| 21019 |
t.a83 = 277; |
| 21020 |
t.a84 = 415; |
| 21021 |
t.a97 = 392; |
| 21022 |
t.a98 = 392; |
| 21023 |
t.a99 = 668; |
| 21024 |
t.a100 = 668; |
| 21025 |
t.a89 = 390; |
| 21026 |
t.a90 = 390; |
| 21027 |
t.a93 = 317; |
| 21028 |
t.a94 = 317; |
| 21029 |
t.a91 = 276; |
| 21030 |
t.a92 = 276; |
| 21031 |
t.a205 = 509; |
| 21032 |
t.a85 = 509; |
| 21033 |
t.a206 = 410; |
| 21034 |
t.a86 = 410; |
| 21035 |
t.a87 = 234; |
| 21036 |
t.a88 = 234; |
| 21037 |
t.a95 = 334; |
| 21038 |
t.a96 = 334; |
| 21039 |
t.a101 = 732; |
| 21040 |
t.a102 = 544; |
| 21041 |
t.a103 = 544; |
| 21042 |
t.a104 = 910; |
| 21043 |
t.a106 = 667; |
| 21044 |
t.a107 = 760; |
| 21045 |
t.a108 = 760; |
| 21046 |
t.a112 = 776; |
| 21047 |
t.a111 = 595; |
| 21048 |
t.a110 = 694; |
| 21049 |
t.a109 = 626; |
| 21050 |
t.a120 = 788; |
| 21051 |
t.a121 = 788; |
| 21052 |
t.a122 = 788; |
| 21053 |
t.a123 = 788; |
| 21054 |
t.a124 = 788; |
| 21055 |
t.a125 = 788; |
| 21056 |
t.a126 = 788; |
| 21057 |
t.a127 = 788; |
| 21058 |
t.a128 = 788; |
| 21059 |
t.a129 = 788; |
| 21060 |
t.a130 = 788; |
| 21061 |
t.a131 = 788; |
| 21062 |
t.a132 = 788; |
| 21063 |
t.a133 = 788; |
| 21064 |
t.a134 = 788; |
| 21065 |
t.a135 = 788; |
| 21066 |
t.a136 = 788; |
| 21067 |
t.a137 = 788; |
| 21068 |
t.a138 = 788; |
| 21069 |
t.a139 = 788; |
| 21070 |
t.a140 = 788; |
| 21071 |
t.a141 = 788; |
| 21072 |
t.a142 = 788; |
| 21073 |
t.a143 = 788; |
| 21074 |
t.a144 = 788; |
| 21075 |
t.a145 = 788; |
| 21076 |
t.a146 = 788; |
| 21077 |
t.a147 = 788; |
| 21078 |
t.a148 = 788; |
| 21079 |
t.a149 = 788; |
| 21080 |
t.a150 = 788; |
| 21081 |
t.a151 = 788; |
| 21082 |
t.a152 = 788; |
| 21083 |
t.a153 = 788; |
| 21084 |
t.a154 = 788; |
| 21085 |
t.a155 = 788; |
| 21086 |
t.a156 = 788; |
| 21087 |
t.a157 = 788; |
| 21088 |
t.a158 = 788; |
| 21089 |
t.a159 = 788; |
| 21090 |
t.a160 = 894; |
| 21091 |
t.a161 = 838; |
| 21092 |
t.a163 = 1016; |
| 21093 |
t.a164 = 458; |
| 21094 |
t.a196 = 748; |
| 21095 |
t.a165 = 924; |
| 21096 |
t.a192 = 748; |
| 21097 |
t.a166 = 918; |
| 21098 |
t.a167 = 927; |
| 21099 |
t.a168 = 928; |
| 21100 |
t.a169 = 928; |
| 21101 |
t.a170 = 834; |
| 21102 |
t.a171 = 873; |
| 21103 |
t.a172 = 828; |
| 21104 |
t.a173 = 924; |
| 21105 |
t.a162 = 924; |
| 21106 |
t.a174 = 917; |
| 21107 |
t.a175 = 930; |
| 21108 |
t.a176 = 931; |
| 21109 |
t.a177 = 463; |
| 21110 |
t.a178 = 883; |
| 21111 |
t.a179 = 836; |
| 21112 |
t.a193 = 836; |
| 21113 |
t.a180 = 867; |
| 21114 |
t.a199 = 867; |
| 21115 |
t.a181 = 696; |
| 21116 |
t.a200 = 696; |
| 21117 |
t.a182 = 874; |
| 21118 |
t.a201 = 874; |
| 21119 |
t.a183 = 760; |
| 21120 |
t.a184 = 946; |
| 21121 |
t.a197 = 771; |
| 21122 |
t.a185 = 865; |
| 21123 |
t.a194 = 771; |
| 21124 |
t.a198 = 888; |
| 21125 |
t.a186 = 967; |
| 21126 |
t.a195 = 888; |
| 21127 |
t.a187 = 831; |
| 21128 |
t.a188 = 873; |
| 21129 |
t.a189 = 927; |
| 21130 |
t.a190 = 970; |
| 21131 |
t.a191 = 918; |
| 21132 |
}); |
| 21133 |
}); |
| 21134 |
const getFontBasicMetrics = getLookupTableFactory(function (t) { |
| 21135 |
t.Courier = { |
| 21136 |
ascent: 629, |
| 21137 |
descent: -157, |
| 21138 |
capHeight: 562, |
| 21139 |
xHeight: -426 |
| 21140 |
}; |
| 21141 |
t["Courier-Bold"] = { |
| 21142 |
ascent: 629, |
| 21143 |
descent: -157, |
| 21144 |
capHeight: 562, |
| 21145 |
xHeight: 439 |
| 21146 |
}; |
| 21147 |
t["Courier-Oblique"] = { |
| 21148 |
ascent: 629, |
| 21149 |
descent: -157, |
| 21150 |
capHeight: 562, |
| 21151 |
xHeight: 426 |
| 21152 |
}; |
| 21153 |
t["Courier-BoldOblique"] = { |
| 21154 |
ascent: 629, |
| 21155 |
descent: -157, |
| 21156 |
capHeight: 562, |
| 21157 |
xHeight: 426 |
| 21158 |
}; |
| 21159 |
t.Helvetica = { |
| 21160 |
ascent: 718, |
| 21161 |
descent: -207, |
| 21162 |
capHeight: 718, |
| 21163 |
xHeight: 523 |
| 21164 |
}; |
| 21165 |
t["Helvetica-Bold"] = { |
| 21166 |
ascent: 718, |
| 21167 |
descent: -207, |
| 21168 |
capHeight: 718, |
| 21169 |
xHeight: 532 |
| 21170 |
}; |
| 21171 |
t["Helvetica-Oblique"] = { |
| 21172 |
ascent: 718, |
| 21173 |
descent: -207, |
| 21174 |
capHeight: 718, |
| 21175 |
xHeight: 523 |
| 21176 |
}; |
| 21177 |
t["Helvetica-BoldOblique"] = { |
| 21178 |
ascent: 718, |
| 21179 |
descent: -207, |
| 21180 |
capHeight: 718, |
| 21181 |
xHeight: 532 |
| 21182 |
}; |
| 21183 |
t["Times-Roman"] = { |
| 21184 |
ascent: 683, |
| 21185 |
descent: -217, |
| 21186 |
capHeight: 662, |
| 21187 |
xHeight: 450 |
| 21188 |
}; |
| 21189 |
t["Times-Bold"] = { |
| 21190 |
ascent: 683, |
| 21191 |
descent: -217, |
| 21192 |
capHeight: 676, |
| 21193 |
xHeight: 461 |
| 21194 |
}; |
| 21195 |
t["Times-Italic"] = { |
| 21196 |
ascent: 683, |
| 21197 |
descent: -217, |
| 21198 |
capHeight: 653, |
| 21199 |
xHeight: 441 |
| 21200 |
}; |
| 21201 |
t["Times-BoldItalic"] = { |
| 21202 |
ascent: 683, |
| 21203 |
descent: -217, |
| 21204 |
capHeight: 669, |
| 21205 |
xHeight: 462 |
| 21206 |
}; |
| 21207 |
t.Symbol = { |
| 21208 |
ascent: Math.NaN, |
| 21209 |
descent: Math.NaN, |
| 21210 |
capHeight: Math.NaN, |
| 21211 |
xHeight: Math.NaN |
| 21212 |
}; |
| 21213 |
t.ZapfDingbats = { |
| 21214 |
ascent: Math.NaN, |
| 21215 |
descent: Math.NaN, |
| 21216 |
capHeight: Math.NaN, |
| 21217 |
xHeight: Math.NaN |
| 21218 |
}; |
| 21219 |
}); |
| 21220 |
|
| 21221 |
;// ./src/core/glyf.js |
| 21222 |
const ON_CURVE_POINT = 1 << 0; |
| 21223 |
const X_SHORT_VECTOR = 1 << 1; |
| 21224 |
const Y_SHORT_VECTOR = 1 << 2; |
| 21225 |
const REPEAT_FLAG = 1 << 3; |
| 21226 |
const X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR = 1 << 4; |
| 21227 |
const Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR = 1 << 5; |
| 21228 |
const OVERLAP_SIMPLE = 1 << 6; |
| 21229 |
const ARG_1_AND_2_ARE_WORDS = 1 << 0; |
| 21230 |
const ARGS_ARE_XY_VALUES = 1 << 1; |
| 21231 |
const WE_HAVE_A_SCALE = 1 << 3; |
| 21232 |
const MORE_COMPONENTS = 1 << 5; |
| 21233 |
const WE_HAVE_AN_X_AND_Y_SCALE = 1 << 6; |
| 21234 |
const WE_HAVE_A_TWO_BY_TWO = 1 << 7; |
| 21235 |
const WE_HAVE_INSTRUCTIONS = 1 << 8; |
| 21236 |
class GlyfTable { |
| 21237 |
constructor({ |
| 21238 |
glyfTable, |
| 21239 |
isGlyphLocationsLong, |
| 21240 |
locaTable, |
| 21241 |
numGlyphs |
| 21242 |
}) { |
| 21243 |
this.glyphs = []; |
| 21244 |
const loca = new DataView(locaTable.buffer, locaTable.byteOffset, locaTable.byteLength); |
| 21245 |
const glyf = new DataView(glyfTable.buffer, glyfTable.byteOffset, glyfTable.byteLength); |
| 21246 |
const offsetSize = isGlyphLocationsLong ? 4 : 2; |
| 21247 |
let prev = isGlyphLocationsLong ? loca.getUint32(0) : 2 * loca.getUint16(0); |
| 21248 |
let pos = 0; |
| 21249 |
for (let i = 0; i < numGlyphs; i++) { |
| 21250 |
pos += offsetSize; |
| 21251 |
const next = isGlyphLocationsLong ? loca.getUint32(pos) : 2 * loca.getUint16(pos); |
| 21252 |
if (next === prev) { |
| 21253 |
this.glyphs.push(new Glyph({})); |
| 21254 |
continue; |
| 21255 |
} |
| 21256 |
const glyph = Glyph.parse(prev, glyf); |
| 21257 |
this.glyphs.push(glyph); |
| 21258 |
prev = next; |
| 21259 |
} |
| 21260 |
} |
| 21261 |
getSize() { |
| 21262 |
return this.glyphs.reduce((a, g) => { |
| 21263 |
const size = g.getSize(); |
| 21264 |
return a + (size + 3 & ~3); |
| 21265 |
}, 0); |
| 21266 |
} |
| 21267 |
write() { |
| 21268 |
const totalSize = this.getSize(); |
| 21269 |
const glyfTable = new DataView(new ArrayBuffer(totalSize)); |
| 21270 |
const isLocationLong = totalSize > 0x1fffe; |
| 21271 |
const offsetSize = isLocationLong ? 4 : 2; |
| 21272 |
const locaTable = new DataView(new ArrayBuffer((this.glyphs.length + 1) * offsetSize)); |
| 21273 |
if (isLocationLong) { |
| 21274 |
locaTable.setUint32(0, 0); |
| 21275 |
} else { |
| 21276 |
locaTable.setUint16(0, 0); |
| 21277 |
} |
| 21278 |
let pos = 0; |
| 21279 |
let locaIndex = 0; |
| 21280 |
for (const glyph of this.glyphs) { |
| 21281 |
pos += glyph.write(pos, glyfTable); |
| 21282 |
pos = pos + 3 & ~3; |
| 21283 |
locaIndex += offsetSize; |
| 21284 |
if (isLocationLong) { |
| 21285 |
locaTable.setUint32(locaIndex, pos); |
| 21286 |
} else { |
| 21287 |
locaTable.setUint16(locaIndex, pos >> 1); |
| 21288 |
} |
| 21289 |
} |
| 21290 |
return { |
| 21291 |
isLocationLong, |
| 21292 |
loca: new Uint8Array(locaTable.buffer), |
| 21293 |
glyf: new Uint8Array(glyfTable.buffer) |
| 21294 |
}; |
| 21295 |
} |
| 21296 |
scale(factors) { |
| 21297 |
for (let i = 0, ii = this.glyphs.length; i < ii; i++) { |
| 21298 |
this.glyphs[i].scale(factors[i]); |
| 21299 |
} |
| 21300 |
} |
| 21301 |
} |
| 21302 |
class Glyph { |
| 21303 |
constructor({ |
| 21304 |
header = null, |
| 21305 |
simple = null, |
| 21306 |
composites = null |
| 21307 |
}) { |
| 21308 |
this.header = header; |
| 21309 |
this.simple = simple; |
| 21310 |
this.composites = composites; |
| 21311 |
} |
| 21312 |
static parse(pos, glyf) { |
| 21313 |
const [read, header] = GlyphHeader.parse(pos, glyf); |
| 21314 |
pos += read; |
| 21315 |
if (header.numberOfContours < 0) { |
| 21316 |
const composites = []; |
| 21317 |
while (true) { |
| 21318 |
const [n, composite] = CompositeGlyph.parse(pos, glyf); |
| 21319 |
pos += n; |
| 21320 |
composites.push(composite); |
| 21321 |
if (!(composite.flags & MORE_COMPONENTS)) { |
| 21322 |
break; |
| 21323 |
} |
| 21324 |
} |
| 21325 |
return new Glyph({ |
| 21326 |
header, |
| 21327 |
composites |
| 21328 |
}); |
| 21329 |
} |
| 21330 |
const simple = SimpleGlyph.parse(pos, glyf, header.numberOfContours); |
| 21331 |
return new Glyph({ |
| 21332 |
header, |
| 21333 |
simple |
| 21334 |
}); |
| 21335 |
} |
| 21336 |
getSize() { |
| 21337 |
if (!this.header) { |
| 21338 |
return 0; |
| 21339 |
} |
| 21340 |
const size = this.simple ? this.simple.getSize() : this.composites.reduce((a, c) => a + c.getSize(), 0); |
| 21341 |
return this.header.getSize() + size; |
| 21342 |
} |
| 21343 |
write(pos, buf) { |
| 21344 |
if (!this.header) { |
| 21345 |
return 0; |
| 21346 |
} |
| 21347 |
const spos = pos; |
| 21348 |
pos += this.header.write(pos, buf); |
| 21349 |
if (this.simple) { |
| 21350 |
pos += this.simple.write(pos, buf); |
| 21351 |
} else { |
| 21352 |
for (const composite of this.composites) { |
| 21353 |
pos += composite.write(pos, buf); |
| 21354 |
} |
| 21355 |
} |
| 21356 |
return pos - spos; |
| 21357 |
} |
| 21358 |
scale(factor) { |
| 21359 |
if (!this.header) { |
| 21360 |
return; |
| 21361 |
} |
| 21362 |
const xMiddle = (this.header.xMin + this.header.xMax) / 2; |
| 21363 |
this.header.scale(xMiddle, factor); |
| 21364 |
if (this.simple) { |
| 21365 |
this.simple.scale(xMiddle, factor); |
| 21366 |
} else { |
| 21367 |
for (const composite of this.composites) { |
| 21368 |
composite.scale(xMiddle, factor); |
| 21369 |
} |
| 21370 |
} |
| 21371 |
} |
| 21372 |
} |
| 21373 |
class GlyphHeader { |
| 21374 |
constructor({ |
| 21375 |
numberOfContours, |
| 21376 |
xMin, |
| 21377 |
yMin, |
| 21378 |
xMax, |
| 21379 |
yMax |
| 21380 |
}) { |
| 21381 |
this.numberOfContours = numberOfContours; |
| 21382 |
this.xMin = xMin; |
| 21383 |
this.yMin = yMin; |
| 21384 |
this.xMax = xMax; |
| 21385 |
this.yMax = yMax; |
| 21386 |
} |
| 21387 |
static parse(pos, glyf) { |
| 21388 |
return [10, new GlyphHeader({ |
| 21389 |
numberOfContours: glyf.getInt16(pos), |
| 21390 |
xMin: glyf.getInt16(pos + 2), |
| 21391 |
yMin: glyf.getInt16(pos + 4), |
| 21392 |
xMax: glyf.getInt16(pos + 6), |
| 21393 |
yMax: glyf.getInt16(pos + 8) |
| 21394 |
})]; |
| 21395 |
} |
| 21396 |
getSize() { |
| 21397 |
return 10; |
| 21398 |
} |
| 21399 |
write(pos, buf) { |
| 21400 |
buf.setInt16(pos, this.numberOfContours); |
| 21401 |
buf.setInt16(pos + 2, this.xMin); |
| 21402 |
buf.setInt16(pos + 4, this.yMin); |
| 21403 |
buf.setInt16(pos + 6, this.xMax); |
| 21404 |
buf.setInt16(pos + 8, this.yMax); |
| 21405 |
return 10; |
| 21406 |
} |
| 21407 |
scale(x, factor) { |
| 21408 |
this.xMin = Math.round(x + (this.xMin - x) * factor); |
| 21409 |
this.xMax = Math.round(x + (this.xMax - x) * factor); |
| 21410 |
} |
| 21411 |
} |
| 21412 |
class Contour { |
| 21413 |
constructor({ |
| 21414 |
flags, |
| 21415 |
xCoordinates, |
| 21416 |
yCoordinates |
| 21417 |
}) { |
| 21418 |
this.xCoordinates = xCoordinates; |
| 21419 |
this.yCoordinates = yCoordinates; |
| 21420 |
this.flags = flags; |
| 21421 |
} |
| 21422 |
} |
| 21423 |
class SimpleGlyph { |
| 21424 |
constructor({ |
| 21425 |
contours, |
| 21426 |
instructions |
| 21427 |
}) { |
| 21428 |
this.contours = contours; |
| 21429 |
this.instructions = instructions; |
| 21430 |
} |
| 21431 |
static parse(pos, glyf, numberOfContours) { |
| 21432 |
const endPtsOfContours = []; |
| 21433 |
for (let i = 0; i < numberOfContours; i++) { |
| 21434 |
const endPt = glyf.getUint16(pos); |
| 21435 |
pos += 2; |
| 21436 |
endPtsOfContours.push(endPt); |
| 21437 |
} |
| 21438 |
const numberOfPt = endPtsOfContours[numberOfContours - 1] + 1; |
| 21439 |
const instructionLength = glyf.getUint16(pos); |
| 21440 |
pos += 2; |
| 21441 |
const instructions = new Uint8Array(glyf).slice(pos, pos + instructionLength); |
| 21442 |
pos += instructionLength; |
| 21443 |
const flags = []; |
| 21444 |
for (let i = 0; i < numberOfPt; pos++, i++) { |
| 21445 |
let flag = glyf.getUint8(pos); |
| 21446 |
flags.push(flag); |
| 21447 |
if (flag & REPEAT_FLAG) { |
| 21448 |
const count = glyf.getUint8(++pos); |
| 21449 |
flag ^= REPEAT_FLAG; |
| 21450 |
for (let m = 0; m < count; m++) { |
| 21451 |
flags.push(flag); |
| 21452 |
} |
| 21453 |
i += count; |
| 21454 |
} |
| 21455 |
} |
| 21456 |
const allXCoordinates = []; |
| 21457 |
let xCoordinates = []; |
| 21458 |
let yCoordinates = []; |
| 21459 |
let pointFlags = []; |
| 21460 |
const contours = []; |
| 21461 |
let endPtsOfContoursIndex = 0; |
| 21462 |
let lastCoordinate = 0; |
| 21463 |
for (let i = 0; i < numberOfPt; i++) { |
| 21464 |
const flag = flags[i]; |
| 21465 |
if (flag & X_SHORT_VECTOR) { |
| 21466 |
const x = glyf.getUint8(pos++); |
| 21467 |
lastCoordinate += flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR ? x : -x; |
| 21468 |
xCoordinates.push(lastCoordinate); |
| 21469 |
} else if (flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR) { |
| 21470 |
xCoordinates.push(lastCoordinate); |
| 21471 |
} else { |
| 21472 |
lastCoordinate += glyf.getInt16(pos); |
| 21473 |
pos += 2; |
| 21474 |
xCoordinates.push(lastCoordinate); |
| 21475 |
} |
| 21476 |
if (endPtsOfContours[endPtsOfContoursIndex] === i) { |
| 21477 |
endPtsOfContoursIndex++; |
| 21478 |
allXCoordinates.push(xCoordinates); |
| 21479 |
xCoordinates = []; |
| 21480 |
} |
| 21481 |
} |
| 21482 |
lastCoordinate = 0; |
| 21483 |
endPtsOfContoursIndex = 0; |
| 21484 |
for (let i = 0; i < numberOfPt; i++) { |
| 21485 |
const flag = flags[i]; |
| 21486 |
if (flag & Y_SHORT_VECTOR) { |
| 21487 |
const y = glyf.getUint8(pos++); |
| 21488 |
lastCoordinate += flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR ? y : -y; |
| 21489 |
yCoordinates.push(lastCoordinate); |
| 21490 |
} else if (flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR) { |
| 21491 |
yCoordinates.push(lastCoordinate); |
| 21492 |
} else { |
| 21493 |
lastCoordinate += glyf.getInt16(pos); |
| 21494 |
pos += 2; |
| 21495 |
yCoordinates.push(lastCoordinate); |
| 21496 |
} |
| 21497 |
pointFlags.push(flag & ON_CURVE_POINT | flag & OVERLAP_SIMPLE); |
| 21498 |
if (endPtsOfContours[endPtsOfContoursIndex] === i) { |
| 21499 |
xCoordinates = allXCoordinates[endPtsOfContoursIndex]; |
| 21500 |
endPtsOfContoursIndex++; |
| 21501 |
contours.push(new Contour({ |
| 21502 |
flags: pointFlags, |
| 21503 |
xCoordinates, |
| 21504 |
yCoordinates |
| 21505 |
})); |
| 21506 |
yCoordinates = []; |
| 21507 |
pointFlags = []; |
| 21508 |
} |
| 21509 |
} |
| 21510 |
return new SimpleGlyph({ |
| 21511 |
contours, |
| 21512 |
instructions |
| 21513 |
}); |
| 21514 |
} |
| 21515 |
getSize() { |
| 21516 |
let size = this.contours.length * 2 + 2 + this.instructions.length; |
| 21517 |
let lastX = 0; |
| 21518 |
let lastY = 0; |
| 21519 |
for (const contour of this.contours) { |
| 21520 |
size += contour.flags.length; |
| 21521 |
for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) { |
| 21522 |
const x = contour.xCoordinates[i]; |
| 21523 |
const y = contour.yCoordinates[i]; |
| 21524 |
let abs = Math.abs(x - lastX); |
| 21525 |
if (abs > 255) { |
| 21526 |
size += 2; |
| 21527 |
} else if (abs > 0) { |
| 21528 |
size += 1; |
| 21529 |
} |
| 21530 |
lastX = x; |
| 21531 |
abs = Math.abs(y - lastY); |
| 21532 |
if (abs > 255) { |
| 21533 |
size += 2; |
| 21534 |
} else if (abs > 0) { |
| 21535 |
size += 1; |
| 21536 |
} |
| 21537 |
lastY = y; |
| 21538 |
} |
| 21539 |
} |
| 21540 |
return size; |
| 21541 |
} |
| 21542 |
write(pos, buf) { |
| 21543 |
const spos = pos; |
| 21544 |
const xCoordinates = []; |
| 21545 |
const yCoordinates = []; |
| 21546 |
const flags = []; |
| 21547 |
let lastX = 0; |
| 21548 |
let lastY = 0; |
| 21549 |
for (const contour of this.contours) { |
| 21550 |
for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) { |
| 21551 |
let flag = contour.flags[i]; |
| 21552 |
const x = contour.xCoordinates[i]; |
| 21553 |
let delta = x - lastX; |
| 21554 |
if (delta === 0) { |
| 21555 |
flag |= X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR; |
| 21556 |
xCoordinates.push(0); |
| 21557 |
} else { |
| 21558 |
const abs = Math.abs(delta); |
| 21559 |
if (abs <= 255) { |
| 21560 |
flag |= delta >= 0 ? X_SHORT_VECTOR | X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR : X_SHORT_VECTOR; |
| 21561 |
xCoordinates.push(abs); |
| 21562 |
} else { |
| 21563 |
xCoordinates.push(delta); |
| 21564 |
} |
| 21565 |
} |
| 21566 |
lastX = x; |
| 21567 |
const y = contour.yCoordinates[i]; |
| 21568 |
delta = y - lastY; |
| 21569 |
if (delta === 0) { |
| 21570 |
flag |= Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR; |
| 21571 |
yCoordinates.push(0); |
| 21572 |
} else { |
| 21573 |
const abs = Math.abs(delta); |
| 21574 |
if (abs <= 255) { |
| 21575 |
flag |= delta >= 0 ? Y_SHORT_VECTOR | Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR : Y_SHORT_VECTOR; |
| 21576 |
yCoordinates.push(abs); |
| 21577 |
} else { |
| 21578 |
yCoordinates.push(delta); |
| 21579 |
} |
| 21580 |
} |
| 21581 |
lastY = y; |
| 21582 |
flags.push(flag); |
| 21583 |
} |
| 21584 |
buf.setUint16(pos, xCoordinates.length - 1); |
| 21585 |
pos += 2; |
| 21586 |
} |
| 21587 |
buf.setUint16(pos, this.instructions.length); |
| 21588 |
pos += 2; |
| 21589 |
if (this.instructions.length) { |
| 21590 |
new Uint8Array(buf.buffer, 0, buf.buffer.byteLength).set(this.instructions, pos); |
| 21591 |
pos += this.instructions.length; |
| 21592 |
} |
| 21593 |
for (const flag of flags) { |
| 21594 |
buf.setUint8(pos++, flag); |
| 21595 |
} |
| 21596 |
for (let i = 0, ii = xCoordinates.length; i < ii; i++) { |
| 21597 |
const x = xCoordinates[i]; |
| 21598 |
const flag = flags[i]; |
| 21599 |
if (flag & X_SHORT_VECTOR) { |
| 21600 |
buf.setUint8(pos++, x); |
| 21601 |
} else if (!(flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR)) { |
| 21602 |
buf.setInt16(pos, x); |
| 21603 |
pos += 2; |
| 21604 |
} |
| 21605 |
} |
| 21606 |
for (let i = 0, ii = yCoordinates.length; i < ii; i++) { |
| 21607 |
const y = yCoordinates[i]; |
| 21608 |
const flag = flags[i]; |
| 21609 |
if (flag & Y_SHORT_VECTOR) { |
| 21610 |
buf.setUint8(pos++, y); |
| 21611 |
} else if (!(flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR)) { |
| 21612 |
buf.setInt16(pos, y); |
| 21613 |
pos += 2; |
| 21614 |
} |
| 21615 |
} |
| 21616 |
return pos - spos; |
| 21617 |
} |
| 21618 |
scale(x, factor) { |
| 21619 |
for (const contour of this.contours) { |
| 21620 |
if (contour.xCoordinates.length === 0) { |
| 21621 |
continue; |
| 21622 |
} |
| 21623 |
for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) { |
| 21624 |
contour.xCoordinates[i] = Math.round(x + (contour.xCoordinates[i] - x) * factor); |
| 21625 |
} |
| 21626 |
} |
| 21627 |
} |
| 21628 |
} |
| 21629 |
class CompositeGlyph { |
| 21630 |
constructor({ |
| 21631 |
flags, |
| 21632 |
glyphIndex, |
| 21633 |
argument1, |
| 21634 |
argument2, |
| 21635 |
transf, |
| 21636 |
instructions |
| 21637 |
}) { |
| 21638 |
this.flags = flags; |
| 21639 |
this.glyphIndex = glyphIndex; |
| 21640 |
this.argument1 = argument1; |
| 21641 |
this.argument2 = argument2; |
| 21642 |
this.transf = transf; |
| 21643 |
this.instructions = instructions; |
| 21644 |
} |
| 21645 |
static parse(pos, glyf) { |
| 21646 |
const spos = pos; |
| 21647 |
const transf = []; |
| 21648 |
let flags = glyf.getUint16(pos); |
| 21649 |
const glyphIndex = glyf.getUint16(pos + 2); |
| 21650 |
pos += 4; |
| 21651 |
let argument1, argument2; |
| 21652 |
if (flags & ARG_1_AND_2_ARE_WORDS) { |
| 21653 |
if (flags & ARGS_ARE_XY_VALUES) { |
| 21654 |
argument1 = glyf.getInt16(pos); |
| 21655 |
argument2 = glyf.getInt16(pos + 2); |
| 21656 |
} else { |
| 21657 |
argument1 = glyf.getUint16(pos); |
| 21658 |
argument2 = glyf.getUint16(pos + 2); |
| 21659 |
} |
| 21660 |
pos += 4; |
| 21661 |
flags ^= ARG_1_AND_2_ARE_WORDS; |
| 21662 |
} else { |
| 21663 |
if (flags & ARGS_ARE_XY_VALUES) { |
| 21664 |
argument1 = glyf.getInt8(pos); |
| 21665 |
argument2 = glyf.getInt8(pos + 1); |
| 21666 |
} else { |
| 21667 |
argument1 = glyf.getUint8(pos); |
| 21668 |
argument2 = glyf.getUint8(pos + 1); |
| 21669 |
} |
| 21670 |
pos += 2; |
| 21671 |
} |
| 21672 |
if (flags & WE_HAVE_A_SCALE) { |
| 21673 |
transf.push(glyf.getUint16(pos)); |
| 21674 |
pos += 2; |
| 21675 |
} else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) { |
| 21676 |
transf.push(glyf.getUint16(pos), glyf.getUint16(pos + 2)); |
| 21677 |
pos += 4; |
| 21678 |
} else if (flags & WE_HAVE_A_TWO_BY_TWO) { |
| 21679 |
transf.push(glyf.getUint16(pos), glyf.getUint16(pos + 2), glyf.getUint16(pos + 4), glyf.getUint16(pos + 6)); |
| 21680 |
pos += 8; |
| 21681 |
} |
| 21682 |
let instructions = null; |
| 21683 |
if (flags & WE_HAVE_INSTRUCTIONS) { |
| 21684 |
const instructionLength = glyf.getUint16(pos); |
| 21685 |
pos += 2; |
| 21686 |
instructions = new Uint8Array(glyf).slice(pos, pos + instructionLength); |
| 21687 |
pos += instructionLength; |
| 21688 |
} |
| 21689 |
return [pos - spos, new CompositeGlyph({ |
| 21690 |
flags, |
| 21691 |
glyphIndex, |
| 21692 |
argument1, |
| 21693 |
argument2, |
| 21694 |
transf, |
| 21695 |
instructions |
| 21696 |
})]; |
| 21697 |
} |
| 21698 |
getSize() { |
| 21699 |
let size = 2 + 2 + this.transf.length * 2; |
| 21700 |
if (this.flags & WE_HAVE_INSTRUCTIONS) { |
| 21701 |
size += 2 + this.instructions.length; |
| 21702 |
} |
| 21703 |
size += 2; |
| 21704 |
if (this.flags & 2) { |
| 21705 |
if (!(this.argument1 >= -128 && this.argument1 <= 127 && this.argument2 >= -128 && this.argument2 <= 127)) { |
| 21706 |
size += 2; |
| 21707 |
} |
| 21708 |
} else if (!(this.argument1 >= 0 && this.argument1 <= 255 && this.argument2 >= 0 && this.argument2 <= 255)) { |
| 21709 |
size += 2; |
| 21710 |
} |
| 21711 |
return size; |
| 21712 |
} |
| 21713 |
write(pos, buf) { |
| 21714 |
const spos = pos; |
| 21715 |
if (this.flags & ARGS_ARE_XY_VALUES) { |
| 21716 |
if (!(this.argument1 >= -128 && this.argument1 <= 127 && this.argument2 >= -128 && this.argument2 <= 127)) { |
| 21717 |
this.flags |= ARG_1_AND_2_ARE_WORDS; |
| 21718 |
} |
| 21719 |
} else if (!(this.argument1 >= 0 && this.argument1 <= 255 && this.argument2 >= 0 && this.argument2 <= 255)) { |
| 21720 |
this.flags |= ARG_1_AND_2_ARE_WORDS; |
| 21721 |
} |
| 21722 |
buf.setUint16(pos, this.flags); |
| 21723 |
buf.setUint16(pos + 2, this.glyphIndex); |
| 21724 |
pos += 4; |
| 21725 |
if (this.flags & ARG_1_AND_2_ARE_WORDS) { |
| 21726 |
if (this.flags & ARGS_ARE_XY_VALUES) { |
| 21727 |
buf.setInt16(pos, this.argument1); |
| 21728 |
buf.setInt16(pos + 2, this.argument2); |
| 21729 |
} else { |
| 21730 |
buf.setUint16(pos, this.argument1); |
| 21731 |
buf.setUint16(pos + 2, this.argument2); |
| 21732 |
} |
| 21733 |
pos += 4; |
| 21734 |
} else { |
| 21735 |
buf.setUint8(pos, this.argument1); |
| 21736 |
buf.setUint8(pos + 1, this.argument2); |
| 21737 |
pos += 2; |
| 21738 |
} |
| 21739 |
if (this.flags & WE_HAVE_INSTRUCTIONS) { |
| 21740 |
buf.setUint16(pos, this.instructions.length); |
| 21741 |
pos += 2; |
| 21742 |
if (this.instructions.length) { |
| 21743 |
new Uint8Array(buf.buffer, 0, buf.buffer.byteLength).set(this.instructions, pos); |
| 21744 |
pos += this.instructions.length; |
| 21745 |
} |
| 21746 |
} |
| 21747 |
return pos - spos; |
| 21748 |
} |
| 21749 |
scale(x, factor) {} |
| 21750 |
} |
| 21751 |
|
| 21752 |
;// ./src/core/opentype_file_builder.js |
| 21753 |
|
| 21754 |
|
| 21755 |
function writeInt16(dest, offset, num) { |
| 21756 |
dest[offset] = num >> 8 & 0xff; |
| 21757 |
dest[offset + 1] = num & 0xff; |
| 21758 |
} |
| 21759 |
function writeInt32(dest, offset, num) { |
| 21760 |
dest[offset] = num >> 24 & 0xff; |
| 21761 |
dest[offset + 1] = num >> 16 & 0xff; |
| 21762 |
dest[offset + 2] = num >> 8 & 0xff; |
| 21763 |
dest[offset + 3] = num & 0xff; |
| 21764 |
} |
| 21765 |
function writeData(dest, offset, data) { |
| 21766 |
if (data instanceof Uint8Array) { |
| 21767 |
dest.set(data, offset); |
| 21768 |
} else if (typeof data === "string") { |
| 21769 |
for (let i = 0, ii = data.length; i < ii; i++) { |
| 21770 |
dest[offset++] = data.charCodeAt(i) & 0xff; |
| 21771 |
} |
| 21772 |
} else { |
| 21773 |
for (const num of data) { |
| 21774 |
dest[offset++] = num & 0xff; |
| 21775 |
} |
| 21776 |
} |
| 21777 |
} |
| 21778 |
const OTF_HEADER_SIZE = 12; |
| 21779 |
const OTF_TABLE_ENTRY_SIZE = 16; |
| 21780 |
class OpenTypeFileBuilder { |
| 21781 |
constructor(sfnt) { |
| 21782 |
this.sfnt = sfnt; |
| 21783 |
this.tables = Object.create(null); |
| 21784 |
} |
| 21785 |
static getSearchParams(entriesCount, entrySize) { |
| 21786 |
let maxPower2 = 1, |
| 21787 |
log2 = 0; |
| 21788 |
while ((maxPower2 ^ entriesCount) > maxPower2) { |
| 21789 |
maxPower2 <<= 1; |
| 21790 |
log2++; |
| 21791 |
} |
| 21792 |
const searchRange = maxPower2 * entrySize; |
| 21793 |
return { |
| 21794 |
range: searchRange, |
| 21795 |
entry: log2, |
| 21796 |
rangeShift: entrySize * entriesCount - searchRange |
| 21797 |
}; |
| 21798 |
} |
| 21799 |
toArray() { |
| 21800 |
let sfnt = this.sfnt; |
| 21801 |
const tables = this.tables; |
| 21802 |
const tablesNames = Object.keys(tables); |
| 21803 |
tablesNames.sort(); |
| 21804 |
const numTables = tablesNames.length; |
| 21805 |
let i, j, jj, table, tableName; |
| 21806 |
let offset = OTF_HEADER_SIZE + numTables * OTF_TABLE_ENTRY_SIZE; |
| 21807 |
const tableOffsets = [offset]; |
| 21808 |
for (i = 0; i < numTables; i++) { |
| 21809 |
table = tables[tablesNames[i]]; |
| 21810 |
const paddedLength = (table.length + 3 & ~3) >>> 0; |
| 21811 |
offset += paddedLength; |
| 21812 |
tableOffsets.push(offset); |
| 21813 |
} |
| 21814 |
const file = new Uint8Array(offset); |
| 21815 |
for (i = 0; i < numTables; i++) { |
| 21816 |
table = tables[tablesNames[i]]; |
| 21817 |
writeData(file, tableOffsets[i], table); |
| 21818 |
} |
| 21819 |
if (sfnt === "true") { |
| 21820 |
sfnt = string32(0x00010000); |
| 21821 |
} |
| 21822 |
file[0] = sfnt.charCodeAt(0) & 0xff; |
| 21823 |
file[1] = sfnt.charCodeAt(1) & 0xff; |
| 21824 |
file[2] = sfnt.charCodeAt(2) & 0xff; |
| 21825 |
file[3] = sfnt.charCodeAt(3) & 0xff; |
| 21826 |
writeInt16(file, 4, numTables); |
| 21827 |
const searchParams = OpenTypeFileBuilder.getSearchParams(numTables, 16); |
| 21828 |
writeInt16(file, 6, searchParams.range); |
| 21829 |
writeInt16(file, 8, searchParams.entry); |
| 21830 |
writeInt16(file, 10, searchParams.rangeShift); |
| 21831 |
offset = OTF_HEADER_SIZE; |
| 21832 |
for (i = 0; i < numTables; i++) { |
| 21833 |
tableName = tablesNames[i]; |
| 21834 |
file[offset] = tableName.charCodeAt(0) & 0xff; |
| 21835 |
file[offset + 1] = tableName.charCodeAt(1) & 0xff; |
| 21836 |
file[offset + 2] = tableName.charCodeAt(2) & 0xff; |
| 21837 |
file[offset + 3] = tableName.charCodeAt(3) & 0xff; |
| 21838 |
let checksum = 0; |
| 21839 |
for (j = tableOffsets[i], jj = tableOffsets[i + 1]; j < jj; j += 4) { |
| 21840 |
const quad = readUint32(file, j); |
| 21841 |
checksum = checksum + quad >>> 0; |
| 21842 |
} |
| 21843 |
writeInt32(file, offset + 4, checksum); |
| 21844 |
writeInt32(file, offset + 8, tableOffsets[i]); |
| 21845 |
writeInt32(file, offset + 12, tables[tableName].length); |
| 21846 |
offset += OTF_TABLE_ENTRY_SIZE; |
| 21847 |
} |
| 21848 |
return file; |
| 21849 |
} |
| 21850 |
addTable(tag, data) { |
| 21851 |
if (tag in this.tables) { |
| 21852 |
throw new Error("Table " + tag + " already exists"); |
| 21853 |
} |
| 21854 |
this.tables[tag] = data; |
| 21855 |
} |
| 21856 |
} |
| 21857 |
|
| 21858 |
;// ./src/core/type1_parser.js |
| 21859 |
|
| 21860 |
|
| 21861 |
|
| 21862 |
|
| 21863 |
const HINTING_ENABLED = false; |
| 21864 |
const COMMAND_MAP = { |
| 21865 |
hstem: [1], |
| 21866 |
vstem: [3], |
| 21867 |
vmoveto: [4], |
| 21868 |
rlineto: [5], |
| 21869 |
hlineto: [6], |
| 21870 |
vlineto: [7], |
| 21871 |
rrcurveto: [8], |
| 21872 |
callsubr: [10], |
| 21873 |
flex: [12, 35], |
| 21874 |
drop: [12, 18], |
| 21875 |
endchar: [14], |
| 21876 |
rmoveto: [21], |
| 21877 |
hmoveto: [22], |
| 21878 |
vhcurveto: [30], |
| 21879 |
hvcurveto: [31] |
| 21880 |
}; |
| 21881 |
class Type1CharString { |
| 21882 |
constructor() { |
| 21883 |
this.width = 0; |
| 21884 |
this.lsb = 0; |
| 21885 |
this.flexing = false; |
| 21886 |
this.output = []; |
| 21887 |
this.stack = []; |
| 21888 |
} |
| 21889 |
convert(encoded, subrs, seacAnalysisEnabled) { |
| 21890 |
const count = encoded.length; |
| 21891 |
let error = false; |
| 21892 |
let wx, sbx, subrNumber; |
| 21893 |
for (let i = 0; i < count; i++) { |
| 21894 |
let value = encoded[i]; |
| 21895 |
if (value < 32) { |
| 21896 |
if (value === 12) { |
| 21897 |
value = (value << 8) + encoded[++i]; |
| 21898 |
} |
| 21899 |
switch (value) { |
| 21900 |
case 1: |
| 21901 |
if (!HINTING_ENABLED) { |
| 21902 |
this.stack = []; |
| 21903 |
break; |
| 21904 |
} |
| 21905 |
error = this.executeCommand(2, COMMAND_MAP.hstem); |
| 21906 |
break; |
| 21907 |
case 3: |
| 21908 |
if (!HINTING_ENABLED) { |
| 21909 |
this.stack = []; |
| 21910 |
break; |
| 21911 |
} |
| 21912 |
error = this.executeCommand(2, COMMAND_MAP.vstem); |
| 21913 |
break; |
| 21914 |
case 4: |
| 21915 |
if (this.flexing) { |
| 21916 |
if (this.stack.length < 1) { |
| 21917 |
error = true; |
| 21918 |
break; |
| 21919 |
} |
| 21920 |
const dy = this.stack.pop(); |
| 21921 |
this.stack.push(0, dy); |
| 21922 |
break; |
| 21923 |
} |
| 21924 |
error = this.executeCommand(1, COMMAND_MAP.vmoveto); |
| 21925 |
break; |
| 21926 |
case 5: |
| 21927 |
error = this.executeCommand(2, COMMAND_MAP.rlineto); |
| 21928 |
break; |
| 21929 |
case 6: |
| 21930 |
error = this.executeCommand(1, COMMAND_MAP.hlineto); |
| 21931 |
break; |
| 21932 |
case 7: |
| 21933 |
error = this.executeCommand(1, COMMAND_MAP.vlineto); |
| 21934 |
break; |
| 21935 |
case 8: |
| 21936 |
error = this.executeCommand(6, COMMAND_MAP.rrcurveto); |
| 21937 |
break; |
| 21938 |
case 9: |
| 21939 |
this.stack = []; |
| 21940 |
break; |
| 21941 |
case 10: |
| 21942 |
if (this.stack.length < 1) { |
| 21943 |
error = true; |
| 21944 |
break; |
| 21945 |
} |
| 21946 |
subrNumber = this.stack.pop(); |
| 21947 |
if (!subrs[subrNumber]) { |
| 21948 |
error = true; |
| 21949 |
break; |
| 21950 |
} |
| 21951 |
error = this.convert(subrs[subrNumber], subrs, seacAnalysisEnabled); |
| 21952 |
break; |
| 21953 |
case 11: |
| 21954 |
return error; |
| 21955 |
case 13: |
| 21956 |
if (this.stack.length < 2) { |
| 21957 |
error = true; |
| 21958 |
break; |
| 21959 |
} |
| 21960 |
wx = this.stack.pop(); |
| 21961 |
sbx = this.stack.pop(); |
| 21962 |
this.lsb = sbx; |
| 21963 |
this.width = wx; |
| 21964 |
this.stack.push(wx, sbx); |
| 21965 |
error = this.executeCommand(2, COMMAND_MAP.hmoveto); |
| 21966 |
break; |
| 21967 |
case 14: |
| 21968 |
this.output.push(COMMAND_MAP.endchar[0]); |
| 21969 |
break; |
| 21970 |
case 21: |
| 21971 |
if (this.flexing) { |
| 21972 |
break; |
| 21973 |
} |
| 21974 |
error = this.executeCommand(2, COMMAND_MAP.rmoveto); |
| 21975 |
break; |
| 21976 |
case 22: |
| 21977 |
if (this.flexing) { |
| 21978 |
this.stack.push(0); |
| 21979 |
break; |
| 21980 |
} |
| 21981 |
error = this.executeCommand(1, COMMAND_MAP.hmoveto); |
| 21982 |
break; |
| 21983 |
case 30: |
| 21984 |
error = this.executeCommand(4, COMMAND_MAP.vhcurveto); |
| 21985 |
break; |
| 21986 |
case 31: |
| 21987 |
error = this.executeCommand(4, COMMAND_MAP.hvcurveto); |
| 21988 |
break; |
| 21989 |
case (12 << 8) + 0: |
| 21990 |
this.stack = []; |
| 21991 |
break; |
| 21992 |
case (12 << 8) + 1: |
| 21993 |
if (!HINTING_ENABLED) { |
| 21994 |
this.stack = []; |
| 21995 |
break; |
| 21996 |
} |
| 21997 |
error = this.executeCommand(2, COMMAND_MAP.vstem); |
| 21998 |
break; |
| 21999 |
case (12 << 8) + 2: |
| 22000 |
if (!HINTING_ENABLED) { |
| 22001 |
this.stack = []; |
| 22002 |
break; |
| 22003 |
} |
| 22004 |
error = this.executeCommand(2, COMMAND_MAP.hstem); |
| 22005 |
break; |
| 22006 |
case (12 << 8) + 6: |
| 22007 |
if (seacAnalysisEnabled) { |
| 22008 |
const asb = this.stack.at(-5); |
| 22009 |
this.seac = this.stack.splice(-4, 4); |
| 22010 |
this.seac[0] += this.lsb - asb; |
| 22011 |
error = this.executeCommand(0, COMMAND_MAP.endchar); |
| 22012 |
} else { |
| 22013 |
error = this.executeCommand(4, COMMAND_MAP.endchar); |
| 22014 |
} |
| 22015 |
break; |
| 22016 |
case (12 << 8) + 7: |
| 22017 |
if (this.stack.length < 4) { |
| 22018 |
error = true; |
| 22019 |
break; |
| 22020 |
} |
| 22021 |
this.stack.pop(); |
| 22022 |
wx = this.stack.pop(); |
| 22023 |
const sby = this.stack.pop(); |
| 22024 |
sbx = this.stack.pop(); |
| 22025 |
this.lsb = sbx; |
| 22026 |
this.width = wx; |
| 22027 |
this.stack.push(wx, sbx, sby); |
| 22028 |
error = this.executeCommand(3, COMMAND_MAP.rmoveto); |
| 22029 |
break; |
| 22030 |
case (12 << 8) + 12: |
| 22031 |
if (this.stack.length < 2) { |
| 22032 |
error = true; |
| 22033 |
break; |
| 22034 |
} |
| 22035 |
const num2 = this.stack.pop(); |
| 22036 |
const num1 = this.stack.pop(); |
| 22037 |
this.stack.push(num1 / num2); |
| 22038 |
break; |
| 22039 |
case (12 << 8) + 16: |
| 22040 |
if (this.stack.length < 2) { |
| 22041 |
error = true; |
| 22042 |
break; |
| 22043 |
} |
| 22044 |
subrNumber = this.stack.pop(); |
| 22045 |
const numArgs = this.stack.pop(); |
| 22046 |
if (subrNumber === 0 && numArgs === 3) { |
| 22047 |
const flexArgs = this.stack.splice(-17, 17); |
| 22048 |
this.stack.push(flexArgs[2] + flexArgs[0], flexArgs[3] + flexArgs[1], flexArgs[4], flexArgs[5], flexArgs[6], flexArgs[7], flexArgs[8], flexArgs[9], flexArgs[10], flexArgs[11], flexArgs[12], flexArgs[13], flexArgs[14]); |
| 22049 |
error = this.executeCommand(13, COMMAND_MAP.flex, true); |
| 22050 |
this.flexing = false; |
| 22051 |
this.stack.push(flexArgs[15], flexArgs[16]); |
| 22052 |
} else if (subrNumber === 1 && numArgs === 0) { |
| 22053 |
this.flexing = true; |
| 22054 |
} |
| 22055 |
break; |
| 22056 |
case (12 << 8) + 17: |
| 22057 |
break; |
| 22058 |
case (12 << 8) + 33: |
| 22059 |
this.stack = []; |
| 22060 |
break; |
| 22061 |
default: |
| 22062 |
warn('Unknown type 1 charstring command of "' + value + '"'); |
| 22063 |
break; |
| 22064 |
} |
| 22065 |
if (error) { |
| 22066 |
break; |
| 22067 |
} |
| 22068 |
continue; |
| 22069 |
} else if (value <= 246) { |
| 22070 |
value -= 139; |
| 22071 |
} else if (value <= 250) { |
| 22072 |
value = (value - 247) * 256 + encoded[++i] + 108; |
| 22073 |
} else if (value <= 254) { |
| 22074 |
value = -((value - 251) * 256) - encoded[++i] - 108; |
| 22075 |
} else { |
| 22076 |
value = (encoded[++i] & 0xff) << 24 | (encoded[++i] & 0xff) << 16 | (encoded[++i] & 0xff) << 8 | (encoded[++i] & 0xff) << 0; |
| 22077 |
} |
| 22078 |
this.stack.push(value); |
| 22079 |
} |
| 22080 |
return error; |
| 22081 |
} |
| 22082 |
executeCommand(howManyArgs, command, keepStack) { |
| 22083 |
const stackLength = this.stack.length; |
| 22084 |
if (howManyArgs > stackLength) { |
| 22085 |
return true; |
| 22086 |
} |
| 22087 |
const start = stackLength - howManyArgs; |
| 22088 |
for (let i = start; i < stackLength; i++) { |
| 22089 |
let value = this.stack[i]; |
| 22090 |
if (Number.isInteger(value)) { |
| 22091 |
this.output.push(28, value >> 8 & 0xff, value & 0xff); |
| 22092 |
} else { |
| 22093 |
value = 65536 * value | 0; |
| 22094 |
this.output.push(255, value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); |
| 22095 |
} |
| 22096 |
} |
| 22097 |
this.output.push(...command); |
| 22098 |
if (keepStack) { |
| 22099 |
this.stack.splice(start, howManyArgs); |
| 22100 |
} else { |
| 22101 |
this.stack.length = 0; |
| 22102 |
} |
| 22103 |
return false; |
| 22104 |
} |
| 22105 |
} |
| 22106 |
const EEXEC_ENCRYPT_KEY = 55665; |
| 22107 |
const CHAR_STRS_ENCRYPT_KEY = 4330; |
| 22108 |
function isHexDigit(code) { |
| 22109 |
return code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102; |
| 22110 |
} |
| 22111 |
function decrypt(data, key, discardNumber) { |
| 22112 |
if (discardNumber >= data.length) { |
| 22113 |
return new Uint8Array(0); |
| 22114 |
} |
| 22115 |
const c1 = 52845, |
| 22116 |
c2 = 22719; |
| 22117 |
let r = key | 0, |
| 22118 |
i, |
| 22119 |
j; |
| 22120 |
for (i = 0; i < discardNumber; i++) { |
| 22121 |
r = (data[i] + r) * c1 + c2 & (1 << 16) - 1; |
| 22122 |
} |
| 22123 |
const count = data.length - discardNumber; |
| 22124 |
const decrypted = new Uint8Array(count); |
| 22125 |
for (i = discardNumber, j = 0; j < count; i++, j++) { |
| 22126 |
const value = data[i]; |
| 22127 |
decrypted[j] = value ^ r >> 8; |
| 22128 |
r = (value + r) * c1 + c2 & (1 << 16) - 1; |
| 22129 |
} |
| 22130 |
return decrypted; |
| 22131 |
} |
| 22132 |
function decryptAscii(data, key, discardNumber) { |
| 22133 |
const c1 = 52845, |
| 22134 |
c2 = 22719; |
| 22135 |
let r = key | 0; |
| 22136 |
const count = data.length, |
| 22137 |
maybeLength = count >>> 1; |
| 22138 |
const decrypted = new Uint8Array(maybeLength); |
| 22139 |
let i, j; |
| 22140 |
for (i = 0, j = 0; i < count; i++) { |
| 22141 |
const digit1 = data[i]; |
| 22142 |
if (!isHexDigit(digit1)) { |
| 22143 |
continue; |
| 22144 |
} |
| 22145 |
i++; |
| 22146 |
let digit2; |
| 22147 |
while (i < count && !isHexDigit(digit2 = data[i])) { |
| 22148 |
i++; |
| 22149 |
} |
| 22150 |
if (i < count) { |
| 22151 |
const value = parseInt(String.fromCharCode(digit1, digit2), 16); |
| 22152 |
decrypted[j++] = value ^ r >> 8; |
| 22153 |
r = (value + r) * c1 + c2 & (1 << 16) - 1; |
| 22154 |
} |
| 22155 |
} |
| 22156 |
return decrypted.slice(discardNumber, j); |
| 22157 |
} |
| 22158 |
function isSpecial(c) { |
| 22159 |
return c === 0x2f || c === 0x5b || c === 0x5d || c === 0x7b || c === 0x7d || c === 0x28 || c === 0x29; |
| 22160 |
} |
| 22161 |
class Type1Parser { |
| 22162 |
constructor(stream, encrypted, seacAnalysisEnabled) { |
| 22163 |
if (encrypted) { |
| 22164 |
const data = stream.getBytes(); |
| 22165 |
const isBinary = !((isHexDigit(data[0]) || isWhiteSpace(data[0])) && isHexDigit(data[1]) && isHexDigit(data[2]) && isHexDigit(data[3]) && isHexDigit(data[4]) && isHexDigit(data[5]) && isHexDigit(data[6]) && isHexDigit(data[7])); |
| 22166 |
stream = new Stream(isBinary ? decrypt(data, EEXEC_ENCRYPT_KEY, 4) : decryptAscii(data, EEXEC_ENCRYPT_KEY, 4)); |
| 22167 |
} |
| 22168 |
this.seacAnalysisEnabled = !!seacAnalysisEnabled; |
| 22169 |
this.stream = stream; |
| 22170 |
this.nextChar(); |
| 22171 |
} |
| 22172 |
readNumberArray() { |
| 22173 |
this.getToken(); |
| 22174 |
const array = []; |
| 22175 |
while (true) { |
| 22176 |
const token = this.getToken(); |
| 22177 |
if (token === null || token === "]" || token === "}") { |
| 22178 |
break; |
| 22179 |
} |
| 22180 |
array.push(parseFloat(token || 0)); |
| 22181 |
} |
| 22182 |
return array; |
| 22183 |
} |
| 22184 |
readNumber() { |
| 22185 |
const token = this.getToken(); |
| 22186 |
return parseFloat(token || 0); |
| 22187 |
} |
| 22188 |
readInt() { |
| 22189 |
const token = this.getToken(); |
| 22190 |
return parseInt(token || 0, 10) | 0; |
| 22191 |
} |
| 22192 |
readBoolean() { |
| 22193 |
const token = this.getToken(); |
| 22194 |
return token === "true" ? 1 : 0; |
| 22195 |
} |
| 22196 |
nextChar() { |
| 22197 |
return this.currentChar = this.stream.getByte(); |
| 22198 |
} |
| 22199 |
prevChar() { |
| 22200 |
this.stream.skip(-2); |
| 22201 |
return this.currentChar = this.stream.getByte(); |
| 22202 |
} |
| 22203 |
getToken() { |
| 22204 |
let comment = false; |
| 22205 |
let ch = this.currentChar; |
| 22206 |
while (true) { |
| 22207 |
if (ch === -1) { |
| 22208 |
return null; |
| 22209 |
} |
| 22210 |
if (comment) { |
| 22211 |
if (ch === 0x0a || ch === 0x0d) { |
| 22212 |
comment = false; |
| 22213 |
} |
| 22214 |
} else if (ch === 0x25) { |
| 22215 |
comment = true; |
| 22216 |
} else if (!isWhiteSpace(ch)) { |
| 22217 |
break; |
| 22218 |
} |
| 22219 |
ch = this.nextChar(); |
| 22220 |
} |
| 22221 |
if (isSpecial(ch)) { |
| 22222 |
this.nextChar(); |
| 22223 |
return String.fromCharCode(ch); |
| 22224 |
} |
| 22225 |
let token = ""; |
| 22226 |
do { |
| 22227 |
token += String.fromCharCode(ch); |
| 22228 |
ch = this.nextChar(); |
| 22229 |
} while (ch >= 0 && !isWhiteSpace(ch) && !isSpecial(ch)); |
| 22230 |
return token; |
| 22231 |
} |
| 22232 |
readCharStrings(bytes, lenIV) { |
| 22233 |
if (lenIV === -1) { |
| 22234 |
return bytes; |
| 22235 |
} |
| 22236 |
return decrypt(bytes, CHAR_STRS_ENCRYPT_KEY, lenIV); |
| 22237 |
} |
| 22238 |
extractFontProgram(properties) { |
| 22239 |
const stream = this.stream; |
| 22240 |
const subrs = [], |
| 22241 |
charstrings = []; |
| 22242 |
const privateData = Object.create(null); |
| 22243 |
privateData.lenIV = 4; |
| 22244 |
const program = { |
| 22245 |
subrs: [], |
| 22246 |
charstrings: [], |
| 22247 |
properties: { |
| 22248 |
privateData |
| 22249 |
} |
| 22250 |
}; |
| 22251 |
let token, length, data, lenIV; |
| 22252 |
while ((token = this.getToken()) !== null) { |
| 22253 |
if (token !== "/") { |
| 22254 |
continue; |
| 22255 |
} |
| 22256 |
token = this.getToken(); |
| 22257 |
switch (token) { |
| 22258 |
case "CharStrings": |
| 22259 |
this.getToken(); |
| 22260 |
this.getToken(); |
| 22261 |
this.getToken(); |
| 22262 |
this.getToken(); |
| 22263 |
while (true) { |
| 22264 |
token = this.getToken(); |
| 22265 |
if (token === null || token === "end") { |
| 22266 |
break; |
| 22267 |
} |
| 22268 |
if (token !== "/") { |
| 22269 |
continue; |
| 22270 |
} |
| 22271 |
const glyph = this.getToken(); |
| 22272 |
length = this.readInt(); |
| 22273 |
this.getToken(); |
| 22274 |
data = length > 0 ? stream.getBytes(length) : new Uint8Array(0); |
| 22275 |
lenIV = program.properties.privateData.lenIV; |
| 22276 |
const encoded = this.readCharStrings(data, lenIV); |
| 22277 |
this.nextChar(); |
| 22278 |
token = this.getToken(); |
| 22279 |
if (token === "noaccess") { |
| 22280 |
this.getToken(); |
| 22281 |
} else if (token === "/") { |
| 22282 |
this.prevChar(); |
| 22283 |
} |
| 22284 |
charstrings.push({ |
| 22285 |
glyph, |
| 22286 |
encoded |
| 22287 |
}); |
| 22288 |
} |
| 22289 |
break; |
| 22290 |
case "Subrs": |
| 22291 |
this.readInt(); |
| 22292 |
this.getToken(); |
| 22293 |
while (this.getToken() === "dup") { |
| 22294 |
const index = this.readInt(); |
| 22295 |
length = this.readInt(); |
| 22296 |
this.getToken(); |
| 22297 |
data = length > 0 ? stream.getBytes(length) : new Uint8Array(0); |
| 22298 |
lenIV = program.properties.privateData.lenIV; |
| 22299 |
const encoded = this.readCharStrings(data, lenIV); |
| 22300 |
this.nextChar(); |
| 22301 |
token = this.getToken(); |
| 22302 |
if (token === "noaccess") { |
| 22303 |
this.getToken(); |
| 22304 |
} |
| 22305 |
subrs[index] = encoded; |
| 22306 |
} |
| 22307 |
break; |
| 22308 |
case "BlueValues": |
| 22309 |
case "OtherBlues": |
| 22310 |
case "FamilyBlues": |
| 22311 |
case "FamilyOtherBlues": |
| 22312 |
const blueArray = this.readNumberArray(); |
| 22313 |
if (blueArray.length > 0 && blueArray.length % 2 === 0 && HINTING_ENABLED) { |
| 22314 |
program.properties.privateData[token] = blueArray; |
| 22315 |
} |
| 22316 |
break; |
| 22317 |
case "StemSnapH": |
| 22318 |
case "StemSnapV": |
| 22319 |
program.properties.privateData[token] = this.readNumberArray(); |
| 22320 |
break; |
| 22321 |
case "StdHW": |
| 22322 |
case "StdVW": |
| 22323 |
program.properties.privateData[token] = this.readNumberArray()[0]; |
| 22324 |
break; |
| 22325 |
case "BlueShift": |
| 22326 |
case "lenIV": |
| 22327 |
case "BlueFuzz": |
| 22328 |
case "BlueScale": |
| 22329 |
case "LanguageGroup": |
| 22330 |
program.properties.privateData[token] = this.readNumber(); |
| 22331 |
break; |
| 22332 |
case "ExpansionFactor": |
| 22333 |
program.properties.privateData[token] = this.readNumber() || 0.06; |
| 22334 |
break; |
| 22335 |
case "ForceBold": |
| 22336 |
program.properties.privateData[token] = this.readBoolean(); |
| 22337 |
break; |
| 22338 |
} |
| 22339 |
} |
| 22340 |
for (const { |
| 22341 |
encoded, |
| 22342 |
glyph |
| 22343 |
} of charstrings) { |
| 22344 |
const charString = new Type1CharString(); |
| 22345 |
const error = charString.convert(encoded, subrs, this.seacAnalysisEnabled); |
| 22346 |
let output = charString.output; |
| 22347 |
if (error) { |
| 22348 |
output = [14]; |
| 22349 |
} |
| 22350 |
const charStringObject = { |
| 22351 |
glyphName: glyph, |
| 22352 |
charstring: output, |
| 22353 |
width: charString.width, |
| 22354 |
lsb: charString.lsb, |
| 22355 |
seac: charString.seac |
| 22356 |
}; |
| 22357 |
if (glyph === ".notdef") { |
| 22358 |
program.charstrings.unshift(charStringObject); |
| 22359 |
} else { |
| 22360 |
program.charstrings.push(charStringObject); |
| 22361 |
} |
| 22362 |
if (properties.builtInEncoding) { |
| 22363 |
const index = properties.builtInEncoding.indexOf(glyph); |
| 22364 |
if (index > -1 && properties.widths[index] === undefined && index >= properties.firstChar && index <= properties.lastChar) { |
| 22365 |
properties.widths[index] = charString.width; |
| 22366 |
} |
| 22367 |
} |
| 22368 |
} |
| 22369 |
return program; |
| 22370 |
} |
| 22371 |
extractFontHeader(properties) { |
| 22372 |
let token; |
| 22373 |
while ((token = this.getToken()) !== null) { |
| 22374 |
if (token !== "/") { |
| 22375 |
continue; |
| 22376 |
} |
| 22377 |
token = this.getToken(); |
| 22378 |
switch (token) { |
| 22379 |
case "FontMatrix": |
| 22380 |
const matrix = this.readNumberArray(); |
| 22381 |
properties.fontMatrix = matrix; |
| 22382 |
break; |
| 22383 |
case "Encoding": |
| 22384 |
const encodingArg = this.getToken(); |
| 22385 |
let encoding; |
| 22386 |
if (!/^\d+$/.test(encodingArg)) { |
| 22387 |
encoding = getEncoding(encodingArg); |
| 22388 |
} else { |
| 22389 |
encoding = []; |
| 22390 |
const size = parseInt(encodingArg, 10) | 0; |
| 22391 |
this.getToken(); |
| 22392 |
for (let j = 0; j < size; j++) { |
| 22393 |
token = this.getToken(); |
| 22394 |
while (token !== "dup" && token !== "def") { |
| 22395 |
token = this.getToken(); |
| 22396 |
if (token === null) { |
| 22397 |
return; |
| 22398 |
} |
| 22399 |
} |
| 22400 |
if (token === "def") { |
| 22401 |
break; |
| 22402 |
} |
| 22403 |
const index = this.readInt(); |
| 22404 |
this.getToken(); |
| 22405 |
const glyph = this.getToken(); |
| 22406 |
encoding[index] = glyph; |
| 22407 |
this.getToken(); |
| 22408 |
} |
| 22409 |
} |
| 22410 |
properties.builtInEncoding = encoding; |
| 22411 |
break; |
| 22412 |
case "FontBBox": |
| 22413 |
const fontBBox = this.readNumberArray(); |
| 22414 |
properties.ascent = Math.max(fontBBox[3], fontBBox[1]); |
| 22415 |
properties.descent = Math.min(fontBBox[1], fontBBox[3]); |
| 22416 |
properties.ascentScaled = true; |
| 22417 |
break; |
| 22418 |
} |
| 22419 |
} |
| 22420 |
} |
| 22421 |
} |
| 22422 |
|
| 22423 |
;// ./src/core/type1_font.js |
| 22424 |
|
| 22425 |
|
| 22426 |
|
| 22427 |
|
| 22428 |
|
| 22429 |
|
| 22430 |
function findBlock(streamBytes, signature, startIndex) { |
| 22431 |
const streamBytesLength = streamBytes.length; |
| 22432 |
const signatureLength = signature.length; |
| 22433 |
const scanLength = streamBytesLength - signatureLength; |
| 22434 |
let i = startIndex, |
| 22435 |
found = false; |
| 22436 |
while (i < scanLength) { |
| 22437 |
let j = 0; |
| 22438 |
while (j < signatureLength && streamBytes[i + j] === signature[j]) { |
| 22439 |
j++; |
| 22440 |
} |
| 22441 |
if (j >= signatureLength) { |
| 22442 |
i += j; |
| 22443 |
while (i < streamBytesLength && isWhiteSpace(streamBytes[i])) { |
| 22444 |
i++; |
| 22445 |
} |
| 22446 |
found = true; |
| 22447 |
break; |
| 22448 |
} |
| 22449 |
i++; |
| 22450 |
} |
| 22451 |
return { |
| 22452 |
found, |
| 22453 |
length: i |
| 22454 |
}; |
| 22455 |
} |
| 22456 |
function getHeaderBlock(stream, suggestedLength) { |
| 22457 |
const EEXEC_SIGNATURE = [0x65, 0x65, 0x78, 0x65, 0x63]; |
| 22458 |
const streamStartPos = stream.pos; |
| 22459 |
let headerBytes, headerBytesLength, block; |
| 22460 |
try { |
| 22461 |
headerBytes = stream.getBytes(suggestedLength); |
| 22462 |
headerBytesLength = headerBytes.length; |
| 22463 |
} catch {} |
| 22464 |
if (headerBytesLength === suggestedLength) { |
| 22465 |
block = findBlock(headerBytes, EEXEC_SIGNATURE, suggestedLength - 2 * EEXEC_SIGNATURE.length); |
| 22466 |
if (block.found && block.length === suggestedLength) { |
| 22467 |
return { |
| 22468 |
stream: new Stream(headerBytes), |
| 22469 |
length: suggestedLength |
| 22470 |
}; |
| 22471 |
} |
| 22472 |
} |
| 22473 |
warn('Invalid "Length1" property in Type1 font -- trying to recover.'); |
| 22474 |
stream.pos = streamStartPos; |
| 22475 |
const SCAN_BLOCK_LENGTH = 2048; |
| 22476 |
let actualLength; |
| 22477 |
while (true) { |
| 22478 |
const scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH); |
| 22479 |
block = findBlock(scanBytes, EEXEC_SIGNATURE, 0); |
| 22480 |
if (block.length === 0) { |
| 22481 |
break; |
| 22482 |
} |
| 22483 |
stream.pos += block.length; |
| 22484 |
if (block.found) { |
| 22485 |
actualLength = stream.pos - streamStartPos; |
| 22486 |
break; |
| 22487 |
} |
| 22488 |
} |
| 22489 |
stream.pos = streamStartPos; |
| 22490 |
if (actualLength) { |
| 22491 |
return { |
| 22492 |
stream: new Stream(stream.getBytes(actualLength)), |
| 22493 |
length: actualLength |
| 22494 |
}; |
| 22495 |
} |
| 22496 |
warn('Unable to recover "Length1" property in Type1 font -- using as is.'); |
| 22497 |
return { |
| 22498 |
stream: new Stream(stream.getBytes(suggestedLength)), |
| 22499 |
length: suggestedLength |
| 22500 |
}; |
| 22501 |
} |
| 22502 |
function getEexecBlock(stream, suggestedLength) { |
| 22503 |
const eexecBytes = stream.getBytes(); |
| 22504 |
if (eexecBytes.length === 0) { |
| 22505 |
throw new FormatError("getEexecBlock - no font program found."); |
| 22506 |
} |
| 22507 |
return { |
| 22508 |
stream: new Stream(eexecBytes), |
| 22509 |
length: eexecBytes.length |
| 22510 |
}; |
| 22511 |
} |
| 22512 |
class Type1Font { |
| 22513 |
constructor(name, file, properties) { |
| 22514 |
const PFB_HEADER_SIZE = 6; |
| 22515 |
let headerBlockLength = properties.length1; |
| 22516 |
let eexecBlockLength = properties.length2; |
| 22517 |
let pfbHeader = file.peekBytes(PFB_HEADER_SIZE); |
| 22518 |
const pfbHeaderPresent = pfbHeader[0] === 0x80 && pfbHeader[1] === 0x01; |
| 22519 |
if (pfbHeaderPresent) { |
| 22520 |
file.skip(PFB_HEADER_SIZE); |
| 22521 |
headerBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2]; |
| 22522 |
} |
| 22523 |
const headerBlock = getHeaderBlock(file, headerBlockLength); |
| 22524 |
const headerBlockParser = new Type1Parser(headerBlock.stream, false, SEAC_ANALYSIS_ENABLED); |
| 22525 |
headerBlockParser.extractFontHeader(properties); |
| 22526 |
if (pfbHeaderPresent) { |
| 22527 |
pfbHeader = file.getBytes(PFB_HEADER_SIZE); |
| 22528 |
eexecBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2]; |
| 22529 |
} |
| 22530 |
const eexecBlock = getEexecBlock(file, eexecBlockLength); |
| 22531 |
const eexecBlockParser = new Type1Parser(eexecBlock.stream, true, SEAC_ANALYSIS_ENABLED); |
| 22532 |
const data = eexecBlockParser.extractFontProgram(properties); |
| 22533 |
for (const key in data.properties) { |
| 22534 |
properties[key] = data.properties[key]; |
| 22535 |
} |
| 22536 |
const charstrings = data.charstrings; |
| 22537 |
const type2Charstrings = this.getType2Charstrings(charstrings); |
| 22538 |
const subrs = this.getType2Subrs(data.subrs); |
| 22539 |
this.charstrings = charstrings; |
| 22540 |
this.data = this.wrap(name, type2Charstrings, this.charstrings, subrs, properties); |
| 22541 |
this.seacs = this.getSeacs(data.charstrings); |
| 22542 |
} |
| 22543 |
get numGlyphs() { |
| 22544 |
return this.charstrings.length + 1; |
| 22545 |
} |
| 22546 |
getCharset() { |
| 22547 |
const charset = [".notdef"]; |
| 22548 |
for (const { |
| 22549 |
glyphName |
| 22550 |
} of this.charstrings) { |
| 22551 |
charset.push(glyphName); |
| 22552 |
} |
| 22553 |
return charset; |
| 22554 |
} |
| 22555 |
getGlyphMapping(properties) { |
| 22556 |
const charstrings = this.charstrings; |
| 22557 |
if (properties.composite) { |
| 22558 |
const charCodeToGlyphId = Object.create(null); |
| 22559 |
for (let glyphId = 0, charstringsLen = charstrings.length; glyphId < charstringsLen; glyphId++) { |
| 22560 |
const charCode = properties.cMap.charCodeOf(glyphId); |
| 22561 |
charCodeToGlyphId[charCode] = glyphId + 1; |
| 22562 |
} |
| 22563 |
return charCodeToGlyphId; |
| 22564 |
} |
| 22565 |
const glyphNames = [".notdef"]; |
| 22566 |
let builtInEncoding, glyphId; |
| 22567 |
for (glyphId = 0; glyphId < charstrings.length; glyphId++) { |
| 22568 |
glyphNames.push(charstrings[glyphId].glyphName); |
| 22569 |
} |
| 22570 |
const encoding = properties.builtInEncoding; |
| 22571 |
if (encoding) { |
| 22572 |
builtInEncoding = Object.create(null); |
| 22573 |
for (const charCode in encoding) { |
| 22574 |
glyphId = glyphNames.indexOf(encoding[charCode]); |
| 22575 |
if (glyphId >= 0) { |
| 22576 |
builtInEncoding[charCode] = glyphId; |
| 22577 |
} |
| 22578 |
} |
| 22579 |
} |
| 22580 |
return type1FontGlyphMapping(properties, builtInEncoding, glyphNames); |
| 22581 |
} |
| 22582 |
hasGlyphId(id) { |
| 22583 |
if (id < 0 || id >= this.numGlyphs) { |
| 22584 |
return false; |
| 22585 |
} |
| 22586 |
if (id === 0) { |
| 22587 |
return true; |
| 22588 |
} |
| 22589 |
const glyph = this.charstrings[id - 1]; |
| 22590 |
return glyph.charstring.length > 0; |
| 22591 |
} |
| 22592 |
getSeacs(charstrings) { |
| 22593 |
const seacMap = []; |
| 22594 |
for (let i = 0, ii = charstrings.length; i < ii; i++) { |
| 22595 |
const charstring = charstrings[i]; |
| 22596 |
if (charstring.seac) { |
| 22597 |
seacMap[i + 1] = charstring.seac; |
| 22598 |
} |
| 22599 |
} |
| 22600 |
return seacMap; |
| 22601 |
} |
| 22602 |
getType2Charstrings(type1Charstrings) { |
| 22603 |
const type2Charstrings = []; |
| 22604 |
for (const type1Charstring of type1Charstrings) { |
| 22605 |
type2Charstrings.push(type1Charstring.charstring); |
| 22606 |
} |
| 22607 |
return type2Charstrings; |
| 22608 |
} |
| 22609 |
getType2Subrs(type1Subrs) { |
| 22610 |
let bias = 0; |
| 22611 |
const count = type1Subrs.length; |
| 22612 |
if (count < 1133) { |
| 22613 |
bias = 107; |
| 22614 |
} else if (count < 33769) { |
| 22615 |
bias = 1131; |
| 22616 |
} else { |
| 22617 |
bias = 32768; |
| 22618 |
} |
| 22619 |
const type2Subrs = []; |
| 22620 |
let i; |
| 22621 |
for (i = 0; i < bias; i++) { |
| 22622 |
type2Subrs.push([0x0b]); |
| 22623 |
} |
| 22624 |
for (i = 0; i < count; i++) { |
| 22625 |
type2Subrs.push(type1Subrs[i]); |
| 22626 |
} |
| 22627 |
return type2Subrs; |
| 22628 |
} |
| 22629 |
wrap(name, glyphs, charstrings, subrs, properties) { |
| 22630 |
const cff = new CFF(); |
| 22631 |
cff.header = new CFFHeader(1, 0, 4, 4); |
| 22632 |
cff.names = [name]; |
| 22633 |
const topDict = new CFFTopDict(); |
| 22634 |
topDict.setByName("version", 391); |
| 22635 |
topDict.setByName("Notice", 392); |
| 22636 |
topDict.setByName("FullName", 393); |
| 22637 |
topDict.setByName("FamilyName", 394); |
| 22638 |
topDict.setByName("Weight", 395); |
| 22639 |
topDict.setByName("Encoding", null); |
| 22640 |
topDict.setByName("FontMatrix", properties.fontMatrix); |
| 22641 |
topDict.setByName("FontBBox", properties.bbox); |
| 22642 |
topDict.setByName("charset", null); |
| 22643 |
topDict.setByName("CharStrings", null); |
| 22644 |
topDict.setByName("Private", null); |
| 22645 |
cff.topDict = topDict; |
| 22646 |
const strings = new CFFStrings(); |
| 22647 |
strings.add("Version 0.11"); |
| 22648 |
strings.add("See original notice"); |
| 22649 |
strings.add(name); |
| 22650 |
strings.add(name); |
| 22651 |
strings.add("Medium"); |
| 22652 |
cff.strings = strings; |
| 22653 |
cff.globalSubrIndex = new CFFIndex(); |
| 22654 |
const count = glyphs.length; |
| 22655 |
const charsetArray = [".notdef"]; |
| 22656 |
let i, ii; |
| 22657 |
for (i = 0; i < count; i++) { |
| 22658 |
const glyphName = charstrings[i].glyphName; |
| 22659 |
const index = CFFStandardStrings.indexOf(glyphName); |
| 22660 |
if (index === -1) { |
| 22661 |
strings.add(glyphName); |
| 22662 |
} |
| 22663 |
charsetArray.push(glyphName); |
| 22664 |
} |
| 22665 |
cff.charset = new CFFCharset(false, 0, charsetArray); |
| 22666 |
const charStringsIndex = new CFFIndex(); |
| 22667 |
charStringsIndex.add([0x8b, 0x0e]); |
| 22668 |
for (i = 0; i < count; i++) { |
| 22669 |
charStringsIndex.add(glyphs[i]); |
| 22670 |
} |
| 22671 |
cff.charStrings = charStringsIndex; |
| 22672 |
const privateDict = new CFFPrivateDict(); |
| 22673 |
privateDict.setByName("Subrs", null); |
| 22674 |
const fields = ["BlueValues", "OtherBlues", "FamilyBlues", "FamilyOtherBlues", "StemSnapH", "StemSnapV", "BlueShift", "BlueFuzz", "BlueScale", "LanguageGroup", "ExpansionFactor", "ForceBold", "StdHW", "StdVW"]; |
| 22675 |
for (i = 0, ii = fields.length; i < ii; i++) { |
| 22676 |
const field = fields[i]; |
| 22677 |
if (!(field in properties.privateData)) { |
| 22678 |
continue; |
| 22679 |
} |
| 22680 |
const value = properties.privateData[field]; |
| 22681 |
if (Array.isArray(value)) { |
| 22682 |
for (let j = value.length - 1; j > 0; j--) { |
| 22683 |
value[j] -= value[j - 1]; |
| 22684 |
} |
| 22685 |
} |
| 22686 |
privateDict.setByName(field, value); |
| 22687 |
} |
| 22688 |
cff.topDict.privateDict = privateDict; |
| 22689 |
const subrIndex = new CFFIndex(); |
| 22690 |
for (i = 0, ii = subrs.length; i < ii; i++) { |
| 22691 |
subrIndex.add(subrs[i]); |
| 22692 |
} |
| 22693 |
privateDict.subrsIndex = subrIndex; |
| 22694 |
const compiler = new CFFCompiler(cff); |
| 22695 |
return compiler.compile(); |
| 22696 |
} |
| 22697 |
} |
| 22698 |
|
| 22699 |
;// ./src/core/fonts.js |
| 22700 |
|
| 22701 |
|
| 22702 |
|
| 22703 |
|
| 22704 |
|
| 22705 |
|
| 22706 |
|
| 22707 |
|
| 22708 |
|
| 22709 |
|
| 22710 |
|
| 22711 |
|
| 22712 |
|
| 22713 |
|
| 22714 |
|
| 22715 |
|
| 22716 |
|
| 22717 |
const PRIVATE_USE_AREAS = [[0xe000, 0xf8ff], [0x100000, 0x10fffd]]; |
| 22718 |
const PDF_GLYPH_SPACE_UNITS = 1000; |
| 22719 |
const EXPORT_DATA_PROPERTIES = ["ascent", "bbox", "black", "bold", "charProcOperatorList", "composite", "cssFontInfo", "data", "defaultVMetrics", "defaultWidth", "descent", "fallbackName", "fontMatrix", "isInvalidPDFjsFont", "isType3Font", "italic", "loadedName", "mimetype", "missingFile", "name", "remeasure", "subtype", "systemFontInfo", "type", "vertical"]; |
| 22720 |
const EXPORT_DATA_EXTRA_PROPERTIES = ["cMap", "defaultEncoding", "differences", "isMonospace", "isSerifFont", "isSymbolicFont", "seacMap", "toFontChar", "toUnicode", "vmetrics", "widths"]; |
| 22721 |
function adjustWidths(properties) { |
| 22722 |
if (!properties.fontMatrix) { |
| 22723 |
return; |
| 22724 |
} |
| 22725 |
if (properties.fontMatrix[0] === FONT_IDENTITY_MATRIX[0]) { |
| 22726 |
return; |
| 22727 |
} |
| 22728 |
const scale = 0.001 / properties.fontMatrix[0]; |
| 22729 |
const glyphsWidths = properties.widths; |
| 22730 |
for (const glyph in glyphsWidths) { |
| 22731 |
glyphsWidths[glyph] *= scale; |
| 22732 |
} |
| 22733 |
properties.defaultWidth *= scale; |
| 22734 |
} |
| 22735 |
function adjustTrueTypeToUnicode(properties, isSymbolicFont, nameRecords) { |
| 22736 |
if (properties.isInternalFont) { |
| 22737 |
return; |
| 22738 |
} |
| 22739 |
if (properties.hasIncludedToUnicodeMap) { |
| 22740 |
return; |
| 22741 |
} |
| 22742 |
if (properties.hasEncoding) { |
| 22743 |
return; |
| 22744 |
} |
| 22745 |
if (properties.toUnicode instanceof IdentityToUnicodeMap) { |
| 22746 |
return; |
| 22747 |
} |
| 22748 |
if (!isSymbolicFont) { |
| 22749 |
return; |
| 22750 |
} |
| 22751 |
if (nameRecords.length === 0) { |
| 22752 |
return; |
| 22753 |
} |
| 22754 |
if (properties.defaultEncoding === WinAnsiEncoding) { |
| 22755 |
return; |
| 22756 |
} |
| 22757 |
for (const r of nameRecords) { |
| 22758 |
if (!isWinNameRecord(r)) { |
| 22759 |
return; |
| 22760 |
} |
| 22761 |
} |
| 22762 |
const encoding = WinAnsiEncoding; |
| 22763 |
const toUnicode = [], |
| 22764 |
glyphsUnicodeMap = getGlyphsUnicode(); |
| 22765 |
for (const charCode in encoding) { |
| 22766 |
const glyphName = encoding[charCode]; |
| 22767 |
if (glyphName === "") { |
| 22768 |
continue; |
| 22769 |
} |
| 22770 |
const unicode = glyphsUnicodeMap[glyphName]; |
| 22771 |
if (unicode === undefined) { |
| 22772 |
continue; |
| 22773 |
} |
| 22774 |
toUnicode[charCode] = String.fromCharCode(unicode); |
| 22775 |
} |
| 22776 |
if (toUnicode.length > 0) { |
| 22777 |
properties.toUnicode.amend(toUnicode); |
| 22778 |
} |
| 22779 |
} |
| 22780 |
function adjustType1ToUnicode(properties, builtInEncoding) { |
| 22781 |
if (properties.isInternalFont) { |
| 22782 |
return; |
| 22783 |
} |
| 22784 |
if (properties.hasIncludedToUnicodeMap) { |
| 22785 |
return; |
| 22786 |
} |
| 22787 |
if (builtInEncoding === properties.defaultEncoding) { |
| 22788 |
return; |
| 22789 |
} |
| 22790 |
if (properties.toUnicode instanceof IdentityToUnicodeMap) { |
| 22791 |
return; |
| 22792 |
} |
| 22793 |
const toUnicode = [], |
| 22794 |
glyphsUnicodeMap = getGlyphsUnicode(); |
| 22795 |
for (const charCode in builtInEncoding) { |
| 22796 |
if (properties.hasEncoding) { |
| 22797 |
if (properties.baseEncodingName || properties.differences[charCode] !== undefined) { |
| 22798 |
continue; |
| 22799 |
} |
| 22800 |
} |
| 22801 |
const glyphName = builtInEncoding[charCode]; |
| 22802 |
const unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); |
| 22803 |
if (unicode !== -1) { |
| 22804 |
toUnicode[charCode] = String.fromCharCode(unicode); |
| 22805 |
} |
| 22806 |
} |
| 22807 |
if (toUnicode.length > 0) { |
| 22808 |
properties.toUnicode.amend(toUnicode); |
| 22809 |
} |
| 22810 |
} |
| 22811 |
function amendFallbackToUnicode(properties) { |
| 22812 |
if (!properties.fallbackToUnicode) { |
| 22813 |
return; |
| 22814 |
} |
| 22815 |
if (properties.toUnicode instanceof IdentityToUnicodeMap) { |
| 22816 |
return; |
| 22817 |
} |
| 22818 |
const toUnicode = []; |
| 22819 |
for (const charCode in properties.fallbackToUnicode) { |
| 22820 |
if (properties.toUnicode.has(charCode)) { |
| 22821 |
continue; |
| 22822 |
} |
| 22823 |
toUnicode[charCode] = properties.fallbackToUnicode[charCode]; |
| 22824 |
} |
| 22825 |
if (toUnicode.length > 0) { |
| 22826 |
properties.toUnicode.amend(toUnicode); |
| 22827 |
} |
| 22828 |
} |
| 22829 |
class fonts_Glyph { |
| 22830 |
constructor(originalCharCode, fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont) { |
| 22831 |
this.originalCharCode = originalCharCode; |
| 22832 |
this.fontChar = fontChar; |
| 22833 |
this.unicode = unicode; |
| 22834 |
this.accent = accent; |
| 22835 |
this.width = width; |
| 22836 |
this.vmetric = vmetric; |
| 22837 |
this.operatorListId = operatorListId; |
| 22838 |
this.isSpace = isSpace; |
| 22839 |
this.isInFont = isInFont; |
| 22840 |
} |
| 22841 |
get category() { |
| 22842 |
return shadow(this, "category", getCharUnicodeCategory(this.unicode), true); |
| 22843 |
} |
| 22844 |
} |
| 22845 |
function int16(b0, b1) { |
| 22846 |
return (b0 << 8) + b1; |
| 22847 |
} |
| 22848 |
function writeSignedInt16(bytes, index, value) { |
| 22849 |
bytes[index + 1] = value; |
| 22850 |
bytes[index] = value >>> 8; |
| 22851 |
} |
| 22852 |
function signedInt16(b0, b1) { |
| 22853 |
const value = (b0 << 8) + b1; |
| 22854 |
return value & 1 << 15 ? value - 0x10000 : value; |
| 22855 |
} |
| 22856 |
function writeUint32(bytes, index, value) { |
| 22857 |
bytes[index + 3] = value & 0xff; |
| 22858 |
bytes[index + 2] = value >>> 8; |
| 22859 |
bytes[index + 1] = value >>> 16; |
| 22860 |
bytes[index] = value >>> 24; |
| 22861 |
} |
| 22862 |
function int32(b0, b1, b2, b3) { |
| 22863 |
return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; |
| 22864 |
} |
| 22865 |
function string16(value) { |
| 22866 |
return String.fromCharCode(value >> 8 & 0xff, value & 0xff); |
| 22867 |
} |
| 22868 |
function safeString16(value) { |
| 22869 |
if (value > 0x7fff) { |
| 22870 |
value = 0x7fff; |
| 22871 |
} else if (value < -0x8000) { |
| 22872 |
value = -0x8000; |
| 22873 |
} |
| 22874 |
return String.fromCharCode(value >> 8 & 0xff, value & 0xff); |
| 22875 |
} |
| 22876 |
function isTrueTypeFile(file) { |
| 22877 |
const header = file.peekBytes(4); |
| 22878 |
return readUint32(header, 0) === 0x00010000 || bytesToString(header) === "true"; |
| 22879 |
} |
| 22880 |
function isTrueTypeCollectionFile(file) { |
| 22881 |
const header = file.peekBytes(4); |
| 22882 |
return bytesToString(header) === "ttcf"; |
| 22883 |
} |
| 22884 |
function isOpenTypeFile(file) { |
| 22885 |
const header = file.peekBytes(4); |
| 22886 |
return bytesToString(header) === "OTTO"; |
| 22887 |
} |
| 22888 |
function isType1File(file) { |
| 22889 |
const header = file.peekBytes(2); |
| 22890 |
if (header[0] === 0x25 && header[1] === 0x21) { |
| 22891 |
return true; |
| 22892 |
} |
| 22893 |
if (header[0] === 0x80 && header[1] === 0x01) { |
| 22894 |
return true; |
| 22895 |
} |
| 22896 |
return false; |
| 22897 |
} |
| 22898 |
function isCFFFile(file) { |
| 22899 |
const header = file.peekBytes(4); |
| 22900 |
if (header[0] >= 1 && header[3] >= 1 && header[3] <= 4) { |
| 22901 |
return true; |
| 22902 |
} |
| 22903 |
return false; |
| 22904 |
} |
| 22905 |
function getFontFileType(file, { |
| 22906 |
type, |
| 22907 |
subtype, |
| 22908 |
composite |
| 22909 |
}) { |
| 22910 |
let fileType, fileSubtype; |
| 22911 |
if (isTrueTypeFile(file) || isTrueTypeCollectionFile(file)) { |
| 22912 |
fileType = composite ? "CIDFontType2" : "TrueType"; |
| 22913 |
} else if (isOpenTypeFile(file)) { |
| 22914 |
fileType = composite ? "CIDFontType2" : "OpenType"; |
| 22915 |
} else if (isType1File(file)) { |
| 22916 |
if (composite) { |
| 22917 |
fileType = "CIDFontType0"; |
| 22918 |
} else { |
| 22919 |
fileType = type === "MMType1" ? "MMType1" : "Type1"; |
| 22920 |
} |
| 22921 |
} else if (isCFFFile(file)) { |
| 22922 |
if (composite) { |
| 22923 |
fileType = "CIDFontType0"; |
| 22924 |
fileSubtype = "CIDFontType0C"; |
| 22925 |
} else { |
| 22926 |
fileType = type === "MMType1" ? "MMType1" : "Type1"; |
| 22927 |
fileSubtype = "Type1C"; |
| 22928 |
} |
| 22929 |
} else { |
| 22930 |
warn("getFontFileType: Unable to detect correct font file Type/Subtype."); |
| 22931 |
fileType = type; |
| 22932 |
fileSubtype = subtype; |
| 22933 |
} |
| 22934 |
return [fileType, fileSubtype]; |
| 22935 |
} |
| 22936 |
function applyStandardFontGlyphMap(map, glyphMap) { |
| 22937 |
for (const charCode in glyphMap) { |
| 22938 |
map[+charCode] = glyphMap[charCode]; |
| 22939 |
} |
| 22940 |
} |
| 22941 |
function buildToFontChar(encoding, glyphsUnicodeMap, differences) { |
| 22942 |
const toFontChar = []; |
| 22943 |
let unicode; |
| 22944 |
for (let i = 0, ii = encoding.length; i < ii; i++) { |
| 22945 |
unicode = getUnicodeForGlyph(encoding[i], glyphsUnicodeMap); |
| 22946 |
if (unicode !== -1) { |
| 22947 |
toFontChar[i] = unicode; |
| 22948 |
} |
| 22949 |
} |
| 22950 |
for (const charCode in differences) { |
| 22951 |
unicode = getUnicodeForGlyph(differences[charCode], glyphsUnicodeMap); |
| 22952 |
if (unicode !== -1) { |
| 22953 |
toFontChar[+charCode] = unicode; |
| 22954 |
} |
| 22955 |
} |
| 22956 |
return toFontChar; |
| 22957 |
} |
| 22958 |
function isMacNameRecord(r) { |
| 22959 |
return r.platform === 1 && r.encoding === 0 && r.language === 0; |
| 22960 |
} |
| 22961 |
function isWinNameRecord(r) { |
| 22962 |
return r.platform === 3 && r.encoding === 1 && r.language === 0x409; |
| 22963 |
} |
| 22964 |
function convertCidString(charCode, cid, shouldThrow = false) { |
| 22965 |
switch (cid.length) { |
| 22966 |
case 1: |
| 22967 |
return cid.charCodeAt(0); |
| 22968 |
case 2: |
| 22969 |
return cid.charCodeAt(0) << 8 | cid.charCodeAt(1); |
| 22970 |
} |
| 22971 |
const msg = `Unsupported CID string (charCode ${charCode}): "${cid}".`; |
| 22972 |
if (shouldThrow) { |
| 22973 |
throw new FormatError(msg); |
| 22974 |
} |
| 22975 |
warn(msg); |
| 22976 |
return cid; |
| 22977 |
} |
| 22978 |
function adjustMapping(charCodeToGlyphId, hasGlyph, newGlyphZeroId, toUnicode) { |
| 22979 |
const newMap = Object.create(null); |
| 22980 |
const toUnicodeExtraMap = new Map(); |
| 22981 |
const toFontChar = []; |
| 22982 |
const usedGlyphIds = new Set(); |
| 22983 |
let privateUseAreaIndex = 0; |
| 22984 |
const privateUseOffetStart = PRIVATE_USE_AREAS[privateUseAreaIndex][0]; |
| 22985 |
let nextAvailableFontCharCode = privateUseOffetStart; |
| 22986 |
let privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1]; |
| 22987 |
const isInPrivateArea = code => PRIVATE_USE_AREAS[0][0] <= code && code <= PRIVATE_USE_AREAS[0][1] || PRIVATE_USE_AREAS[1][0] <= code && code <= PRIVATE_USE_AREAS[1][1]; |
| 22988 |
for (const originalCharCode in charCodeToGlyphId) { |
| 22989 |
let glyphId = charCodeToGlyphId[originalCharCode]; |
| 22990 |
if (!hasGlyph(glyphId)) { |
| 22991 |
continue; |
| 22992 |
} |
| 22993 |
if (nextAvailableFontCharCode > privateUseOffetEnd) { |
| 22994 |
privateUseAreaIndex++; |
| 22995 |
if (privateUseAreaIndex >= PRIVATE_USE_AREAS.length) { |
| 22996 |
warn("Ran out of space in font private use area."); |
| 22997 |
break; |
| 22998 |
} |
| 22999 |
nextAvailableFontCharCode = PRIVATE_USE_AREAS[privateUseAreaIndex][0]; |
| 23000 |
privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1]; |
| 23001 |
} |
| 23002 |
const fontCharCode = nextAvailableFontCharCode++; |
| 23003 |
if (glyphId === 0) { |
| 23004 |
glyphId = newGlyphZeroId; |
| 23005 |
} |
| 23006 |
let unicode = toUnicode.get(originalCharCode); |
| 23007 |
if (typeof unicode === "string") { |
| 23008 |
unicode = unicode.codePointAt(0); |
| 23009 |
} |
| 23010 |
if (unicode && !isInPrivateArea(unicode) && !usedGlyphIds.has(glyphId)) { |
| 23011 |
toUnicodeExtraMap.set(unicode, glyphId); |
| 23012 |
usedGlyphIds.add(glyphId); |
| 23013 |
} |
| 23014 |
newMap[fontCharCode] = glyphId; |
| 23015 |
toFontChar[originalCharCode] = fontCharCode; |
| 23016 |
} |
| 23017 |
return { |
| 23018 |
toFontChar, |
| 23019 |
charCodeToGlyphId: newMap, |
| 23020 |
toUnicodeExtraMap, |
| 23021 |
nextAvailableFontCharCode |
| 23022 |
}; |
| 23023 |
} |
| 23024 |
function getRanges(glyphs, toUnicodeExtraMap, numGlyphs) { |
| 23025 |
const codes = []; |
| 23026 |
for (const charCode in glyphs) { |
| 23027 |
if (glyphs[charCode] >= numGlyphs) { |
| 23028 |
continue; |
| 23029 |
} |
| 23030 |
codes.push({ |
| 23031 |
fontCharCode: charCode | 0, |
| 23032 |
glyphId: glyphs[charCode] |
| 23033 |
}); |
| 23034 |
} |
| 23035 |
if (toUnicodeExtraMap) { |
| 23036 |
for (const [unicode, glyphId] of toUnicodeExtraMap) { |
| 23037 |
if (glyphId >= numGlyphs) { |
| 23038 |
continue; |
| 23039 |
} |
| 23040 |
codes.push({ |
| 23041 |
fontCharCode: unicode, |
| 23042 |
glyphId |
| 23043 |
}); |
| 23044 |
} |
| 23045 |
} |
| 23046 |
if (codes.length === 0) { |
| 23047 |
codes.push({ |
| 23048 |
fontCharCode: 0, |
| 23049 |
glyphId: 0 |
| 23050 |
}); |
| 23051 |
} |
| 23052 |
codes.sort(function fontGetRangesSort(a, b) { |
| 23053 |
return a.fontCharCode - b.fontCharCode; |
| 23054 |
}); |
| 23055 |
const ranges = []; |
| 23056 |
const length = codes.length; |
| 23057 |
for (let n = 0; n < length;) { |
| 23058 |
const start = codes[n].fontCharCode; |
| 23059 |
const codeIndices = [codes[n].glyphId]; |
| 23060 |
++n; |
| 23061 |
let end = start; |
| 23062 |
while (n < length && end + 1 === codes[n].fontCharCode) { |
| 23063 |
codeIndices.push(codes[n].glyphId); |
| 23064 |
++end; |
| 23065 |
++n; |
| 23066 |
if (end === 0xffff) { |
| 23067 |
break; |
| 23068 |
} |
| 23069 |
} |
| 23070 |
ranges.push([start, end, codeIndices]); |
| 23071 |
} |
| 23072 |
return ranges; |
| 23073 |
} |
| 23074 |
function createCmapTable(glyphs, toUnicodeExtraMap, numGlyphs) { |
| 23075 |
const ranges = getRanges(glyphs, toUnicodeExtraMap, numGlyphs); |
| 23076 |
const numTables = ranges.at(-1)[1] > 0xffff ? 2 : 1; |
| 23077 |
let cmap = "\x00\x00" + string16(numTables) + "\x00\x03" + "\x00\x01" + string32(4 + numTables * 8); |
| 23078 |
let i, ii, j, jj; |
| 23079 |
for (i = ranges.length - 1; i >= 0; --i) { |
| 23080 |
if (ranges[i][0] <= 0xffff) { |
| 23081 |
break; |
| 23082 |
} |
| 23083 |
} |
| 23084 |
const bmpLength = i + 1; |
| 23085 |
if (ranges[i][0] < 0xffff && ranges[i][1] === 0xffff) { |
| 23086 |
ranges[i][1] = 0xfffe; |
| 23087 |
} |
| 23088 |
const trailingRangesCount = ranges[i][1] < 0xffff ? 1 : 0; |
| 23089 |
const segCount = bmpLength + trailingRangesCount; |
| 23090 |
const searchParams = OpenTypeFileBuilder.getSearchParams(segCount, 2); |
| 23091 |
let startCount = ""; |
| 23092 |
let endCount = ""; |
| 23093 |
let idDeltas = ""; |
| 23094 |
let idRangeOffsets = ""; |
| 23095 |
let glyphsIds = ""; |
| 23096 |
let bias = 0; |
| 23097 |
let range, start, end, codes; |
| 23098 |
for (i = 0, ii = bmpLength; i < ii; i++) { |
| 23099 |
range = ranges[i]; |
| 23100 |
start = range[0]; |
| 23101 |
end = range[1]; |
| 23102 |
startCount += string16(start); |
| 23103 |
endCount += string16(end); |
| 23104 |
codes = range[2]; |
| 23105 |
let contiguous = true; |
| 23106 |
for (j = 1, jj = codes.length; j < jj; ++j) { |
| 23107 |
if (codes[j] !== codes[j - 1] + 1) { |
| 23108 |
contiguous = false; |
| 23109 |
break; |
| 23110 |
} |
| 23111 |
} |
| 23112 |
if (!contiguous) { |
| 23113 |
const offset = (segCount - i) * 2 + bias * 2; |
| 23114 |
bias += end - start + 1; |
| 23115 |
idDeltas += string16(0); |
| 23116 |
idRangeOffsets += string16(offset); |
| 23117 |
for (j = 0, jj = codes.length; j < jj; ++j) { |
| 23118 |
glyphsIds += string16(codes[j]); |
| 23119 |
} |
| 23120 |
} else { |
| 23121 |
const startCode = codes[0]; |
| 23122 |
idDeltas += string16(startCode - start & 0xffff); |
| 23123 |
idRangeOffsets += string16(0); |
| 23124 |
} |
| 23125 |
} |
| 23126 |
if (trailingRangesCount > 0) { |
| 23127 |
endCount += "\xFF\xFF"; |
| 23128 |
startCount += "\xFF\xFF"; |
| 23129 |
idDeltas += "\x00\x01"; |
| 23130 |
idRangeOffsets += "\x00\x00"; |
| 23131 |
} |
| 23132 |
const format314 = "\x00\x00" + string16(2 * segCount) + string16(searchParams.range) + string16(searchParams.entry) + string16(searchParams.rangeShift) + endCount + "\x00\x00" + startCount + idDeltas + idRangeOffsets + glyphsIds; |
| 23133 |
let format31012 = ""; |
| 23134 |
let header31012 = ""; |
| 23135 |
if (numTables > 1) { |
| 23136 |
cmap += "\x00\x03" + "\x00\x0A" + string32(4 + numTables * 8 + 4 + format314.length); |
| 23137 |
format31012 = ""; |
| 23138 |
for (i = 0, ii = ranges.length; i < ii; i++) { |
| 23139 |
range = ranges[i]; |
| 23140 |
start = range[0]; |
| 23141 |
codes = range[2]; |
| 23142 |
let code = codes[0]; |
| 23143 |
for (j = 1, jj = codes.length; j < jj; ++j) { |
| 23144 |
if (codes[j] !== codes[j - 1] + 1) { |
| 23145 |
end = range[0] + j - 1; |
| 23146 |
format31012 += string32(start) + string32(end) + string32(code); |
| 23147 |
start = end + 1; |
| 23148 |
code = codes[j]; |
| 23149 |
} |
| 23150 |
} |
| 23151 |
format31012 += string32(start) + string32(range[1]) + string32(code); |
| 23152 |
} |
| 23153 |
header31012 = "\x00\x0C" + "\x00\x00" + string32(format31012.length + 16) + "\x00\x00\x00\x00" + string32(format31012.length / 12); |
| 23154 |
} |
| 23155 |
return cmap + "\x00\x04" + string16(format314.length + 4) + format314 + header31012 + format31012; |
| 23156 |
} |
| 23157 |
function validateOS2Table(os2, file) { |
| 23158 |
file.pos = (file.start || 0) + os2.offset; |
| 23159 |
const version = file.getUint16(); |
| 23160 |
file.skip(60); |
| 23161 |
const selection = file.getUint16(); |
| 23162 |
if (version < 4 && selection & 0x0300) { |
| 23163 |
return false; |
| 23164 |
} |
| 23165 |
const firstChar = file.getUint16(); |
| 23166 |
const lastChar = file.getUint16(); |
| 23167 |
if (firstChar > lastChar) { |
| 23168 |
return false; |
| 23169 |
} |
| 23170 |
file.skip(6); |
| 23171 |
const usWinAscent = file.getUint16(); |
| 23172 |
if (usWinAscent === 0) { |
| 23173 |
return false; |
| 23174 |
} |
| 23175 |
os2.data[8] = os2.data[9] = 0; |
| 23176 |
return true; |
| 23177 |
} |
| 23178 |
function createOS2Table(properties, charstrings, override) { |
| 23179 |
override ||= { |
| 23180 |
unitsPerEm: 0, |
| 23181 |
yMax: 0, |
| 23182 |
yMin: 0, |
| 23183 |
ascent: 0, |
| 23184 |
descent: 0 |
| 23185 |
}; |
| 23186 |
let ulUnicodeRange1 = 0; |
| 23187 |
let ulUnicodeRange2 = 0; |
| 23188 |
let ulUnicodeRange3 = 0; |
| 23189 |
let ulUnicodeRange4 = 0; |
| 23190 |
let firstCharIndex = null; |
| 23191 |
let lastCharIndex = 0; |
| 23192 |
let position = -1; |
| 23193 |
if (charstrings) { |
| 23194 |
for (let code in charstrings) { |
| 23195 |
code |= 0; |
| 23196 |
if (firstCharIndex > code || !firstCharIndex) { |
| 23197 |
firstCharIndex = code; |
| 23198 |
} |
| 23199 |
if (lastCharIndex < code) { |
| 23200 |
lastCharIndex = code; |
| 23201 |
} |
| 23202 |
position = getUnicodeRangeFor(code, position); |
| 23203 |
if (position < 32) { |
| 23204 |
ulUnicodeRange1 |= 1 << position; |
| 23205 |
} else if (position < 64) { |
| 23206 |
ulUnicodeRange2 |= 1 << position - 32; |
| 23207 |
} else if (position < 96) { |
| 23208 |
ulUnicodeRange3 |= 1 << position - 64; |
| 23209 |
} else if (position < 123) { |
| 23210 |
ulUnicodeRange4 |= 1 << position - 96; |
| 23211 |
} else { |
| 23212 |
throw new FormatError("Unicode ranges Bits > 123 are reserved for internal usage"); |
| 23213 |
} |
| 23214 |
} |
| 23215 |
if (lastCharIndex > 0xffff) { |
| 23216 |
lastCharIndex = 0xffff; |
| 23217 |
} |
| 23218 |
} else { |
| 23219 |
firstCharIndex = 0; |
| 23220 |
lastCharIndex = 255; |
| 23221 |
} |
| 23222 |
const bbox = properties.bbox || [0, 0, 0, 0]; |
| 23223 |
const unitsPerEm = override.unitsPerEm || (properties.fontMatrix ? 1 / Math.max(...properties.fontMatrix.slice(0, 4).map(Math.abs)) : 1000); |
| 23224 |
const scale = properties.ascentScaled ? 1.0 : unitsPerEm / PDF_GLYPH_SPACE_UNITS; |
| 23225 |
const typoAscent = override.ascent || Math.round(scale * (properties.ascent || bbox[3])); |
| 23226 |
let typoDescent = override.descent || Math.round(scale * (properties.descent || bbox[1])); |
| 23227 |
if (typoDescent > 0 && properties.descent > 0 && bbox[1] < 0) { |
| 23228 |
typoDescent = -typoDescent; |
| 23229 |
} |
| 23230 |
const winAscent = override.yMax || typoAscent; |
| 23231 |
const winDescent = -override.yMin || -typoDescent; |
| 23232 |
return "\x00\x03" + "\x02\x24" + "\x01\xF4" + "\x00\x05" + "\x00\x00" + "\x02\x8A" + "\x02\xBB" + "\x00\x00" + "\x00\x8C" + "\x02\x8A" + "\x02\xBB" + "\x00\x00" + "\x01\xDF" + "\x00\x31" + "\x01\x02" + "\x00\x00" + "\x00\x00\x06" + String.fromCharCode(properties.fixedPitch ? 0x09 : 0x00) + "\x00\x00\x00\x00\x00\x00" + string32(ulUnicodeRange1) + string32(ulUnicodeRange2) + string32(ulUnicodeRange3) + string32(ulUnicodeRange4) + "\x2A\x32\x31\x2A" + string16(properties.italicAngle ? 1 : 0) + string16(firstCharIndex || properties.firstChar) + string16(lastCharIndex || properties.lastChar) + string16(typoAscent) + string16(typoDescent) + "\x00\x64" + string16(winAscent) + string16(winDescent) + "\x00\x00\x00\x00" + "\x00\x00\x00\x00" + string16(properties.xHeight) + string16(properties.capHeight) + string16(0) + string16(firstCharIndex || properties.firstChar) + "\x00\x03"; |
| 23233 |
} |
| 23234 |
function createPostTable(properties) { |
| 23235 |
const angle = Math.floor(properties.italicAngle * 2 ** 16); |
| 23236 |
return "\x00\x03\x00\x00" + string32(angle) + "\x00\x00" + "\x00\x00" + string32(properties.fixedPitch ? 1 : 0) + "\x00\x00\x00\x00" + "\x00\x00\x00\x00" + "\x00\x00\x00\x00" + "\x00\x00\x00\x00"; |
| 23237 |
} |
| 23238 |
function createPostscriptName(name) { |
| 23239 |
return name.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g, "").slice(0, 63); |
| 23240 |
} |
| 23241 |
function createNameTable(name, proto) { |
| 23242 |
if (!proto) { |
| 23243 |
proto = [[], []]; |
| 23244 |
} |
| 23245 |
const strings = [proto[0][0] || "Original licence", proto[0][1] || name, proto[0][2] || "Unknown", proto[0][3] || "uniqueID", proto[0][4] || name, proto[0][5] || "Version 0.11", proto[0][6] || createPostscriptName(name), proto[0][7] || "Unknown", proto[0][8] || "Unknown", proto[0][9] || "Unknown"]; |
| 23246 |
const stringsUnicode = []; |
| 23247 |
let i, ii, j, jj, str; |
| 23248 |
for (i = 0, ii = strings.length; i < ii; i++) { |
| 23249 |
str = proto[1][i] || strings[i]; |
| 23250 |
const strBufUnicode = []; |
| 23251 |
for (j = 0, jj = str.length; j < jj; j++) { |
| 23252 |
strBufUnicode.push(string16(str.charCodeAt(j))); |
| 23253 |
} |
| 23254 |
stringsUnicode.push(strBufUnicode.join("")); |
| 23255 |
} |
| 23256 |
const names = [strings, stringsUnicode]; |
| 23257 |
const platforms = ["\x00\x01", "\x00\x03"]; |
| 23258 |
const encodings = ["\x00\x00", "\x00\x01"]; |
| 23259 |
const languages = ["\x00\x00", "\x04\x09"]; |
| 23260 |
const namesRecordCount = strings.length * platforms.length; |
| 23261 |
let nameTable = "\x00\x00" + string16(namesRecordCount) + string16(namesRecordCount * 12 + 6); |
| 23262 |
let strOffset = 0; |
| 23263 |
for (i = 0, ii = platforms.length; i < ii; i++) { |
| 23264 |
const strs = names[i]; |
| 23265 |
for (j = 0, jj = strs.length; j < jj; j++) { |
| 23266 |
str = strs[j]; |
| 23267 |
const nameRecord = platforms[i] + encodings[i] + languages[i] + string16(j) + string16(str.length) + string16(strOffset); |
| 23268 |
nameTable += nameRecord; |
| 23269 |
strOffset += str.length; |
| 23270 |
} |
| 23271 |
} |
| 23272 |
nameTable += strings.join("") + stringsUnicode.join(""); |
| 23273 |
return nameTable; |
| 23274 |
} |
| 23275 |
class Font { |
| 23276 |
constructor(name, file, properties) { |
| 23277 |
this.name = name; |
| 23278 |
this.psName = null; |
| 23279 |
this.mimetype = null; |
| 23280 |
this.disableFontFace = false; |
| 23281 |
this.loadedName = properties.loadedName; |
| 23282 |
this.isType3Font = properties.isType3Font; |
| 23283 |
this.missingFile = false; |
| 23284 |
this.cssFontInfo = properties.cssFontInfo; |
| 23285 |
this._charsCache = Object.create(null); |
| 23286 |
this._glyphCache = Object.create(null); |
| 23287 |
let isSerifFont = !!(properties.flags & FontFlags.Serif); |
| 23288 |
if (!isSerifFont && !properties.isSimulatedFlags) { |
| 23289 |
const baseName = name.replaceAll(/[,_]/g, "-").split("-", 1)[0], |
| 23290 |
serifFonts = getSerifFonts(); |
| 23291 |
for (const namePart of baseName.split("+")) { |
| 23292 |
if (serifFonts[namePart]) { |
| 23293 |
isSerifFont = true; |
| 23294 |
break; |
| 23295 |
} |
| 23296 |
} |
| 23297 |
} |
| 23298 |
this.isSerifFont = isSerifFont; |
| 23299 |
this.isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); |
| 23300 |
this.isMonospace = !!(properties.flags & FontFlags.FixedPitch); |
| 23301 |
let { |
| 23302 |
type, |
| 23303 |
subtype |
| 23304 |
} = properties; |
| 23305 |
this.type = type; |
| 23306 |
this.subtype = subtype; |
| 23307 |
this.systemFontInfo = properties.systemFontInfo; |
| 23308 |
const matches = name.match(/^InvalidPDFjsFont_(.*)_\d+$/); |
| 23309 |
this.isInvalidPDFjsFont = !!matches; |
| 23310 |
if (this.isInvalidPDFjsFont) { |
| 23311 |
this.fallbackName = matches[1]; |
| 23312 |
} else if (this.isMonospace) { |
| 23313 |
this.fallbackName = "monospace"; |
| 23314 |
} else if (this.isSerifFont) { |
| 23315 |
this.fallbackName = "serif"; |
| 23316 |
} else { |
| 23317 |
this.fallbackName = "sans-serif"; |
| 23318 |
} |
| 23319 |
if (this.systemFontInfo?.guessFallback) { |
| 23320 |
this.systemFontInfo.guessFallback = false; |
| 23321 |
this.systemFontInfo.css += `,${this.fallbackName}`; |
| 23322 |
} |
| 23323 |
this.differences = properties.differences; |
| 23324 |
this.widths = properties.widths; |
| 23325 |
this.defaultWidth = properties.defaultWidth; |
| 23326 |
this.composite = properties.composite; |
| 23327 |
this.cMap = properties.cMap; |
| 23328 |
this.capHeight = properties.capHeight / PDF_GLYPH_SPACE_UNITS; |
| 23329 |
this.ascent = properties.ascent / PDF_GLYPH_SPACE_UNITS; |
| 23330 |
this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS; |
| 23331 |
this.lineHeight = this.ascent - this.descent; |
| 23332 |
this.fontMatrix = properties.fontMatrix; |
| 23333 |
this.bbox = properties.bbox; |
| 23334 |
this.defaultEncoding = properties.defaultEncoding; |
| 23335 |
this.toUnicode = properties.toUnicode; |
| 23336 |
this.toFontChar = []; |
| 23337 |
if (properties.type === "Type3") { |
| 23338 |
for (let charCode = 0; charCode < 256; charCode++) { |
| 23339 |
this.toFontChar[charCode] = this.differences[charCode] || properties.defaultEncoding[charCode]; |
| 23340 |
} |
| 23341 |
return; |
| 23342 |
} |
| 23343 |
this.cidEncoding = properties.cidEncoding || ""; |
| 23344 |
this.vertical = !!properties.vertical; |
| 23345 |
if (this.vertical) { |
| 23346 |
this.vmetrics = properties.vmetrics; |
| 23347 |
this.defaultVMetrics = properties.defaultVMetrics; |
| 23348 |
} |
| 23349 |
if (!file || file.isEmpty) { |
| 23350 |
if (file) { |
| 23351 |
warn('Font file is empty in "' + name + '" (' + this.loadedName + ")"); |
| 23352 |
} |
| 23353 |
this.fallbackToSystemFont(properties); |
| 23354 |
return; |
| 23355 |
} |
| 23356 |
[type, subtype] = getFontFileType(file, properties); |
| 23357 |
if (type !== this.type || subtype !== this.subtype) { |
| 23358 |
info("Inconsistent font file Type/SubType, expected: " + `${this.type}/${this.subtype} but found: ${type}/${subtype}.`); |
| 23359 |
} |
| 23360 |
let data; |
| 23361 |
try { |
| 23362 |
switch (type) { |
| 23363 |
case "MMType1": |
| 23364 |
info("MMType1 font (" + name + "), falling back to Type1."); |
| 23365 |
case "Type1": |
| 23366 |
case "CIDFontType0": |
| 23367 |
this.mimetype = "font/opentype"; |
| 23368 |
const cff = subtype === "Type1C" || subtype === "CIDFontType0C" ? new CFFFont(file, properties) : new Type1Font(name, file, properties); |
| 23369 |
adjustWidths(properties); |
| 23370 |
data = this.convert(name, cff, properties); |
| 23371 |
break; |
| 23372 |
case "OpenType": |
| 23373 |
case "TrueType": |
| 23374 |
case "CIDFontType2": |
| 23375 |
this.mimetype = "font/opentype"; |
| 23376 |
data = this.checkAndRepair(name, file, properties); |
| 23377 |
if (this.isOpenType) { |
| 23378 |
adjustWidths(properties); |
| 23379 |
type = "OpenType"; |
| 23380 |
} |
| 23381 |
break; |
| 23382 |
default: |
| 23383 |
throw new FormatError(`Font ${type} is not supported`); |
| 23384 |
} |
| 23385 |
} catch (e) { |
| 23386 |
warn(e); |
| 23387 |
this.fallbackToSystemFont(properties); |
| 23388 |
return; |
| 23389 |
} |
| 23390 |
amendFallbackToUnicode(properties); |
| 23391 |
this.data = data; |
| 23392 |
this.type = type; |
| 23393 |
this.subtype = subtype; |
| 23394 |
this.fontMatrix = properties.fontMatrix; |
| 23395 |
this.widths = properties.widths; |
| 23396 |
this.defaultWidth = properties.defaultWidth; |
| 23397 |
this.toUnicode = properties.toUnicode; |
| 23398 |
this.seacMap = properties.seacMap; |
| 23399 |
} |
| 23400 |
get renderer() { |
| 23401 |
const renderer = FontRendererFactory.create(this, SEAC_ANALYSIS_ENABLED); |
| 23402 |
return shadow(this, "renderer", renderer); |
| 23403 |
} |
| 23404 |
exportData(extraProperties = false) { |
| 23405 |
const exportDataProperties = extraProperties ? [...EXPORT_DATA_PROPERTIES, ...EXPORT_DATA_EXTRA_PROPERTIES] : EXPORT_DATA_PROPERTIES; |
| 23406 |
const data = Object.create(null); |
| 23407 |
let property, value; |
| 23408 |
for (property of exportDataProperties) { |
| 23409 |
value = this[property]; |
| 23410 |
if (value !== undefined) { |
| 23411 |
data[property] = value; |
| 23412 |
} |
| 23413 |
} |
| 23414 |
return data; |
| 23415 |
} |
| 23416 |
fallbackToSystemFont(properties) { |
| 23417 |
this.missingFile = true; |
| 23418 |
const { |
| 23419 |
name, |
| 23420 |
type |
| 23421 |
} = this; |
| 23422 |
let fontName = normalizeFontName(name); |
| 23423 |
const stdFontMap = getStdFontMap(), |
| 23424 |
nonStdFontMap = getNonStdFontMap(); |
| 23425 |
const isStandardFont = !!stdFontMap[fontName]; |
| 23426 |
const isMappedToStandardFont = !!(nonStdFontMap[fontName] && stdFontMap[nonStdFontMap[fontName]]); |
| 23427 |
fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName; |
| 23428 |
const fontBasicMetricsMap = getFontBasicMetrics(); |
| 23429 |
const metrics = fontBasicMetricsMap[fontName]; |
| 23430 |
if (metrics) { |
| 23431 |
if (isNaN(this.ascent)) { |
| 23432 |
this.ascent = metrics.ascent / PDF_GLYPH_SPACE_UNITS; |
| 23433 |
} |
| 23434 |
if (isNaN(this.descent)) { |
| 23435 |
this.descent = metrics.descent / PDF_GLYPH_SPACE_UNITS; |
| 23436 |
} |
| 23437 |
if (isNaN(this.capHeight)) { |
| 23438 |
this.capHeight = metrics.capHeight / PDF_GLYPH_SPACE_UNITS; |
| 23439 |
} |
| 23440 |
} |
| 23441 |
this.bold = /bold/gi.test(fontName); |
| 23442 |
this.italic = /oblique|italic/gi.test(fontName); |
| 23443 |
this.black = /Black/g.test(name); |
| 23444 |
const isNarrow = /Narrow/g.test(name); |
| 23445 |
this.remeasure = (!isStandardFont || isNarrow) && Object.keys(this.widths).length > 0; |
| 23446 |
if ((isStandardFont || isMappedToStandardFont) && type === "CIDFontType2" && this.cidEncoding.startsWith("Identity-")) { |
| 23447 |
const cidToGidMap = properties.cidToGidMap; |
| 23448 |
const map = []; |
| 23449 |
applyStandardFontGlyphMap(map, getGlyphMapForStandardFonts()); |
| 23450 |
if (/Arial-?Black/i.test(name)) { |
| 23451 |
applyStandardFontGlyphMap(map, getSupplementalGlyphMapForArialBlack()); |
| 23452 |
} else if (/Calibri/i.test(name)) { |
| 23453 |
applyStandardFontGlyphMap(map, getSupplementalGlyphMapForCalibri()); |
| 23454 |
} |
| 23455 |
if (cidToGidMap) { |
| 23456 |
for (const charCode in map) { |
| 23457 |
const cid = map[charCode]; |
| 23458 |
if (cidToGidMap[cid] !== undefined) { |
| 23459 |
map[+charCode] = cidToGidMap[cid]; |
| 23460 |
} |
| 23461 |
} |
| 23462 |
if (cidToGidMap.length !== this.toUnicode.length && properties.hasIncludedToUnicodeMap && this.toUnicode instanceof IdentityToUnicodeMap) { |
| 23463 |
this.toUnicode.forEach(function (charCode, unicodeCharCode) { |
| 23464 |
const cid = map[charCode]; |
| 23465 |
if (cidToGidMap[cid] === undefined) { |
| 23466 |
map[+charCode] = unicodeCharCode; |
| 23467 |
} |
| 23468 |
}); |
| 23469 |
} |
| 23470 |
} |
| 23471 |
if (!(this.toUnicode instanceof IdentityToUnicodeMap)) { |
| 23472 |
this.toUnicode.forEach(function (charCode, unicodeCharCode) { |
| 23473 |
map[+charCode] = unicodeCharCode; |
| 23474 |
}); |
| 23475 |
} |
| 23476 |
this.toFontChar = map; |
| 23477 |
this.toUnicode = new ToUnicodeMap(map); |
| 23478 |
} else if (/Symbol/i.test(fontName)) { |
| 23479 |
this.toFontChar = buildToFontChar(SymbolSetEncoding, getGlyphsUnicode(), this.differences); |
| 23480 |
} else if (/Dingbats/i.test(fontName)) { |
| 23481 |
this.toFontChar = buildToFontChar(ZapfDingbatsEncoding, getDingbatsGlyphsUnicode(), this.differences); |
| 23482 |
} else if (isStandardFont || isMappedToStandardFont) { |
| 23483 |
const map = buildToFontChar(this.defaultEncoding, getGlyphsUnicode(), this.differences); |
| 23484 |
if (type === "CIDFontType2" && !this.cidEncoding.startsWith("Identity-") && !(this.toUnicode instanceof IdentityToUnicodeMap)) { |
| 23485 |
this.toUnicode.forEach(function (charCode, unicodeCharCode) { |
| 23486 |
map[+charCode] = unicodeCharCode; |
| 23487 |
}); |
| 23488 |
} |
| 23489 |
this.toFontChar = map; |
| 23490 |
} else { |
| 23491 |
const glyphsUnicodeMap = getGlyphsUnicode(); |
| 23492 |
const map = []; |
| 23493 |
this.toUnicode.forEach((charCode, unicodeCharCode) => { |
| 23494 |
if (!this.composite) { |
| 23495 |
const glyphName = this.differences[charCode] || this.defaultEncoding[charCode]; |
| 23496 |
const unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); |
| 23497 |
if (unicode !== -1) { |
| 23498 |
unicodeCharCode = unicode; |
| 23499 |
} |
| 23500 |
} |
| 23501 |
map[+charCode] = unicodeCharCode; |
| 23502 |
}); |
| 23503 |
if (this.composite && this.toUnicode instanceof IdentityToUnicodeMap) { |
| 23504 |
if (/Tahoma|Verdana/i.test(name)) { |
| 23505 |
applyStandardFontGlyphMap(map, getGlyphMapForStandardFonts()); |
| 23506 |
} |
| 23507 |
} |
| 23508 |
this.toFontChar = map; |
| 23509 |
} |
| 23510 |
amendFallbackToUnicode(properties); |
| 23511 |
this.loadedName = fontName.split("-", 1)[0]; |
| 23512 |
} |
| 23513 |
checkAndRepair(name, font, properties) { |
| 23514 |
const VALID_TABLES = ["OS/2", "cmap", "head", "hhea", "hmtx", "maxp", "name", "post", "loca", "glyf", "fpgm", "prep", "cvt ", "CFF "]; |
| 23515 |
function readTables(file, numTables) { |
| 23516 |
const tables = Object.create(null); |
| 23517 |
tables["OS/2"] = null; |
| 23518 |
tables.cmap = null; |
| 23519 |
tables.head = null; |
| 23520 |
tables.hhea = null; |
| 23521 |
tables.hmtx = null; |
| 23522 |
tables.maxp = null; |
| 23523 |
tables.name = null; |
| 23524 |
tables.post = null; |
| 23525 |
for (let i = 0; i < numTables; i++) { |
| 23526 |
const table = readTableEntry(file); |
| 23527 |
if (!VALID_TABLES.includes(table.tag)) { |
| 23528 |
continue; |
| 23529 |
} |
| 23530 |
if (table.length === 0) { |
| 23531 |
continue; |
| 23532 |
} |
| 23533 |
tables[table.tag] = table; |
| 23534 |
} |
| 23535 |
return tables; |
| 23536 |
} |
| 23537 |
function readTableEntry(file) { |
| 23538 |
const tag = file.getString(4); |
| 23539 |
const checksum = file.getInt32() >>> 0; |
| 23540 |
const offset = file.getInt32() >>> 0; |
| 23541 |
const length = file.getInt32() >>> 0; |
| 23542 |
const previousPosition = file.pos; |
| 23543 |
file.pos = file.start || 0; |
| 23544 |
file.skip(offset); |
| 23545 |
const data = file.getBytes(length); |
| 23546 |
file.pos = previousPosition; |
| 23547 |
if (tag === "head") { |
| 23548 |
data[8] = data[9] = data[10] = data[11] = 0; |
| 23549 |
data[17] |= 0x20; |
| 23550 |
} |
| 23551 |
return { |
| 23552 |
tag, |
| 23553 |
checksum, |
| 23554 |
length, |
| 23555 |
offset, |
| 23556 |
data |
| 23557 |
}; |
| 23558 |
} |
| 23559 |
function readOpenTypeHeader(ttf) { |
| 23560 |
return { |
| 23561 |
version: ttf.getString(4), |
| 23562 |
numTables: ttf.getUint16(), |
| 23563 |
searchRange: ttf.getUint16(), |
| 23564 |
entrySelector: ttf.getUint16(), |
| 23565 |
rangeShift: ttf.getUint16() |
| 23566 |
}; |
| 23567 |
} |
| 23568 |
function readTrueTypeCollectionHeader(ttc) { |
| 23569 |
const ttcTag = ttc.getString(4); |
| 23570 |
assert(ttcTag === "ttcf", "Must be a TrueType Collection font."); |
| 23571 |
const majorVersion = ttc.getUint16(); |
| 23572 |
const minorVersion = ttc.getUint16(); |
| 23573 |
const numFonts = ttc.getInt32() >>> 0; |
| 23574 |
const offsetTable = []; |
| 23575 |
for (let i = 0; i < numFonts; i++) { |
| 23576 |
offsetTable.push(ttc.getInt32() >>> 0); |
| 23577 |
} |
| 23578 |
const header = { |
| 23579 |
ttcTag, |
| 23580 |
majorVersion, |
| 23581 |
minorVersion, |
| 23582 |
numFonts, |
| 23583 |
offsetTable |
| 23584 |
}; |
| 23585 |
switch (majorVersion) { |
| 23586 |
case 1: |
| 23587 |
return header; |
| 23588 |
case 2: |
| 23589 |
header.dsigTag = ttc.getInt32() >>> 0; |
| 23590 |
header.dsigLength = ttc.getInt32() >>> 0; |
| 23591 |
header.dsigOffset = ttc.getInt32() >>> 0; |
| 23592 |
return header; |
| 23593 |
} |
| 23594 |
throw new FormatError(`Invalid TrueType Collection majorVersion: ${majorVersion}.`); |
| 23595 |
} |
| 23596 |
function readTrueTypeCollectionData(ttc, fontName) { |
| 23597 |
const { |
| 23598 |
numFonts, |
| 23599 |
offsetTable |
| 23600 |
} = readTrueTypeCollectionHeader(ttc); |
| 23601 |
const fontNameParts = fontName.split("+"); |
| 23602 |
let fallbackData; |
| 23603 |
for (let i = 0; i < numFonts; i++) { |
| 23604 |
ttc.pos = (ttc.start || 0) + offsetTable[i]; |
| 23605 |
const potentialHeader = readOpenTypeHeader(ttc); |
| 23606 |
const potentialTables = readTables(ttc, potentialHeader.numTables); |
| 23607 |
if (!potentialTables.name) { |
| 23608 |
throw new FormatError('TrueType Collection font must contain a "name" table.'); |
| 23609 |
} |
| 23610 |
const [nameTable] = readNameTable(potentialTables.name); |
| 23611 |
for (let j = 0, jj = nameTable.length; j < jj; j++) { |
| 23612 |
for (let k = 0, kk = nameTable[j].length; k < kk; k++) { |
| 23613 |
const nameEntry = nameTable[j][k]?.replaceAll(/\s/g, ""); |
| 23614 |
if (!nameEntry) { |
| 23615 |
continue; |
| 23616 |
} |
| 23617 |
if (nameEntry === fontName) { |
| 23618 |
return { |
| 23619 |
header: potentialHeader, |
| 23620 |
tables: potentialTables |
| 23621 |
}; |
| 23622 |
} |
| 23623 |
if (fontNameParts.length < 2) { |
| 23624 |
continue; |
| 23625 |
} |
| 23626 |
for (const part of fontNameParts) { |
| 23627 |
if (nameEntry === part) { |
| 23628 |
fallbackData = { |
| 23629 |
name: part, |
| 23630 |
header: potentialHeader, |
| 23631 |
tables: potentialTables |
| 23632 |
}; |
| 23633 |
} |
| 23634 |
} |
| 23635 |
} |
| 23636 |
} |
| 23637 |
} |
| 23638 |
if (fallbackData) { |
| 23639 |
warn(`TrueType Collection does not contain "${fontName}" font, ` + `falling back to "${fallbackData.name}" font instead.`); |
| 23640 |
return { |
| 23641 |
header: fallbackData.header, |
| 23642 |
tables: fallbackData.tables |
| 23643 |
}; |
| 23644 |
} |
| 23645 |
throw new FormatError(`TrueType Collection does not contain "${fontName}" font.`); |
| 23646 |
} |
| 23647 |
function readCmapTable(cmap, file, isSymbolicFont, hasEncoding) { |
| 23648 |
if (!cmap) { |
| 23649 |
warn("No cmap table available."); |
| 23650 |
return { |
| 23651 |
platformId: -1, |
| 23652 |
encodingId: -1, |
| 23653 |
mappings: [], |
| 23654 |
hasShortCmap: false |
| 23655 |
}; |
| 23656 |
} |
| 23657 |
let segment; |
| 23658 |
let start = (file.start || 0) + cmap.offset; |
| 23659 |
file.pos = start; |
| 23660 |
file.skip(2); |
| 23661 |
const numTables = file.getUint16(); |
| 23662 |
let potentialTable; |
| 23663 |
let canBreak = false; |
| 23664 |
for (let i = 0; i < numTables; i++) { |
| 23665 |
const platformId = file.getUint16(); |
| 23666 |
const encodingId = file.getUint16(); |
| 23667 |
const offset = file.getInt32() >>> 0; |
| 23668 |
let useTable = false; |
| 23669 |
if (potentialTable?.platformId === platformId && potentialTable?.encodingId === encodingId) { |
| 23670 |
continue; |
| 23671 |
} |
| 23672 |
if (platformId === 0 && (encodingId === 0 || encodingId === 1 || encodingId === 3)) { |
| 23673 |
useTable = true; |
| 23674 |
} else if (platformId === 1 && encodingId === 0) { |
| 23675 |
useTable = true; |
| 23676 |
} else if (platformId === 3 && encodingId === 1 && (hasEncoding || !potentialTable)) { |
| 23677 |
useTable = true; |
| 23678 |
if (!isSymbolicFont) { |
| 23679 |
canBreak = true; |
| 23680 |
} |
| 23681 |
} else if (isSymbolicFont && platformId === 3 && encodingId === 0) { |
| 23682 |
useTable = true; |
| 23683 |
let correctlySorted = true; |
| 23684 |
if (i < numTables - 1) { |
| 23685 |
const nextBytes = file.peekBytes(2), |
| 23686 |
nextPlatformId = int16(nextBytes[0], nextBytes[1]); |
| 23687 |
if (nextPlatformId < platformId) { |
| 23688 |
correctlySorted = false; |
| 23689 |
} |
| 23690 |
} |
| 23691 |
if (correctlySorted) { |
| 23692 |
canBreak = true; |
| 23693 |
} |
| 23694 |
} |
| 23695 |
if (useTable) { |
| 23696 |
potentialTable = { |
| 23697 |
platformId, |
| 23698 |
encodingId, |
| 23699 |
offset |
| 23700 |
}; |
| 23701 |
} |
| 23702 |
if (canBreak) { |
| 23703 |
break; |
| 23704 |
} |
| 23705 |
} |
| 23706 |
if (potentialTable) { |
| 23707 |
file.pos = start + potentialTable.offset; |
| 23708 |
} |
| 23709 |
if (!potentialTable || file.peekByte() === -1) { |
| 23710 |
warn("Could not find a preferred cmap table."); |
| 23711 |
return { |
| 23712 |
platformId: -1, |
| 23713 |
encodingId: -1, |
| 23714 |
mappings: [], |
| 23715 |
hasShortCmap: false |
| 23716 |
}; |
| 23717 |
} |
| 23718 |
const format = file.getUint16(); |
| 23719 |
let hasShortCmap = false; |
| 23720 |
const mappings = []; |
| 23721 |
let j, glyphId; |
| 23722 |
if (format === 0) { |
| 23723 |
file.skip(2 + 2); |
| 23724 |
for (j = 0; j < 256; j++) { |
| 23725 |
const index = file.getByte(); |
| 23726 |
if (!index) { |
| 23727 |
continue; |
| 23728 |
} |
| 23729 |
mappings.push({ |
| 23730 |
charCode: j, |
| 23731 |
glyphId: index |
| 23732 |
}); |
| 23733 |
} |
| 23734 |
hasShortCmap = true; |
| 23735 |
} else if (format === 2) { |
| 23736 |
file.skip(2 + 2); |
| 23737 |
const subHeaderKeys = []; |
| 23738 |
let maxSubHeaderKey = 0; |
| 23739 |
for (let i = 0; i < 256; i++) { |
| 23740 |
const subHeaderKey = file.getUint16() >> 3; |
| 23741 |
subHeaderKeys.push(subHeaderKey); |
| 23742 |
maxSubHeaderKey = Math.max(subHeaderKey, maxSubHeaderKey); |
| 23743 |
} |
| 23744 |
const subHeaders = []; |
| 23745 |
for (let i = 0; i <= maxSubHeaderKey; i++) { |
| 23746 |
subHeaders.push({ |
| 23747 |
firstCode: file.getUint16(), |
| 23748 |
entryCount: file.getUint16(), |
| 23749 |
idDelta: signedInt16(file.getByte(), file.getByte()), |
| 23750 |
idRangePos: file.pos + file.getUint16() |
| 23751 |
}); |
| 23752 |
} |
| 23753 |
for (let i = 0; i < 256; i++) { |
| 23754 |
if (subHeaderKeys[i] === 0) { |
| 23755 |
file.pos = subHeaders[0].idRangePos + 2 * i; |
| 23756 |
glyphId = file.getUint16(); |
| 23757 |
mappings.push({ |
| 23758 |
charCode: i, |
| 23759 |
glyphId |
| 23760 |
}); |
| 23761 |
} else { |
| 23762 |
const s = subHeaders[subHeaderKeys[i]]; |
| 23763 |
for (j = 0; j < s.entryCount; j++) { |
| 23764 |
const charCode = (i << 8) + j + s.firstCode; |
| 23765 |
file.pos = s.idRangePos + 2 * j; |
| 23766 |
glyphId = file.getUint16(); |
| 23767 |
if (glyphId !== 0) { |
| 23768 |
glyphId = (glyphId + s.idDelta) % 65536; |
| 23769 |
} |
| 23770 |
mappings.push({ |
| 23771 |
charCode, |
| 23772 |
glyphId |
| 23773 |
}); |
| 23774 |
} |
| 23775 |
} |
| 23776 |
} |
| 23777 |
} else if (format === 4) { |
| 23778 |
file.skip(2 + 2); |
| 23779 |
const segCount = file.getUint16() >> 1; |
| 23780 |
file.skip(6); |
| 23781 |
const segments = []; |
| 23782 |
let segIndex; |
| 23783 |
for (segIndex = 0; segIndex < segCount; segIndex++) { |
| 23784 |
segments.push({ |
| 23785 |
end: file.getUint16() |
| 23786 |
}); |
| 23787 |
} |
| 23788 |
file.skip(2); |
| 23789 |
for (segIndex = 0; segIndex < segCount; segIndex++) { |
| 23790 |
segments[segIndex].start = file.getUint16(); |
| 23791 |
} |
| 23792 |
for (segIndex = 0; segIndex < segCount; segIndex++) { |
| 23793 |
segments[segIndex].delta = file.getUint16(); |
| 23794 |
} |
| 23795 |
let offsetsCount = 0, |
| 23796 |
offsetIndex; |
| 23797 |
for (segIndex = 0; segIndex < segCount; segIndex++) { |
| 23798 |
segment = segments[segIndex]; |
| 23799 |
const rangeOffset = file.getUint16(); |
| 23800 |
if (!rangeOffset) { |
| 23801 |
segment.offsetIndex = -1; |
| 23802 |
continue; |
| 23803 |
} |
| 23804 |
offsetIndex = (rangeOffset >> 1) - (segCount - segIndex); |
| 23805 |
segment.offsetIndex = offsetIndex; |
| 23806 |
offsetsCount = Math.max(offsetsCount, offsetIndex + segment.end - segment.start + 1); |
| 23807 |
} |
| 23808 |
const offsets = []; |
| 23809 |
for (j = 0; j < offsetsCount; j++) { |
| 23810 |
offsets.push(file.getUint16()); |
| 23811 |
} |
| 23812 |
for (segIndex = 0; segIndex < segCount; segIndex++) { |
| 23813 |
segment = segments[segIndex]; |
| 23814 |
start = segment.start; |
| 23815 |
const end = segment.end; |
| 23816 |
const delta = segment.delta; |
| 23817 |
offsetIndex = segment.offsetIndex; |
| 23818 |
for (j = start; j <= end; j++) { |
| 23819 |
if (j === 0xffff) { |
| 23820 |
continue; |
| 23821 |
} |
| 23822 |
glyphId = offsetIndex < 0 ? j : offsets[offsetIndex + j - start]; |
| 23823 |
glyphId = glyphId + delta & 0xffff; |
| 23824 |
mappings.push({ |
| 23825 |
charCode: j, |
| 23826 |
glyphId |
| 23827 |
}); |
| 23828 |
} |
| 23829 |
} |
| 23830 |
} else if (format === 6) { |
| 23831 |
file.skip(2 + 2); |
| 23832 |
const firstCode = file.getUint16(); |
| 23833 |
const entryCount = file.getUint16(); |
| 23834 |
for (j = 0; j < entryCount; j++) { |
| 23835 |
glyphId = file.getUint16(); |
| 23836 |
const charCode = firstCode + j; |
| 23837 |
mappings.push({ |
| 23838 |
charCode, |
| 23839 |
glyphId |
| 23840 |
}); |
| 23841 |
} |
| 23842 |
} else if (format === 12) { |
| 23843 |
file.skip(2 + 4 + 4); |
| 23844 |
const nGroups = file.getInt32() >>> 0; |
| 23845 |
for (j = 0; j < nGroups; j++) { |
| 23846 |
const startCharCode = file.getInt32() >>> 0; |
| 23847 |
const endCharCode = file.getInt32() >>> 0; |
| 23848 |
let glyphCode = file.getInt32() >>> 0; |
| 23849 |
for (let charCode = startCharCode; charCode <= endCharCode; charCode++) { |
| 23850 |
mappings.push({ |
| 23851 |
charCode, |
| 23852 |
glyphId: glyphCode++ |
| 23853 |
}); |
| 23854 |
} |
| 23855 |
} |
| 23856 |
} else { |
| 23857 |
warn("cmap table has unsupported format: " + format); |
| 23858 |
return { |
| 23859 |
platformId: -1, |
| 23860 |
encodingId: -1, |
| 23861 |
mappings: [], |
| 23862 |
hasShortCmap: false |
| 23863 |
}; |
| 23864 |
} |
| 23865 |
mappings.sort(function (a, b) { |
| 23866 |
return a.charCode - b.charCode; |
| 23867 |
}); |
| 23868 |
for (let i = 1; i < mappings.length; i++) { |
| 23869 |
if (mappings[i - 1].charCode === mappings[i].charCode) { |
| 23870 |
mappings.splice(i, 1); |
| 23871 |
i--; |
| 23872 |
} |
| 23873 |
} |
| 23874 |
return { |
| 23875 |
platformId: potentialTable.platformId, |
| 23876 |
encodingId: potentialTable.encodingId, |
| 23877 |
mappings, |
| 23878 |
hasShortCmap |
| 23879 |
}; |
| 23880 |
} |
| 23881 |
function sanitizeMetrics(file, header, metrics, headTable, numGlyphs, dupFirstEntry) { |
| 23882 |
if (!header) { |
| 23883 |
if (metrics) { |
| 23884 |
metrics.data = null; |
| 23885 |
} |
| 23886 |
return; |
| 23887 |
} |
| 23888 |
file.pos = (file.start || 0) + header.offset; |
| 23889 |
file.pos += 4; |
| 23890 |
file.pos += 2; |
| 23891 |
file.pos += 2; |
| 23892 |
file.pos += 2; |
| 23893 |
file.pos += 2; |
| 23894 |
file.pos += 2; |
| 23895 |
file.pos += 2; |
| 23896 |
file.pos += 2; |
| 23897 |
file.pos += 2; |
| 23898 |
file.pos += 2; |
| 23899 |
const caretOffset = file.getUint16(); |
| 23900 |
file.pos += 8; |
| 23901 |
file.pos += 2; |
| 23902 |
let numOfMetrics = file.getUint16(); |
| 23903 |
if (caretOffset !== 0) { |
| 23904 |
const macStyle = int16(headTable.data[44], headTable.data[45]); |
| 23905 |
if (!(macStyle & 2)) { |
| 23906 |
header.data[22] = 0; |
| 23907 |
header.data[23] = 0; |
| 23908 |
} |
| 23909 |
} |
| 23910 |
if (numOfMetrics > numGlyphs) { |
| 23911 |
info(`The numOfMetrics (${numOfMetrics}) should not be ` + `greater than the numGlyphs (${numGlyphs}).`); |
| 23912 |
numOfMetrics = numGlyphs; |
| 23913 |
header.data[34] = (numOfMetrics & 0xff00) >> 8; |
| 23914 |
header.data[35] = numOfMetrics & 0x00ff; |
| 23915 |
} |
| 23916 |
const numOfSidebearings = numGlyphs - numOfMetrics; |
| 23917 |
const numMissing = numOfSidebearings - (metrics.length - numOfMetrics * 4 >> 1); |
| 23918 |
if (numMissing > 0) { |
| 23919 |
const entries = new Uint8Array(metrics.length + numMissing * 2); |
| 23920 |
entries.set(metrics.data); |
| 23921 |
if (dupFirstEntry) { |
| 23922 |
entries[metrics.length] = metrics.data[2]; |
| 23923 |
entries[metrics.length + 1] = metrics.data[3]; |
| 23924 |
} |
| 23925 |
metrics.data = entries; |
| 23926 |
} |
| 23927 |
} |
| 23928 |
function sanitizeGlyph(source, sourceStart, sourceEnd, dest, destStart, hintsValid) { |
| 23929 |
const glyphProfile = { |
| 23930 |
length: 0, |
| 23931 |
sizeOfInstructions: 0 |
| 23932 |
}; |
| 23933 |
if (sourceStart < 0 || sourceStart >= source.length || sourceEnd > source.length || sourceEnd - sourceStart <= 12) { |
| 23934 |
return glyphProfile; |
| 23935 |
} |
| 23936 |
const glyf = source.subarray(sourceStart, sourceEnd); |
| 23937 |
const xMin = signedInt16(glyf[2], glyf[3]); |
| 23938 |
const yMin = signedInt16(glyf[4], glyf[5]); |
| 23939 |
const xMax = signedInt16(glyf[6], glyf[7]); |
| 23940 |
const yMax = signedInt16(glyf[8], glyf[9]); |
| 23941 |
if (xMin > xMax) { |
| 23942 |
writeSignedInt16(glyf, 2, xMax); |
| 23943 |
writeSignedInt16(glyf, 6, xMin); |
| 23944 |
} |
| 23945 |
if (yMin > yMax) { |
| 23946 |
writeSignedInt16(glyf, 4, yMax); |
| 23947 |
writeSignedInt16(glyf, 8, yMin); |
| 23948 |
} |
| 23949 |
const contoursCount = signedInt16(glyf[0], glyf[1]); |
| 23950 |
if (contoursCount < 0) { |
| 23951 |
if (contoursCount < -1) { |
| 23952 |
return glyphProfile; |
| 23953 |
} |
| 23954 |
dest.set(glyf, destStart); |
| 23955 |
glyphProfile.length = glyf.length; |
| 23956 |
return glyphProfile; |
| 23957 |
} |
| 23958 |
let i, |
| 23959 |
j = 10, |
| 23960 |
flagsCount = 0; |
| 23961 |
for (i = 0; i < contoursCount; i++) { |
| 23962 |
const endPoint = glyf[j] << 8 | glyf[j + 1]; |
| 23963 |
flagsCount = endPoint + 1; |
| 23964 |
j += 2; |
| 23965 |
} |
| 23966 |
const instructionsStart = j; |
| 23967 |
const instructionsLength = glyf[j] << 8 | glyf[j + 1]; |
| 23968 |
glyphProfile.sizeOfInstructions = instructionsLength; |
| 23969 |
j += 2 + instructionsLength; |
| 23970 |
const instructionsEnd = j; |
| 23971 |
let coordinatesLength = 0; |
| 23972 |
for (i = 0; i < flagsCount; i++) { |
| 23973 |
const flag = glyf[j++]; |
| 23974 |
if (flag & 0xc0) { |
| 23975 |
glyf[j - 1] = flag & 0x3f; |
| 23976 |
} |
| 23977 |
let xLength = 2; |
| 23978 |
if (flag & 2) { |
| 23979 |
xLength = 1; |
| 23980 |
} else if (flag & 16) { |
| 23981 |
xLength = 0; |
| 23982 |
} |
| 23983 |
let yLength = 2; |
| 23984 |
if (flag & 4) { |
| 23985 |
yLength = 1; |
| 23986 |
} else if (flag & 32) { |
| 23987 |
yLength = 0; |
| 23988 |
} |
| 23989 |
const xyLength = xLength + yLength; |
| 23990 |
coordinatesLength += xyLength; |
| 23991 |
if (flag & 8) { |
| 23992 |
const repeat = glyf[j++]; |
| 23993 |
if (repeat === 0) { |
| 23994 |
glyf[j - 1] ^= 8; |
| 23995 |
} |
| 23996 |
i += repeat; |
| 23997 |
coordinatesLength += repeat * xyLength; |
| 23998 |
} |
| 23999 |
} |
| 24000 |
if (coordinatesLength === 0) { |
| 24001 |
return glyphProfile; |
| 24002 |
} |
| 24003 |
let glyphDataLength = j + coordinatesLength; |
| 24004 |
if (glyphDataLength > glyf.length) { |
| 24005 |
return glyphProfile; |
| 24006 |
} |
| 24007 |
if (!hintsValid && instructionsLength > 0) { |
| 24008 |
dest.set(glyf.subarray(0, instructionsStart), destStart); |
| 24009 |
dest.set([0, 0], destStart + instructionsStart); |
| 24010 |
dest.set(glyf.subarray(instructionsEnd, glyphDataLength), destStart + instructionsStart + 2); |
| 24011 |
glyphDataLength -= instructionsLength; |
| 24012 |
if (glyf.length - glyphDataLength > 3) { |
| 24013 |
glyphDataLength = glyphDataLength + 3 & ~3; |
| 24014 |
} |
| 24015 |
glyphProfile.length = glyphDataLength; |
| 24016 |
return glyphProfile; |
| 24017 |
} |
| 24018 |
if (glyf.length - glyphDataLength > 3) { |
| 24019 |
glyphDataLength = glyphDataLength + 3 & ~3; |
| 24020 |
dest.set(glyf.subarray(0, glyphDataLength), destStart); |
| 24021 |
glyphProfile.length = glyphDataLength; |
| 24022 |
return glyphProfile; |
| 24023 |
} |
| 24024 |
dest.set(glyf, destStart); |
| 24025 |
glyphProfile.length = glyf.length; |
| 24026 |
return glyphProfile; |
| 24027 |
} |
| 24028 |
function sanitizeHead(head, numGlyphs, locaLength) { |
| 24029 |
const data = head.data; |
| 24030 |
const version = int32(data[0], data[1], data[2], data[3]); |
| 24031 |
if (version >> 16 !== 1) { |
| 24032 |
info("Attempting to fix invalid version in head table: " + version); |
| 24033 |
data[0] = 0; |
| 24034 |
data[1] = 1; |
| 24035 |
data[2] = 0; |
| 24036 |
data[3] = 0; |
| 24037 |
} |
| 24038 |
const indexToLocFormat = int16(data[50], data[51]); |
| 24039 |
if (indexToLocFormat < 0 || indexToLocFormat > 1) { |
| 24040 |
info("Attempting to fix invalid indexToLocFormat in head table: " + indexToLocFormat); |
| 24041 |
const numGlyphsPlusOne = numGlyphs + 1; |
| 24042 |
if (locaLength === numGlyphsPlusOne << 1) { |
| 24043 |
data[50] = 0; |
| 24044 |
data[51] = 0; |
| 24045 |
} else if (locaLength === numGlyphsPlusOne << 2) { |
| 24046 |
data[50] = 0; |
| 24047 |
data[51] = 1; |
| 24048 |
} else { |
| 24049 |
throw new FormatError("Could not fix indexToLocFormat: " + indexToLocFormat); |
| 24050 |
} |
| 24051 |
} |
| 24052 |
} |
| 24053 |
function sanitizeGlyphLocations(loca, glyf, numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions) { |
| 24054 |
let itemSize, itemDecode, itemEncode; |
| 24055 |
if (isGlyphLocationsLong) { |
| 24056 |
itemSize = 4; |
| 24057 |
itemDecode = function fontItemDecodeLong(data, offset) { |
| 24058 |
return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]; |
| 24059 |
}; |
| 24060 |
itemEncode = function fontItemEncodeLong(data, offset, value) { |
| 24061 |
data[offset] = value >>> 24 & 0xff; |
| 24062 |
data[offset + 1] = value >> 16 & 0xff; |
| 24063 |
data[offset + 2] = value >> 8 & 0xff; |
| 24064 |
data[offset + 3] = value & 0xff; |
| 24065 |
}; |
| 24066 |
} else { |
| 24067 |
itemSize = 2; |
| 24068 |
itemDecode = function fontItemDecode(data, offset) { |
| 24069 |
return data[offset] << 9 | data[offset + 1] << 1; |
| 24070 |
}; |
| 24071 |
itemEncode = function fontItemEncode(data, offset, value) { |
| 24072 |
data[offset] = value >> 9 & 0xff; |
| 24073 |
data[offset + 1] = value >> 1 & 0xff; |
| 24074 |
}; |
| 24075 |
} |
| 24076 |
const numGlyphsOut = dupFirstEntry ? numGlyphs + 1 : numGlyphs; |
| 24077 |
const locaDataSize = itemSize * (1 + numGlyphsOut); |
| 24078 |
const locaData = new Uint8Array(locaDataSize); |
| 24079 |
locaData.set(loca.data.subarray(0, locaDataSize)); |
| 24080 |
loca.data = locaData; |
| 24081 |
const oldGlyfData = glyf.data; |
| 24082 |
const oldGlyfDataLength = oldGlyfData.length; |
| 24083 |
const newGlyfData = new Uint8Array(oldGlyfDataLength); |
| 24084 |
let i, j; |
| 24085 |
const locaEntries = []; |
| 24086 |
for (i = 0, j = 0; i < numGlyphs + 1; i++, j += itemSize) { |
| 24087 |
let offset = itemDecode(locaData, j); |
| 24088 |
if (offset > oldGlyfDataLength) { |
| 24089 |
offset = oldGlyfDataLength; |
| 24090 |
} |
| 24091 |
locaEntries.push({ |
| 24092 |
index: i, |
| 24093 |
offset, |
| 24094 |
endOffset: 0 |
| 24095 |
}); |
| 24096 |
} |
| 24097 |
locaEntries.sort((a, b) => a.offset - b.offset); |
| 24098 |
for (i = 0; i < numGlyphs; i++) { |
| 24099 |
locaEntries[i].endOffset = locaEntries[i + 1].offset; |
| 24100 |
} |
| 24101 |
locaEntries.sort((a, b) => a.index - b.index); |
| 24102 |
for (i = 0; i < numGlyphs; i++) { |
| 24103 |
const { |
| 24104 |
offset, |
| 24105 |
endOffset |
| 24106 |
} = locaEntries[i]; |
| 24107 |
if (offset !== 0 || endOffset !== 0) { |
| 24108 |
break; |
| 24109 |
} |
| 24110 |
const nextOffset = locaEntries[i + 1].offset; |
| 24111 |
if (nextOffset === 0) { |
| 24112 |
continue; |
| 24113 |
} |
| 24114 |
locaEntries[i].endOffset = nextOffset; |
| 24115 |
break; |
| 24116 |
} |
| 24117 |
const last = locaEntries.at(-2); |
| 24118 |
if (last.offset !== 0 && last.endOffset === 0) { |
| 24119 |
last.endOffset = oldGlyfDataLength; |
| 24120 |
} |
| 24121 |
const missingGlyphs = Object.create(null); |
| 24122 |
let writeOffset = 0; |
| 24123 |
itemEncode(locaData, 0, writeOffset); |
| 24124 |
for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { |
| 24125 |
const glyphProfile = sanitizeGlyph(oldGlyfData, locaEntries[i].offset, locaEntries[i].endOffset, newGlyfData, writeOffset, hintsValid); |
| 24126 |
const newLength = glyphProfile.length; |
| 24127 |
if (newLength === 0) { |
| 24128 |
missingGlyphs[i] = true; |
| 24129 |
} |
| 24130 |
if (glyphProfile.sizeOfInstructions > maxSizeOfInstructions) { |
| 24131 |
maxSizeOfInstructions = glyphProfile.sizeOfInstructions; |
| 24132 |
} |
| 24133 |
writeOffset += newLength; |
| 24134 |
itemEncode(locaData, j, writeOffset); |
| 24135 |
} |
| 24136 |
if (writeOffset === 0) { |
| 24137 |
const simpleGlyph = new Uint8Array([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0]); |
| 24138 |
for (i = 0, j = itemSize; i < numGlyphsOut; i++, j += itemSize) { |
| 24139 |
itemEncode(locaData, j, simpleGlyph.length); |
| 24140 |
} |
| 24141 |
glyf.data = simpleGlyph; |
| 24142 |
} else if (dupFirstEntry) { |
| 24143 |
const firstEntryLength = itemDecode(locaData, itemSize); |
| 24144 |
if (newGlyfData.length > firstEntryLength + writeOffset) { |
| 24145 |
glyf.data = newGlyfData.subarray(0, firstEntryLength + writeOffset); |
| 24146 |
} else { |
| 24147 |
glyf.data = new Uint8Array(firstEntryLength + writeOffset); |
| 24148 |
glyf.data.set(newGlyfData.subarray(0, writeOffset)); |
| 24149 |
} |
| 24150 |
glyf.data.set(newGlyfData.subarray(0, firstEntryLength), writeOffset); |
| 24151 |
itemEncode(loca.data, locaData.length - itemSize, writeOffset + firstEntryLength); |
| 24152 |
} else { |
| 24153 |
glyf.data = newGlyfData.subarray(0, writeOffset); |
| 24154 |
} |
| 24155 |
return { |
| 24156 |
missingGlyphs, |
| 24157 |
maxSizeOfInstructions |
| 24158 |
}; |
| 24159 |
} |
| 24160 |
function readPostScriptTable(post, propertiesObj, maxpNumGlyphs) { |
| 24161 |
const start = (font.start || 0) + post.offset; |
| 24162 |
font.pos = start; |
| 24163 |
const length = post.length, |
| 24164 |
end = start + length; |
| 24165 |
const version = font.getInt32(); |
| 24166 |
font.skip(28); |
| 24167 |
let glyphNames; |
| 24168 |
let valid = true; |
| 24169 |
let i; |
| 24170 |
switch (version) { |
| 24171 |
case 0x00010000: |
| 24172 |
glyphNames = MacStandardGlyphOrdering; |
| 24173 |
break; |
| 24174 |
case 0x00020000: |
| 24175 |
const numGlyphs = font.getUint16(); |
| 24176 |
if (numGlyphs !== maxpNumGlyphs) { |
| 24177 |
valid = false; |
| 24178 |
break; |
| 24179 |
} |
| 24180 |
const glyphNameIndexes = []; |
| 24181 |
for (i = 0; i < numGlyphs; ++i) { |
| 24182 |
const index = font.getUint16(); |
| 24183 |
if (index >= 32768) { |
| 24184 |
valid = false; |
| 24185 |
break; |
| 24186 |
} |
| 24187 |
glyphNameIndexes.push(index); |
| 24188 |
} |
| 24189 |
if (!valid) { |
| 24190 |
break; |
| 24191 |
} |
| 24192 |
const customNames = [], |
| 24193 |
strBuf = []; |
| 24194 |
while (font.pos < end) { |
| 24195 |
const stringLength = font.getByte(); |
| 24196 |
strBuf.length = stringLength; |
| 24197 |
for (i = 0; i < stringLength; ++i) { |
| 24198 |
strBuf[i] = String.fromCharCode(font.getByte()); |
| 24199 |
} |
| 24200 |
customNames.push(strBuf.join("")); |
| 24201 |
} |
| 24202 |
glyphNames = []; |
| 24203 |
for (i = 0; i < numGlyphs; ++i) { |
| 24204 |
const j = glyphNameIndexes[i]; |
| 24205 |
if (j < 258) { |
| 24206 |
glyphNames.push(MacStandardGlyphOrdering[j]); |
| 24207 |
continue; |
| 24208 |
} |
| 24209 |
glyphNames.push(customNames[j - 258]); |
| 24210 |
} |
| 24211 |
break; |
| 24212 |
case 0x00030000: |
| 24213 |
break; |
| 24214 |
default: |
| 24215 |
warn("Unknown/unsupported post table version " + version); |
| 24216 |
valid = false; |
| 24217 |
if (propertiesObj.defaultEncoding) { |
| 24218 |
glyphNames = propertiesObj.defaultEncoding; |
| 24219 |
} |
| 24220 |
break; |
| 24221 |
} |
| 24222 |
propertiesObj.glyphNames = glyphNames; |
| 24223 |
return valid; |
| 24224 |
} |
| 24225 |
function readNameTable(nameTable) { |
| 24226 |
const start = (font.start || 0) + nameTable.offset; |
| 24227 |
font.pos = start; |
| 24228 |
const names = [[], []], |
| 24229 |
records = []; |
| 24230 |
const length = nameTable.length, |
| 24231 |
end = start + length; |
| 24232 |
const format = font.getUint16(); |
| 24233 |
const FORMAT_0_HEADER_LENGTH = 6; |
| 24234 |
if (format !== 0 || length < FORMAT_0_HEADER_LENGTH) { |
| 24235 |
return [names, records]; |
| 24236 |
} |
| 24237 |
const numRecords = font.getUint16(); |
| 24238 |
const stringsStart = font.getUint16(); |
| 24239 |
const NAME_RECORD_LENGTH = 12; |
| 24240 |
let i, ii; |
| 24241 |
for (i = 0; i < numRecords && font.pos + NAME_RECORD_LENGTH <= end; i++) { |
| 24242 |
const r = { |
| 24243 |
platform: font.getUint16(), |
| 24244 |
encoding: font.getUint16(), |
| 24245 |
language: font.getUint16(), |
| 24246 |
name: font.getUint16(), |
| 24247 |
length: font.getUint16(), |
| 24248 |
offset: font.getUint16() |
| 24249 |
}; |
| 24250 |
if (isMacNameRecord(r) || isWinNameRecord(r)) { |
| 24251 |
records.push(r); |
| 24252 |
} |
| 24253 |
} |
| 24254 |
for (i = 0, ii = records.length; i < ii; i++) { |
| 24255 |
const record = records[i]; |
| 24256 |
if (record.length <= 0) { |
| 24257 |
continue; |
| 24258 |
} |
| 24259 |
const pos = start + stringsStart + record.offset; |
| 24260 |
if (pos + record.length > end) { |
| 24261 |
continue; |
| 24262 |
} |
| 24263 |
font.pos = pos; |
| 24264 |
const nameIndex = record.name; |
| 24265 |
if (record.encoding) { |
| 24266 |
let str = ""; |
| 24267 |
for (let j = 0, jj = record.length; j < jj; j += 2) { |
| 24268 |
str += String.fromCharCode(font.getUint16()); |
| 24269 |
} |
| 24270 |
names[1][nameIndex] = str; |
| 24271 |
} else { |
| 24272 |
names[0][nameIndex] = font.getString(record.length); |
| 24273 |
} |
| 24274 |
} |
| 24275 |
return [names, records]; |
| 24276 |
} |
| 24277 |
const TTOpsStackDeltas = [0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1, 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -999, 0, -2, -2, 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2]; |
| 24278 |
function sanitizeTTProgram(table, ttContext) { |
| 24279 |
let data = table.data; |
| 24280 |
let i = 0, |
| 24281 |
j, |
| 24282 |
n, |
| 24283 |
b, |
| 24284 |
funcId, |
| 24285 |
pc, |
| 24286 |
lastEndf = 0, |
| 24287 |
lastDeff = 0; |
| 24288 |
const stack = []; |
| 24289 |
const callstack = []; |
| 24290 |
const functionsCalled = []; |
| 24291 |
let tooComplexToFollowFunctions = ttContext.tooComplexToFollowFunctions; |
| 24292 |
let inFDEF = false, |
| 24293 |
ifLevel = 0, |
| 24294 |
inELSE = 0; |
| 24295 |
for (let ii = data.length; i < ii;) { |
| 24296 |
const op = data[i++]; |
| 24297 |
if (op === 0x40) { |
| 24298 |
n = data[i++]; |
| 24299 |
if (inFDEF || inELSE) { |
| 24300 |
i += n; |
| 24301 |
} else { |
| 24302 |
for (j = 0; j < n; j++) { |
| 24303 |
stack.push(data[i++]); |
| 24304 |
} |
| 24305 |
} |
| 24306 |
} else if (op === 0x41) { |
| 24307 |
n = data[i++]; |
| 24308 |
if (inFDEF || inELSE) { |
| 24309 |
i += n * 2; |
| 24310 |
} else { |
| 24311 |
for (j = 0; j < n; j++) { |
| 24312 |
b = data[i++]; |
| 24313 |
stack.push(b << 8 | data[i++]); |
| 24314 |
} |
| 24315 |
} |
| 24316 |
} else if ((op & 0xf8) === 0xb0) { |
| 24317 |
n = op - 0xb0 + 1; |
| 24318 |
if (inFDEF || inELSE) { |
| 24319 |
i += n; |
| 24320 |
} else { |
| 24321 |
for (j = 0; j < n; j++) { |
| 24322 |
stack.push(data[i++]); |
| 24323 |
} |
| 24324 |
} |
| 24325 |
} else if ((op & 0xf8) === 0xb8) { |
| 24326 |
n = op - 0xb8 + 1; |
| 24327 |
if (inFDEF || inELSE) { |
| 24328 |
i += n * 2; |
| 24329 |
} else { |
| 24330 |
for (j = 0; j < n; j++) { |
| 24331 |
b = data[i++]; |
| 24332 |
stack.push(signedInt16(b, data[i++])); |
| 24333 |
} |
| 24334 |
} |
| 24335 |
} else if (op === 0x2b && !tooComplexToFollowFunctions) { |
| 24336 |
if (!inFDEF && !inELSE) { |
| 24337 |
funcId = stack.at(-1); |
| 24338 |
if (isNaN(funcId)) { |
| 24339 |
info("TT: CALL empty stack (or invalid entry)."); |
| 24340 |
} else { |
| 24341 |
ttContext.functionsUsed[funcId] = true; |
| 24342 |
if (funcId in ttContext.functionsStackDeltas) { |
| 24343 |
const newStackLength = stack.length + ttContext.functionsStackDeltas[funcId]; |
| 24344 |
if (newStackLength < 0) { |
| 24345 |
warn("TT: CALL invalid functions stack delta."); |
| 24346 |
ttContext.hintsValid = false; |
| 24347 |
return; |
| 24348 |
} |
| 24349 |
stack.length = newStackLength; |
| 24350 |
} else if (funcId in ttContext.functionsDefined && !functionsCalled.includes(funcId)) { |
| 24351 |
callstack.push({ |
| 24352 |
data, |
| 24353 |
i, |
| 24354 |
stackTop: stack.length - 1 |
| 24355 |
}); |
| 24356 |
functionsCalled.push(funcId); |
| 24357 |
pc = ttContext.functionsDefined[funcId]; |
| 24358 |
if (!pc) { |
| 24359 |
warn("TT: CALL non-existent function"); |
| 24360 |
ttContext.hintsValid = false; |
| 24361 |
return; |
| 24362 |
} |
| 24363 |
data = pc.data; |
| 24364 |
i = pc.i; |
| 24365 |
} |
| 24366 |
} |
| 24367 |
} |
| 24368 |
} else if (op === 0x2c && !tooComplexToFollowFunctions) { |
| 24369 |
if (inFDEF || inELSE) { |
| 24370 |
warn("TT: nested FDEFs not allowed"); |
| 24371 |
tooComplexToFollowFunctions = true; |
| 24372 |
} |
| 24373 |
inFDEF = true; |
| 24374 |
lastDeff = i; |
| 24375 |
funcId = stack.pop(); |
| 24376 |
ttContext.functionsDefined[funcId] = { |
| 24377 |
data, |
| 24378 |
i |
| 24379 |
}; |
| 24380 |
} else if (op === 0x2d) { |
| 24381 |
if (inFDEF) { |
| 24382 |
inFDEF = false; |
| 24383 |
lastEndf = i; |
| 24384 |
} else { |
| 24385 |
pc = callstack.pop(); |
| 24386 |
if (!pc) { |
| 24387 |
warn("TT: ENDF bad stack"); |
| 24388 |
ttContext.hintsValid = false; |
| 24389 |
return; |
| 24390 |
} |
| 24391 |
funcId = functionsCalled.pop(); |
| 24392 |
data = pc.data; |
| 24393 |
i = pc.i; |
| 24394 |
ttContext.functionsStackDeltas[funcId] = stack.length - pc.stackTop; |
| 24395 |
} |
| 24396 |
} else if (op === 0x89) { |
| 24397 |
if (inFDEF || inELSE) { |
| 24398 |
warn("TT: nested IDEFs not allowed"); |
| 24399 |
tooComplexToFollowFunctions = true; |
| 24400 |
} |
| 24401 |
inFDEF = true; |
| 24402 |
lastDeff = i; |
| 24403 |
} else if (op === 0x58) { |
| 24404 |
++ifLevel; |
| 24405 |
} else if (op === 0x1b) { |
| 24406 |
inELSE = ifLevel; |
| 24407 |
} else if (op === 0x59) { |
| 24408 |
if (inELSE === ifLevel) { |
| 24409 |
inELSE = 0; |
| 24410 |
} |
| 24411 |
--ifLevel; |
| 24412 |
} else if (op === 0x1c) { |
| 24413 |
if (!inFDEF && !inELSE) { |
| 24414 |
const offset = stack.at(-1); |
| 24415 |
if (offset > 0) { |
| 24416 |
i += offset - 1; |
| 24417 |
} |
| 24418 |
} |
| 24419 |
} |
| 24420 |
if (!inFDEF && !inELSE) { |
| 24421 |
let stackDelta = 0; |
| 24422 |
if (op <= 0x8e) { |
| 24423 |
stackDelta = TTOpsStackDeltas[op]; |
| 24424 |
} else if (op >= 0xc0 && op <= 0xdf) { |
| 24425 |
stackDelta = -1; |
| 24426 |
} else if (op >= 0xe0) { |
| 24427 |
stackDelta = -2; |
| 24428 |
} |
| 24429 |
if (op >= 0x71 && op <= 0x75) { |
| 24430 |
n = stack.pop(); |
| 24431 |
if (!isNaN(n)) { |
| 24432 |
stackDelta = -n * 2; |
| 24433 |
} |
| 24434 |
} |
| 24435 |
while (stackDelta < 0 && stack.length > 0) { |
| 24436 |
stack.pop(); |
| 24437 |
stackDelta++; |
| 24438 |
} |
| 24439 |
while (stackDelta > 0) { |
| 24440 |
stack.push(NaN); |
| 24441 |
stackDelta--; |
| 24442 |
} |
| 24443 |
} |
| 24444 |
} |
| 24445 |
ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions; |
| 24446 |
const content = [data]; |
| 24447 |
if (i > data.length) { |
| 24448 |
content.push(new Uint8Array(i - data.length)); |
| 24449 |
} |
| 24450 |
if (lastDeff > lastEndf) { |
| 24451 |
warn("TT: complementing a missing function tail"); |
| 24452 |
content.push(new Uint8Array([0x22, 0x2d])); |
| 24453 |
} |
| 24454 |
foldTTTable(table, content); |
| 24455 |
} |
| 24456 |
function checkInvalidFunctions(ttContext, maxFunctionDefs) { |
| 24457 |
if (ttContext.tooComplexToFollowFunctions) { |
| 24458 |
return; |
| 24459 |
} |
| 24460 |
if (ttContext.functionsDefined.length > maxFunctionDefs) { |
| 24461 |
warn("TT: more functions defined than expected"); |
| 24462 |
ttContext.hintsValid = false; |
| 24463 |
return; |
| 24464 |
} |
| 24465 |
for (let j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) { |
| 24466 |
if (j > maxFunctionDefs) { |
| 24467 |
warn("TT: invalid function id: " + j); |
| 24468 |
ttContext.hintsValid = false; |
| 24469 |
return; |
| 24470 |
} |
| 24471 |
if (ttContext.functionsUsed[j] && !ttContext.functionsDefined[j]) { |
| 24472 |
warn("TT: undefined function: " + j); |
| 24473 |
ttContext.hintsValid = false; |
| 24474 |
return; |
| 24475 |
} |
| 24476 |
} |
| 24477 |
} |
| 24478 |
function foldTTTable(table, content) { |
| 24479 |
if (content.length > 1) { |
| 24480 |
let newLength = 0; |
| 24481 |
let j, jj; |
| 24482 |
for (j = 0, jj = content.length; j < jj; j++) { |
| 24483 |
newLength += content[j].length; |
| 24484 |
} |
| 24485 |
newLength = newLength + 3 & ~3; |
| 24486 |
const result = new Uint8Array(newLength); |
| 24487 |
let pos = 0; |
| 24488 |
for (j = 0, jj = content.length; j < jj; j++) { |
| 24489 |
result.set(content[j], pos); |
| 24490 |
pos += content[j].length; |
| 24491 |
} |
| 24492 |
table.data = result; |
| 24493 |
table.length = newLength; |
| 24494 |
} |
| 24495 |
} |
| 24496 |
function sanitizeTTPrograms(fpgm, prep, cvt, maxFunctionDefs) { |
| 24497 |
const ttContext = { |
| 24498 |
functionsDefined: [], |
| 24499 |
functionsUsed: [], |
| 24500 |
functionsStackDeltas: [], |
| 24501 |
tooComplexToFollowFunctions: false, |
| 24502 |
hintsValid: true |
| 24503 |
}; |
| 24504 |
if (fpgm) { |
| 24505 |
sanitizeTTProgram(fpgm, ttContext); |
| 24506 |
} |
| 24507 |
if (prep) { |
| 24508 |
sanitizeTTProgram(prep, ttContext); |
| 24509 |
} |
| 24510 |
if (fpgm) { |
| 24511 |
checkInvalidFunctions(ttContext, maxFunctionDefs); |
| 24512 |
} |
| 24513 |
if (cvt && cvt.length & 1) { |
| 24514 |
const cvtData = new Uint8Array(cvt.length + 1); |
| 24515 |
cvtData.set(cvt.data); |
| 24516 |
cvt.data = cvtData; |
| 24517 |
} |
| 24518 |
return ttContext.hintsValid; |
| 24519 |
} |
| 24520 |
font = new Stream(new Uint8Array(font.getBytes())); |
| 24521 |
let header, tables; |
| 24522 |
if (isTrueTypeCollectionFile(font)) { |
| 24523 |
const ttcData = readTrueTypeCollectionData(font, this.name); |
| 24524 |
header = ttcData.header; |
| 24525 |
tables = ttcData.tables; |
| 24526 |
} else { |
| 24527 |
header = readOpenTypeHeader(font); |
| 24528 |
tables = readTables(font, header.numTables); |
| 24529 |
} |
| 24530 |
let cff, cffFile; |
| 24531 |
const isTrueType = !tables["CFF "]; |
| 24532 |
if (!isTrueType) { |
| 24533 |
const isComposite = properties.composite && (properties.cidToGidMap?.length > 0 || !(properties.cMap instanceof IdentityCMap)); |
| 24534 |
if (header.version === "OTTO" && !isComposite || !tables.head || !tables.hhea || !tables.maxp || !tables.post) { |
| 24535 |
cffFile = new Stream(tables["CFF "].data); |
| 24536 |
cff = new CFFFont(cffFile, properties); |
| 24537 |
adjustWidths(properties); |
| 24538 |
return this.convert(name, cff, properties); |
| 24539 |
} |
| 24540 |
delete tables.glyf; |
| 24541 |
delete tables.loca; |
| 24542 |
delete tables.fpgm; |
| 24543 |
delete tables.prep; |
| 24544 |
delete tables["cvt "]; |
| 24545 |
this.isOpenType = true; |
| 24546 |
} else { |
| 24547 |
if (!tables.loca) { |
| 24548 |
throw new FormatError('Required "loca" table is not found'); |
| 24549 |
} |
| 24550 |
if (!tables.glyf) { |
| 24551 |
warn('Required "glyf" table is not found -- trying to recover.'); |
| 24552 |
tables.glyf = { |
| 24553 |
tag: "glyf", |
| 24554 |
data: new Uint8Array(0) |
| 24555 |
}; |
| 24556 |
} |
| 24557 |
this.isOpenType = false; |
| 24558 |
} |
| 24559 |
if (!tables.maxp) { |
| 24560 |
throw new FormatError('Required "maxp" table is not found'); |
| 24561 |
} |
| 24562 |
font.pos = (font.start || 0) + tables.maxp.offset; |
| 24563 |
let version = font.getInt32(); |
| 24564 |
const numGlyphs = font.getUint16(); |
| 24565 |
if (version !== 0x00010000 && version !== 0x00005000) { |
| 24566 |
if (tables.maxp.length === 6) { |
| 24567 |
version = 0x0005000; |
| 24568 |
} else if (tables.maxp.length >= 32) { |
| 24569 |
version = 0x00010000; |
| 24570 |
} else { |
| 24571 |
throw new FormatError(`"maxp" table has a wrong version number`); |
| 24572 |
} |
| 24573 |
writeUint32(tables.maxp.data, 0, version); |
| 24574 |
} |
| 24575 |
if (properties.scaleFactors?.length === numGlyphs && isTrueType) { |
| 24576 |
const { |
| 24577 |
scaleFactors |
| 24578 |
} = properties; |
| 24579 |
const isGlyphLocationsLong = int16(tables.head.data[50], tables.head.data[51]); |
| 24580 |
const glyphs = new GlyfTable({ |
| 24581 |
glyfTable: tables.glyf.data, |
| 24582 |
isGlyphLocationsLong, |
| 24583 |
locaTable: tables.loca.data, |
| 24584 |
numGlyphs |
| 24585 |
}); |
| 24586 |
glyphs.scale(scaleFactors); |
| 24587 |
const { |
| 24588 |
glyf, |
| 24589 |
loca, |
| 24590 |
isLocationLong |
| 24591 |
} = glyphs.write(); |
| 24592 |
tables.glyf.data = glyf; |
| 24593 |
tables.loca.data = loca; |
| 24594 |
if (isLocationLong !== !!isGlyphLocationsLong) { |
| 24595 |
tables.head.data[50] = 0; |
| 24596 |
tables.head.data[51] = isLocationLong ? 1 : 0; |
| 24597 |
} |
| 24598 |
const metrics = tables.hmtx.data; |
| 24599 |
for (let i = 0; i < numGlyphs; i++) { |
| 24600 |
const j = 4 * i; |
| 24601 |
const advanceWidth = Math.round(scaleFactors[i] * int16(metrics[j], metrics[j + 1])); |
| 24602 |
metrics[j] = advanceWidth >> 8 & 0xff; |
| 24603 |
metrics[j + 1] = advanceWidth & 0xff; |
| 24604 |
const lsb = Math.round(scaleFactors[i] * signedInt16(metrics[j + 2], metrics[j + 3])); |
| 24605 |
writeSignedInt16(metrics, j + 2, lsb); |
| 24606 |
} |
| 24607 |
} |
| 24608 |
let numGlyphsOut = numGlyphs + 1; |
| 24609 |
let dupFirstEntry = true; |
| 24610 |
if (numGlyphsOut > 0xffff) { |
| 24611 |
dupFirstEntry = false; |
| 24612 |
numGlyphsOut = numGlyphs; |
| 24613 |
warn("Not enough space in glyfs to duplicate first glyph."); |
| 24614 |
} |
| 24615 |
let maxFunctionDefs = 0; |
| 24616 |
let maxSizeOfInstructions = 0; |
| 24617 |
if (version >= 0x00010000 && tables.maxp.length >= 32) { |
| 24618 |
font.pos += 8; |
| 24619 |
const maxZones = font.getUint16(); |
| 24620 |
if (maxZones > 2) { |
| 24621 |
tables.maxp.data[14] = 0; |
| 24622 |
tables.maxp.data[15] = 2; |
| 24623 |
} |
| 24624 |
font.pos += 4; |
| 24625 |
maxFunctionDefs = font.getUint16(); |
| 24626 |
font.pos += 4; |
| 24627 |
maxSizeOfInstructions = font.getUint16(); |
| 24628 |
} |
| 24629 |
tables.maxp.data[4] = numGlyphsOut >> 8; |
| 24630 |
tables.maxp.data[5] = numGlyphsOut & 255; |
| 24631 |
const hintsValid = sanitizeTTPrograms(tables.fpgm, tables.prep, tables["cvt "], maxFunctionDefs); |
| 24632 |
if (!hintsValid) { |
| 24633 |
delete tables.fpgm; |
| 24634 |
delete tables.prep; |
| 24635 |
delete tables["cvt "]; |
| 24636 |
} |
| 24637 |
sanitizeMetrics(font, tables.hhea, tables.hmtx, tables.head, numGlyphsOut, dupFirstEntry); |
| 24638 |
if (!tables.head) { |
| 24639 |
throw new FormatError('Required "head" table is not found'); |
| 24640 |
} |
| 24641 |
sanitizeHead(tables.head, numGlyphs, isTrueType ? tables.loca.length : 0); |
| 24642 |
let missingGlyphs = Object.create(null); |
| 24643 |
if (isTrueType) { |
| 24644 |
const isGlyphLocationsLong = int16(tables.head.data[50], tables.head.data[51]); |
| 24645 |
const glyphsInfo = sanitizeGlyphLocations(tables.loca, tables.glyf, numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions); |
| 24646 |
missingGlyphs = glyphsInfo.missingGlyphs; |
| 24647 |
if (version >= 0x00010000 && tables.maxp.length >= 32) { |
| 24648 |
tables.maxp.data[26] = glyphsInfo.maxSizeOfInstructions >> 8; |
| 24649 |
tables.maxp.data[27] = glyphsInfo.maxSizeOfInstructions & 255; |
| 24650 |
} |
| 24651 |
} |
| 24652 |
if (!tables.hhea) { |
| 24653 |
throw new FormatError('Required "hhea" table is not found'); |
| 24654 |
} |
| 24655 |
if (tables.hhea.data[10] === 0 && tables.hhea.data[11] === 0) { |
| 24656 |
tables.hhea.data[10] = 0xff; |
| 24657 |
tables.hhea.data[11] = 0xff; |
| 24658 |
} |
| 24659 |
const metricsOverride = { |
| 24660 |
unitsPerEm: int16(tables.head.data[18], tables.head.data[19]), |
| 24661 |
yMax: signedInt16(tables.head.data[42], tables.head.data[43]), |
| 24662 |
yMin: signedInt16(tables.head.data[38], tables.head.data[39]), |
| 24663 |
ascent: signedInt16(tables.hhea.data[4], tables.hhea.data[5]), |
| 24664 |
descent: signedInt16(tables.hhea.data[6], tables.hhea.data[7]), |
| 24665 |
lineGap: signedInt16(tables.hhea.data[8], tables.hhea.data[9]) |
| 24666 |
}; |
| 24667 |
this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm; |
| 24668 |
this.descent = metricsOverride.descent / metricsOverride.unitsPerEm; |
| 24669 |
this.lineGap = metricsOverride.lineGap / metricsOverride.unitsPerEm; |
| 24670 |
if (this.cssFontInfo?.lineHeight) { |
| 24671 |
this.lineHeight = this.cssFontInfo.metrics.lineHeight; |
| 24672 |
this.lineGap = this.cssFontInfo.metrics.lineGap; |
| 24673 |
} else { |
| 24674 |
this.lineHeight = this.ascent - this.descent + this.lineGap; |
| 24675 |
} |
| 24676 |
if (tables.post) { |
| 24677 |
readPostScriptTable(tables.post, properties, numGlyphs); |
| 24678 |
} |
| 24679 |
tables.post = { |
| 24680 |
tag: "post", |
| 24681 |
data: createPostTable(properties) |
| 24682 |
}; |
| 24683 |
const charCodeToGlyphId = Object.create(null); |
| 24684 |
function hasGlyph(glyphId) { |
| 24685 |
return !missingGlyphs[glyphId]; |
| 24686 |
} |
| 24687 |
if (properties.composite) { |
| 24688 |
const cidToGidMap = properties.cidToGidMap || []; |
| 24689 |
const isCidToGidMapEmpty = cidToGidMap.length === 0; |
| 24690 |
properties.cMap.forEach(function (charCode, cid) { |
| 24691 |
if (typeof cid === "string") { |
| 24692 |
cid = convertCidString(charCode, cid, true); |
| 24693 |
} |
| 24694 |
if (cid > 0xffff) { |
| 24695 |
throw new FormatError("Max size of CID is 65,535"); |
| 24696 |
} |
| 24697 |
let glyphId = -1; |
| 24698 |
if (isCidToGidMapEmpty) { |
| 24699 |
glyphId = cid; |
| 24700 |
} else if (cidToGidMap[cid] !== undefined) { |
| 24701 |
glyphId = cidToGidMap[cid]; |
| 24702 |
} |
| 24703 |
if (glyphId >= 0 && glyphId < numGlyphs && hasGlyph(glyphId)) { |
| 24704 |
charCodeToGlyphId[charCode] = glyphId; |
| 24705 |
} |
| 24706 |
}); |
| 24707 |
} else { |
| 24708 |
const cmapTable = readCmapTable(tables.cmap, font, this.isSymbolicFont, properties.hasEncoding); |
| 24709 |
const cmapPlatformId = cmapTable.platformId; |
| 24710 |
const cmapEncodingId = cmapTable.encodingId; |
| 24711 |
const cmapMappings = cmapTable.mappings; |
| 24712 |
let baseEncoding = [], |
| 24713 |
forcePostTable = false; |
| 24714 |
if (properties.hasEncoding && (properties.baseEncodingName === "MacRomanEncoding" || properties.baseEncodingName === "WinAnsiEncoding")) { |
| 24715 |
baseEncoding = getEncoding(properties.baseEncodingName); |
| 24716 |
} |
| 24717 |
if (properties.hasEncoding && !this.isSymbolicFont && (cmapPlatformId === 3 && cmapEncodingId === 1 || cmapPlatformId === 1 && cmapEncodingId === 0)) { |
| 24718 |
const glyphsUnicodeMap = getGlyphsUnicode(); |
| 24719 |
for (let charCode = 0; charCode < 256; charCode++) { |
| 24720 |
let glyphName; |
| 24721 |
if (this.differences[charCode] !== undefined) { |
| 24722 |
glyphName = this.differences[charCode]; |
| 24723 |
} else if (baseEncoding.length && baseEncoding[charCode] !== "") { |
| 24724 |
glyphName = baseEncoding[charCode]; |
| 24725 |
} else { |
| 24726 |
glyphName = StandardEncoding[charCode]; |
| 24727 |
} |
| 24728 |
if (!glyphName) { |
| 24729 |
continue; |
| 24730 |
} |
| 24731 |
const standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); |
| 24732 |
let unicodeOrCharCode; |
| 24733 |
if (cmapPlatformId === 3 && cmapEncodingId === 1) { |
| 24734 |
unicodeOrCharCode = glyphsUnicodeMap[standardGlyphName]; |
| 24735 |
} else if (cmapPlatformId === 1 && cmapEncodingId === 0) { |
| 24736 |
unicodeOrCharCode = MacRomanEncoding.indexOf(standardGlyphName); |
| 24737 |
} |
| 24738 |
if (unicodeOrCharCode === undefined) { |
| 24739 |
if (!properties.glyphNames && properties.hasIncludedToUnicodeMap && !(this.toUnicode instanceof IdentityToUnicodeMap)) { |
| 24740 |
const unicode = this.toUnicode.get(charCode); |
| 24741 |
if (unicode) { |
| 24742 |
unicodeOrCharCode = unicode.codePointAt(0); |
| 24743 |
} |
| 24744 |
} |
| 24745 |
if (unicodeOrCharCode === undefined) { |
| 24746 |
continue; |
| 24747 |
} |
| 24748 |
} |
| 24749 |
for (const mapping of cmapMappings) { |
| 24750 |
if (mapping.charCode !== unicodeOrCharCode) { |
| 24751 |
continue; |
| 24752 |
} |
| 24753 |
charCodeToGlyphId[charCode] = mapping.glyphId; |
| 24754 |
break; |
| 24755 |
} |
| 24756 |
} |
| 24757 |
} else if (cmapPlatformId === 0) { |
| 24758 |
for (const mapping of cmapMappings) { |
| 24759 |
charCodeToGlyphId[mapping.charCode] = mapping.glyphId; |
| 24760 |
} |
| 24761 |
forcePostTable = true; |
| 24762 |
} else if (cmapPlatformId === 3 && cmapEncodingId === 0) { |
| 24763 |
for (const mapping of cmapMappings) { |
| 24764 |
let charCode = mapping.charCode; |
| 24765 |
if (charCode >= 0xf000 && charCode <= 0xf0ff) { |
| 24766 |
charCode &= 0xff; |
| 24767 |
} |
| 24768 |
charCodeToGlyphId[charCode] = mapping.glyphId; |
| 24769 |
} |
| 24770 |
} else { |
| 24771 |
for (const mapping of cmapMappings) { |
| 24772 |
charCodeToGlyphId[mapping.charCode] = mapping.glyphId; |
| 24773 |
} |
| 24774 |
} |
| 24775 |
if (properties.glyphNames && (baseEncoding.length || this.differences.length)) { |
| 24776 |
for (let i = 0; i < 256; ++i) { |
| 24777 |
if (!forcePostTable && charCodeToGlyphId[i] !== undefined) { |
| 24778 |
continue; |
| 24779 |
} |
| 24780 |
const glyphName = this.differences[i] || baseEncoding[i]; |
| 24781 |
if (!glyphName) { |
| 24782 |
continue; |
| 24783 |
} |
| 24784 |
const glyphId = properties.glyphNames.indexOf(glyphName); |
| 24785 |
if (glyphId > 0 && hasGlyph(glyphId)) { |
| 24786 |
charCodeToGlyphId[i] = glyphId; |
| 24787 |
} |
| 24788 |
} |
| 24789 |
} |
| 24790 |
} |
| 24791 |
if (charCodeToGlyphId.length === 0) { |
| 24792 |
charCodeToGlyphId[0] = 0; |
| 24793 |
} |
| 24794 |
let glyphZeroId = numGlyphsOut - 1; |
| 24795 |
if (!dupFirstEntry) { |
| 24796 |
glyphZeroId = 0; |
| 24797 |
} |
| 24798 |
if (!properties.cssFontInfo) { |
| 24799 |
const newMapping = adjustMapping(charCodeToGlyphId, hasGlyph, glyphZeroId, this.toUnicode); |
| 24800 |
this.toFontChar = newMapping.toFontChar; |
| 24801 |
tables.cmap = { |
| 24802 |
tag: "cmap", |
| 24803 |
data: createCmapTable(newMapping.charCodeToGlyphId, newMapping.toUnicodeExtraMap, numGlyphsOut) |
| 24804 |
}; |
| 24805 |
if (!tables["OS/2"] || !validateOS2Table(tables["OS/2"], font)) { |
| 24806 |
tables["OS/2"] = { |
| 24807 |
tag: "OS/2", |
| 24808 |
data: createOS2Table(properties, newMapping.charCodeToGlyphId, metricsOverride) |
| 24809 |
}; |
| 24810 |
} |
| 24811 |
} |
| 24812 |
if (!isTrueType) { |
| 24813 |
try { |
| 24814 |
cffFile = new Stream(tables["CFF "].data); |
| 24815 |
const parser = new CFFParser(cffFile, properties, SEAC_ANALYSIS_ENABLED); |
| 24816 |
cff = parser.parse(); |
| 24817 |
cff.duplicateFirstGlyph(); |
| 24818 |
const compiler = new CFFCompiler(cff); |
| 24819 |
tables["CFF "].data = compiler.compile(); |
| 24820 |
} catch { |
| 24821 |
warn("Failed to compile font " + properties.loadedName); |
| 24822 |
} |
| 24823 |
} |
| 24824 |
if (!tables.name) { |
| 24825 |
tables.name = { |
| 24826 |
tag: "name", |
| 24827 |
data: createNameTable(this.name) |
| 24828 |
}; |
| 24829 |
} else { |
| 24830 |
const [namePrototype, nameRecords] = readNameTable(tables.name); |
| 24831 |
tables.name.data = createNameTable(name, namePrototype); |
| 24832 |
this.psName = namePrototype[0][6] || null; |
| 24833 |
if (!properties.composite) { |
| 24834 |
adjustTrueTypeToUnicode(properties, this.isSymbolicFont, nameRecords); |
| 24835 |
} |
| 24836 |
} |
| 24837 |
const builder = new OpenTypeFileBuilder(header.version); |
| 24838 |
for (const tableTag in tables) { |
| 24839 |
builder.addTable(tableTag, tables[tableTag].data); |
| 24840 |
} |
| 24841 |
return builder.toArray(); |
| 24842 |
} |
| 24843 |
convert(fontName, font, properties) { |
| 24844 |
properties.fixedPitch = false; |
| 24845 |
if (properties.builtInEncoding) { |
| 24846 |
adjustType1ToUnicode(properties, properties.builtInEncoding); |
| 24847 |
} |
| 24848 |
let glyphZeroId = 1; |
| 24849 |
if (font instanceof CFFFont) { |
| 24850 |
glyphZeroId = font.numGlyphs - 1; |
| 24851 |
} |
| 24852 |
const mapping = font.getGlyphMapping(properties); |
| 24853 |
let newMapping = null; |
| 24854 |
let newCharCodeToGlyphId = mapping; |
| 24855 |
let toUnicodeExtraMap = null; |
| 24856 |
if (!properties.cssFontInfo) { |
| 24857 |
newMapping = adjustMapping(mapping, font.hasGlyphId.bind(font), glyphZeroId, this.toUnicode); |
| 24858 |
this.toFontChar = newMapping.toFontChar; |
| 24859 |
newCharCodeToGlyphId = newMapping.charCodeToGlyphId; |
| 24860 |
toUnicodeExtraMap = newMapping.toUnicodeExtraMap; |
| 24861 |
} |
| 24862 |
const numGlyphs = font.numGlyphs; |
| 24863 |
function getCharCodes(charCodeToGlyphId, glyphId) { |
| 24864 |
let charCodes = null; |
| 24865 |
for (const charCode in charCodeToGlyphId) { |
| 24866 |
if (glyphId === charCodeToGlyphId[charCode]) { |
| 24867 |
(charCodes ||= []).push(charCode | 0); |
| 24868 |
} |
| 24869 |
} |
| 24870 |
return charCodes; |
| 24871 |
} |
| 24872 |
function createCharCode(charCodeToGlyphId, glyphId) { |
| 24873 |
for (const charCode in charCodeToGlyphId) { |
| 24874 |
if (glyphId === charCodeToGlyphId[charCode]) { |
| 24875 |
return charCode | 0; |
| 24876 |
} |
| 24877 |
} |
| 24878 |
newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = glyphId; |
| 24879 |
return newMapping.nextAvailableFontCharCode++; |
| 24880 |
} |
| 24881 |
const seacs = font.seacs; |
| 24882 |
if (newMapping && SEAC_ANALYSIS_ENABLED && seacs?.length) { |
| 24883 |
const matrix = properties.fontMatrix || FONT_IDENTITY_MATRIX; |
| 24884 |
const charset = font.getCharset(); |
| 24885 |
const seacMap = Object.create(null); |
| 24886 |
for (let glyphId in seacs) { |
| 24887 |
glyphId |= 0; |
| 24888 |
const seac = seacs[glyphId]; |
| 24889 |
const baseGlyphName = StandardEncoding[seac[2]]; |
| 24890 |
const accentGlyphName = StandardEncoding[seac[3]]; |
| 24891 |
const baseGlyphId = charset.indexOf(baseGlyphName); |
| 24892 |
const accentGlyphId = charset.indexOf(accentGlyphName); |
| 24893 |
if (baseGlyphId < 0 || accentGlyphId < 0) { |
| 24894 |
continue; |
| 24895 |
} |
| 24896 |
const accentOffset = { |
| 24897 |
x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4], |
| 24898 |
y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5] |
| 24899 |
}; |
| 24900 |
const charCodes = getCharCodes(mapping, glyphId); |
| 24901 |
if (!charCodes) { |
| 24902 |
continue; |
| 24903 |
} |
| 24904 |
for (const charCode of charCodes) { |
| 24905 |
const charCodeToGlyphId = newMapping.charCodeToGlyphId; |
| 24906 |
const baseFontCharCode = createCharCode(charCodeToGlyphId, baseGlyphId); |
| 24907 |
const accentFontCharCode = createCharCode(charCodeToGlyphId, accentGlyphId); |
| 24908 |
seacMap[charCode] = { |
| 24909 |
baseFontCharCode, |
| 24910 |
accentFontCharCode, |
| 24911 |
accentOffset |
| 24912 |
}; |
| 24913 |
} |
| 24914 |
} |
| 24915 |
properties.seacMap = seacMap; |
| 24916 |
} |
| 24917 |
const unitsPerEm = properties.fontMatrix ? 1 / Math.max(...properties.fontMatrix.slice(0, 4).map(Math.abs)) : 1000; |
| 24918 |
const builder = new OpenTypeFileBuilder("\x4F\x54\x54\x4F"); |
| 24919 |
builder.addTable("CFF ", font.data); |
| 24920 |
builder.addTable("OS/2", createOS2Table(properties, newCharCodeToGlyphId)); |
| 24921 |
builder.addTable("cmap", createCmapTable(newCharCodeToGlyphId, toUnicodeExtraMap, numGlyphs)); |
| 24922 |
builder.addTable("head", "\x00\x01\x00\x00" + "\x00\x00\x10\x00" + "\x00\x00\x00\x00" + "\x5F\x0F\x3C\xF5" + "\x00\x00" + safeString16(unitsPerEm) + "\x00\x00\x00\x00\x9e\x0b\x7e\x27" + "\x00\x00\x00\x00\x9e\x0b\x7e\x27" + "\x00\x00" + safeString16(properties.descent) + "\x0F\xFF" + safeString16(properties.ascent) + string16(properties.italicAngle ? 2 : 0) + "\x00\x11" + "\x00\x00" + "\x00\x00" + "\x00\x00"); |
| 24923 |
builder.addTable("hhea", "\x00\x01\x00\x00" + safeString16(properties.ascent) + safeString16(properties.descent) + "\x00\x00" + "\xFF\xFF" + "\x00\x00" + "\x00\x00" + "\x00\x00" + safeString16(properties.capHeight) + safeString16(Math.tan(properties.italicAngle) * properties.xHeight) + "\x00\x00" + "\x00\x00" + "\x00\x00" + "\x00\x00" + "\x00\x00" + "\x00\x00" + string16(numGlyphs)); |
| 24924 |
builder.addTable("hmtx", function fontFieldsHmtx() { |
| 24925 |
const charstrings = font.charstrings; |
| 24926 |
const cffWidths = font.cff ? font.cff.widths : null; |
| 24927 |
let hmtx = "\x00\x00\x00\x00"; |
| 24928 |
for (let i = 1, ii = numGlyphs; i < ii; i++) { |
| 24929 |
let width = 0; |
| 24930 |
if (charstrings) { |
| 24931 |
const charstring = charstrings[i - 1]; |
| 24932 |
width = "width" in charstring ? charstring.width : 0; |
| 24933 |
} else if (cffWidths) { |
| 24934 |
width = Math.ceil(cffWidths[i] || 0); |
| 24935 |
} |
| 24936 |
hmtx += string16(width) + string16(0); |
| 24937 |
} |
| 24938 |
return hmtx; |
| 24939 |
}()); |
| 24940 |
builder.addTable("maxp", "\x00\x00\x50\x00" + string16(numGlyphs)); |
| 24941 |
builder.addTable("name", createNameTable(fontName)); |
| 24942 |
builder.addTable("post", createPostTable(properties)); |
| 24943 |
return builder.toArray(); |
| 24944 |
} |
| 24945 |
get _spaceWidth() { |
| 24946 |
const possibleSpaceReplacements = ["space", "minus", "one", "i", "I"]; |
| 24947 |
let width; |
| 24948 |
for (const glyphName of possibleSpaceReplacements) { |
| 24949 |
if (glyphName in this.widths) { |
| 24950 |
width = this.widths[glyphName]; |
| 24951 |
break; |
| 24952 |
} |
| 24953 |
const glyphsUnicodeMap = getGlyphsUnicode(); |
| 24954 |
const glyphUnicode = glyphsUnicodeMap[glyphName]; |
| 24955 |
let charcode = 0; |
| 24956 |
if (this.composite && this.cMap.contains(glyphUnicode)) { |
| 24957 |
charcode = this.cMap.lookup(glyphUnicode); |
| 24958 |
if (typeof charcode === "string") { |
| 24959 |
charcode = convertCidString(glyphUnicode, charcode); |
| 24960 |
} |
| 24961 |
} |
| 24962 |
if (!charcode && this.toUnicode) { |
| 24963 |
charcode = this.toUnicode.charCodeOf(glyphUnicode); |
| 24964 |
} |
| 24965 |
if (charcode <= 0) { |
| 24966 |
charcode = glyphUnicode; |
| 24967 |
} |
| 24968 |
width = this.widths[charcode]; |
| 24969 |
if (width) { |
| 24970 |
break; |
| 24971 |
} |
| 24972 |
} |
| 24973 |
return shadow(this, "_spaceWidth", width || this.defaultWidth); |
| 24974 |
} |
| 24975 |
_charToGlyph(charcode, isSpace = false) { |
| 24976 |
let glyph = this._glyphCache[charcode]; |
| 24977 |
if (glyph?.isSpace === isSpace) { |
| 24978 |
return glyph; |
| 24979 |
} |
| 24980 |
let fontCharCode, width, operatorListId; |
| 24981 |
let widthCode = charcode; |
| 24982 |
if (this.cMap?.contains(charcode)) { |
| 24983 |
widthCode = this.cMap.lookup(charcode); |
| 24984 |
if (typeof widthCode === "string") { |
| 24985 |
widthCode = convertCidString(charcode, widthCode); |
| 24986 |
} |
| 24987 |
} |
| 24988 |
width = this.widths[widthCode]; |
| 24989 |
if (typeof width !== "number") { |
| 24990 |
width = this.defaultWidth; |
| 24991 |
} |
| 24992 |
const vmetric = this.vmetrics?.[widthCode]; |
| 24993 |
let unicode = this.toUnicode.get(charcode) || charcode; |
| 24994 |
if (typeof unicode === "number") { |
| 24995 |
unicode = String.fromCharCode(unicode); |
| 24996 |
} |
| 24997 |
let isInFont = this.toFontChar[charcode] !== undefined; |
| 24998 |
fontCharCode = this.toFontChar[charcode] || charcode; |
| 24999 |
if (this.missingFile) { |
| 25000 |
const glyphName = this.differences[charcode] || this.defaultEncoding[charcode]; |
| 25001 |
if ((glyphName === ".notdef" || glyphName === "") && this.type === "Type1") { |
| 25002 |
fontCharCode = 0x20; |
| 25003 |
if (glyphName === "") { |
| 25004 |
width ||= this._spaceWidth; |
| 25005 |
unicode = String.fromCharCode(fontCharCode); |
| 25006 |
} |
| 25007 |
} |
| 25008 |
fontCharCode = mapSpecialUnicodeValues(fontCharCode); |
| 25009 |
} |
| 25010 |
if (this.isType3Font) { |
| 25011 |
operatorListId = fontCharCode; |
| 25012 |
} |
| 25013 |
let accent = null; |
| 25014 |
if (this.seacMap?.[charcode]) { |
| 25015 |
isInFont = true; |
| 25016 |
const seac = this.seacMap[charcode]; |
| 25017 |
fontCharCode = seac.baseFontCharCode; |
| 25018 |
accent = { |
| 25019 |
fontChar: String.fromCodePoint(seac.accentFontCharCode), |
| 25020 |
offset: seac.accentOffset |
| 25021 |
}; |
| 25022 |
} |
| 25023 |
let fontChar = ""; |
| 25024 |
if (typeof fontCharCode === "number") { |
| 25025 |
if (fontCharCode <= 0x10ffff) { |
| 25026 |
fontChar = String.fromCodePoint(fontCharCode); |
| 25027 |
} else { |
| 25028 |
warn(`charToGlyph - invalid fontCharCode: ${fontCharCode}`); |
| 25029 |
} |
| 25030 |
} |
| 25031 |
if (this.missingFile && this.vertical && fontChar.length === 1) { |
| 25032 |
const vertical = getVerticalPresentationForm()[fontChar.charCodeAt(0)]; |
| 25033 |
if (vertical) { |
| 25034 |
fontChar = unicode = String.fromCharCode(vertical); |
| 25035 |
} |
| 25036 |
} |
| 25037 |
glyph = new fonts_Glyph(charcode, fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont); |
| 25038 |
return this._glyphCache[charcode] = glyph; |
| 25039 |
} |
| 25040 |
charsToGlyphs(chars) { |
| 25041 |
let glyphs = this._charsCache[chars]; |
| 25042 |
if (glyphs) { |
| 25043 |
return glyphs; |
| 25044 |
} |
| 25045 |
glyphs = []; |
| 25046 |
if (this.cMap) { |
| 25047 |
const c = Object.create(null), |
| 25048 |
ii = chars.length; |
| 25049 |
let i = 0; |
| 25050 |
while (i < ii) { |
| 25051 |
this.cMap.readCharCode(chars, i, c); |
| 25052 |
const { |
| 25053 |
charcode, |
| 25054 |
length |
| 25055 |
} = c; |
| 25056 |
i += length; |
| 25057 |
const glyph = this._charToGlyph(charcode, length === 1 && chars.charCodeAt(i - 1) === 0x20); |
| 25058 |
glyphs.push(glyph); |
| 25059 |
} |
| 25060 |
} else { |
| 25061 |
for (let i = 0, ii = chars.length; i < ii; ++i) { |
| 25062 |
const charcode = chars.charCodeAt(i); |
| 25063 |
const glyph = this._charToGlyph(charcode, charcode === 0x20); |
| 25064 |
glyphs.push(glyph); |
| 25065 |
} |
| 25066 |
} |
| 25067 |
return this._charsCache[chars] = glyphs; |
| 25068 |
} |
| 25069 |
getCharPositions(chars) { |
| 25070 |
const positions = []; |
| 25071 |
if (this.cMap) { |
| 25072 |
const c = Object.create(null); |
| 25073 |
let i = 0; |
| 25074 |
while (i < chars.length) { |
| 25075 |
this.cMap.readCharCode(chars, i, c); |
| 25076 |
const length = c.length; |
| 25077 |
positions.push([i, i + length]); |
| 25078 |
i += length; |
| 25079 |
} |
| 25080 |
} else { |
| 25081 |
for (let i = 0, ii = chars.length; i < ii; ++i) { |
| 25082 |
positions.push([i, i + 1]); |
| 25083 |
} |
| 25084 |
} |
| 25085 |
return positions; |
| 25086 |
} |
| 25087 |
get glyphCacheValues() { |
| 25088 |
return Object.values(this._glyphCache); |
| 25089 |
} |
| 25090 |
encodeString(str) { |
| 25091 |
const buffers = []; |
| 25092 |
const currentBuf = []; |
| 25093 |
const hasCurrentBufErrors = () => buffers.length % 2 === 1; |
| 25094 |
const getCharCode = this.toUnicode instanceof IdentityToUnicodeMap ? unicode => this.toUnicode.charCodeOf(unicode) : unicode => this.toUnicode.charCodeOf(String.fromCodePoint(unicode)); |
| 25095 |
for (let i = 0, ii = str.length; i < ii; i++) { |
| 25096 |
const unicode = str.codePointAt(i); |
| 25097 |
if (unicode > 0xd7ff && (unicode < 0xe000 || unicode > 0xfffd)) { |
| 25098 |
i++; |
| 25099 |
} |
| 25100 |
if (this.toUnicode) { |
| 25101 |
const charCode = getCharCode(unicode); |
| 25102 |
if (charCode !== -1) { |
| 25103 |
if (hasCurrentBufErrors()) { |
| 25104 |
buffers.push(currentBuf.join("")); |
| 25105 |
currentBuf.length = 0; |
| 25106 |
} |
| 25107 |
const charCodeLength = this.cMap ? this.cMap.getCharCodeLength(charCode) : 1; |
| 25108 |
for (let j = charCodeLength - 1; j >= 0; j--) { |
| 25109 |
currentBuf.push(String.fromCharCode(charCode >> 8 * j & 0xff)); |
| 25110 |
} |
| 25111 |
continue; |
| 25112 |
} |
| 25113 |
} |
| 25114 |
if (!hasCurrentBufErrors()) { |
| 25115 |
buffers.push(currentBuf.join("")); |
| 25116 |
currentBuf.length = 0; |
| 25117 |
} |
| 25118 |
currentBuf.push(String.fromCodePoint(unicode)); |
| 25119 |
} |
| 25120 |
buffers.push(currentBuf.join("")); |
| 25121 |
return buffers; |
| 25122 |
} |
| 25123 |
} |
| 25124 |
class ErrorFont { |
| 25125 |
constructor(error) { |
| 25126 |
this.error = error; |
| 25127 |
this.loadedName = "g_font_error"; |
| 25128 |
this.missingFile = true; |
| 25129 |
} |
| 25130 |
charsToGlyphs() { |
| 25131 |
return []; |
| 25132 |
} |
| 25133 |
encodeString(chars) { |
| 25134 |
return [chars]; |
| 25135 |
} |
| 25136 |
exportData(extraProperties = false) { |
| 25137 |
return { |
| 25138 |
error: this.error |
| 25139 |
}; |
| 25140 |
} |
| 25141 |
} |
| 25142 |
|
| 25143 |
;// ./src/core/pattern.js |
| 25144 |
|
| 25145 |
|
| 25146 |
|
| 25147 |
|
| 25148 |
const ShadingType = { |
| 25149 |
FUNCTION_BASED: 1, |
| 25150 |
AXIAL: 2, |
| 25151 |
RADIAL: 3, |
| 25152 |
FREE_FORM_MESH: 4, |
| 25153 |
LATTICE_FORM_MESH: 5, |
| 25154 |
COONS_PATCH_MESH: 6, |
| 25155 |
TENSOR_PATCH_MESH: 7 |
| 25156 |
}; |
| 25157 |
class Pattern { |
| 25158 |
constructor() { |
| 25159 |
unreachable("Cannot initialize Pattern."); |
| 25160 |
} |
| 25161 |
static parseShading(shading, xref, res, pdfFunctionFactory, localColorSpaceCache) { |
| 25162 |
const dict = shading instanceof BaseStream ? shading.dict : shading; |
| 25163 |
const type = dict.get("ShadingType"); |
| 25164 |
try { |
| 25165 |
switch (type) { |
| 25166 |
case ShadingType.AXIAL: |
| 25167 |
case ShadingType.RADIAL: |
| 25168 |
return new RadialAxialShading(dict, xref, res, pdfFunctionFactory, localColorSpaceCache); |
| 25169 |
case ShadingType.FREE_FORM_MESH: |
| 25170 |
case ShadingType.LATTICE_FORM_MESH: |
| 25171 |
case ShadingType.COONS_PATCH_MESH: |
| 25172 |
case ShadingType.TENSOR_PATCH_MESH: |
| 25173 |
return new MeshShading(shading, xref, res, pdfFunctionFactory, localColorSpaceCache); |
| 25174 |
default: |
| 25175 |
throw new FormatError("Unsupported ShadingType: " + type); |
| 25176 |
} |
| 25177 |
} catch (ex) { |
| 25178 |
if (ex instanceof MissingDataException) { |
| 25179 |
throw ex; |
| 25180 |
} |
| 25181 |
warn(ex); |
| 25182 |
return new DummyShading(); |
| 25183 |
} |
| 25184 |
} |
| 25185 |
} |
| 25186 |
class BaseShading { |
| 25187 |
static SMALL_NUMBER = 1e-6; |
| 25188 |
getIR() { |
| 25189 |
unreachable("Abstract method `getIR` called."); |
| 25190 |
} |
| 25191 |
} |
| 25192 |
class RadialAxialShading extends BaseShading { |
| 25193 |
constructor(dict, xref, resources, pdfFunctionFactory, localColorSpaceCache) { |
| 25194 |
super(); |
| 25195 |
this.shadingType = dict.get("ShadingType"); |
| 25196 |
let coordsLen = 0; |
| 25197 |
if (this.shadingType === ShadingType.AXIAL) { |
| 25198 |
coordsLen = 4; |
| 25199 |
} else if (this.shadingType === ShadingType.RADIAL) { |
| 25200 |
coordsLen = 6; |
| 25201 |
} |
| 25202 |
this.coordsArr = dict.getArray("Coords"); |
| 25203 |
if (!isNumberArray(this.coordsArr, coordsLen)) { |
| 25204 |
throw new FormatError("RadialAxialShading: Invalid /Coords array."); |
| 25205 |
} |
| 25206 |
const cs = ColorSpace.parse({ |
| 25207 |
cs: dict.getRaw("CS") || dict.getRaw("ColorSpace"), |
| 25208 |
xref, |
| 25209 |
resources, |
| 25210 |
pdfFunctionFactory, |
| 25211 |
localColorSpaceCache |
| 25212 |
}); |
| 25213 |
this.bbox = lookupNormalRect(dict.getArray("BBox"), null); |
| 25214 |
let t0 = 0.0, |
| 25215 |
t1 = 1.0; |
| 25216 |
const domainArr = dict.getArray("Domain"); |
| 25217 |
if (isNumberArray(domainArr, 2)) { |
| 25218 |
[t0, t1] = domainArr; |
| 25219 |
} |
| 25220 |
let extendStart = false, |
| 25221 |
extendEnd = false; |
| 25222 |
const extendArr = dict.getArray("Extend"); |
| 25223 |
if (isBooleanArray(extendArr, 2)) { |
| 25224 |
[extendStart, extendEnd] = extendArr; |
| 25225 |
} |
| 25226 |
if (this.shadingType === ShadingType.RADIAL && (!extendStart || !extendEnd)) { |
| 25227 |
const [x1, y1, r1, x2, y2, r2] = this.coordsArr; |
| 25228 |
const distance = Math.hypot(x1 - x2, y1 - y2); |
| 25229 |
if (r1 <= r2 + distance && r2 <= r1 + distance) { |
| 25230 |
warn("Unsupported radial gradient."); |
| 25231 |
} |
| 25232 |
} |
| 25233 |
this.extendStart = extendStart; |
| 25234 |
this.extendEnd = extendEnd; |
| 25235 |
const fnObj = dict.getRaw("Function"); |
| 25236 |
const fn = pdfFunctionFactory.createFromArray(fnObj); |
| 25237 |
const NUMBER_OF_SAMPLES = 840; |
| 25238 |
const step = (t1 - t0) / NUMBER_OF_SAMPLES; |
| 25239 |
const colorStops = this.colorStops = []; |
| 25240 |
if (t0 >= t1 || step <= 0) { |
| 25241 |
info("Bad shading domain."); |
| 25242 |
return; |
| 25243 |
} |
| 25244 |
const color = new Float32Array(cs.numComps), |
| 25245 |
ratio = new Float32Array(1); |
| 25246 |
let rgbColor; |
| 25247 |
let iBase = 0; |
| 25248 |
ratio[0] = t0; |
| 25249 |
fn(ratio, 0, color, 0); |
| 25250 |
let rgbBase = cs.getRgb(color, 0); |
| 25251 |
const cssColorBase = Util.makeHexColor(rgbBase[0], rgbBase[1], rgbBase[2]); |
| 25252 |
colorStops.push([0, cssColorBase]); |
| 25253 |
let iPrev = 1; |
| 25254 |
ratio[0] = t0 + step; |
| 25255 |
fn(ratio, 0, color, 0); |
| 25256 |
let rgbPrev = cs.getRgb(color, 0); |
| 25257 |
let maxSlopeR = rgbPrev[0] - rgbBase[0] + 1; |
| 25258 |
let maxSlopeG = rgbPrev[1] - rgbBase[1] + 1; |
| 25259 |
let maxSlopeB = rgbPrev[2] - rgbBase[2] + 1; |
| 25260 |
let minSlopeR = rgbPrev[0] - rgbBase[0] - 1; |
| 25261 |
let minSlopeG = rgbPrev[1] - rgbBase[1] - 1; |
| 25262 |
let minSlopeB = rgbPrev[2] - rgbBase[2] - 1; |
| 25263 |
for (let i = 2; i < NUMBER_OF_SAMPLES; i++) { |
| 25264 |
ratio[0] = t0 + i * step; |
| 25265 |
fn(ratio, 0, color, 0); |
| 25266 |
rgbColor = cs.getRgb(color, 0); |
| 25267 |
const run = i - iBase; |
| 25268 |
maxSlopeR = Math.min(maxSlopeR, (rgbColor[0] - rgbBase[0] + 1) / run); |
| 25269 |
maxSlopeG = Math.min(maxSlopeG, (rgbColor[1] - rgbBase[1] + 1) / run); |
| 25270 |
maxSlopeB = Math.min(maxSlopeB, (rgbColor[2] - rgbBase[2] + 1) / run); |
| 25271 |
minSlopeR = Math.max(minSlopeR, (rgbColor[0] - rgbBase[0] - 1) / run); |
| 25272 |
minSlopeG = Math.max(minSlopeG, (rgbColor[1] - rgbBase[1] - 1) / run); |
| 25273 |
minSlopeB = Math.max(minSlopeB, (rgbColor[2] - rgbBase[2] - 1) / run); |
| 25274 |
const slopesExist = minSlopeR <= maxSlopeR && minSlopeG <= maxSlopeG && minSlopeB <= maxSlopeB; |
| 25275 |
if (!slopesExist) { |
| 25276 |
const cssColor = Util.makeHexColor(rgbPrev[0], rgbPrev[1], rgbPrev[2]); |
| 25277 |
colorStops.push([iPrev / NUMBER_OF_SAMPLES, cssColor]); |
| 25278 |
maxSlopeR = rgbColor[0] - rgbPrev[0] + 1; |
| 25279 |
maxSlopeG = rgbColor[1] - rgbPrev[1] + 1; |
| 25280 |
maxSlopeB = rgbColor[2] - rgbPrev[2] + 1; |
| 25281 |
minSlopeR = rgbColor[0] - rgbPrev[0] - 1; |
| 25282 |
minSlopeG = rgbColor[1] - rgbPrev[1] - 1; |
| 25283 |
minSlopeB = rgbColor[2] - rgbPrev[2] - 1; |
| 25284 |
iBase = iPrev; |
| 25285 |
rgbBase = rgbPrev; |
| 25286 |
} |
| 25287 |
iPrev = i; |
| 25288 |
rgbPrev = rgbColor; |
| 25289 |
} |
| 25290 |
const cssColor = Util.makeHexColor(rgbPrev[0], rgbPrev[1], rgbPrev[2]); |
| 25291 |
colorStops.push([1, cssColor]); |
| 25292 |
let background = "transparent"; |
| 25293 |
if (dict.has("Background")) { |
| 25294 |
rgbColor = cs.getRgb(dict.get("Background"), 0); |
| 25295 |
background = Util.makeHexColor(rgbColor[0], rgbColor[1], rgbColor[2]); |
| 25296 |
} |
| 25297 |
if (!extendStart) { |
| 25298 |
colorStops.unshift([0, background]); |
| 25299 |
colorStops[1][0] += BaseShading.SMALL_NUMBER; |
| 25300 |
} |
| 25301 |
if (!extendEnd) { |
| 25302 |
colorStops.at(-1)[0] -= BaseShading.SMALL_NUMBER; |
| 25303 |
colorStops.push([1, background]); |
| 25304 |
} |
| 25305 |
this.colorStops = colorStops; |
| 25306 |
} |
| 25307 |
getIR() { |
| 25308 |
const { |
| 25309 |
coordsArr, |
| 25310 |
shadingType |
| 25311 |
} = this; |
| 25312 |
let type, p0, p1, r0, r1; |
| 25313 |
if (shadingType === ShadingType.AXIAL) { |
| 25314 |
p0 = [coordsArr[0], coordsArr[1]]; |
| 25315 |
p1 = [coordsArr[2], coordsArr[3]]; |
| 25316 |
r0 = null; |
| 25317 |
r1 = null; |
| 25318 |
type = "axial"; |
| 25319 |
} else if (shadingType === ShadingType.RADIAL) { |
| 25320 |
p0 = [coordsArr[0], coordsArr[1]]; |
| 25321 |
p1 = [coordsArr[3], coordsArr[4]]; |
| 25322 |
r0 = coordsArr[2]; |
| 25323 |
r1 = coordsArr[5]; |
| 25324 |
type = "radial"; |
| 25325 |
} else { |
| 25326 |
unreachable(`getPattern type unknown: ${shadingType}`); |
| 25327 |
} |
| 25328 |
return ["RadialAxial", type, this.bbox, this.colorStops, p0, p1, r0, r1]; |
| 25329 |
} |
| 25330 |
} |
| 25331 |
class MeshStreamReader { |
| 25332 |
constructor(stream, context) { |
| 25333 |
this.stream = stream; |
| 25334 |
this.context = context; |
| 25335 |
this.buffer = 0; |
| 25336 |
this.bufferLength = 0; |
| 25337 |
const numComps = context.numComps; |
| 25338 |
this.tmpCompsBuf = new Float32Array(numComps); |
| 25339 |
const csNumComps = context.colorSpace.numComps; |
| 25340 |
this.tmpCsCompsBuf = context.colorFn ? new Float32Array(csNumComps) : this.tmpCompsBuf; |
| 25341 |
} |
| 25342 |
get hasData() { |
| 25343 |
if (this.stream.end) { |
| 25344 |
return this.stream.pos < this.stream.end; |
| 25345 |
} |
| 25346 |
if (this.bufferLength > 0) { |
| 25347 |
return true; |
| 25348 |
} |
| 25349 |
const nextByte = this.stream.getByte(); |
| 25350 |
if (nextByte < 0) { |
| 25351 |
return false; |
| 25352 |
} |
| 25353 |
this.buffer = nextByte; |
| 25354 |
this.bufferLength = 8; |
| 25355 |
return true; |
| 25356 |
} |
| 25357 |
readBits(n) { |
| 25358 |
let buffer = this.buffer; |
| 25359 |
let bufferLength = this.bufferLength; |
| 25360 |
if (n === 32) { |
| 25361 |
if (bufferLength === 0) { |
| 25362 |
return (this.stream.getByte() << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte()) >>> 0; |
| 25363 |
} |
| 25364 |
buffer = buffer << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte(); |
| 25365 |
const nextByte = this.stream.getByte(); |
| 25366 |
this.buffer = nextByte & (1 << bufferLength) - 1; |
| 25367 |
return (buffer << 8 - bufferLength | (nextByte & 0xff) >> bufferLength) >>> 0; |
| 25368 |
} |
| 25369 |
if (n === 8 && bufferLength === 0) { |
| 25370 |
return this.stream.getByte(); |
| 25371 |
} |
| 25372 |
while (bufferLength < n) { |
| 25373 |
buffer = buffer << 8 | this.stream.getByte(); |
| 25374 |
bufferLength += 8; |
| 25375 |
} |
| 25376 |
bufferLength -= n; |
| 25377 |
this.bufferLength = bufferLength; |
| 25378 |
this.buffer = buffer & (1 << bufferLength) - 1; |
| 25379 |
return buffer >> bufferLength; |
| 25380 |
} |
| 25381 |
align() { |
| 25382 |
this.buffer = 0; |
| 25383 |
this.bufferLength = 0; |
| 25384 |
} |
| 25385 |
readFlag() { |
| 25386 |
return this.readBits(this.context.bitsPerFlag); |
| 25387 |
} |
| 25388 |
readCoordinate() { |
| 25389 |
const bitsPerCoordinate = this.context.bitsPerCoordinate; |
| 25390 |
const xi = this.readBits(bitsPerCoordinate); |
| 25391 |
const yi = this.readBits(bitsPerCoordinate); |
| 25392 |
const decode = this.context.decode; |
| 25393 |
const scale = bitsPerCoordinate < 32 ? 1 / ((1 << bitsPerCoordinate) - 1) : 2.3283064365386963e-10; |
| 25394 |
return [xi * scale * (decode[1] - decode[0]) + decode[0], yi * scale * (decode[3] - decode[2]) + decode[2]]; |
| 25395 |
} |
| 25396 |
readComponents() { |
| 25397 |
const numComps = this.context.numComps; |
| 25398 |
const bitsPerComponent = this.context.bitsPerComponent; |
| 25399 |
const scale = bitsPerComponent < 32 ? 1 / ((1 << bitsPerComponent) - 1) : 2.3283064365386963e-10; |
| 25400 |
const decode = this.context.decode; |
| 25401 |
const components = this.tmpCompsBuf; |
| 25402 |
for (let i = 0, j = 4; i < numComps; i++, j += 2) { |
| 25403 |
const ci = this.readBits(bitsPerComponent); |
| 25404 |
components[i] = ci * scale * (decode[j + 1] - decode[j]) + decode[j]; |
| 25405 |
} |
| 25406 |
const color = this.tmpCsCompsBuf; |
| 25407 |
if (this.context.colorFn) { |
| 25408 |
this.context.colorFn(components, 0, color, 0); |
| 25409 |
} |
| 25410 |
return this.context.colorSpace.getRgb(color, 0); |
| 25411 |
} |
| 25412 |
} |
| 25413 |
let bCache = Object.create(null); |
| 25414 |
function buildB(count) { |
| 25415 |
const lut = []; |
| 25416 |
for (let i = 0; i <= count; i++) { |
| 25417 |
const t = i / count, |
| 25418 |
t_ = 1 - t; |
| 25419 |
lut.push(new Float32Array([t_ ** 3, 3 * t * t_ ** 2, 3 * t ** 2 * t_, t ** 3])); |
| 25420 |
} |
| 25421 |
return lut; |
| 25422 |
} |
| 25423 |
function getB(count) { |
| 25424 |
return bCache[count] ||= buildB(count); |
| 25425 |
} |
| 25426 |
function clearPatternCaches() { |
| 25427 |
bCache = Object.create(null); |
| 25428 |
} |
| 25429 |
class MeshShading extends BaseShading { |
| 25430 |
static MIN_SPLIT_PATCH_CHUNKS_AMOUNT = 3; |
| 25431 |
static MAX_SPLIT_PATCH_CHUNKS_AMOUNT = 20; |
| 25432 |
static TRIANGLE_DENSITY = 20; |
| 25433 |
constructor(stream, xref, resources, pdfFunctionFactory, localColorSpaceCache) { |
| 25434 |
super(); |
| 25435 |
if (!(stream instanceof BaseStream)) { |
| 25436 |
throw new FormatError("Mesh data is not a stream"); |
| 25437 |
} |
| 25438 |
const dict = stream.dict; |
| 25439 |
this.shadingType = dict.get("ShadingType"); |
| 25440 |
this.bbox = lookupNormalRect(dict.getArray("BBox"), null); |
| 25441 |
const cs = ColorSpace.parse({ |
| 25442 |
cs: dict.getRaw("CS") || dict.getRaw("ColorSpace"), |
| 25443 |
xref, |
| 25444 |
resources, |
| 25445 |
pdfFunctionFactory, |
| 25446 |
localColorSpaceCache |
| 25447 |
}); |
| 25448 |
this.background = dict.has("Background") ? cs.getRgb(dict.get("Background"), 0) : null; |
| 25449 |
const fnObj = dict.getRaw("Function"); |
| 25450 |
const fn = fnObj ? pdfFunctionFactory.createFromArray(fnObj) : null; |
| 25451 |
this.coords = []; |
| 25452 |
this.colors = []; |
| 25453 |
this.figures = []; |
| 25454 |
const decodeContext = { |
| 25455 |
bitsPerCoordinate: dict.get("BitsPerCoordinate"), |
| 25456 |
bitsPerComponent: dict.get("BitsPerComponent"), |
| 25457 |
bitsPerFlag: dict.get("BitsPerFlag"), |
| 25458 |
decode: dict.getArray("Decode"), |
| 25459 |
colorFn: fn, |
| 25460 |
colorSpace: cs, |
| 25461 |
numComps: fn ? 1 : cs.numComps |
| 25462 |
}; |
| 25463 |
const reader = new MeshStreamReader(stream, decodeContext); |
| 25464 |
let patchMesh = false; |
| 25465 |
switch (this.shadingType) { |
| 25466 |
case ShadingType.FREE_FORM_MESH: |
| 25467 |
this._decodeType4Shading(reader); |
| 25468 |
break; |
| 25469 |
case ShadingType.LATTICE_FORM_MESH: |
| 25470 |
const verticesPerRow = dict.get("VerticesPerRow") | 0; |
| 25471 |
if (verticesPerRow < 2) { |
| 25472 |
throw new FormatError("Invalid VerticesPerRow"); |
| 25473 |
} |
| 25474 |
this._decodeType5Shading(reader, verticesPerRow); |
| 25475 |
break; |
| 25476 |
case ShadingType.COONS_PATCH_MESH: |
| 25477 |
this._decodeType6Shading(reader); |
| 25478 |
patchMesh = true; |
| 25479 |
break; |
| 25480 |
case ShadingType.TENSOR_PATCH_MESH: |
| 25481 |
this._decodeType7Shading(reader); |
| 25482 |
patchMesh = true; |
| 25483 |
break; |
| 25484 |
default: |
| 25485 |
unreachable("Unsupported mesh type."); |
| 25486 |
break; |
| 25487 |
} |
| 25488 |
if (patchMesh) { |
| 25489 |
this._updateBounds(); |
| 25490 |
for (let i = 0, ii = this.figures.length; i < ii; i++) { |
| 25491 |
this._buildFigureFromPatch(i); |
| 25492 |
} |
| 25493 |
} |
| 25494 |
this._updateBounds(); |
| 25495 |
this._packData(); |
| 25496 |
} |
| 25497 |
_decodeType4Shading(reader) { |
| 25498 |
const coords = this.coords; |
| 25499 |
const colors = this.colors; |
| 25500 |
const operators = []; |
| 25501 |
const ps = []; |
| 25502 |
let verticesLeft = 0; |
| 25503 |
while (reader.hasData) { |
| 25504 |
const f = reader.readFlag(); |
| 25505 |
const coord = reader.readCoordinate(); |
| 25506 |
const color = reader.readComponents(); |
| 25507 |
if (verticesLeft === 0) { |
| 25508 |
if (!(0 <= f && f <= 2)) { |
| 25509 |
throw new FormatError("Unknown type4 flag"); |
| 25510 |
} |
| 25511 |
switch (f) { |
| 25512 |
case 0: |
| 25513 |
verticesLeft = 3; |
| 25514 |
break; |
| 25515 |
case 1: |
| 25516 |
ps.push(ps.at(-2), ps.at(-1)); |
| 25517 |
verticesLeft = 1; |
| 25518 |
break; |
| 25519 |
case 2: |
| 25520 |
ps.push(ps.at(-3), ps.at(-1)); |
| 25521 |
verticesLeft = 1; |
| 25522 |
break; |
| 25523 |
} |
| 25524 |
operators.push(f); |
| 25525 |
} |
| 25526 |
ps.push(coords.length); |
| 25527 |
coords.push(coord); |
| 25528 |
colors.push(color); |
| 25529 |
verticesLeft--; |
| 25530 |
reader.align(); |
| 25531 |
} |
| 25532 |
this.figures.push({ |
| 25533 |
type: "triangles", |
| 25534 |
coords: new Int32Array(ps), |
| 25535 |
colors: new Int32Array(ps) |
| 25536 |
}); |
| 25537 |
} |
| 25538 |
_decodeType5Shading(reader, verticesPerRow) { |
| 25539 |
const coords = this.coords; |
| 25540 |
const colors = this.colors; |
| 25541 |
const ps = []; |
| 25542 |
while (reader.hasData) { |
| 25543 |
const coord = reader.readCoordinate(); |
| 25544 |
const color = reader.readComponents(); |
| 25545 |
ps.push(coords.length); |
| 25546 |
coords.push(coord); |
| 25547 |
colors.push(color); |
| 25548 |
} |
| 25549 |
this.figures.push({ |
| 25550 |
type: "lattice", |
| 25551 |
coords: new Int32Array(ps), |
| 25552 |
colors: new Int32Array(ps), |
| 25553 |
verticesPerRow |
| 25554 |
}); |
| 25555 |
} |
| 25556 |
_decodeType6Shading(reader) { |
| 25557 |
const coords = this.coords; |
| 25558 |
const colors = this.colors; |
| 25559 |
const ps = new Int32Array(16); |
| 25560 |
const cs = new Int32Array(4); |
| 25561 |
while (reader.hasData) { |
| 25562 |
const f = reader.readFlag(); |
| 25563 |
if (!(0 <= f && f <= 3)) { |
| 25564 |
throw new FormatError("Unknown type6 flag"); |
| 25565 |
} |
| 25566 |
const pi = coords.length; |
| 25567 |
for (let i = 0, ii = f !== 0 ? 8 : 12; i < ii; i++) { |
| 25568 |
coords.push(reader.readCoordinate()); |
| 25569 |
} |
| 25570 |
const ci = colors.length; |
| 25571 |
for (let i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) { |
| 25572 |
colors.push(reader.readComponents()); |
| 25573 |
} |
| 25574 |
let tmp1, tmp2, tmp3, tmp4; |
| 25575 |
switch (f) { |
| 25576 |
case 0: |
| 25577 |
ps[12] = pi + 3; |
| 25578 |
ps[13] = pi + 4; |
| 25579 |
ps[14] = pi + 5; |
| 25580 |
ps[15] = pi + 6; |
| 25581 |
ps[8] = pi + 2; |
| 25582 |
ps[11] = pi + 7; |
| 25583 |
ps[4] = pi + 1; |
| 25584 |
ps[7] = pi + 8; |
| 25585 |
ps[0] = pi; |
| 25586 |
ps[1] = pi + 11; |
| 25587 |
ps[2] = pi + 10; |
| 25588 |
ps[3] = pi + 9; |
| 25589 |
cs[2] = ci + 1; |
| 25590 |
cs[3] = ci + 2; |
| 25591 |
cs[0] = ci; |
| 25592 |
cs[1] = ci + 3; |
| 25593 |
break; |
| 25594 |
case 1: |
| 25595 |
tmp1 = ps[12]; |
| 25596 |
tmp2 = ps[13]; |
| 25597 |
tmp3 = ps[14]; |
| 25598 |
tmp4 = ps[15]; |
| 25599 |
ps[12] = tmp4; |
| 25600 |
ps[13] = pi + 0; |
| 25601 |
ps[14] = pi + 1; |
| 25602 |
ps[15] = pi + 2; |
| 25603 |
ps[8] = tmp3; |
| 25604 |
ps[11] = pi + 3; |
| 25605 |
ps[4] = tmp2; |
| 25606 |
ps[7] = pi + 4; |
| 25607 |
ps[0] = tmp1; |
| 25608 |
ps[1] = pi + 7; |
| 25609 |
ps[2] = pi + 6; |
| 25610 |
ps[3] = pi + 5; |
| 25611 |
tmp1 = cs[2]; |
| 25612 |
tmp2 = cs[3]; |
| 25613 |
cs[2] = tmp2; |
| 25614 |
cs[3] = ci; |
| 25615 |
cs[0] = tmp1; |
| 25616 |
cs[1] = ci + 1; |
| 25617 |
break; |
| 25618 |
case 2: |
| 25619 |
tmp1 = ps[15]; |
| 25620 |
tmp2 = ps[11]; |
| 25621 |
ps[12] = ps[3]; |
| 25622 |
ps[13] = pi + 0; |
| 25623 |
ps[14] = pi + 1; |
| 25624 |
ps[15] = pi + 2; |
| 25625 |
ps[8] = ps[7]; |
| 25626 |
ps[11] = pi + 3; |
| 25627 |
ps[4] = tmp2; |
| 25628 |
ps[7] = pi + 4; |
| 25629 |
ps[0] = tmp1; |
| 25630 |
ps[1] = pi + 7; |
| 25631 |
ps[2] = pi + 6; |
| 25632 |
ps[3] = pi + 5; |
| 25633 |
tmp1 = cs[3]; |
| 25634 |
cs[2] = cs[1]; |
| 25635 |
cs[3] = ci; |
| 25636 |
cs[0] = tmp1; |
| 25637 |
cs[1] = ci + 1; |
| 25638 |
break; |
| 25639 |
case 3: |
| 25640 |
ps[12] = ps[0]; |
| 25641 |
ps[13] = pi + 0; |
| 25642 |
ps[14] = pi + 1; |
| 25643 |
ps[15] = pi + 2; |
| 25644 |
ps[8] = ps[1]; |
| 25645 |
ps[11] = pi + 3; |
| 25646 |
ps[4] = ps[2]; |
| 25647 |
ps[7] = pi + 4; |
| 25648 |
ps[0] = ps[3]; |
| 25649 |
ps[1] = pi + 7; |
| 25650 |
ps[2] = pi + 6; |
| 25651 |
ps[3] = pi + 5; |
| 25652 |
cs[2] = cs[0]; |
| 25653 |
cs[3] = ci; |
| 25654 |
cs[0] = cs[1]; |
| 25655 |
cs[1] = ci + 1; |
| 25656 |
break; |
| 25657 |
} |
| 25658 |
ps[5] = coords.length; |
| 25659 |
coords.push([(-4 * coords[ps[0]][0] - coords[ps[15]][0] + 6 * (coords[ps[4]][0] + coords[ps[1]][0]) - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + 3 * (coords[ps[13]][0] + coords[ps[7]][0])) / 9, (-4 * coords[ps[0]][1] - coords[ps[15]][1] + 6 * (coords[ps[4]][1] + coords[ps[1]][1]) - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + 3 * (coords[ps[13]][1] + coords[ps[7]][1])) / 9]); |
| 25660 |
ps[6] = coords.length; |
| 25661 |
coords.push([(-4 * coords[ps[3]][0] - coords[ps[12]][0] + 6 * (coords[ps[2]][0] + coords[ps[7]][0]) - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + 3 * (coords[ps[4]][0] + coords[ps[14]][0])) / 9, (-4 * coords[ps[3]][1] - coords[ps[12]][1] + 6 * (coords[ps[2]][1] + coords[ps[7]][1]) - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + 3 * (coords[ps[4]][1] + coords[ps[14]][1])) / 9]); |
| 25662 |
ps[9] = coords.length; |
| 25663 |
coords.push([(-4 * coords[ps[12]][0] - coords[ps[3]][0] + 6 * (coords[ps[8]][0] + coords[ps[13]][0]) - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + 3 * (coords[ps[11]][0] + coords[ps[1]][0])) / 9, (-4 * coords[ps[12]][1] - coords[ps[3]][1] + 6 * (coords[ps[8]][1] + coords[ps[13]][1]) - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + 3 * (coords[ps[11]][1] + coords[ps[1]][1])) / 9]); |
| 25664 |
ps[10] = coords.length; |
| 25665 |
coords.push([(-4 * coords[ps[15]][0] - coords[ps[0]][0] + 6 * (coords[ps[11]][0] + coords[ps[14]][0]) - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + 3 * (coords[ps[2]][0] + coords[ps[8]][0])) / 9, (-4 * coords[ps[15]][1] - coords[ps[0]][1] + 6 * (coords[ps[11]][1] + coords[ps[14]][1]) - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + 3 * (coords[ps[2]][1] + coords[ps[8]][1])) / 9]); |
| 25666 |
this.figures.push({ |
| 25667 |
type: "patch", |
| 25668 |
coords: new Int32Array(ps), |
| 25669 |
colors: new Int32Array(cs) |
| 25670 |
}); |
| 25671 |
} |
| 25672 |
} |
| 25673 |
_decodeType7Shading(reader) { |
| 25674 |
const coords = this.coords; |
| 25675 |
const colors = this.colors; |
| 25676 |
const ps = new Int32Array(16); |
| 25677 |
const cs = new Int32Array(4); |
| 25678 |
while (reader.hasData) { |
| 25679 |
const f = reader.readFlag(); |
| 25680 |
if (!(0 <= f && f <= 3)) { |
| 25681 |
throw new FormatError("Unknown type7 flag"); |
| 25682 |
} |
| 25683 |
const pi = coords.length; |
| 25684 |
for (let i = 0, ii = f !== 0 ? 12 : 16; i < ii; i++) { |
| 25685 |
coords.push(reader.readCoordinate()); |
| 25686 |
} |
| 25687 |
const ci = colors.length; |
| 25688 |
for (let i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) { |
| 25689 |
colors.push(reader.readComponents()); |
| 25690 |
} |
| 25691 |
let tmp1, tmp2, tmp3, tmp4; |
| 25692 |
switch (f) { |
| 25693 |
case 0: |
| 25694 |
ps[12] = pi + 3; |
| 25695 |
ps[13] = pi + 4; |
| 25696 |
ps[14] = pi + 5; |
| 25697 |
ps[15] = pi + 6; |
| 25698 |
ps[8] = pi + 2; |
| 25699 |
ps[9] = pi + 13; |
| 25700 |
ps[10] = pi + 14; |
| 25701 |
ps[11] = pi + 7; |
| 25702 |
ps[4] = pi + 1; |
| 25703 |
ps[5] = pi + 12; |
| 25704 |
ps[6] = pi + 15; |
| 25705 |
ps[7] = pi + 8; |
| 25706 |
ps[0] = pi; |
| 25707 |
ps[1] = pi + 11; |
| 25708 |
ps[2] = pi + 10; |
| 25709 |
ps[3] = pi + 9; |
| 25710 |
cs[2] = ci + 1; |
| 25711 |
cs[3] = ci + 2; |
| 25712 |
cs[0] = ci; |
| 25713 |
cs[1] = ci + 3; |
| 25714 |
break; |
| 25715 |
case 1: |
| 25716 |
tmp1 = ps[12]; |
| 25717 |
tmp2 = ps[13]; |
| 25718 |
tmp3 = ps[14]; |
| 25719 |
tmp4 = ps[15]; |
| 25720 |
ps[12] = tmp4; |
| 25721 |
ps[13] = pi + 0; |
| 25722 |
ps[14] = pi + 1; |
| 25723 |
ps[15] = pi + 2; |
| 25724 |
ps[8] = tmp3; |
| 25725 |
ps[9] = pi + 9; |
| 25726 |
ps[10] = pi + 10; |
| 25727 |
ps[11] = pi + 3; |
| 25728 |
ps[4] = tmp2; |
| 25729 |
ps[5] = pi + 8; |
| 25730 |
ps[6] = pi + 11; |
| 25731 |
ps[7] = pi + 4; |
| 25732 |
ps[0] = tmp1; |
| 25733 |
ps[1] = pi + 7; |
| 25734 |
ps[2] = pi + 6; |
| 25735 |
ps[3] = pi + 5; |
| 25736 |
tmp1 = cs[2]; |
| 25737 |
tmp2 = cs[3]; |
| 25738 |
cs[2] = tmp2; |
| 25739 |
cs[3] = ci; |
| 25740 |
cs[0] = tmp1; |
| 25741 |
cs[1] = ci + 1; |
| 25742 |
break; |
| 25743 |
case 2: |
| 25744 |
tmp1 = ps[15]; |
| 25745 |
tmp2 = ps[11]; |
| 25746 |
ps[12] = ps[3]; |
| 25747 |
ps[13] = pi + 0; |
| 25748 |
ps[14] = pi + 1; |
| 25749 |
ps[15] = pi + 2; |
| 25750 |
ps[8] = ps[7]; |
| 25751 |
ps[9] = pi + 9; |
| 25752 |
ps[10] = pi + 10; |
| 25753 |
ps[11] = pi + 3; |
| 25754 |
ps[4] = tmp2; |
| 25755 |
ps[5] = pi + 8; |
| 25756 |
ps[6] = pi + 11; |
| 25757 |
ps[7] = pi + 4; |
| 25758 |
ps[0] = tmp1; |
| 25759 |
ps[1] = pi + 7; |
| 25760 |
ps[2] = pi + 6; |
| 25761 |
ps[3] = pi + 5; |
| 25762 |
tmp1 = cs[3]; |
| 25763 |
cs[2] = cs[1]; |
| 25764 |
cs[3] = ci; |
| 25765 |
cs[0] = tmp1; |
| 25766 |
cs[1] = ci + 1; |
| 25767 |
break; |
| 25768 |
case 3: |
| 25769 |
ps[12] = ps[0]; |
| 25770 |
ps[13] = pi + 0; |
| 25771 |
ps[14] = pi + 1; |
| 25772 |
ps[15] = pi + 2; |
| 25773 |
ps[8] = ps[1]; |
| 25774 |
ps[9] = pi + 9; |
| 25775 |
ps[10] = pi + 10; |
| 25776 |
ps[11] = pi + 3; |
| 25777 |
ps[4] = ps[2]; |
| 25778 |
ps[5] = pi + 8; |
| 25779 |
ps[6] = pi + 11; |
| 25780 |
ps[7] = pi + 4; |
| 25781 |
ps[0] = ps[3]; |
| 25782 |
ps[1] = pi + 7; |
| 25783 |
ps[2] = pi + 6; |
| 25784 |
ps[3] = pi + 5; |
| 25785 |
cs[2] = cs[0]; |
| 25786 |
cs[3] = ci; |
| 25787 |
cs[0] = cs[1]; |
| 25788 |
cs[1] = ci + 1; |
| 25789 |
break; |
| 25790 |
} |
| 25791 |
this.figures.push({ |
| 25792 |
type: "patch", |
| 25793 |
coords: new Int32Array(ps), |
| 25794 |
colors: new Int32Array(cs) |
| 25795 |
}); |
| 25796 |
} |
| 25797 |
} |
| 25798 |
_buildFigureFromPatch(index) { |
| 25799 |
const figure = this.figures[index]; |
| 25800 |
assert(figure.type === "patch", "Unexpected patch mesh figure"); |
| 25801 |
const coords = this.coords, |
| 25802 |
colors = this.colors; |
| 25803 |
const pi = figure.coords; |
| 25804 |
const ci = figure.colors; |
| 25805 |
const figureMinX = Math.min(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]); |
| 25806 |
const figureMinY = Math.min(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]); |
| 25807 |
const figureMaxX = Math.max(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]); |
| 25808 |
const figureMaxY = Math.max(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]); |
| 25809 |
let splitXBy = Math.ceil((figureMaxX - figureMinX) * MeshShading.TRIANGLE_DENSITY / (this.bounds[2] - this.bounds[0])); |
| 25810 |
splitXBy = Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitXBy)); |
| 25811 |
let splitYBy = Math.ceil((figureMaxY - figureMinY) * MeshShading.TRIANGLE_DENSITY / (this.bounds[3] - this.bounds[1])); |
| 25812 |
splitYBy = Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitYBy)); |
| 25813 |
const verticesPerRow = splitXBy + 1; |
| 25814 |
const figureCoords = new Int32Array((splitYBy + 1) * verticesPerRow); |
| 25815 |
const figureColors = new Int32Array((splitYBy + 1) * verticesPerRow); |
| 25816 |
let k = 0; |
| 25817 |
const cl = new Uint8Array(3), |
| 25818 |
cr = new Uint8Array(3); |
| 25819 |
const c0 = colors[ci[0]], |
| 25820 |
c1 = colors[ci[1]], |
| 25821 |
c2 = colors[ci[2]], |
| 25822 |
c3 = colors[ci[3]]; |
| 25823 |
const bRow = getB(splitYBy), |
| 25824 |
bCol = getB(splitXBy); |
| 25825 |
for (let row = 0; row <= splitYBy; row++) { |
| 25826 |
cl[0] = (c0[0] * (splitYBy - row) + c2[0] * row) / splitYBy | 0; |
| 25827 |
cl[1] = (c0[1] * (splitYBy - row) + c2[1] * row) / splitYBy | 0; |
| 25828 |
cl[2] = (c0[2] * (splitYBy - row) + c2[2] * row) / splitYBy | 0; |
| 25829 |
cr[0] = (c1[0] * (splitYBy - row) + c3[0] * row) / splitYBy | 0; |
| 25830 |
cr[1] = (c1[1] * (splitYBy - row) + c3[1] * row) / splitYBy | 0; |
| 25831 |
cr[2] = (c1[2] * (splitYBy - row) + c3[2] * row) / splitYBy | 0; |
| 25832 |
for (let col = 0; col <= splitXBy; col++, k++) { |
| 25833 |
if ((row === 0 || row === splitYBy) && (col === 0 || col === splitXBy)) { |
| 25834 |
continue; |
| 25835 |
} |
| 25836 |
let x = 0, |
| 25837 |
y = 0; |
| 25838 |
let q = 0; |
| 25839 |
for (let i = 0; i <= 3; i++) { |
| 25840 |
for (let j = 0; j <= 3; j++, q++) { |
| 25841 |
const m = bRow[row][i] * bCol[col][j]; |
| 25842 |
x += coords[pi[q]][0] * m; |
| 25843 |
y += coords[pi[q]][1] * m; |
| 25844 |
} |
| 25845 |
} |
| 25846 |
figureCoords[k] = coords.length; |
| 25847 |
coords.push([x, y]); |
| 25848 |
figureColors[k] = colors.length; |
| 25849 |
const newColor = new Uint8Array(3); |
| 25850 |
newColor[0] = (cl[0] * (splitXBy - col) + cr[0] * col) / splitXBy | 0; |
| 25851 |
newColor[1] = (cl[1] * (splitXBy - col) + cr[1] * col) / splitXBy | 0; |
| 25852 |
newColor[2] = (cl[2] * (splitXBy - col) + cr[2] * col) / splitXBy | 0; |
| 25853 |
colors.push(newColor); |
| 25854 |
} |
| 25855 |
} |
| 25856 |
figureCoords[0] = pi[0]; |
| 25857 |
figureColors[0] = ci[0]; |
| 25858 |
figureCoords[splitXBy] = pi[3]; |
| 25859 |
figureColors[splitXBy] = ci[1]; |
| 25860 |
figureCoords[verticesPerRow * splitYBy] = pi[12]; |
| 25861 |
figureColors[verticesPerRow * splitYBy] = ci[2]; |
| 25862 |
figureCoords[verticesPerRow * splitYBy + splitXBy] = pi[15]; |
| 25863 |
figureColors[verticesPerRow * splitYBy + splitXBy] = ci[3]; |
| 25864 |
this.figures[index] = { |
| 25865 |
type: "lattice", |
| 25866 |
coords: figureCoords, |
| 25867 |
colors: figureColors, |
| 25868 |
verticesPerRow |
| 25869 |
}; |
| 25870 |
} |
| 25871 |
_updateBounds() { |
| 25872 |
let minX = this.coords[0][0], |
| 25873 |
minY = this.coords[0][1], |
| 25874 |
maxX = minX, |
| 25875 |
maxY = minY; |
| 25876 |
for (let i = 1, ii = this.coords.length; i < ii; i++) { |
| 25877 |
const x = this.coords[i][0], |
| 25878 |
y = this.coords[i][1]; |
| 25879 |
minX = minX > x ? x : minX; |
| 25880 |
minY = minY > y ? y : minY; |
| 25881 |
maxX = maxX < x ? x : maxX; |
| 25882 |
maxY = maxY < y ? y : maxY; |
| 25883 |
} |
| 25884 |
this.bounds = [minX, minY, maxX, maxY]; |
| 25885 |
} |
| 25886 |
_packData() { |
| 25887 |
let i, ii, j, jj; |
| 25888 |
const coords = this.coords; |
| 25889 |
const coordsPacked = new Float32Array(coords.length * 2); |
| 25890 |
for (i = 0, j = 0, ii = coords.length; i < ii; i++) { |
| 25891 |
const xy = coords[i]; |
| 25892 |
coordsPacked[j++] = xy[0]; |
| 25893 |
coordsPacked[j++] = xy[1]; |
| 25894 |
} |
| 25895 |
this.coords = coordsPacked; |
| 25896 |
const colors = this.colors; |
| 25897 |
const colorsPacked = new Uint8Array(colors.length * 3); |
| 25898 |
for (i = 0, j = 0, ii = colors.length; i < ii; i++) { |
| 25899 |
const c = colors[i]; |
| 25900 |
colorsPacked[j++] = c[0]; |
| 25901 |
colorsPacked[j++] = c[1]; |
| 25902 |
colorsPacked[j++] = c[2]; |
| 25903 |
} |
| 25904 |
this.colors = colorsPacked; |
| 25905 |
const figures = this.figures; |
| 25906 |
for (i = 0, ii = figures.length; i < ii; i++) { |
| 25907 |
const figure = figures[i], |
| 25908 |
ps = figure.coords, |
| 25909 |
cs = figure.colors; |
| 25910 |
for (j = 0, jj = ps.length; j < jj; j++) { |
| 25911 |
ps[j] *= 2; |
| 25912 |
cs[j] *= 3; |
| 25913 |
} |
| 25914 |
} |
| 25915 |
} |
| 25916 |
getIR() { |
| 25917 |
const { |
| 25918 |
bounds |
| 25919 |
} = this; |
| 25920 |
if (bounds[2] - bounds[0] === 0 || bounds[3] - bounds[1] === 0) { |
| 25921 |
throw new FormatError(`Invalid MeshShading bounds: [${bounds}].`); |
| 25922 |
} |
| 25923 |
return ["Mesh", this.shadingType, this.coords, this.colors, this.figures, bounds, this.bbox, this.background]; |
| 25924 |
} |
| 25925 |
} |
| 25926 |
class DummyShading extends BaseShading { |
| 25927 |
getIR() { |
| 25928 |
return ["Dummy"]; |
| 25929 |
} |
| 25930 |
} |
| 25931 |
function getTilingPatternIR(operatorList, dict, color) { |
| 25932 |
const matrix = lookupMatrix(dict.getArray("Matrix"), IDENTITY_MATRIX); |
| 25933 |
const bbox = lookupNormalRect(dict.getArray("BBox"), null); |
| 25934 |
if (!bbox || bbox[2] - bbox[0] === 0 || bbox[3] - bbox[1] === 0) { |
| 25935 |
throw new FormatError(`Invalid getTilingPatternIR /BBox array.`); |
| 25936 |
} |
| 25937 |
const xstep = dict.get("XStep"); |
| 25938 |
if (typeof xstep !== "number") { |
| 25939 |
throw new FormatError(`Invalid getTilingPatternIR /XStep value.`); |
| 25940 |
} |
| 25941 |
const ystep = dict.get("YStep"); |
| 25942 |
if (typeof ystep !== "number") { |
| 25943 |
throw new FormatError(`Invalid getTilingPatternIR /YStep value.`); |
| 25944 |
} |
| 25945 |
const paintType = dict.get("PaintType"); |
| 25946 |
if (!Number.isInteger(paintType)) { |
| 25947 |
throw new FormatError(`Invalid getTilingPatternIR /PaintType value.`); |
| 25948 |
} |
| 25949 |
const tilingType = dict.get("TilingType"); |
| 25950 |
if (!Number.isInteger(tilingType)) { |
| 25951 |
throw new FormatError(`Invalid getTilingPatternIR /TilingType value.`); |
| 25952 |
} |
| 25953 |
return ["TilingPattern", color, operatorList, matrix, bbox, xstep, ystep, paintType, tilingType]; |
| 25954 |
} |
| 25955 |
|
| 25956 |
;// ./src/core/calibri_factors.js |
| 25957 |
const CalibriBoldFactors = [1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566, 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.54657, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859, 0.92138, 0.83908, 0.7762, 0.73293, 0.87289, 0.73133, 0.7514, 0.81921, 0.87356, 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.9121, 0.86943, 0.79795, 0.88198, 0.77958, 0.70864, 0.81055, 0.90399, 0.88653, 0.96017, 0.82577, 0.77892, 0.78257, 0.97507, 1.54657, 0.97507, 0.85284, 0.89552, 0.90176, 0.88762, 0.8785, 0.75241, 0.8785, 0.90518, 0.95015, 0.77618, 0.8785, 0.88401, 0.91916, 0.86304, 0.88401, 0.91488, 0.8785, 0.8801, 0.8785, 0.8785, 0.91343, 0.7173, 1.04106, 0.8785, 0.85075, 0.95794, 0.82616, 0.85162, 0.79492, 0.88331, 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.7801, 0.89552, 1.24487, 1.13254, 1.12401, 0.96839, 0.85284, 0.68787, 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, 0.90323, 1, 1.07463, 1, 0.91056, 0.75806, 1.19118, 0.96839, 0.78864, 0.82845, 0.84133, 0.75859, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.77539, 0.73293, 0.73133, 0.73133, 0.73133, 0.73133, 0.95958, 0.95958, 0.95958, 0.95958, 0.88506, 0.9121, 0.86943, 0.86943, 0.86943, 0.86943, 0.86943, 0.85284, 0.87508, 0.90399, 0.90399, 0.90399, 0.90399, 0.77892, 0.79795, 0.90807, 0.88762, 0.88762, 0.88762, 0.88762, 0.88762, 0.88762, 0.8715, 0.75241, 0.90518, 0.90518, 0.90518, 0.90518, 0.88401, 0.88401, 0.88401, 0.88401, 0.8785, 0.8785, 0.8801, 0.8801, 0.8801, 0.8801, 0.8801, 0.90747, 0.89049, 0.8785, 0.8785, 0.8785, 0.8785, 0.85162, 0.8785, 0.85162, 0.83908, 0.88762, 0.83908, 0.88762, 0.83908, 0.88762, 0.73293, 0.75241, 0.73293, 0.75241, 0.73293, 0.75241, 0.73293, 0.75241, 0.87289, 0.83016, 0.88506, 0.93125, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.81921, 0.77618, 0.81921, 0.77618, 0.81921, 0.77618, 1, 1, 0.87356, 0.8785, 0.91075, 0.89608, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.76229, 0.90167, 0.59526, 0.91916, 1, 1, 0.86304, 0.69225, 0.88401, 1, 1, 0.70424, 0.79468, 0.91926, 0.88175, 0.70823, 0.94903, 0.9121, 0.8785, 1, 1, 0.9121, 0.8785, 0.87802, 0.88656, 0.8785, 0.86943, 0.8801, 0.86943, 0.8801, 0.86943, 0.8801, 0.87402, 0.89291, 0.77958, 0.91343, 1, 1, 0.77958, 0.91343, 0.70864, 0.7173, 0.70864, 0.7173, 0.70864, 0.7173, 0.70864, 0.7173, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.96017, 0.95794, 0.77892, 0.85162, 0.77892, 0.78257, 0.79492, 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, 0.88762, 0.77539, 0.8715, 0.87508, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, 1.20528, 1, 1.15543, 0.70674, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, 1.06303, 0.83908, 0.80352, 0.57184, 0.6965, 0.56289, 0.82001, 0.56029, 0.81235, 1.02988, 0.83908, 0.7762, 0.68156, 0.80367, 0.73133, 0.78257, 0.87356, 0.86943, 0.95958, 0.75727, 0.89019, 1.04924, 0.9121, 0.7648, 0.86943, 0.87356, 0.79795, 0.78275, 0.81055, 0.77892, 0.9762, 0.82577, 0.99819, 0.84896, 0.95958, 0.77892, 0.96108, 1.01407, 0.89049, 1.02988, 0.94211, 0.96108, 0.8936, 0.84021, 0.87842, 0.96399, 0.79109, 0.89049, 1.00813, 1.02988, 0.86077, 0.87445, 0.92099, 0.84723, 0.86513, 0.8801, 0.75638, 0.85714, 0.78216, 0.79586, 0.87965, 0.94211, 0.97747, 0.78287, 0.97926, 0.84971, 1.02988, 0.94211, 0.8801, 0.94211, 0.84971, 0.73133, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90264, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90518, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90548, 1, 1, 1, 1, 1, 1, 0.96017, 0.95794, 0.96017, 0.95794, 0.96017, 0.95794, 0.77892, 0.85162, 1, 1, 0.89552, 0.90527, 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.92794, 0.87012, 0.87012, 0.87012, 0.89552, 0.89552, 1.42259, 0.71143, 1.06152, 1, 1, 1.03372, 1.03372, 0.97171, 1.4956, 2.2807, 0.93835, 0.83406, 0.91133, 0.84107, 0.91133, 1, 1, 1, 0.72021, 1, 1.23108, 0.83489, 0.88525, 0.88525, 0.81499, 0.90527, 1.81055, 0.90527, 1.81055, 1.31006, 1.53711, 0.94434, 1.08696, 1, 0.95018, 0.77192, 0.85284, 0.90747, 1.17534, 0.69825, 0.9716, 1.37077, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.08004, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 25958 |
const CalibriBoldMetrics = { |
| 25959 |
lineHeight: 1.2207, |
| 25960 |
lineGap: 0.2207 |
| 25961 |
}; |
| 25962 |
const CalibriBoldItalicFactors = [1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566, 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.56239, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859, 0.92138, 0.83908, 0.7762, 0.71805, 0.87289, 0.73133, 0.7514, 0.81921, 0.87356, 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.90872, 0.85938, 0.79795, 0.87068, 0.77958, 0.69766, 0.81055, 0.90399, 0.88653, 0.96068, 0.82577, 0.77892, 0.78257, 0.97507, 1.529, 0.97507, 0.85284, 0.89552, 0.90176, 0.94908, 0.86411, 0.74012, 0.86411, 0.88323, 0.95015, 0.86411, 0.86331, 0.88401, 0.91916, 0.86304, 0.88401, 0.9039, 0.86331, 0.86331, 0.86411, 0.86411, 0.90464, 0.70852, 1.04106, 0.86331, 0.84372, 0.95794, 0.82616, 0.84548, 0.79492, 0.88331, 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.7801, 0.89552, 1.24487, 1.13254, 1.19129, 0.96839, 0.85284, 0.68787, 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, 0.90323, 1, 1.07463, 1, 0.91056, 0.75806, 1.19118, 0.96839, 0.78864, 0.82845, 0.84133, 0.75859, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.77539, 0.71805, 0.73133, 0.73133, 0.73133, 0.73133, 0.95958, 0.95958, 0.95958, 0.95958, 0.88506, 0.90872, 0.85938, 0.85938, 0.85938, 0.85938, 0.85938, 0.85284, 0.87068, 0.90399, 0.90399, 0.90399, 0.90399, 0.77892, 0.79795, 0.90807, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, 0.85887, 0.74012, 0.88323, 0.88323, 0.88323, 0.88323, 0.88401, 0.88401, 0.88401, 0.88401, 0.8785, 0.86331, 0.86331, 0.86331, 0.86331, 0.86331, 0.86331, 0.90747, 0.89049, 0.86331, 0.86331, 0.86331, 0.86331, 0.84548, 0.86411, 0.84548, 0.83908, 0.94908, 0.83908, 0.94908, 0.83908, 0.94908, 0.71805, 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.87289, 0.79538, 0.88506, 0.92726, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.81921, 0.86411, 0.81921, 0.86411, 0.81921, 0.86411, 1, 1, 0.87356, 0.86331, 0.91075, 0.8777, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.76467, 0.90167, 0.59526, 0.91916, 1, 1, 0.86304, 0.69225, 0.88401, 1, 1, 0.70424, 0.77312, 0.91926, 0.88175, 0.70823, 0.94903, 0.90872, 0.86331, 1, 1, 0.90872, 0.86331, 0.86906, 0.88116, 0.86331, 0.85938, 0.86331, 0.85938, 0.86331, 0.85938, 0.86331, 0.87402, 0.86549, 0.77958, 0.90464, 1, 1, 0.77958, 0.90464, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766, 0.70852, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.96068, 0.95794, 0.77892, 0.84548, 0.77892, 0.78257, 0.79492, 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, 0.94908, 0.77539, 0.85887, 0.87068, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, 1.20528, 1, 1.15543, 0.70088, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, 1.48387, 0.83908, 0.80352, 0.57118, 0.6965, 0.56347, 0.79179, 0.55853, 0.80346, 1.02988, 0.83908, 0.7762, 0.67174, 0.86036, 0.73133, 0.78257, 0.87356, 0.86441, 0.95958, 0.75727, 0.89019, 1.04924, 0.90872, 0.74889, 0.85938, 0.87891, 0.79795, 0.7957, 0.81055, 0.77892, 0.97447, 0.82577, 0.97466, 0.87179, 0.95958, 0.77892, 0.94252, 0.95612, 0.8753, 1.02988, 0.92733, 0.94252, 0.87411, 0.84021, 0.8728, 0.95612, 0.74081, 0.8753, 1.02189, 1.02988, 0.84814, 0.87445, 0.91822, 0.84723, 0.85668, 0.86331, 0.81344, 0.87581, 0.76422, 0.82046, 0.96057, 0.92733, 0.99375, 0.78022, 0.95452, 0.86015, 1.02988, 0.92733, 0.86331, 0.92733, 0.86015, 0.73133, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90631, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.88323, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85174, 1, 1, 1, 1, 1, 1, 0.96068, 0.95794, 0.96068, 0.95794, 0.96068, 0.95794, 0.77892, 0.84548, 1, 1, 0.89552, 0.90527, 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.89807, 0.87012, 0.87012, 0.87012, 0.89552, 0.89552, 1.42259, 0.71094, 1.06152, 1, 1, 1.03372, 1.03372, 0.97171, 1.4956, 2.2807, 0.92972, 0.83406, 0.91133, 0.83326, 0.91133, 1, 1, 1, 0.72021, 1, 1.23108, 0.83489, 0.88525, 0.88525, 0.81499, 0.90616, 1.81055, 0.90527, 1.81055, 1.3107, 1.53711, 0.94434, 1.08696, 1, 0.95018, 0.77192, 0.85284, 0.90747, 1.17534, 0.69825, 0.9716, 1.37077, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.08004, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 25963 |
const CalibriBoldItalicMetrics = { |
| 25964 |
lineHeight: 1.2207, |
| 25965 |
lineGap: 0.2207 |
| 25966 |
}; |
| 25967 |
const CalibriItalicFactors = [1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, 1.15601, 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39543, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, 0.88071, 0.8675, 0.81552, 0.72346, 0.85193, 0.73206, 0.7522, 0.81105, 0.86275, 0.90685, 0.6377, 0.77892, 0.75593, 1.02638, 0.89249, 0.84118, 0.77452, 0.85374, 0.75186, 0.67789, 0.79776, 0.88844, 0.85066, 0.94309, 0.77818, 0.7306, 0.76659, 1.10369, 1.38313, 1.10369, 1.06139, 0.89552, 0.8739, 0.9245, 0.9245, 0.83203, 0.9245, 0.85865, 1.09842, 0.9245, 0.9245, 1.03297, 1.07692, 0.90918, 1.03297, 0.94959, 0.9245, 0.92274, 0.9245, 0.9245, 1.02933, 0.77832, 1.20562, 0.9245, 0.8916, 0.98986, 0.86621, 0.89453, 0.79004, 0.94152, 1.77256, 0.94152, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.91729, 0.89552, 1.17889, 1.13254, 1.16359, 0.92098, 0.85284, 0.68787, 0.71353, 0.84737, 0.90747, 1.0088, 1.0044, 0.87683, 1, 1.09091, 1, 0.92229, 0.739, 1.15642, 0.92098, 0.76288, 0.80504, 0.80972, 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.76318, 0.72346, 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, 0.90685, 0.90685, 0.90685, 0.86477, 0.89249, 0.84118, 0.84118, 0.84118, 0.84118, 0.84118, 0.85284, 0.84557, 0.88844, 0.88844, 0.88844, 0.88844, 0.7306, 0.77452, 0.86331, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, 0.84843, 0.83203, 0.85865, 0.85865, 0.85865, 0.85865, 0.82601, 0.82601, 0.82601, 0.82601, 0.94469, 0.9245, 0.92274, 0.92274, 0.92274, 0.92274, 0.92274, 0.90747, 0.86651, 0.9245, 0.9245, 0.9245, 0.9245, 0.89453, 0.9245, 0.89453, 0.8675, 0.9245, 0.8675, 0.9245, 0.8675, 0.9245, 0.72346, 0.83203, 0.72346, 0.83203, 0.72346, 0.83203, 0.72346, 0.83203, 0.85193, 0.8875, 0.86477, 0.99034, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.81105, 0.9245, 0.81105, 0.9245, 0.81105, 0.9245, 1, 1, 0.86275, 0.9245, 0.90872, 0.93591, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 1.03297, 0.90685, 0.82601, 0.77896, 1.05611, 0.6377, 1.07692, 1, 1, 0.90918, 0.75593, 1.03297, 1, 1, 0.76032, 0.9375, 0.98156, 0.93407, 0.77261, 1.11429, 0.89249, 0.9245, 1, 1, 0.89249, 0.9245, 0.92534, 0.86698, 0.9245, 0.84118, 0.92274, 0.84118, 0.92274, 0.84118, 0.92274, 0.8667, 0.86291, 0.75186, 1.02933, 1, 1, 0.75186, 1.02933, 0.67789, 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 1, 1, 0.79776, 0.97655, 0.79776, 1.23023, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.94309, 0.98986, 0.7306, 0.89453, 0.7306, 0.76659, 0.79004, 0.76659, 0.79004, 0.76659, 0.79004, 1.09231, 0.54873, 0.8675, 0.9245, 0.76318, 0.84843, 0.84557, 0.86651, 1, 1, 0.79776, 1.20562, 1.18622, 1.18622, 1, 1.1437, 0.67009, 0.96334, 0.93695, 1.35191, 1.40909, 0.95161, 1.48387, 0.8675, 0.90861, 0.6192, 0.7363, 0.64824, 0.82411, 0.56321, 0.85696, 1.23516, 0.8675, 0.81552, 0.7286, 0.84134, 0.73206, 0.76659, 0.86275, 0.84369, 0.90685, 0.77892, 0.85871, 1.02638, 0.89249, 0.75828, 0.84118, 0.85984, 0.77452, 0.76466, 0.79776, 0.7306, 0.90782, 0.77818, 0.903, 0.87291, 0.90685, 0.7306, 0.99058, 1.03667, 0.94635, 1.23516, 0.9849, 0.99058, 0.92393, 0.8916, 0.942, 1.03667, 0.75026, 0.94635, 1.0297, 1.23516, 0.90918, 0.94048, 0.98217, 0.89746, 0.84153, 0.92274, 0.82507, 0.88832, 0.84438, 0.88178, 1.03525, 0.9849, 1.00225, 0.78086, 0.97248, 0.89404, 1.23516, 0.9849, 0.92274, 0.9849, 0.89404, 0.73206, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89693, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85865, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90933, 1, 1, 1, 1, 1, 1, 0.94309, 0.98986, 0.94309, 0.98986, 0.94309, 0.98986, 0.7306, 0.89453, 1, 1, 0.89552, 0.90527, 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, 1.2566, 0.89552, 0.89552, 1.42259, 0.68994, 1.03809, 1, 1, 1.0176, 1.0176, 1.11523, 1.4956, 2.01462, 0.97858, 0.82616, 0.91133, 0.83437, 0.91133, 1, 1, 1, 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90572, 1.81055, 0.90749, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589, 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747, 0.85284, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 25968 |
const CalibriItalicMetrics = { |
| 25969 |
lineHeight: 1.2207, |
| 25970 |
lineGap: 0.2207 |
| 25971 |
}; |
| 25972 |
const CalibriRegularFactors = [1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, 1.15601, 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39016, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, 0.88071, 0.8675, 0.81552, 0.73834, 0.85193, 0.73206, 0.7522, 0.81105, 0.86275, 0.90685, 0.6377, 0.77892, 0.75593, 1.02638, 0.89385, 0.85122, 0.77452, 0.86503, 0.75186, 0.68887, 0.79776, 0.88844, 0.85066, 0.94258, 0.77818, 0.7306, 0.76659, 1.10369, 1.39016, 1.10369, 1.06139, 0.89552, 0.8739, 0.86128, 0.94469, 0.8457, 0.94469, 0.89464, 1.09842, 0.84636, 0.94469, 1.03297, 1.07692, 0.90918, 1.03297, 0.95897, 0.94469, 0.9482, 0.94469, 0.94469, 1.04692, 0.78223, 1.20562, 0.94469, 0.90332, 0.98986, 0.86621, 0.90527, 0.79004, 0.94152, 1.77256, 0.94152, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.91729, 0.89552, 1.17889, 1.13254, 1.08707, 0.92098, 0.85284, 0.68787, 0.71353, 0.84737, 0.90747, 1.0088, 1.0044, 0.87683, 1, 1.09091, 1, 0.92229, 0.739, 1.15642, 0.92098, 0.76288, 0.80504, 0.80972, 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.76318, 0.73834, 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, 0.90685, 0.90685, 0.90685, 0.86477, 0.89385, 0.85122, 0.85122, 0.85122, 0.85122, 0.85122, 0.85284, 0.85311, 0.88844, 0.88844, 0.88844, 0.88844, 0.7306, 0.77452, 0.86331, 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.8693, 0.8457, 0.89464, 0.89464, 0.89464, 0.89464, 0.82601, 0.82601, 0.82601, 0.82601, 0.94469, 0.94469, 0.9482, 0.9482, 0.9482, 0.9482, 0.9482, 0.90747, 0.86651, 0.94469, 0.94469, 0.94469, 0.94469, 0.90527, 0.94469, 0.90527, 0.8675, 0.86128, 0.8675, 0.86128, 0.8675, 0.86128, 0.73834, 0.8457, 0.73834, 0.8457, 0.73834, 0.8457, 0.73834, 0.8457, 0.85193, 0.92454, 0.86477, 0.9921, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.81105, 0.84636, 0.81105, 0.84636, 0.81105, 0.84636, 1, 1, 0.86275, 0.94469, 0.90872, 0.95786, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 1.03297, 0.90685, 0.82601, 0.77741, 1.05611, 0.6377, 1.07692, 1, 1, 0.90918, 0.75593, 1.03297, 1, 1, 0.76032, 0.90452, 0.98156, 1.11842, 0.77261, 1.11429, 0.89385, 0.94469, 1, 1, 0.89385, 0.94469, 0.95877, 0.86901, 0.94469, 0.85122, 0.9482, 0.85122, 0.9482, 0.85122, 0.9482, 0.8667, 0.90016, 0.75186, 1.04692, 1, 1, 0.75186, 1.04692, 0.68887, 0.78223, 0.68887, 0.78223, 0.68887, 0.78223, 0.68887, 0.78223, 1, 1, 0.79776, 0.92188, 0.79776, 1.23023, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.94258, 0.98986, 0.7306, 0.90527, 0.7306, 0.76659, 0.79004, 0.76659, 0.79004, 0.76659, 0.79004, 1.09231, 0.54873, 0.8675, 0.86128, 0.76318, 0.8693, 0.85311, 0.86651, 1, 1, 0.79776, 1.20562, 1.18622, 1.18622, 1, 1.1437, 0.67742, 0.96334, 0.93695, 1.35191, 1.40909, 0.95161, 1.48387, 0.86686, 0.90861, 0.62267, 0.74359, 0.65649, 0.85498, 0.56963, 0.88254, 1.23516, 0.8675, 0.81552, 0.75443, 0.84503, 0.73206, 0.76659, 0.86275, 0.85122, 0.90685, 0.77892, 0.85746, 1.02638, 0.89385, 0.75657, 0.85122, 0.86275, 0.77452, 0.74171, 0.79776, 0.7306, 0.95165, 0.77818, 0.89772, 0.88831, 0.90685, 0.7306, 0.98142, 1.02191, 0.96576, 1.23516, 0.99018, 0.98142, 0.9236, 0.89258, 0.94035, 1.02191, 0.78848, 0.96576, 0.9561, 1.23516, 0.90918, 0.92578, 0.95424, 0.89746, 0.83969, 0.9482, 0.80113, 0.89442, 0.85208, 0.86155, 0.98022, 0.99018, 1.00452, 0.81209, 0.99247, 0.89181, 1.23516, 0.99018, 0.9482, 0.99018, 0.89181, 0.73206, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.88844, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89464, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.96766, 1, 1, 1, 1, 1, 1, 0.94258, 0.98986, 0.94258, 0.98986, 0.94258, 0.98986, 0.7306, 0.90527, 1, 1, 0.89552, 0.90527, 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, 1.2566, 0.89552, 0.89552, 1.42259, 0.69043, 1.03809, 1, 1, 1.0176, 1.0176, 1.11523, 1.4956, 2.01462, 0.99331, 0.82616, 0.91133, 0.84286, 0.91133, 1, 1, 1, 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90527, 1.81055, 0.90527, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589, 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, 1.07185, 0.99413, 0.96334, 1.08065, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 25973 |
const CalibriRegularMetrics = { |
| 25974 |
lineHeight: 1.2207, |
| 25975 |
lineGap: 0.2207 |
| 25976 |
}; |
| 25977 |
|
| 25978 |
;// ./src/core/helvetica_factors.js |
| 25979 |
const HelveticaBoldFactors = [0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977, 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, 0.9999, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, 0.99998, 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, 1.00026, 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, 1.00026, 1.00026, 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, 0.99973, 0.99973, 1, 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.99973, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 1.03374, 0.99977, 1.00026, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.00042, 0.99973, 0.99973, 1.0006, 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, 1.00026, 1.0006, 1.00026, 1.03828, 1.00026, 0.99999, 1.00026, 1.0006, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.9993, 0.9998, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1, 1.00016, 0.99977, 0.99959, 0.99977, 0.99959, 0.99977, 0.99959, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00026, 0.99998, 1.00026, 0.8121, 1.00026, 0.99998, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.00016, 1.00022, 1.00001, 0.99973, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 0.99973, 1.00026, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 1.00034, 0.99977, 1, 0.99997, 1.00026, 1.00078, 1.00036, 0.99973, 1.00013, 1.0006, 0.99977, 0.99977, 0.99988, 0.85148, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 0.99977, 1.00001, 0.99999, 0.99977, 1.00069, 1.00022, 0.99977, 1.00001, 0.99984, 1.00026, 1.00001, 1.00024, 1.00001, 0.9999, 1, 1.0006, 1.00001, 1.00041, 0.99962, 1.00026, 1.0006, 0.99995, 1.00041, 0.99942, 0.99973, 0.99927, 1.00082, 0.99902, 1.00026, 1.00087, 1.0006, 1.00069, 0.99973, 0.99867, 0.99973, 0.9993, 1.00026, 1.00049, 1.00056, 1, 0.99988, 0.99935, 0.99995, 0.99954, 1.00055, 0.99945, 1.00032, 1.0006, 0.99995, 1.00026, 0.99995, 1.00032, 1.00001, 1.00008, 0.99971, 1.00019, 0.9994, 1.00001, 1.0006, 1.00044, 0.99973, 1.00023, 1.00047, 1, 0.99942, 0.99561, 0.99989, 1.00035, 0.99977, 1.00035, 0.99977, 1.00019, 0.99944, 1.00001, 1.00021, 0.99926, 1.00035, 1.00035, 0.99942, 1.00048, 0.99999, 0.99977, 1.00022, 1.00035, 1.00001, 0.99977, 1.00026, 0.99989, 1.00057, 1.00001, 0.99936, 1.00052, 1.00012, 0.99996, 1.00043, 1, 1.00035, 0.9994, 0.99976, 1.00035, 0.99973, 1.00052, 1.00041, 1.00119, 1.00037, 0.99973, 1.00002, 0.99986, 1.00041, 1.00041, 0.99902, 0.9996, 1.00034, 0.99999, 1.00026, 0.99999, 1.00026, 0.99973, 1.00052, 0.99973, 1, 0.99973, 1.00041, 1.00075, 0.9994, 1.0003, 0.99999, 1, 1.00041, 0.99955, 1, 0.99915, 0.99973, 0.99973, 1.00026, 1.00119, 0.99955, 0.99973, 1.0006, 0.99911, 1.0006, 1.00026, 0.99972, 1.00026, 0.99902, 1.00041, 0.99973, 0.99999, 1, 1, 1.00038, 1.0005, 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1, 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973, 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 0.99971, 1.00047, 1.00023, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1, 1, 1, 1, 1, 1, 1, 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, 0.99561, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.99972, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 25980 |
const HelveticaBoldMetrics = { |
| 25981 |
lineHeight: 1.2, |
| 25982 |
lineGap: 0.2 |
| 25983 |
}; |
| 25984 |
const HelveticaBoldItalicFactors = [0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977, 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, 0.9999, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, 0.99998, 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, 1.00026, 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, 1.00026, 1.00026, 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, 0.99973, 0.99973, 1, 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.99973, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 1.0044, 0.99977, 1.00026, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99971, 0.99973, 0.99973, 1.0006, 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, 1.00026, 1.0006, 1.00026, 1.01011, 1.00026, 0.99999, 1.00026, 1.0006, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.9993, 0.9998, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1, 1.00016, 0.99977, 0.99959, 0.99977, 0.99959, 0.99977, 0.99959, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00026, 0.99998, 1.00026, 0.8121, 1.00026, 0.99998, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.00016, 1.00022, 1.00001, 0.99973, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 0.99973, 1.00026, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99977, 1, 1, 1.00026, 0.99969, 0.99972, 0.99981, 0.9998, 1.0006, 0.99977, 0.99977, 1.00022, 0.91155, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 0.99977, 1.00001, 0.99999, 0.99977, 0.99966, 1.00022, 1.00032, 1.00001, 0.99944, 1.00026, 1.00001, 0.99968, 1.00001, 1.00047, 1, 1.0006, 1.00001, 0.99981, 1.00101, 1.00026, 1.0006, 0.99948, 0.99981, 1.00064, 0.99973, 0.99942, 1.00101, 1.00061, 1.00026, 1.00069, 1.0006, 1.00014, 0.99973, 1.01322, 0.99973, 1.00065, 1.00026, 1.00012, 0.99923, 1, 1.00064, 1.00076, 0.99948, 1.00055, 1.00063, 1.00007, 0.99943, 1.0006, 0.99948, 1.00026, 0.99948, 0.99943, 1.00001, 1.00001, 1.00029, 1.00038, 1.00035, 1.00001, 1.0006, 1.0006, 0.99973, 0.99978, 1.00001, 1.00057, 0.99989, 0.99967, 0.99964, 0.99967, 0.99977, 0.99999, 0.99977, 1.00038, 0.99977, 1.00001, 0.99973, 1.00066, 0.99967, 0.99967, 1.00041, 0.99998, 0.99999, 0.99977, 1.00022, 0.99967, 1.00001, 0.99977, 1.00026, 0.99964, 1.00031, 1.00001, 0.99999, 0.99999, 1, 1.00023, 1, 1, 0.99999, 1.00035, 1.00001, 0.99999, 0.99973, 0.99977, 0.99999, 1.00058, 0.99973, 0.99973, 0.99955, 0.9995, 1.00026, 1.00026, 1.00032, 0.99989, 1.00034, 0.99999, 1.00026, 1.00026, 1.00026, 0.99973, 0.45998, 0.99973, 1.00026, 0.99973, 1.00001, 0.99999, 0.99982, 0.99994, 0.99996, 1, 1.00042, 1.00044, 1.00029, 1.00023, 0.99973, 0.99973, 1.00026, 0.99949, 1.00002, 0.99973, 1.0006, 1.0006, 1.0006, 0.99975, 1.00026, 1.00026, 1.00032, 0.98685, 0.99973, 1.00026, 1, 1, 0.99966, 1.00044, 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1, 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973, 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1, 0.99973, 0.99971, 0.99978, 1, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1.00098, 1, 1, 1, 1.00049, 1, 1, 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, 0.99561, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.99972, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 25985 |
const HelveticaBoldItalicMetrics = { |
| 25986 |
lineHeight: 1.35, |
| 25987 |
lineGap: 0.2 |
| 25988 |
}; |
| 25989 |
const HelveticaItalicFactors = [0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001, 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, 0.99987, 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, 0.99973, 0.99973, 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, 0.99924, 1, 0.99924, 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.0006, 0.99973, 1, 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 1, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.06409, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 1, 0.99973, 1, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.0288, 0.99977, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99924, 1.0006, 1.0006, 0.99946, 1.00034, 1, 0.99924, 1.00001, 1, 1, 0.99973, 0.99924, 0.99973, 0.99924, 0.99973, 1.06311, 0.99973, 1.00024, 0.99973, 0.99924, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00041, 0.9998, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016, 0.99977, 0.99998, 0.99977, 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00026, 1.0006, 1.00026, 0.89547, 1.00026, 1.0006, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 1.00001, 1, 1.00054, 0.99977, 1.00084, 1.00007, 0.99973, 1.00013, 0.99924, 1.00001, 1.00001, 0.99945, 0.91221, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 1.00001, 1.00001, 0.99999, 0.99977, 0.99933, 1.00022, 1.00054, 1.00001, 1.00065, 1.00026, 1.00001, 1.0001, 1.00001, 1.00052, 1, 1.0006, 1.00001, 0.99945, 0.99897, 0.99968, 0.99924, 1.00036, 0.99945, 0.99949, 1, 1.0006, 0.99897, 0.99918, 0.99968, 0.99911, 0.99924, 1, 0.99962, 1.01487, 1, 1.0005, 0.99973, 1.00012, 1.00043, 1, 0.99995, 0.99994, 1.00036, 0.99947, 1.00019, 1.00063, 1.00025, 0.99924, 1.00036, 0.99973, 1.00036, 1.00025, 1.00001, 1.00001, 1.00027, 1.0001, 1.00068, 1.00001, 1.0006, 1.0006, 1, 1.00008, 0.99957, 0.99972, 0.9994, 0.99954, 0.99975, 1.00051, 1.00001, 1.00019, 1.00001, 1.0001, 0.99986, 1.00001, 1.00001, 1.00038, 0.99954, 0.99954, 0.9994, 1.00066, 0.99999, 0.99977, 1.00022, 1.00054, 1.00001, 0.99977, 1.00026, 0.99975, 1.0001, 1.00001, 0.99993, 0.9995, 0.99955, 1.00016, 0.99978, 0.99974, 1.00019, 1.00022, 0.99955, 1.00053, 0.99973, 1.00089, 1.00005, 0.99967, 1.00048, 0.99973, 1.00002, 1.00034, 0.99973, 0.99973, 0.99964, 1.00006, 1.00066, 0.99947, 0.99973, 0.98894, 0.99973, 1, 0.44898, 1, 0.99946, 1, 1.00039, 1.00082, 0.99991, 0.99991, 0.99985, 1.00022, 1.00023, 1.00061, 1.00006, 0.99966, 0.99973, 0.99973, 0.99973, 1.00019, 1.0008, 1, 0.99924, 0.99924, 0.99924, 0.99983, 1.00044, 0.99973, 0.99964, 0.98332, 1, 0.99973, 1, 1, 0.99962, 0.99895, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016, 0.99977, 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924, 0.99924, 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, 1.00267, 0.99999, 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 1.00423, 0.99925, 0.99999, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1.00049, 1, 1.00245, 1, 1, 1, 1, 0.96329, 1, 1.20985, 1.39713, 1.00003, 0.8254, 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031, 1.00003, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.95317, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 25990 |
const HelveticaItalicMetrics = { |
| 25991 |
lineHeight: 1.35, |
| 25992 |
lineGap: 0.2 |
| 25993 |
}; |
| 25994 |
const HelveticaRegularFactors = [0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001, 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, 0.99987, 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, 0.99973, 0.99973, 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, 0.99924, 1, 0.99924, 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.0006, 0.99973, 1, 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 1, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.06409, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 1, 0.99973, 1, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.04596, 0.99977, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99924, 1.0006, 1.0006, 1.00019, 1.00034, 1, 0.99924, 1.00001, 1, 1, 0.99973, 0.99924, 0.99973, 0.99924, 0.99973, 1.02572, 0.99973, 1.00005, 0.99973, 0.99924, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99999, 0.9998, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016, 0.99977, 0.99998, 0.99977, 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00026, 1.0006, 1.00026, 0.84533, 1.00026, 1.0006, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99928, 1, 0.99977, 1.00013, 1.00055, 0.99947, 0.99945, 0.99941, 0.99924, 1.00001, 1.00001, 1.0004, 0.91621, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 1.00001, 1.00005, 0.99999, 0.99977, 1.00015, 1.00022, 0.99977, 1.00001, 0.99973, 1.00026, 1.00001, 1.00019, 1.00001, 0.99946, 1, 1.0006, 1.00001, 0.99978, 1.00045, 0.99973, 0.99924, 1.00023, 0.99978, 0.99966, 1, 1.00065, 1.00045, 1.00019, 0.99973, 0.99973, 0.99924, 1, 1, 0.96499, 1, 1.00055, 0.99973, 1.00008, 1.00027, 1, 0.9997, 0.99995, 1.00023, 0.99933, 1.00019, 1.00015, 1.00031, 0.99924, 1.00023, 0.99973, 1.00023, 1.00031, 1.00001, 0.99928, 1.00029, 1.00092, 1.00035, 1.00001, 1.0006, 1.0006, 1, 0.99988, 0.99975, 1, 1.00082, 0.99561, 0.9996, 1.00035, 1.00001, 0.99962, 1.00001, 1.00092, 0.99964, 1.00001, 0.99963, 0.99999, 1.00035, 1.00035, 1.00082, 0.99962, 0.99999, 0.99977, 1.00022, 1.00035, 1.00001, 0.99977, 1.00026, 0.9996, 0.99967, 1.00001, 1.00034, 1.00074, 1.00054, 1.00053, 1.00063, 0.99971, 0.99962, 1.00035, 0.99975, 0.99977, 0.99973, 1.00043, 0.99953, 1.0007, 0.99915, 0.99973, 1.00008, 0.99892, 1.00073, 1.00073, 1.00114, 0.99915, 1.00073, 0.99955, 0.99973, 1.00092, 0.99973, 1, 0.99998, 1, 1.0003, 1, 1.00043, 1.00001, 0.99969, 1.0003, 1, 1.00035, 1.00001, 0.9995, 1, 1.00092, 0.99973, 0.99973, 0.99973, 1.0007, 0.9995, 1, 0.99924, 1.0006, 0.99924, 0.99972, 1.00062, 0.99973, 1.00114, 1.00073, 1, 0.99955, 1, 1, 1.00047, 0.99968, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016, 0.99977, 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924, 0.99924, 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, 1.00267, 0.99999, 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 0.99971, 0.99925, 1.00023, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1, 1, 1, 1, 1, 1, 1, 0.96329, 1, 1.20985, 1.39713, 1.00003, 0.8254, 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.95317, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 25995 |
const HelveticaRegularMetrics = { |
| 25996 |
lineHeight: 1.2, |
| 25997 |
lineGap: 0.2 |
| 25998 |
}; |
| 25999 |
|
| 26000 |
;// ./src/core/liberationsans_widths.js |
| 26001 |
const LiberationSansBoldWidths = [365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 719, 722, 611, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, 611, 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 785, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 385, 611, 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, 778, 611, 778, 611, 1000, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, 556, 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, 611, 500, 611, 500, 278, 556, 722, 556, 1000, 889, 778, 611, 667, 556, 611, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 465, 722, 333, 853, 906, 474, 825, 927, 838, 278, 722, 722, 601, 719, 667, 611, 722, 778, 278, 722, 667, 833, 722, 644, 778, 722, 667, 600, 611, 667, 821, 667, 809, 802, 278, 667, 615, 451, 611, 278, 582, 615, 610, 556, 606, 475, 460, 611, 541, 278, 558, 556, 612, 556, 445, 611, 766, 619, 520, 684, 446, 582, 715, 576, 753, 845, 278, 582, 611, 582, 845, 667, 669, 885, 567, 711, 667, 278, 276, 556, 1094, 1062, 875, 610, 722, 622, 719, 722, 719, 722, 567, 712, 667, 904, 626, 719, 719, 610, 702, 833, 722, 778, 719, 667, 722, 611, 622, 854, 667, 730, 703, 1005, 1019, 870, 979, 719, 711, 1031, 719, 556, 618, 615, 417, 635, 556, 709, 497, 615, 615, 500, 635, 740, 604, 611, 604, 611, 556, 490, 556, 875, 556, 615, 581, 833, 844, 729, 854, 615, 552, 854, 583, 556, 556, 611, 417, 552, 556, 278, 281, 278, 969, 906, 611, 500, 615, 556, 604, 778, 611, 487, 447, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1000, 1000, 552, 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1000, 1000, 240, 479, 333, 333, 604, 333, 167, 396, 556, 556, 1094, 556, 885, 489, 1115, 1000, 768, 600, 834, 834, 834, 834, 1000, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, 333, 333, 333, 333, 333, 333]; |
| 26002 |
const LiberationSansBoldMapping = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; |
| 26003 |
const LiberationSansBoldItalicWidths = [365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 740, 722, 611, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, 611, 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 782, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 396, 611, 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, 778, 611, 778, 611, 1000, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, 556, 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, 611, 500, 611, 500, 278, 556, 722, 556, 1000, 889, 778, 611, 667, 556, 611, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 722, 333, 854, 906, 473, 844, 930, 847, 278, 722, 722, 610, 671, 667, 611, 722, 778, 278, 722, 667, 833, 722, 657, 778, 718, 667, 590, 611, 667, 822, 667, 829, 781, 278, 667, 620, 479, 611, 278, 591, 620, 621, 556, 610, 479, 492, 611, 558, 278, 566, 556, 603, 556, 450, 611, 712, 605, 532, 664, 409, 591, 704, 578, 773, 834, 278, 591, 611, 591, 834, 667, 667, 886, 614, 719, 667, 278, 278, 556, 1094, 1042, 854, 622, 719, 677, 719, 722, 708, 722, 614, 722, 667, 927, 643, 719, 719, 615, 687, 833, 722, 778, 719, 667, 722, 611, 677, 781, 667, 729, 708, 979, 989, 854, 1000, 708, 719, 1042, 729, 556, 619, 604, 534, 618, 556, 736, 510, 611, 611, 507, 622, 740, 604, 611, 611, 611, 556, 889, 556, 885, 556, 646, 583, 889, 935, 707, 854, 594, 552, 865, 589, 556, 556, 611, 469, 563, 556, 278, 278, 278, 969, 906, 611, 507, 619, 556, 611, 778, 611, 575, 467, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1000, 1000, 552, 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1000, 1000, 240, 479, 333, 333, 604, 333, 167, 396, 556, 556, 1104, 556, 885, 516, 1146, 1000, 768, 600, 834, 834, 834, 834, 999, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, 333, 333, 333, 333, 333, 333]; |
| 26004 |
const LiberationSansBoldItalicMapping = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; |
| 26005 |
const LiberationSansItalicWidths = [365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, 556, 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 625, 722, 556, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, 556, 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, 278, 278, 733, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 281, 556, 400, 556, 222, 722, 556, 722, 556, 722, 556, 615, 723, 556, 778, 556, 778, 556, 778, 556, 1000, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, 500, 667, 500, 667, 500, 611, 278, 611, 354, 611, 278, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, 611, 500, 611, 500, 222, 556, 667, 556, 1000, 889, 778, 611, 667, 500, 611, 278, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 789, 846, 389, 794, 865, 775, 222, 667, 667, 570, 671, 667, 611, 722, 778, 278, 667, 667, 833, 722, 648, 778, 725, 667, 600, 611, 667, 837, 667, 831, 761, 278, 667, 570, 439, 555, 222, 550, 570, 571, 500, 556, 439, 463, 555, 542, 222, 500, 492, 548, 500, 447, 556, 670, 573, 486, 603, 374, 550, 652, 546, 728, 779, 222, 550, 556, 550, 779, 667, 667, 843, 544, 708, 667, 278, 278, 500, 1066, 982, 844, 589, 715, 639, 724, 667, 651, 667, 544, 704, 667, 917, 614, 715, 715, 589, 686, 833, 722, 778, 725, 667, 722, 611, 639, 795, 667, 727, 673, 920, 923, 805, 886, 651, 694, 1022, 682, 556, 562, 522, 493, 553, 556, 688, 465, 556, 556, 472, 564, 686, 550, 556, 556, 556, 500, 833, 500, 835, 500, 572, 518, 830, 851, 621, 736, 526, 492, 752, 534, 556, 556, 556, 378, 496, 500, 222, 222, 222, 910, 828, 556, 472, 565, 500, 556, 778, 556, 492, 339, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1000, 1000, 552, 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1000, 1000, 188, 354, 333, 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1083, 1000, 768, 600, 834, 834, 834, 834, 1000, 500, 998, 500, 1000, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 719, 274, 549, 549, 584, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, 324, 324, 316, 328, 398, 285]; |
| 26006 |
const LiberationSansItalicMapping = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; |
| 26007 |
const LiberationSansRegularWidths = [365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, 556, 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 615, 722, 556, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, 556, 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, 278, 278, 735, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 292, 556, 334, 556, 222, 722, 556, 722, 556, 722, 556, 604, 723, 556, 778, 556, 778, 556, 778, 556, 1000, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, 500, 667, 500, 667, 500, 611, 278, 611, 375, 611, 278, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, 611, 500, 611, 500, 222, 556, 667, 556, 1000, 889, 778, 611, 667, 500, 611, 278, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 784, 838, 384, 774, 855, 752, 222, 667, 667, 551, 668, 667, 611, 722, 778, 278, 667, 668, 833, 722, 650, 778, 722, 667, 618, 611, 667, 798, 667, 835, 748, 278, 667, 578, 446, 556, 222, 547, 578, 575, 500, 557, 446, 441, 556, 556, 222, 500, 500, 576, 500, 448, 556, 690, 569, 482, 617, 395, 547, 648, 525, 713, 781, 222, 547, 556, 547, 781, 667, 667, 865, 542, 719, 667, 278, 278, 500, 1057, 1010, 854, 583, 722, 635, 719, 667, 656, 667, 542, 677, 667, 923, 604, 719, 719, 583, 656, 833, 722, 778, 719, 667, 722, 611, 635, 760, 667, 740, 667, 917, 938, 792, 885, 656, 719, 1010, 722, 556, 573, 531, 365, 583, 556, 669, 458, 559, 559, 438, 583, 688, 552, 556, 542, 556, 500, 458, 500, 823, 500, 573, 521, 802, 823, 625, 719, 521, 510, 750, 542, 556, 556, 556, 365, 510, 500, 222, 278, 222, 906, 812, 556, 438, 559, 500, 552, 778, 556, 489, 411, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1000, 1000, 552, 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1000, 1000, 188, 354, 333, 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1073, 1000, 768, 600, 834, 834, 834, 834, 1000, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 719, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, 324, 324, 316, 328, 398, 285]; |
| 26008 |
const LiberationSansRegularMapping = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; |
| 26009 |
|
| 26010 |
;// ./src/core/myriadpro_factors.js |
| 26011 |
const MyriadProBoldFactors = [1.36898, 1, 1, 0.72706, 0.80479, 0.83734, 0.98894, 0.99793, 0.9897, 0.93884, 0.86209, 0.94292, 0.94292, 1.16661, 1.02058, 0.93582, 0.96694, 0.93582, 1.19137, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058, 0.72851, 0.78966, 0.90838, 0.83637, 0.82391, 0.96376, 0.80061, 0.86275, 0.8768, 0.95407, 1.0258, 0.73901, 0.85022, 0.83655, 1.0156, 0.95546, 0.92179, 0.87107, 0.92179, 0.82114, 0.8096, 0.89713, 0.94438, 0.95353, 0.94083, 0.91905, 0.90406, 0.9446, 0.94292, 1.18777, 0.94292, 1.02058, 0.89903, 0.90088, 0.94938, 0.97898, 0.81093, 0.97571, 0.94938, 1.024, 0.9577, 0.95933, 0.98621, 1.0474, 0.97455, 0.98981, 0.9672, 0.95933, 0.9446, 0.97898, 0.97407, 0.97646, 0.78036, 1.10208, 0.95442, 0.95298, 0.97579, 0.9332, 0.94039, 0.938, 0.80687, 1.01149, 0.80687, 1.02058, 0.80479, 0.99793, 0.99793, 0.99793, 0.99793, 1.01149, 1.00872, 0.90088, 0.91882, 1.0213, 0.8361, 1.02058, 0.62295, 0.54324, 0.89022, 1.08595, 1, 1, 0.90088, 1, 0.97455, 0.93582, 0.90088, 1, 1.05686, 0.8361, 0.99642, 0.99642, 0.99642, 0.72851, 0.90838, 0.90838, 0.90838, 0.90838, 0.90838, 0.90838, 0.868, 0.82391, 0.80061, 0.80061, 0.80061, 0.80061, 1.0258, 1.0258, 1.0258, 1.0258, 0.97484, 0.95546, 0.92179, 0.92179, 0.92179, 0.92179, 0.92179, 1.02058, 0.92179, 0.94438, 0.94438, 0.94438, 0.94438, 0.90406, 0.86958, 0.98225, 0.94938, 0.94938, 0.94938, 0.94938, 0.94938, 0.94938, 0.9031, 0.81093, 0.94938, 0.94938, 0.94938, 0.94938, 0.98621, 0.98621, 0.98621, 0.98621, 0.93969, 0.95933, 0.9446, 0.9446, 0.9446, 0.9446, 0.9446, 1.08595, 0.9446, 0.95442, 0.95442, 0.95442, 0.95442, 0.94039, 0.97898, 0.94039, 0.90838, 0.94938, 0.90838, 0.94938, 0.90838, 0.94938, 0.82391, 0.81093, 0.82391, 0.81093, 0.82391, 0.81093, 0.82391, 0.81093, 0.96376, 0.84313, 0.97484, 0.97571, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.8768, 0.9577, 0.8768, 0.9577, 0.8768, 0.9577, 1, 1, 0.95407, 0.95933, 0.97069, 0.95933, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 0.887, 1.01591, 0.73901, 1.0474, 1, 1, 0.97455, 0.83655, 0.98981, 1, 1, 0.83655, 0.73977, 0.83655, 0.73903, 0.84638, 1.033, 0.95546, 0.95933, 1, 1, 0.95546, 0.95933, 0.8271, 0.95417, 0.95933, 0.92179, 0.9446, 0.92179, 0.9446, 0.92179, 0.9446, 0.936, 0.91964, 0.82114, 0.97646, 1, 1, 0.82114, 0.97646, 0.8096, 0.78036, 0.8096, 0.78036, 1, 1, 0.8096, 0.78036, 1, 1, 0.89713, 0.77452, 0.89713, 1.10208, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94083, 0.97579, 0.90406, 0.94039, 0.90406, 0.9446, 0.938, 0.9446, 0.938, 0.9446, 0.938, 1, 0.99793, 0.90838, 0.94938, 0.868, 0.9031, 0.92179, 0.9446, 1, 1, 0.89713, 1.10208, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90989, 0.9358, 0.91945, 0.83181, 0.75261, 0.87992, 0.82976, 0.96034, 0.83689, 0.97268, 1.0078, 0.90838, 0.83637, 0.8019, 0.90157, 0.80061, 0.9446, 0.95407, 0.92436, 1.0258, 0.85022, 0.97153, 1.0156, 0.95546, 0.89192, 0.92179, 0.92361, 0.87107, 0.96318, 0.89713, 0.93704, 0.95638, 0.91905, 0.91709, 0.92796, 1.0258, 0.93704, 0.94836, 1.0373, 0.95933, 1.0078, 0.95871, 0.94836, 0.96174, 0.92601, 0.9498, 0.98607, 0.95776, 0.95933, 1.05453, 1.0078, 0.98275, 0.9314, 0.95617, 0.91701, 1.05993, 0.9446, 0.78367, 0.9553, 1, 0.86832, 1.0128, 0.95871, 0.99394, 0.87548, 0.96361, 0.86774, 1.0078, 0.95871, 0.9446, 0.95871, 0.86774, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.94083, 0.97579, 0.94083, 0.97579, 0.94083, 0.97579, 0.90406, 0.94039, 0.96694, 1, 0.89903, 1, 1, 1, 0.93582, 0.93582, 0.93582, 1, 0.908, 0.908, 0.918, 0.94219, 0.94219, 0.96544, 1, 1.285, 1, 1, 0.81079, 0.81079, 1, 1, 0.74854, 1, 1, 1, 1, 0.99793, 1, 1, 1, 0.65, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.17173, 1, 0.80535, 0.76169, 1.02058, 1.0732, 1.05486, 1, 1, 1.30692, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.16161, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 26012 |
const MyriadProBoldMetrics = { |
| 26013 |
lineHeight: 1.2, |
| 26014 |
lineGap: 0.2 |
| 26015 |
}; |
| 26016 |
const MyriadProBoldItalicFactors = [1.36898, 1, 1, 0.66227, 0.80779, 0.81625, 0.97276, 0.97276, 0.97733, 0.92222, 0.83266, 0.94292, 0.94292, 1.16148, 1.02058, 0.93582, 0.96694, 0.93582, 1.17337, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058, 0.71541, 0.76813, 0.85576, 0.80591, 0.80729, 0.94299, 0.77512, 0.83655, 0.86523, 0.92222, 0.98621, 0.71743, 0.81698, 0.79726, 0.98558, 0.92222, 0.90637, 0.83809, 0.90637, 0.80729, 0.76463, 0.86275, 0.90699, 0.91605, 0.9154, 0.85308, 0.85458, 0.90531, 0.94292, 1.21296, 0.94292, 1.02058, 0.89903, 1.18616, 0.99613, 0.91677, 0.78216, 0.91677, 0.90083, 0.98796, 0.9135, 0.92168, 0.95381, 0.98981, 0.95298, 0.95381, 0.93459, 0.92168, 0.91513, 0.92004, 0.91677, 0.95077, 0.748, 1.04502, 0.91677, 0.92061, 0.94236, 0.89544, 0.89364, 0.9, 0.80687, 0.8578, 0.80687, 1.02058, 0.80779, 0.97276, 0.97276, 0.97276, 0.97276, 0.8578, 0.99973, 1.18616, 0.91339, 1.08074, 0.82891, 1.02058, 0.55509, 0.71526, 0.89022, 1.08595, 1, 1, 1.18616, 1, 0.96736, 0.93582, 1.18616, 1, 1.04864, 0.82711, 0.99043, 0.99043, 0.99043, 0.71541, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, 0.845, 0.80729, 0.77512, 0.77512, 0.77512, 0.77512, 0.98621, 0.98621, 0.98621, 0.98621, 0.95961, 0.92222, 0.90637, 0.90637, 0.90637, 0.90637, 0.90637, 1.02058, 0.90251, 0.90699, 0.90699, 0.90699, 0.90699, 0.85458, 0.83659, 0.94951, 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, 0.85811, 0.78216, 0.90083, 0.90083, 0.90083, 0.90083, 0.95381, 0.95381, 0.95381, 0.95381, 0.9135, 0.92168, 0.91513, 0.91513, 0.91513, 0.91513, 0.91513, 1.08595, 0.91677, 0.91677, 0.91677, 0.91677, 0.91677, 0.89364, 0.92332, 0.89364, 0.85576, 0.99613, 0.85576, 0.99613, 0.85576, 0.99613, 0.80729, 0.78216, 0.80729, 0.78216, 0.80729, 0.78216, 0.80729, 0.78216, 0.94299, 0.76783, 0.95961, 0.91677, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.86523, 0.9135, 0.86523, 0.9135, 0.86523, 0.9135, 1, 1, 0.92222, 0.92168, 0.92222, 0.92168, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.86036, 0.97096, 0.71743, 0.98981, 1, 1, 0.95298, 0.79726, 0.95381, 1, 1, 0.79726, 0.6894, 0.79726, 0.74321, 0.81691, 1.0006, 0.92222, 0.92168, 1, 1, 0.92222, 0.92168, 0.79464, 0.92098, 0.92168, 0.90637, 0.91513, 0.90637, 0.91513, 0.90637, 0.91513, 0.909, 0.87514, 0.80729, 0.95077, 1, 1, 0.80729, 0.95077, 0.76463, 0.748, 0.76463, 0.748, 1, 1, 0.76463, 0.748, 1, 1, 0.86275, 0.72651, 0.86275, 1.04502, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.9154, 0.94236, 0.85458, 0.89364, 0.85458, 0.90531, 0.9, 0.90531, 0.9, 0.90531, 0.9, 1, 0.97276, 0.85576, 0.99613, 0.845, 0.85811, 0.90251, 0.91677, 1, 1, 0.86275, 1.04502, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.00899, 1.30628, 0.85576, 0.80178, 0.66862, 0.7927, 0.69323, 0.88127, 0.72459, 0.89711, 0.95381, 0.85576, 0.80591, 0.7805, 0.94729, 0.77512, 0.90531, 0.92222, 0.90637, 0.98621, 0.81698, 0.92655, 0.98558, 0.92222, 0.85359, 0.90637, 0.90976, 0.83809, 0.94523, 0.86275, 0.83509, 0.93157, 0.85308, 0.83392, 0.92346, 0.98621, 0.83509, 0.92886, 0.91324, 0.92168, 0.95381, 0.90646, 0.92886, 0.90557, 0.86847, 0.90276, 0.91324, 0.86842, 0.92168, 0.99531, 0.95381, 0.9224, 0.85408, 0.92699, 0.86847, 1.0051, 0.91513, 0.80487, 0.93481, 1, 0.88159, 1.05214, 0.90646, 0.97355, 0.81539, 0.89398, 0.85923, 0.95381, 0.90646, 0.91513, 0.90646, 0.85923, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9154, 0.94236, 0.9154, 0.94236, 0.9154, 0.94236, 0.85458, 0.89364, 0.96694, 1, 0.89903, 1, 1, 1, 0.91782, 0.91782, 0.91782, 1, 0.896, 0.896, 0.896, 0.9332, 0.9332, 0.95973, 1, 1.26, 1, 1, 0.80479, 0.80178, 1, 1, 0.85633, 1, 1, 1, 1, 0.97276, 1, 1, 1, 0.698, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.14542, 1, 0.79199, 0.78694, 1.02058, 1.03493, 1.05486, 1, 1, 1.23026, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.20006, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 26017 |
const MyriadProBoldItalicMetrics = { |
| 26018 |
lineHeight: 1.2, |
| 26019 |
lineGap: 0.2 |
| 26020 |
}; |
| 26021 |
const MyriadProItalicFactors = [1.36898, 1, 1, 0.65507, 0.84943, 0.85639, 0.88465, 0.88465, 0.86936, 0.88307, 0.86948, 0.85283, 0.85283, 1.06383, 1.02058, 0.75945, 0.9219, 0.75945, 1.17337, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.75945, 0.75945, 1.02058, 1.02058, 1.02058, 0.69046, 0.70926, 0.85158, 0.77812, 0.76852, 0.89591, 0.70466, 0.76125, 0.80094, 0.86822, 0.83864, 0.728, 0.77212, 0.79475, 0.93637, 0.87514, 0.8588, 0.76013, 0.8588, 0.72421, 0.69866, 0.77598, 0.85991, 0.80811, 0.87832, 0.78112, 0.77512, 0.8562, 1.0222, 1.18417, 1.0222, 1.27014, 0.89903, 1.15012, 0.93859, 0.94399, 0.846, 0.94399, 0.81453, 1.0186, 0.94219, 0.96017, 1.03075, 1.02175, 0.912, 1.03075, 0.96998, 0.96017, 0.93859, 0.94399, 0.94399, 0.95493, 0.746, 1.12658, 0.94578, 0.91, 0.979, 0.882, 0.882, 0.83, 0.85034, 0.83537, 0.85034, 1.02058, 0.70869, 0.88465, 0.88465, 0.88465, 0.88465, 0.83537, 0.90083, 1.15012, 0.9161, 0.94565, 0.73541, 1.02058, 0.53609, 0.69353, 0.79519, 1.08595, 1, 1, 1.15012, 1, 0.91974, 0.75945, 1.15012, 1, 0.9446, 0.73361, 0.9005, 0.9005, 0.9005, 0.62864, 0.85158, 0.85158, 0.85158, 0.85158, 0.85158, 0.85158, 0.773, 0.76852, 0.70466, 0.70466, 0.70466, 0.70466, 0.83864, 0.83864, 0.83864, 0.83864, 0.90561, 0.87514, 0.8588, 0.8588, 0.8588, 0.8588, 0.8588, 1.02058, 0.85751, 0.85991, 0.85991, 0.85991, 0.85991, 0.77512, 0.76013, 0.88075, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 0.8075, 0.846, 0.81453, 0.81453, 0.81453, 0.81453, 0.82424, 0.82424, 0.82424, 0.82424, 0.9278, 0.96017, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 1.08595, 0.8562, 0.94578, 0.94578, 0.94578, 0.94578, 0.882, 0.94578, 0.882, 0.85158, 0.93859, 0.85158, 0.93859, 0.85158, 0.93859, 0.76852, 0.846, 0.76852, 0.846, 0.76852, 0.846, 0.76852, 0.846, 0.89591, 0.8544, 0.90561, 0.94399, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.80094, 0.94219, 0.80094, 0.94219, 0.80094, 0.94219, 1, 1, 0.86822, 0.96017, 0.86822, 0.96017, 0.83864, 0.82424, 0.83864, 0.82424, 0.83864, 0.82424, 0.83864, 1.03075, 0.83864, 0.82424, 0.81402, 1.02738, 0.728, 1.02175, 1, 1, 0.912, 0.79475, 1.03075, 1, 1, 0.79475, 0.83911, 0.79475, 0.66266, 0.80553, 1.06676, 0.87514, 0.96017, 1, 1, 0.87514, 0.96017, 0.86865, 0.87396, 0.96017, 0.8588, 0.93859, 0.8588, 0.93859, 0.8588, 0.93859, 0.867, 0.84759, 0.72421, 0.95493, 1, 1, 0.72421, 0.95493, 0.69866, 0.746, 0.69866, 0.746, 1, 1, 0.69866, 0.746, 1, 1, 0.77598, 0.88417, 0.77598, 1.12658, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.87832, 0.979, 0.77512, 0.882, 0.77512, 0.8562, 0.83, 0.8562, 0.83, 0.8562, 0.83, 1, 0.88465, 0.85158, 0.93859, 0.773, 0.8075, 0.85751, 0.8562, 1, 1, 0.77598, 1.12658, 1.15012, 1.15012, 1.15012, 1.15012, 1.15012, 1.15313, 1.15012, 1.15012, 1.15012, 1.08106, 1.03901, 0.85158, 0.77025, 0.62264, 0.7646, 0.65351, 0.86026, 0.69461, 0.89947, 1.03075, 0.85158, 0.77812, 0.76449, 0.88836, 0.70466, 0.8562, 0.86822, 0.8588, 0.83864, 0.77212, 0.85308, 0.93637, 0.87514, 0.82352, 0.8588, 0.85701, 0.76013, 0.89058, 0.77598, 0.8156, 0.82565, 0.78112, 0.77899, 0.89386, 0.83864, 0.8156, 0.9486, 0.92388, 0.96186, 1.03075, 0.91123, 0.9486, 0.93298, 0.878, 0.93942, 0.92388, 0.84596, 0.96186, 0.95119, 1.03075, 0.922, 0.88787, 0.95829, 0.88, 0.93559, 0.93859, 0.78815, 0.93758, 1, 0.89217, 1.03737, 0.91123, 0.93969, 0.77487, 0.85769, 0.86799, 1.03075, 0.91123, 0.93859, 0.91123, 0.86799, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.87832, 0.979, 0.87832, 0.979, 0.87832, 0.979, 0.77512, 0.882, 0.9219, 1, 0.89903, 1, 1, 1, 0.87321, 0.87321, 0.87321, 1, 1.027, 1.027, 1.027, 0.86847, 0.86847, 0.79121, 1, 1.124, 1, 1, 0.73572, 0.73572, 1, 1, 0.85034, 1, 1, 1, 1, 0.88465, 1, 1, 1, 0.669, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.04828, 1, 0.74948, 0.75187, 1.02058, 0.98391, 1.02119, 1, 1, 1.06233, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05233, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 26022 |
const MyriadProItalicMetrics = { |
| 26023 |
lineHeight: 1.2, |
| 26024 |
lineGap: 0.2 |
| 26025 |
}; |
| 26026 |
const MyriadProRegularFactors = [1.36898, 1, 1, 0.76305, 0.82784, 0.94935, 0.89364, 0.92241, 0.89073, 0.90706, 0.98472, 0.85283, 0.85283, 1.0664, 1.02058, 0.74505, 0.9219, 0.74505, 1.23456, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.74505, 0.74505, 1.02058, 1.02058, 1.02058, 0.73002, 0.72601, 0.91755, 0.8126, 0.80314, 0.92222, 0.73764, 0.79726, 0.83051, 0.90284, 0.86023, 0.74, 0.8126, 0.84869, 0.96518, 0.91115, 0.8858, 0.79761, 0.8858, 0.74498, 0.73914, 0.81363, 0.89591, 0.83659, 0.89633, 0.85608, 0.8111, 0.90531, 1.0222, 1.22736, 1.0222, 1.27014, 0.89903, 0.90088, 0.86667, 1.0231, 0.896, 1.01411, 0.90083, 1.05099, 1.00512, 0.99793, 1.05326, 1.09377, 0.938, 1.06226, 1.00119, 0.99793, 0.98714, 1.0231, 1.01231, 0.98196, 0.792, 1.19137, 0.99074, 0.962, 1.01915, 0.926, 0.942, 0.856, 0.85034, 0.92006, 0.85034, 1.02058, 0.69067, 0.92241, 0.92241, 0.92241, 0.92241, 0.92006, 0.9332, 0.90088, 0.91882, 0.93484, 0.75339, 1.02058, 0.56866, 0.54324, 0.79519, 1.08595, 1, 1, 0.90088, 1, 0.95325, 0.74505, 0.90088, 1, 0.97198, 0.75339, 0.91009, 0.91009, 0.91009, 0.66466, 0.91755, 0.91755, 0.91755, 0.91755, 0.91755, 0.91755, 0.788, 0.80314, 0.73764, 0.73764, 0.73764, 0.73764, 0.86023, 0.86023, 0.86023, 0.86023, 0.92915, 0.91115, 0.8858, 0.8858, 0.8858, 0.8858, 0.8858, 1.02058, 0.8858, 0.89591, 0.89591, 0.89591, 0.89591, 0.8111, 0.79611, 0.89713, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86936, 0.896, 0.90083, 0.90083, 0.90083, 0.90083, 0.84224, 0.84224, 0.84224, 0.84224, 0.97276, 0.99793, 0.98714, 0.98714, 0.98714, 0.98714, 0.98714, 1.08595, 0.89876, 0.99074, 0.99074, 0.99074, 0.99074, 0.942, 1.0231, 0.942, 0.91755, 0.86667, 0.91755, 0.86667, 0.91755, 0.86667, 0.80314, 0.896, 0.80314, 0.896, 0.80314, 0.896, 0.80314, 0.896, 0.92222, 0.93372, 0.92915, 1.01411, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.83051, 1.00512, 0.83051, 1.00512, 0.83051, 1.00512, 1, 1, 0.90284, 0.99793, 0.90976, 0.99793, 0.86023, 0.84224, 0.86023, 0.84224, 0.86023, 0.84224, 0.86023, 1.05326, 0.86023, 0.84224, 0.82873, 1.07469, 0.74, 1.09377, 1, 1, 0.938, 0.84869, 1.06226, 1, 1, 0.84869, 0.83704, 0.84869, 0.81441, 0.85588, 1.08927, 0.91115, 0.99793, 1, 1, 0.91115, 0.99793, 0.91887, 0.90991, 0.99793, 0.8858, 0.98714, 0.8858, 0.98714, 0.8858, 0.98714, 0.894, 0.91434, 0.74498, 0.98196, 1, 1, 0.74498, 0.98196, 0.73914, 0.792, 0.73914, 0.792, 1, 1, 0.73914, 0.792, 1, 1, 0.81363, 0.904, 0.81363, 1.19137, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89633, 1.01915, 0.8111, 0.942, 0.8111, 0.90531, 0.856, 0.90531, 0.856, 0.90531, 0.856, 1, 0.92241, 0.91755, 0.86667, 0.788, 0.86936, 0.8858, 0.89876, 1, 1, 0.81363, 1.19137, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90388, 1.03901, 0.92138, 0.78105, 0.7154, 0.86169, 0.80513, 0.94007, 0.82528, 0.98612, 1.06226, 0.91755, 0.8126, 0.81884, 0.92819, 0.73764, 0.90531, 0.90284, 0.8858, 0.86023, 0.8126, 0.91172, 0.96518, 0.91115, 0.83089, 0.8858, 0.87791, 0.79761, 0.89297, 0.81363, 0.88157, 0.89992, 0.85608, 0.81992, 0.94307, 0.86023, 0.88157, 0.95308, 0.98699, 0.99793, 1.06226, 0.95817, 0.95308, 0.97358, 0.928, 0.98088, 0.98699, 0.92761, 0.99793, 0.96017, 1.06226, 0.986, 0.944, 0.95978, 0.938, 0.96705, 0.98714, 0.80442, 0.98972, 1, 0.89762, 1.04552, 0.95817, 0.99007, 0.87064, 0.91879, 0.88888, 1.06226, 0.95817, 0.98714, 0.95817, 0.88888, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89633, 1.01915, 0.89633, 1.01915, 0.89633, 1.01915, 0.8111, 0.942, 0.9219, 1, 0.89903, 1, 1, 1, 0.93173, 0.93173, 0.93173, 1, 1.06304, 1.06304, 1.06904, 0.89903, 0.89903, 0.80549, 1, 1.156, 1, 1, 0.76575, 0.76575, 1, 1, 0.72458, 1, 1, 1, 1, 0.92241, 1, 1, 1, 0.619, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.07257, 1, 0.74705, 0.71119, 1.02058, 1.024, 1.02119, 1, 1, 1.1536, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05638, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 26027 |
const MyriadProRegularMetrics = { |
| 26028 |
lineHeight: 1.2, |
| 26029 |
lineGap: 0.2 |
| 26030 |
}; |
| 26031 |
|
| 26032 |
;// ./src/core/segoeui_factors.js |
| 26033 |
const SegoeuiBoldFactors = [1.76738, 1, 1, 0.99297, 0.9824, 1.04016, 1.06497, 1.03424, 0.97529, 1.17647, 1.23203, 1.1085, 1.1085, 1.16939, 1.2107, 0.9754, 1.21408, 0.9754, 1.59578, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 0.81378, 0.81378, 1.2107, 1.2107, 1.2107, 0.71703, 0.97847, 0.97363, 0.88776, 0.8641, 1.02096, 0.79795, 0.85132, 0.914, 1.06085, 1.1406, 0.8007, 0.89858, 0.83693, 1.14889, 1.09398, 0.97489, 0.92094, 0.97489, 0.90399, 0.84041, 0.95923, 1.00135, 1, 1.06467, 0.98243, 0.90996, 0.99361, 1.1085, 1.56942, 1.1085, 1.2107, 0.74627, 0.94282, 0.96752, 1.01519, 0.86304, 1.01359, 0.97278, 1.15103, 1.01359, 0.98561, 1.02285, 1.02285, 1.00527, 1.02285, 1.0302, 0.99041, 1.0008, 1.01519, 1.01359, 1.02258, 0.79104, 1.16862, 0.99041, 0.97454, 1.02511, 0.99298, 0.96752, 0.95801, 0.94856, 1.16579, 0.94856, 1.2107, 0.9824, 1.03424, 1.03424, 1, 1.03424, 1.16579, 0.8727, 1.3871, 1.18622, 1.10818, 1.04478, 1.2107, 1.18622, 0.75155, 0.94994, 1.28826, 1.21408, 1.21408, 0.91056, 1, 0.91572, 0.9754, 0.64663, 1.18328, 1.24866, 1.04478, 1.14169, 1.15749, 1.17389, 0.71703, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.93506, 0.8641, 0.79795, 0.79795, 0.79795, 0.79795, 1.1406, 1.1406, 1.1406, 1.1406, 1.02096, 1.09398, 0.97426, 0.97426, 0.97426, 0.97426, 0.97426, 1.2107, 0.97489, 1.00135, 1.00135, 1.00135, 1.00135, 0.90996, 0.92094, 1.02798, 0.96752, 0.96752, 0.96752, 0.96752, 0.96752, 0.96752, 0.93136, 0.86304, 0.97278, 0.97278, 0.97278, 0.97278, 1.02285, 1.02285, 1.02285, 1.02285, 0.97122, 0.99041, 1, 1, 1, 1, 1, 1.28826, 1.0008, 0.99041, 0.99041, 0.99041, 0.99041, 0.96752, 1.01519, 0.96752, 0.97363, 0.96752, 0.97363, 0.96752, 0.97363, 0.96752, 0.8641, 0.86304, 0.8641, 0.86304, 0.8641, 0.86304, 0.8641, 0.86304, 1.02096, 1.03057, 1.02096, 1.03517, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.914, 1.01359, 0.914, 1.01359, 0.914, 1.01359, 1, 1, 1.06085, 0.98561, 1.06085, 1.00879, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 0.97138, 1.08692, 0.8007, 1.02285, 1, 1, 1.00527, 0.83693, 1.02285, 1, 1, 0.83693, 0.9455, 0.83693, 0.90418, 0.83693, 1.13005, 1.09398, 0.99041, 1, 1, 1.09398, 0.99041, 0.96692, 1.09251, 0.99041, 0.97489, 1.0008, 0.97489, 1.0008, 0.97489, 1.0008, 0.93994, 0.97931, 0.90399, 1.02258, 1, 1, 0.90399, 1.02258, 0.84041, 0.79104, 0.84041, 0.79104, 0.84041, 0.79104, 0.84041, 0.79104, 1, 1, 0.95923, 1.07034, 0.95923, 1.16862, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.06467, 1.02511, 0.90996, 0.96752, 0.90996, 0.99361, 0.95801, 0.99361, 0.95801, 0.99361, 0.95801, 1.07733, 1.03424, 0.97363, 0.96752, 0.93506, 0.93136, 0.97489, 1.0008, 1, 1, 0.95923, 1.16862, 1.15103, 1.15103, 1.01173, 1.03959, 0.75953, 0.81378, 0.79912, 1.15103, 1.21994, 0.95161, 0.87815, 1.01149, 0.81525, 0.7676, 0.98167, 1.01134, 1.02546, 0.84097, 1.03089, 1.18102, 0.97363, 0.88776, 0.85134, 0.97826, 0.79795, 0.99361, 1.06085, 0.97489, 1.1406, 0.89858, 1.0388, 1.14889, 1.09398, 0.86039, 0.97489, 1.0595, 0.92094, 0.94793, 0.95923, 0.90996, 0.99346, 0.98243, 1.02112, 0.95493, 1.1406, 0.90996, 1.03574, 1.02597, 1.0008, 1.18102, 1.06628, 1.03574, 1.0192, 1.01932, 1.00886, 0.97531, 1.0106, 1.0008, 1.13189, 1.18102, 1.02277, 0.98683, 1.0016, 0.99561, 1.07237, 1.0008, 0.90434, 0.99921, 0.93803, 0.8965, 1.23085, 1.06628, 1.04983, 0.96268, 1.0499, 0.98439, 1.18102, 1.06628, 1.0008, 1.06628, 0.98439, 0.79795, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.09466, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.97278, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.02065, 1, 1, 1, 1, 1, 1, 1.06467, 1.02511, 1.06467, 1.02511, 1.06467, 1.02511, 0.90996, 0.96752, 1, 1.21408, 0.89903, 1, 1, 0.75155, 1.04394, 1.04394, 1.04394, 1.04394, 0.98633, 0.98633, 0.98633, 0.73047, 0.73047, 1.20642, 0.91211, 1.25635, 1.222, 1.02956, 1.03372, 1.03372, 0.96039, 1.24633, 1, 1.12454, 0.93503, 1.03424, 1.19687, 1.03424, 1, 1, 1, 0.771, 1, 1, 1.15749, 1.15749, 1.15749, 1.10948, 0.86279, 0.94434, 0.86279, 0.94434, 0.86182, 1, 1, 1.16897, 1, 0.96085, 0.90137, 1.2107, 1.18416, 1.13973, 0.69825, 0.9716, 2.10339, 1.29004, 1.29004, 1.21172, 1.29004, 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18874, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.09193, 1.09193, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 26034 |
const SegoeuiBoldMetrics = { |
| 26035 |
lineHeight: 1.33008, |
| 26036 |
lineGap: 0 |
| 26037 |
}; |
| 26038 |
const SegoeuiBoldItalicFactors = [1.76738, 1, 1, 0.98946, 1.03959, 1.04016, 1.02809, 1.036, 0.97639, 1.10953, 1.23203, 1.11144, 1.11144, 1.16939, 1.21237, 0.9754, 1.21261, 0.9754, 1.59754, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 0.81378, 0.81378, 1.21237, 1.21237, 1.21237, 0.73541, 0.97847, 0.97363, 0.89723, 0.87897, 1.0426, 0.79429, 0.85292, 0.91149, 1.05815, 1.1406, 0.79631, 0.90128, 0.83853, 1.04396, 1.10615, 0.97552, 0.94436, 0.97552, 0.88641, 0.80527, 0.96083, 1.00135, 1, 1.06777, 0.9817, 0.91142, 0.99361, 1.11144, 1.57293, 1.11144, 1.21237, 0.74627, 1.31818, 1.06585, 0.97042, 0.83055, 0.97042, 0.93503, 1.1261, 0.97042, 0.97922, 1.14236, 0.94552, 1.01054, 1.14236, 1.02471, 0.97922, 0.94165, 0.97042, 0.97042, 1.0276, 0.78929, 1.1261, 0.97922, 0.95874, 1.02197, 0.98507, 0.96752, 0.97168, 0.95107, 1.16579, 0.95107, 1.21237, 1.03959, 1.036, 1.036, 1, 1.036, 1.16579, 0.87357, 1.31818, 1.18754, 1.26781, 1.05356, 1.21237, 1.18622, 0.79487, 0.94994, 1.29004, 1.24047, 1.24047, 1.31818, 1, 0.91484, 0.9754, 1.31818, 1.1349, 1.24866, 1.05356, 1.13934, 1.15574, 1.17389, 0.73541, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.94385, 0.87897, 0.79429, 0.79429, 0.79429, 0.79429, 1.1406, 1.1406, 1.1406, 1.1406, 1.0426, 1.10615, 0.97552, 0.97552, 0.97552, 0.97552, 0.97552, 1.21237, 0.97552, 1.00135, 1.00135, 1.00135, 1.00135, 0.91142, 0.94436, 0.98721, 1.06585, 1.06585, 1.06585, 1.06585, 1.06585, 1.06585, 0.96705, 0.83055, 0.93503, 0.93503, 0.93503, 0.93503, 1.14236, 1.14236, 1.14236, 1.14236, 0.93125, 0.97922, 0.94165, 0.94165, 0.94165, 0.94165, 0.94165, 1.29004, 0.94165, 0.97922, 0.97922, 0.97922, 0.97922, 0.96752, 0.97042, 0.96752, 0.97363, 1.06585, 0.97363, 1.06585, 0.97363, 1.06585, 0.87897, 0.83055, 0.87897, 0.83055, 0.87897, 0.83055, 0.87897, 0.83055, 1.0426, 1.0033, 1.0426, 0.97042, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.91149, 0.97042, 0.91149, 0.97042, 0.91149, 0.97042, 1, 1, 1.05815, 0.97922, 1.05815, 0.97922, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 0.97441, 1.04302, 0.79631, 1.01582, 1, 1, 1.01054, 0.83853, 1.14236, 1, 1, 0.83853, 1.09125, 0.83853, 0.90418, 0.83853, 1.19508, 1.10615, 0.97922, 1, 1, 1.10615, 0.97922, 1.01034, 1.10466, 0.97922, 0.97552, 0.94165, 0.97552, 0.94165, 0.97552, 0.94165, 0.91602, 0.91981, 0.88641, 1.0276, 1, 1, 0.88641, 1.0276, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, 0.78929, 1, 1, 0.96083, 1.05403, 0.95923, 1.16862, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.06777, 1.02197, 0.91142, 0.96752, 0.91142, 0.99361, 0.97168, 0.99361, 0.97168, 0.99361, 0.97168, 1.23199, 1.036, 0.97363, 1.06585, 0.94385, 0.96705, 0.97552, 0.94165, 1, 1, 0.96083, 1.1261, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 0.95161, 1.27126, 1.00811, 0.83284, 0.77702, 0.99137, 0.95253, 1.0347, 0.86142, 1.07205, 1.14236, 0.97363, 0.89723, 0.86869, 1.09818, 0.79429, 0.99361, 1.05815, 0.97552, 1.1406, 0.90128, 1.06662, 1.04396, 1.10615, 0.84918, 0.97552, 1.04694, 0.94436, 0.98015, 0.96083, 0.91142, 1.00356, 0.9817, 1.01945, 0.98999, 1.1406, 0.91142, 1.04961, 0.9898, 1.00639, 1.14236, 1.07514, 1.04961, 0.99607, 1.02897, 1.008, 0.9898, 0.95134, 1.00639, 1.11121, 1.14236, 1.00518, 0.97981, 1.02186, 1, 1.08578, 0.94165, 0.99314, 0.98387, 0.93028, 0.93377, 1.35125, 1.07514, 1.10687, 0.93491, 1.04232, 1.00351, 1.14236, 1.07514, 0.94165, 1.07514, 1.00351, 0.79429, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.09097, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.93503, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.96609, 1, 1, 1, 1, 1, 1, 1.06777, 1.02197, 1.06777, 1.02197, 1.06777, 1.02197, 0.91142, 0.96752, 1, 1.21261, 0.89903, 1, 1, 0.75155, 1.04745, 1.04745, 1.04745, 1.04394, 0.98633, 0.98633, 0.98633, 0.72959, 0.72959, 1.20502, 0.91406, 1.26514, 1.222, 1.02956, 1.03372, 1.03372, 0.96039, 1.24633, 1, 1.09125, 0.93327, 1.03336, 1.16541, 1.036, 1, 1, 1, 0.771, 1, 1, 1.15574, 1.15574, 1.15574, 1.15574, 0.86364, 0.94434, 0.86279, 0.94434, 0.86224, 1, 1, 1.16798, 1, 0.96085, 0.90068, 1.21237, 1.18416, 1.13904, 0.69825, 0.9716, 2.10339, 1.29004, 1.29004, 1.21339, 1.29004, 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18775, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.13269, 1.13269, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 26039 |
const SegoeuiBoldItalicMetrics = { |
| 26040 |
lineHeight: 1.33008, |
| 26041 |
lineGap: 0 |
| 26042 |
}; |
| 26043 |
const SegoeuiItalicFactors = [1.76738, 1, 1, 0.98946, 1.14763, 1.05365, 1.06234, 0.96927, 0.92586, 1.15373, 1.18414, 0.91349, 0.91349, 1.07403, 1.17308, 0.78383, 1.20088, 0.78383, 1.42531, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.78383, 0.78383, 1.17308, 1.17308, 1.17308, 0.77349, 0.94565, 0.94729, 0.85944, 0.88506, 0.9858, 0.74817, 0.80016, 0.88449, 0.98039, 0.95782, 0.69238, 0.89898, 0.83231, 0.98183, 1.03989, 0.96924, 0.86237, 0.96924, 0.80595, 0.74524, 0.86091, 0.95402, 0.94143, 0.98448, 0.8858, 0.83089, 0.93285, 1.0949, 1.39016, 1.0949, 1.45994, 0.74627, 1.04839, 0.97454, 0.97454, 0.87207, 0.97454, 0.87533, 1.06151, 0.97454, 1.00176, 1.16484, 1.08132, 0.98047, 1.16484, 1.02989, 1.01054, 0.96225, 0.97454, 0.97454, 1.06598, 0.79004, 1.16344, 1.00351, 0.94629, 0.9973, 0.91016, 0.96777, 0.9043, 0.91082, 0.92481, 0.91082, 1.17308, 0.95748, 0.96927, 0.96927, 1, 0.96927, 0.92481, 0.80597, 1.04839, 1.23393, 1.1781, 0.9245, 1.17308, 1.20808, 0.63218, 0.94261, 1.24822, 1.09971, 1.09971, 1.04839, 1, 0.85273, 0.78032, 1.04839, 1.09971, 1.22326, 0.9245, 1.09836, 1.13525, 1.15222, 0.70424, 0.94729, 0.94729, 0.94729, 0.94729, 0.94729, 0.94729, 0.85498, 0.88506, 0.74817, 0.74817, 0.74817, 0.74817, 0.95782, 0.95782, 0.95782, 0.95782, 0.9858, 1.03989, 0.96924, 0.96924, 0.96924, 0.96924, 0.96924, 1.17308, 0.96924, 0.95402, 0.95402, 0.95402, 0.95402, 0.83089, 0.86237, 0.88409, 0.97454, 0.97454, 0.97454, 0.97454, 0.97454, 0.97454, 0.92916, 0.87207, 0.87533, 0.87533, 0.87533, 0.87533, 0.93146, 0.93146, 0.93146, 0.93146, 0.93854, 1.01054, 0.96225, 0.96225, 0.96225, 0.96225, 0.96225, 1.24822, 0.8761, 1.00351, 1.00351, 1.00351, 1.00351, 0.96777, 0.97454, 0.96777, 0.94729, 0.97454, 0.94729, 0.97454, 0.94729, 0.97454, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506, 0.87207, 0.9858, 0.95391, 0.9858, 0.97454, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.88449, 0.97454, 0.88449, 0.97454, 0.88449, 0.97454, 1, 1, 0.98039, 1.00176, 0.98039, 1.00176, 0.95782, 0.93146, 0.95782, 0.93146, 0.95782, 0.93146, 0.95782, 1.16484, 0.95782, 0.93146, 0.84421, 1.12761, 0.69238, 1.08132, 1, 1, 0.98047, 0.83231, 1.16484, 1, 1, 0.84723, 1.04861, 0.84723, 0.78755, 0.83231, 1.23736, 1.03989, 1.01054, 1, 1, 1.03989, 1.01054, 0.9857, 1.03849, 1.01054, 0.96924, 0.96225, 0.96924, 0.96225, 0.96924, 0.96225, 0.92383, 0.90171, 0.80595, 1.06598, 1, 1, 0.80595, 1.06598, 0.74524, 0.79004, 0.74524, 0.79004, 0.74524, 0.79004, 0.74524, 0.79004, 1, 1, 0.86091, 1.02759, 0.85771, 1.16344, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.98448, 0.9973, 0.83089, 0.96777, 0.83089, 0.93285, 0.9043, 0.93285, 0.9043, 0.93285, 0.9043, 1.31868, 0.96927, 0.94729, 0.97454, 0.85498, 0.92916, 0.96924, 0.8761, 1, 1, 0.86091, 1.16344, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 0.81965, 0.81965, 0.94729, 0.78032, 0.71022, 0.90883, 0.84171, 0.99877, 0.77596, 1.05734, 1.2, 0.94729, 0.85944, 0.82791, 0.9607, 0.74817, 0.93285, 0.98039, 0.96924, 0.95782, 0.89898, 0.98316, 0.98183, 1.03989, 0.78614, 0.96924, 0.97642, 0.86237, 0.86075, 0.86091, 0.83089, 0.90082, 0.8858, 0.97296, 1.01284, 0.95782, 0.83089, 1.0976, 1.04, 1.03342, 1.2, 1.0675, 1.0976, 0.98205, 1.03809, 1.05097, 1.04, 0.95364, 1.03342, 1.05401, 1.2, 1.02148, 1.0119, 1.04724, 1.0127, 1.02732, 0.96225, 0.8965, 0.97783, 0.93574, 0.94818, 1.30679, 1.0675, 1.11826, 0.99821, 1.0557, 1.0326, 1.2, 1.0675, 0.96225, 1.0675, 1.0326, 0.74817, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.03754, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.87533, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.98705, 1, 1, 1, 1, 1, 1, 0.98448, 0.9973, 0.98448, 0.9973, 0.98448, 0.9973, 0.83089, 0.96777, 1, 1.20088, 0.89903, 1, 1, 0.75155, 0.94945, 0.94945, 0.94945, 0.94945, 1.12317, 1.12317, 1.12317, 0.67603, 0.67603, 1.15621, 0.73584, 1.21191, 1.22135, 1.06483, 0.94868, 0.94868, 0.95996, 1.24633, 1, 1.07497, 0.87709, 0.96927, 1.01473, 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.09836, 1.09836, 1.09836, 1.01522, 0.86321, 0.94434, 0.8649, 0.94434, 0.86182, 1, 1, 1.083, 1, 0.91578, 0.86438, 1.17308, 1.18416, 1.14589, 0.69825, 0.97622, 1.96791, 1.24822, 1.24822, 1.17308, 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.17984, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.10742, 1.10742, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 26044 |
const SegoeuiItalicMetrics = { |
| 26045 |
lineHeight: 1.33008, |
| 26046 |
lineGap: 0 |
| 26047 |
}; |
| 26048 |
const SegoeuiRegularFactors = [1.76738, 1, 1, 0.98594, 1.02285, 1.10454, 1.06234, 0.96927, 0.92037, 1.19985, 1.2046, 0.90616, 0.90616, 1.07152, 1.1714, 0.78032, 1.20088, 0.78032, 1.40246, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.78032, 0.78032, 1.1714, 1.1714, 1.1714, 0.80597, 0.94084, 0.96706, 0.85944, 0.85734, 0.97093, 0.75842, 0.79936, 0.88198, 0.9831, 0.95782, 0.71387, 0.86969, 0.84636, 1.07796, 1.03584, 0.96924, 0.83968, 0.96924, 0.82826, 0.79649, 0.85771, 0.95132, 0.93119, 0.98965, 0.88433, 0.8287, 0.93365, 1.08612, 1.3638, 1.08612, 1.45786, 0.74627, 0.80499, 0.91484, 1.05707, 0.92383, 1.05882, 0.9403, 1.12654, 1.05882, 1.01756, 1.09011, 1.09011, 0.99414, 1.09011, 1.034, 1.01756, 1.05356, 1.05707, 1.05882, 1.04399, 0.84863, 1.21968, 1.01756, 0.95801, 1.00068, 0.91797, 0.96777, 0.9043, 0.90351, 0.92105, 0.90351, 1.1714, 0.85337, 0.96927, 0.96927, 0.99912, 0.96927, 0.92105, 0.80597, 1.2434, 1.20808, 1.05937, 0.90957, 1.1714, 1.20808, 0.75155, 0.94261, 1.24644, 1.09971, 1.09971, 0.84751, 1, 0.85273, 0.78032, 0.61584, 1.05425, 1.17914, 0.90957, 1.08665, 1.11593, 1.14169, 0.73381, 0.96706, 0.96706, 0.96706, 0.96706, 0.96706, 0.96706, 0.86035, 0.85734, 0.75842, 0.75842, 0.75842, 0.75842, 0.95782, 0.95782, 0.95782, 0.95782, 0.97093, 1.03584, 0.96924, 0.96924, 0.96924, 0.96924, 0.96924, 1.1714, 0.96924, 0.95132, 0.95132, 0.95132, 0.95132, 0.8287, 0.83968, 0.89049, 0.91484, 0.91484, 0.91484, 0.91484, 0.91484, 0.91484, 0.93575, 0.92383, 0.9403, 0.9403, 0.9403, 0.9403, 0.8717, 0.8717, 0.8717, 0.8717, 1.00527, 1.01756, 1.05356, 1.05356, 1.05356, 1.05356, 1.05356, 1.24644, 0.95923, 1.01756, 1.01756, 1.01756, 1.01756, 0.96777, 1.05707, 0.96777, 0.96706, 0.91484, 0.96706, 0.91484, 0.96706, 0.91484, 0.85734, 0.92383, 0.85734, 0.92383, 0.85734, 0.92383, 0.85734, 0.92383, 0.97093, 1.0969, 0.97093, 1.05882, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.88198, 1.05882, 0.88198, 1.05882, 0.88198, 1.05882, 1, 1, 0.9831, 1.01756, 0.9831, 1.01756, 0.95782, 0.8717, 0.95782, 0.8717, 0.95782, 0.8717, 0.95782, 1.09011, 0.95782, 0.8717, 0.84784, 1.11551, 0.71387, 1.09011, 1, 1, 0.99414, 0.84636, 1.09011, 1, 1, 0.84636, 1.0536, 0.84636, 0.94298, 0.84636, 1.23297, 1.03584, 1.01756, 1, 1, 1.03584, 1.01756, 1.00323, 1.03444, 1.01756, 0.96924, 1.05356, 0.96924, 1.05356, 0.96924, 1.05356, 0.93066, 0.98293, 0.82826, 1.04399, 1, 1, 0.82826, 1.04399, 0.79649, 0.84863, 0.79649, 0.84863, 0.79649, 0.84863, 0.79649, 0.84863, 1, 1, 0.85771, 1.17318, 0.85771, 1.21968, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.98965, 1.00068, 0.8287, 0.96777, 0.8287, 0.93365, 0.9043, 0.93365, 0.9043, 0.93365, 0.9043, 1.08571, 0.96927, 0.96706, 0.91484, 0.86035, 0.93575, 0.96924, 0.95923, 1, 1, 0.85771, 1.21968, 1.11437, 1.11437, 0.93109, 0.91202, 0.60411, 0.84164, 0.55572, 1.01173, 0.97361, 0.81818, 0.81818, 0.96635, 0.78032, 0.72727, 0.92366, 0.98601, 1.03405, 0.77968, 1.09799, 1.2, 0.96706, 0.85944, 0.85638, 0.96491, 0.75842, 0.93365, 0.9831, 0.96924, 0.95782, 0.86969, 0.94152, 1.07796, 1.03584, 0.78437, 0.96924, 0.98715, 0.83968, 0.83491, 0.85771, 0.8287, 0.94492, 0.88433, 0.9287, 1.0098, 0.95782, 0.8287, 1.0625, 0.98248, 1.03424, 1.2, 1.01071, 1.0625, 0.95246, 1.03809, 1.04912, 0.98248, 1.00221, 1.03424, 1.05443, 1.2, 1.04785, 0.99609, 1.00169, 1.05176, 0.99346, 1.05356, 0.9087, 1.03004, 0.95542, 0.93117, 1.23362, 1.01071, 1.07831, 1.02512, 1.05205, 1.03502, 1.2, 1.01071, 1.05356, 1.01071, 1.03502, 0.75842, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.03719, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9403, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.04021, 1, 1, 1, 1, 1, 1, 0.98965, 1.00068, 0.98965, 1.00068, 0.98965, 1.00068, 0.8287, 0.96777, 1, 1.20088, 0.89903, 1, 1, 0.75155, 1.03077, 1.03077, 1.03077, 1.03077, 1.13196, 1.13196, 1.13196, 0.67428, 0.67428, 1.16039, 0.73291, 1.20996, 1.22135, 1.06483, 0.94868, 0.94868, 0.95996, 1.24633, 1, 1.07497, 0.87796, 0.96927, 1.01518, 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.10539, 1.10539, 1.11358, 1.06967, 0.86279, 0.94434, 0.86279, 0.94434, 0.86182, 1, 1, 1.083, 1, 0.91578, 0.86507, 1.1714, 1.18416, 1.14589, 0.69825, 0.97622, 1.9697, 1.24822, 1.24822, 1.17238, 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18083, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.10938, 1.10938, 1, 1, 1, 1.05425, 1.09971, 1.09971, 1.09971, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; |
| 26049 |
const SegoeuiRegularMetrics = { |
| 26050 |
lineHeight: 1.33008, |
| 26051 |
lineGap: 0 |
| 26052 |
}; |
| 26053 |
|
| 26054 |
;// ./src/core/xfa_fonts.js |
| 26055 |
|
| 26056 |
|
| 26057 |
|
| 26058 |
|
| 26059 |
|
| 26060 |
|
| 26061 |
|
| 26062 |
|
| 26063 |
const getXFAFontMap = getLookupTableFactory(function (t) { |
| 26064 |
t["MyriadPro-Regular"] = t["PdfJS-Fallback-Regular"] = { |
| 26065 |
name: "LiberationSans-Regular", |
| 26066 |
factors: MyriadProRegularFactors, |
| 26067 |
baseWidths: LiberationSansRegularWidths, |
| 26068 |
baseMapping: LiberationSansRegularMapping, |
| 26069 |
metrics: MyriadProRegularMetrics |
| 26070 |
}; |
| 26071 |
t["MyriadPro-Bold"] = t["PdfJS-Fallback-Bold"] = { |
| 26072 |
name: "LiberationSans-Bold", |
| 26073 |
factors: MyriadProBoldFactors, |
| 26074 |
baseWidths: LiberationSansBoldWidths, |
| 26075 |
baseMapping: LiberationSansBoldMapping, |
| 26076 |
metrics: MyriadProBoldMetrics |
| 26077 |
}; |
| 26078 |
t["MyriadPro-It"] = t["MyriadPro-Italic"] = t["PdfJS-Fallback-Italic"] = { |
| 26079 |
name: "LiberationSans-Italic", |
| 26080 |
factors: MyriadProItalicFactors, |
| 26081 |
baseWidths: LiberationSansItalicWidths, |
| 26082 |
baseMapping: LiberationSansItalicMapping, |
| 26083 |
metrics: MyriadProItalicMetrics |
| 26084 |
}; |
| 26085 |
t["MyriadPro-BoldIt"] = t["MyriadPro-BoldItalic"] = t["PdfJS-Fallback-BoldItalic"] = { |
| 26086 |
name: "LiberationSans-BoldItalic", |
| 26087 |
factors: MyriadProBoldItalicFactors, |
| 26088 |
baseWidths: LiberationSansBoldItalicWidths, |
| 26089 |
baseMapping: LiberationSansBoldItalicMapping, |
| 26090 |
metrics: MyriadProBoldItalicMetrics |
| 26091 |
}; |
| 26092 |
t.ArialMT = t.Arial = t["Arial-Regular"] = { |
| 26093 |
name: "LiberationSans-Regular", |
| 26094 |
baseWidths: LiberationSansRegularWidths, |
| 26095 |
baseMapping: LiberationSansRegularMapping |
| 26096 |
}; |
| 26097 |
t["Arial-BoldMT"] = t["Arial-Bold"] = { |
| 26098 |
name: "LiberationSans-Bold", |
| 26099 |
baseWidths: LiberationSansBoldWidths, |
| 26100 |
baseMapping: LiberationSansBoldMapping |
| 26101 |
}; |
| 26102 |
t["Arial-ItalicMT"] = t["Arial-Italic"] = { |
| 26103 |
name: "LiberationSans-Italic", |
| 26104 |
baseWidths: LiberationSansItalicWidths, |
| 26105 |
baseMapping: LiberationSansItalicMapping |
| 26106 |
}; |
| 26107 |
t["Arial-BoldItalicMT"] = t["Arial-BoldItalic"] = { |
| 26108 |
name: "LiberationSans-BoldItalic", |
| 26109 |
baseWidths: LiberationSansBoldItalicWidths, |
| 26110 |
baseMapping: LiberationSansBoldItalicMapping |
| 26111 |
}; |
| 26112 |
t["Calibri-Regular"] = { |
| 26113 |
name: "LiberationSans-Regular", |
| 26114 |
factors: CalibriRegularFactors, |
| 26115 |
baseWidths: LiberationSansRegularWidths, |
| 26116 |
baseMapping: LiberationSansRegularMapping, |
| 26117 |
metrics: CalibriRegularMetrics |
| 26118 |
}; |
| 26119 |
t["Calibri-Bold"] = { |
| 26120 |
name: "LiberationSans-Bold", |
| 26121 |
factors: CalibriBoldFactors, |
| 26122 |
baseWidths: LiberationSansBoldWidths, |
| 26123 |
baseMapping: LiberationSansBoldMapping, |
| 26124 |
metrics: CalibriBoldMetrics |
| 26125 |
}; |
| 26126 |
t["Calibri-Italic"] = { |
| 26127 |
name: "LiberationSans-Italic", |
| 26128 |
factors: CalibriItalicFactors, |
| 26129 |
baseWidths: LiberationSansItalicWidths, |
| 26130 |
baseMapping: LiberationSansItalicMapping, |
| 26131 |
metrics: CalibriItalicMetrics |
| 26132 |
}; |
| 26133 |
t["Calibri-BoldItalic"] = { |
| 26134 |
name: "LiberationSans-BoldItalic", |
| 26135 |
factors: CalibriBoldItalicFactors, |
| 26136 |
baseWidths: LiberationSansBoldItalicWidths, |
| 26137 |
baseMapping: LiberationSansBoldItalicMapping, |
| 26138 |
metrics: CalibriBoldItalicMetrics |
| 26139 |
}; |
| 26140 |
t["Segoeui-Regular"] = { |
| 26141 |
name: "LiberationSans-Regular", |
| 26142 |
factors: SegoeuiRegularFactors, |
| 26143 |
baseWidths: LiberationSansRegularWidths, |
| 26144 |
baseMapping: LiberationSansRegularMapping, |
| 26145 |
metrics: SegoeuiRegularMetrics |
| 26146 |
}; |
| 26147 |
t["Segoeui-Bold"] = { |
| 26148 |
name: "LiberationSans-Bold", |
| 26149 |
factors: SegoeuiBoldFactors, |
| 26150 |
baseWidths: LiberationSansBoldWidths, |
| 26151 |
baseMapping: LiberationSansBoldMapping, |
| 26152 |
metrics: SegoeuiBoldMetrics |
| 26153 |
}; |
| 26154 |
t["Segoeui-Italic"] = { |
| 26155 |
name: "LiberationSans-Italic", |
| 26156 |
factors: SegoeuiItalicFactors, |
| 26157 |
baseWidths: LiberationSansItalicWidths, |
| 26158 |
baseMapping: LiberationSansItalicMapping, |
| 26159 |
metrics: SegoeuiItalicMetrics |
| 26160 |
}; |
| 26161 |
t["Segoeui-BoldItalic"] = { |
| 26162 |
name: "LiberationSans-BoldItalic", |
| 26163 |
factors: SegoeuiBoldItalicFactors, |
| 26164 |
baseWidths: LiberationSansBoldItalicWidths, |
| 26165 |
baseMapping: LiberationSansBoldItalicMapping, |
| 26166 |
metrics: SegoeuiBoldItalicMetrics |
| 26167 |
}; |
| 26168 |
t["Helvetica-Regular"] = t.Helvetica = { |
| 26169 |
name: "LiberationSans-Regular", |
| 26170 |
factors: HelveticaRegularFactors, |
| 26171 |
baseWidths: LiberationSansRegularWidths, |
| 26172 |
baseMapping: LiberationSansRegularMapping, |
| 26173 |
metrics: HelveticaRegularMetrics |
| 26174 |
}; |
| 26175 |
t["Helvetica-Bold"] = { |
| 26176 |
name: "LiberationSans-Bold", |
| 26177 |
factors: HelveticaBoldFactors, |
| 26178 |
baseWidths: LiberationSansBoldWidths, |
| 26179 |
baseMapping: LiberationSansBoldMapping, |
| 26180 |
metrics: HelveticaBoldMetrics |
| 26181 |
}; |
| 26182 |
t["Helvetica-Italic"] = { |
| 26183 |
name: "LiberationSans-Italic", |
| 26184 |
factors: HelveticaItalicFactors, |
| 26185 |
baseWidths: LiberationSansItalicWidths, |
| 26186 |
baseMapping: LiberationSansItalicMapping, |
| 26187 |
metrics: HelveticaItalicMetrics |
| 26188 |
}; |
| 26189 |
t["Helvetica-BoldItalic"] = { |
| 26190 |
name: "LiberationSans-BoldItalic", |
| 26191 |
factors: HelveticaBoldItalicFactors, |
| 26192 |
baseWidths: LiberationSansBoldItalicWidths, |
| 26193 |
baseMapping: LiberationSansBoldItalicMapping, |
| 26194 |
metrics: HelveticaBoldItalicMetrics |
| 26195 |
}; |
| 26196 |
}); |
| 26197 |
function getXfaFontName(name) { |
| 26198 |
const fontName = normalizeFontName(name); |
| 26199 |
const fontMap = getXFAFontMap(); |
| 26200 |
return fontMap[fontName]; |
| 26201 |
} |
| 26202 |
function getXfaFontWidths(name) { |
| 26203 |
const info = getXfaFontName(name); |
| 26204 |
if (!info) { |
| 26205 |
return null; |
| 26206 |
} |
| 26207 |
const { |
| 26208 |
baseWidths, |
| 26209 |
baseMapping, |
| 26210 |
factors |
| 26211 |
} = info; |
| 26212 |
const rescaledBaseWidths = !factors ? baseWidths : baseWidths.map((w, i) => w * factors[i]); |
| 26213 |
let currentCode = -2; |
| 26214 |
let currentArray; |
| 26215 |
const newWidths = []; |
| 26216 |
for (const [unicode, glyphIndex] of baseMapping.map((charUnicode, index) => [charUnicode, index]).sort(([unicode1], [unicode2]) => unicode1 - unicode2)) { |
| 26217 |
if (unicode === -1) { |
| 26218 |
continue; |
| 26219 |
} |
| 26220 |
if (unicode === currentCode + 1) { |
| 26221 |
currentArray.push(rescaledBaseWidths[glyphIndex]); |
| 26222 |
currentCode += 1; |
| 26223 |
} else { |
| 26224 |
currentCode = unicode; |
| 26225 |
currentArray = [rescaledBaseWidths[glyphIndex]]; |
| 26226 |
newWidths.push(unicode, currentArray); |
| 26227 |
} |
| 26228 |
} |
| 26229 |
return newWidths; |
| 26230 |
} |
| 26231 |
function getXfaFontDict(name) { |
| 26232 |
const widths = getXfaFontWidths(name); |
| 26233 |
const dict = new Dict(null); |
| 26234 |
dict.set("BaseFont", Name.get(name)); |
| 26235 |
dict.set("Type", Name.get("Font")); |
| 26236 |
dict.set("Subtype", Name.get("CIDFontType2")); |
| 26237 |
dict.set("Encoding", Name.get("Identity-H")); |
| 26238 |
dict.set("CIDToGIDMap", Name.get("Identity")); |
| 26239 |
dict.set("W", widths); |
| 26240 |
dict.set("FirstChar", widths[0]); |
| 26241 |
dict.set("LastChar", widths.at(-2) + widths.at(-1).length - 1); |
| 26242 |
const descriptor = new Dict(null); |
| 26243 |
dict.set("FontDescriptor", descriptor); |
| 26244 |
const systemInfo = new Dict(null); |
| 26245 |
systemInfo.set("Ordering", "Identity"); |
| 26246 |
systemInfo.set("Registry", "Adobe"); |
| 26247 |
systemInfo.set("Supplement", 0); |
| 26248 |
dict.set("CIDSystemInfo", systemInfo); |
| 26249 |
return dict; |
| 26250 |
} |
| 26251 |
|
| 26252 |
;// ./src/core/ps_parser.js |
| 26253 |
|
| 26254 |
|
| 26255 |
|
| 26256 |
class PostScriptParser { |
| 26257 |
constructor(lexer) { |
| 26258 |
this.lexer = lexer; |
| 26259 |
this.operators = []; |
| 26260 |
this.token = null; |
| 26261 |
this.prev = null; |
| 26262 |
} |
| 26263 |
nextToken() { |
| 26264 |
this.prev = this.token; |
| 26265 |
this.token = this.lexer.getToken(); |
| 26266 |
} |
| 26267 |
accept(type) { |
| 26268 |
if (this.token.type === type) { |
| 26269 |
this.nextToken(); |
| 26270 |
return true; |
| 26271 |
} |
| 26272 |
return false; |
| 26273 |
} |
| 26274 |
expect(type) { |
| 26275 |
if (this.accept(type)) { |
| 26276 |
return true; |
| 26277 |
} |
| 26278 |
throw new FormatError(`Unexpected symbol: found ${this.token.type} expected ${type}.`); |
| 26279 |
} |
| 26280 |
parse() { |
| 26281 |
this.nextToken(); |
| 26282 |
this.expect(PostScriptTokenTypes.LBRACE); |
| 26283 |
this.parseBlock(); |
| 26284 |
this.expect(PostScriptTokenTypes.RBRACE); |
| 26285 |
return this.operators; |
| 26286 |
} |
| 26287 |
parseBlock() { |
| 26288 |
while (true) { |
| 26289 |
if (this.accept(PostScriptTokenTypes.NUMBER)) { |
| 26290 |
this.operators.push(this.prev.value); |
| 26291 |
} else if (this.accept(PostScriptTokenTypes.OPERATOR)) { |
| 26292 |
this.operators.push(this.prev.value); |
| 26293 |
} else if (this.accept(PostScriptTokenTypes.LBRACE)) { |
| 26294 |
this.parseCondition(); |
| 26295 |
} else { |
| 26296 |
return; |
| 26297 |
} |
| 26298 |
} |
| 26299 |
} |
| 26300 |
parseCondition() { |
| 26301 |
const conditionLocation = this.operators.length; |
| 26302 |
this.operators.push(null, null); |
| 26303 |
this.parseBlock(); |
| 26304 |
this.expect(PostScriptTokenTypes.RBRACE); |
| 26305 |
if (this.accept(PostScriptTokenTypes.IF)) { |
| 26306 |
this.operators[conditionLocation] = this.operators.length; |
| 26307 |
this.operators[conditionLocation + 1] = "jz"; |
| 26308 |
} else if (this.accept(PostScriptTokenTypes.LBRACE)) { |
| 26309 |
const jumpLocation = this.operators.length; |
| 26310 |
this.operators.push(null, null); |
| 26311 |
const endOfTrue = this.operators.length; |
| 26312 |
this.parseBlock(); |
| 26313 |
this.expect(PostScriptTokenTypes.RBRACE); |
| 26314 |
this.expect(PostScriptTokenTypes.IFELSE); |
| 26315 |
this.operators[jumpLocation] = this.operators.length; |
| 26316 |
this.operators[jumpLocation + 1] = "j"; |
| 26317 |
this.operators[conditionLocation] = endOfTrue; |
| 26318 |
this.operators[conditionLocation + 1] = "jz"; |
| 26319 |
} else { |
| 26320 |
throw new FormatError("PS Function: error parsing conditional."); |
| 26321 |
} |
| 26322 |
} |
| 26323 |
} |
| 26324 |
const PostScriptTokenTypes = { |
| 26325 |
LBRACE: 0, |
| 26326 |
RBRACE: 1, |
| 26327 |
NUMBER: 2, |
| 26328 |
OPERATOR: 3, |
| 26329 |
IF: 4, |
| 26330 |
IFELSE: 5 |
| 26331 |
}; |
| 26332 |
class PostScriptToken { |
| 26333 |
static get opCache() { |
| 26334 |
return shadow(this, "opCache", Object.create(null)); |
| 26335 |
} |
| 26336 |
constructor(type, value) { |
| 26337 |
this.type = type; |
| 26338 |
this.value = value; |
| 26339 |
} |
| 26340 |
static getOperator(op) { |
| 26341 |
return PostScriptToken.opCache[op] ||= new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); |
| 26342 |
} |
| 26343 |
static get LBRACE() { |
| 26344 |
return shadow(this, "LBRACE", new PostScriptToken(PostScriptTokenTypes.LBRACE, "{")); |
| 26345 |
} |
| 26346 |
static get RBRACE() { |
| 26347 |
return shadow(this, "RBRACE", new PostScriptToken(PostScriptTokenTypes.RBRACE, "}")); |
| 26348 |
} |
| 26349 |
static get IF() { |
| 26350 |
return shadow(this, "IF", new PostScriptToken(PostScriptTokenTypes.IF, "IF")); |
| 26351 |
} |
| 26352 |
static get IFELSE() { |
| 26353 |
return shadow(this, "IFELSE", new PostScriptToken(PostScriptTokenTypes.IFELSE, "IFELSE")); |
| 26354 |
} |
| 26355 |
} |
| 26356 |
class PostScriptLexer { |
| 26357 |
constructor(stream) { |
| 26358 |
this.stream = stream; |
| 26359 |
this.nextChar(); |
| 26360 |
this.strBuf = []; |
| 26361 |
} |
| 26362 |
nextChar() { |
| 26363 |
return this.currentChar = this.stream.getByte(); |
| 26364 |
} |
| 26365 |
getToken() { |
| 26366 |
let comment = false; |
| 26367 |
let ch = this.currentChar; |
| 26368 |
while (true) { |
| 26369 |
if (ch < 0) { |
| 26370 |
return EOF; |
| 26371 |
} |
| 26372 |
if (comment) { |
| 26373 |
if (ch === 0x0a || ch === 0x0d) { |
| 26374 |
comment = false; |
| 26375 |
} |
| 26376 |
} else if (ch === 0x25) { |
| 26377 |
comment = true; |
| 26378 |
} else if (!isWhiteSpace(ch)) { |
| 26379 |
break; |
| 26380 |
} |
| 26381 |
ch = this.nextChar(); |
| 26382 |
} |
| 26383 |
switch (ch | 0) { |
| 26384 |
case 0x30: |
| 26385 |
case 0x31: |
| 26386 |
case 0x32: |
| 26387 |
case 0x33: |
| 26388 |
case 0x34: |
| 26389 |
case 0x35: |
| 26390 |
case 0x36: |
| 26391 |
case 0x37: |
| 26392 |
case 0x38: |
| 26393 |
case 0x39: |
| 26394 |
case 0x2b: |
| 26395 |
case 0x2d: |
| 26396 |
case 0x2e: |
| 26397 |
return new PostScriptToken(PostScriptTokenTypes.NUMBER, this.getNumber()); |
| 26398 |
case 0x7b: |
| 26399 |
this.nextChar(); |
| 26400 |
return PostScriptToken.LBRACE; |
| 26401 |
case 0x7d: |
| 26402 |
this.nextChar(); |
| 26403 |
return PostScriptToken.RBRACE; |
| 26404 |
} |
| 26405 |
const strBuf = this.strBuf; |
| 26406 |
strBuf.length = 0; |
| 26407 |
strBuf[0] = String.fromCharCode(ch); |
| 26408 |
while ((ch = this.nextChar()) >= 0 && (ch >= 0x41 && ch <= 0x5a || ch >= 0x61 && ch <= 0x7a)) { |
| 26409 |
strBuf.push(String.fromCharCode(ch)); |
| 26410 |
} |
| 26411 |
const str = strBuf.join(""); |
| 26412 |
switch (str.toLowerCase()) { |
| 26413 |
case "if": |
| 26414 |
return PostScriptToken.IF; |
| 26415 |
case "ifelse": |
| 26416 |
return PostScriptToken.IFELSE; |
| 26417 |
default: |
| 26418 |
return PostScriptToken.getOperator(str); |
| 26419 |
} |
| 26420 |
} |
| 26421 |
getNumber() { |
| 26422 |
let ch = this.currentChar; |
| 26423 |
const strBuf = this.strBuf; |
| 26424 |
strBuf.length = 0; |
| 26425 |
strBuf[0] = String.fromCharCode(ch); |
| 26426 |
while ((ch = this.nextChar()) >= 0) { |
| 26427 |
if (ch >= 0x30 && ch <= 0x39 || ch === 0x2d || ch === 0x2e) { |
| 26428 |
strBuf.push(String.fromCharCode(ch)); |
| 26429 |
} else { |
| 26430 |
break; |
| 26431 |
} |
| 26432 |
} |
| 26433 |
const value = parseFloat(strBuf.join("")); |
| 26434 |
if (isNaN(value)) { |
| 26435 |
throw new FormatError(`Invalid floating point number: ${value}`); |
| 26436 |
} |
| 26437 |
return value; |
| 26438 |
} |
| 26439 |
} |
| 26440 |
|
| 26441 |
;// ./src/core/image_utils.js |
| 26442 |
|
| 26443 |
|
| 26444 |
class BaseLocalCache { |
| 26445 |
constructor(options) { |
| 26446 |
this._onlyRefs = options?.onlyRefs === true; |
| 26447 |
if (!this._onlyRefs) { |
| 26448 |
this._nameRefMap = new Map(); |
| 26449 |
this._imageMap = new Map(); |
| 26450 |
} |
| 26451 |
this._imageCache = new RefSetCache(); |
| 26452 |
} |
| 26453 |
getByName(name) { |
| 26454 |
if (this._onlyRefs) { |
| 26455 |
unreachable("Should not call `getByName` method."); |
| 26456 |
} |
| 26457 |
const ref = this._nameRefMap.get(name); |
| 26458 |
if (ref) { |
| 26459 |
return this.getByRef(ref); |
| 26460 |
} |
| 26461 |
return this._imageMap.get(name) || null; |
| 26462 |
} |
| 26463 |
getByRef(ref) { |
| 26464 |
return this._imageCache.get(ref) || null; |
| 26465 |
} |
| 26466 |
set(name, ref, data) { |
| 26467 |
unreachable("Abstract method `set` called."); |
| 26468 |
} |
| 26469 |
} |
| 26470 |
class LocalImageCache extends BaseLocalCache { |
| 26471 |
set(name, ref = null, data) { |
| 26472 |
if (typeof name !== "string") { |
| 26473 |
throw new Error('LocalImageCache.set - expected "name" argument.'); |
| 26474 |
} |
| 26475 |
if (ref) { |
| 26476 |
if (this._imageCache.has(ref)) { |
| 26477 |
return; |
| 26478 |
} |
| 26479 |
this._nameRefMap.set(name, ref); |
| 26480 |
this._imageCache.put(ref, data); |
| 26481 |
return; |
| 26482 |
} |
| 26483 |
if (this._imageMap.has(name)) { |
| 26484 |
return; |
| 26485 |
} |
| 26486 |
this._imageMap.set(name, data); |
| 26487 |
} |
| 26488 |
} |
| 26489 |
class LocalColorSpaceCache extends BaseLocalCache { |
| 26490 |
set(name = null, ref = null, data) { |
| 26491 |
if (typeof name !== "string" && !ref) { |
| 26492 |
throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.'); |
| 26493 |
} |
| 26494 |
if (ref) { |
| 26495 |
if (this._imageCache.has(ref)) { |
| 26496 |
return; |
| 26497 |
} |
| 26498 |
if (name !== null) { |
| 26499 |
this._nameRefMap.set(name, ref); |
| 26500 |
} |
| 26501 |
this._imageCache.put(ref, data); |
| 26502 |
return; |
| 26503 |
} |
| 26504 |
if (this._imageMap.has(name)) { |
| 26505 |
return; |
| 26506 |
} |
| 26507 |
this._imageMap.set(name, data); |
| 26508 |
} |
| 26509 |
} |
| 26510 |
class LocalFunctionCache extends BaseLocalCache { |
| 26511 |
constructor(options) { |
| 26512 |
super({ |
| 26513 |
onlyRefs: true |
| 26514 |
}); |
| 26515 |
} |
| 26516 |
set(name = null, ref, data) { |
| 26517 |
if (!ref) { |
| 26518 |
throw new Error('LocalFunctionCache.set - expected "ref" argument.'); |
| 26519 |
} |
| 26520 |
if (this._imageCache.has(ref)) { |
| 26521 |
return; |
| 26522 |
} |
| 26523 |
this._imageCache.put(ref, data); |
| 26524 |
} |
| 26525 |
} |
| 26526 |
class LocalGStateCache extends BaseLocalCache { |
| 26527 |
set(name, ref = null, data) { |
| 26528 |
if (typeof name !== "string") { |
| 26529 |
throw new Error('LocalGStateCache.set - expected "name" argument.'); |
| 26530 |
} |
| 26531 |
if (ref) { |
| 26532 |
if (this._imageCache.has(ref)) { |
| 26533 |
return; |
| 26534 |
} |
| 26535 |
this._nameRefMap.set(name, ref); |
| 26536 |
this._imageCache.put(ref, data); |
| 26537 |
return; |
| 26538 |
} |
| 26539 |
if (this._imageMap.has(name)) { |
| 26540 |
return; |
| 26541 |
} |
| 26542 |
this._imageMap.set(name, data); |
| 26543 |
} |
| 26544 |
} |
| 26545 |
class LocalTilingPatternCache extends BaseLocalCache { |
| 26546 |
constructor(options) { |
| 26547 |
super({ |
| 26548 |
onlyRefs: true |
| 26549 |
}); |
| 26550 |
} |
| 26551 |
set(name = null, ref, data) { |
| 26552 |
if (!ref) { |
| 26553 |
throw new Error('LocalTilingPatternCache.set - expected "ref" argument.'); |
| 26554 |
} |
| 26555 |
if (this._imageCache.has(ref)) { |
| 26556 |
return; |
| 26557 |
} |
| 26558 |
this._imageCache.put(ref, data); |
| 26559 |
} |
| 26560 |
} |
| 26561 |
class RegionalImageCache extends BaseLocalCache { |
| 26562 |
constructor(options) { |
| 26563 |
super({ |
| 26564 |
onlyRefs: true |
| 26565 |
}); |
| 26566 |
} |
| 26567 |
set(name = null, ref, data) { |
| 26568 |
if (!ref) { |
| 26569 |
throw new Error('RegionalImageCache.set - expected "ref" argument.'); |
| 26570 |
} |
| 26571 |
if (this._imageCache.has(ref)) { |
| 26572 |
return; |
| 26573 |
} |
| 26574 |
this._imageCache.put(ref, data); |
| 26575 |
} |
| 26576 |
} |
| 26577 |
class GlobalImageCache { |
| 26578 |
static NUM_PAGES_THRESHOLD = 2; |
| 26579 |
static MIN_IMAGES_TO_CACHE = 10; |
| 26580 |
static MAX_BYTE_SIZE = 5 * MAX_IMAGE_SIZE_TO_CACHE; |
| 26581 |
#decodeFailedSet = new RefSet(); |
| 26582 |
constructor() { |
| 26583 |
this._refCache = new RefSetCache(); |
| 26584 |
this._imageCache = new RefSetCache(); |
| 26585 |
} |
| 26586 |
get #byteSize() { |
| 26587 |
let byteSize = 0; |
| 26588 |
for (const imageData of this._imageCache) { |
| 26589 |
byteSize += imageData.byteSize; |
| 26590 |
} |
| 26591 |
return byteSize; |
| 26592 |
} |
| 26593 |
get #cacheLimitReached() { |
| 26594 |
if (this._imageCache.size < GlobalImageCache.MIN_IMAGES_TO_CACHE) { |
| 26595 |
return false; |
| 26596 |
} |
| 26597 |
if (this.#byteSize < GlobalImageCache.MAX_BYTE_SIZE) { |
| 26598 |
return false; |
| 26599 |
} |
| 26600 |
return true; |
| 26601 |
} |
| 26602 |
shouldCache(ref, pageIndex) { |
| 26603 |
let pageIndexSet = this._refCache.get(ref); |
| 26604 |
if (!pageIndexSet) { |
| 26605 |
pageIndexSet = new Set(); |
| 26606 |
this._refCache.put(ref, pageIndexSet); |
| 26607 |
} |
| 26608 |
pageIndexSet.add(pageIndex); |
| 26609 |
if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) { |
| 26610 |
return false; |
| 26611 |
} |
| 26612 |
if (!this._imageCache.has(ref) && this.#cacheLimitReached) { |
| 26613 |
return false; |
| 26614 |
} |
| 26615 |
return true; |
| 26616 |
} |
| 26617 |
addDecodeFailed(ref) { |
| 26618 |
this.#decodeFailedSet.put(ref); |
| 26619 |
} |
| 26620 |
hasDecodeFailed(ref) { |
| 26621 |
return this.#decodeFailedSet.has(ref); |
| 26622 |
} |
| 26623 |
addByteSize(ref, byteSize) { |
| 26624 |
const imageData = this._imageCache.get(ref); |
| 26625 |
if (!imageData) { |
| 26626 |
return; |
| 26627 |
} |
| 26628 |
if (imageData.byteSize) { |
| 26629 |
return; |
| 26630 |
} |
| 26631 |
imageData.byteSize = byteSize; |
| 26632 |
} |
| 26633 |
getData(ref, pageIndex) { |
| 26634 |
const pageIndexSet = this._refCache.get(ref); |
| 26635 |
if (!pageIndexSet) { |
| 26636 |
return null; |
| 26637 |
} |
| 26638 |
if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) { |
| 26639 |
return null; |
| 26640 |
} |
| 26641 |
const imageData = this._imageCache.get(ref); |
| 26642 |
if (!imageData) { |
| 26643 |
return null; |
| 26644 |
} |
| 26645 |
pageIndexSet.add(pageIndex); |
| 26646 |
return imageData; |
| 26647 |
} |
| 26648 |
setData(ref, data) { |
| 26649 |
if (!this._refCache.has(ref)) { |
| 26650 |
throw new Error('GlobalImageCache.setData - expected "shouldCache" to have been called.'); |
| 26651 |
} |
| 26652 |
if (this._imageCache.has(ref)) { |
| 26653 |
return; |
| 26654 |
} |
| 26655 |
if (this.#cacheLimitReached) { |
| 26656 |
warn("GlobalImageCache.setData - cache limit reached."); |
| 26657 |
return; |
| 26658 |
} |
| 26659 |
this._imageCache.put(ref, data); |
| 26660 |
} |
| 26661 |
clear(onlyData = false) { |
| 26662 |
if (!onlyData) { |
| 26663 |
this.#decodeFailedSet.clear(); |
| 26664 |
this._refCache.clear(); |
| 26665 |
} |
| 26666 |
this._imageCache.clear(); |
| 26667 |
} |
| 26668 |
} |
| 26669 |
|
| 26670 |
;// ./src/core/function.js |
| 26671 |
|
| 26672 |
|
| 26673 |
|
| 26674 |
|
| 26675 |
|
| 26676 |
|
| 26677 |
class PDFFunctionFactory { |
| 26678 |
constructor({ |
| 26679 |
xref, |
| 26680 |
isEvalSupported = true |
| 26681 |
}) { |
| 26682 |
this.xref = xref; |
| 26683 |
this.isEvalSupported = isEvalSupported !== false; |
| 26684 |
} |
| 26685 |
create(fn) { |
| 26686 |
const cachedFunction = this.getCached(fn); |
| 26687 |
if (cachedFunction) { |
| 26688 |
return cachedFunction; |
| 26689 |
} |
| 26690 |
const parsedFunction = PDFFunction.parse({ |
| 26691 |
xref: this.xref, |
| 26692 |
isEvalSupported: this.isEvalSupported, |
| 26693 |
fn: fn instanceof Ref ? this.xref.fetch(fn) : fn |
| 26694 |
}); |
| 26695 |
this._cache(fn, parsedFunction); |
| 26696 |
return parsedFunction; |
| 26697 |
} |
| 26698 |
createFromArray(fnObj) { |
| 26699 |
const cachedFunction = this.getCached(fnObj); |
| 26700 |
if (cachedFunction) { |
| 26701 |
return cachedFunction; |
| 26702 |
} |
| 26703 |
const parsedFunction = PDFFunction.parseArray({ |
| 26704 |
xref: this.xref, |
| 26705 |
isEvalSupported: this.isEvalSupported, |
| 26706 |
fnObj: fnObj instanceof Ref ? this.xref.fetch(fnObj) : fnObj |
| 26707 |
}); |
| 26708 |
this._cache(fnObj, parsedFunction); |
| 26709 |
return parsedFunction; |
| 26710 |
} |
| 26711 |
getCached(cacheKey) { |
| 26712 |
let fnRef; |
| 26713 |
if (cacheKey instanceof Ref) { |
| 26714 |
fnRef = cacheKey; |
| 26715 |
} else if (cacheKey instanceof Dict) { |
| 26716 |
fnRef = cacheKey.objId; |
| 26717 |
} else if (cacheKey instanceof BaseStream) { |
| 26718 |
fnRef = cacheKey.dict?.objId; |
| 26719 |
} |
| 26720 |
if (fnRef) { |
| 26721 |
const localFunction = this._localFunctionCache.getByRef(fnRef); |
| 26722 |
if (localFunction) { |
| 26723 |
return localFunction; |
| 26724 |
} |
| 26725 |
} |
| 26726 |
return null; |
| 26727 |
} |
| 26728 |
_cache(cacheKey, parsedFunction) { |
| 26729 |
if (!parsedFunction) { |
| 26730 |
throw new Error('PDFFunctionFactory._cache - expected "parsedFunction" argument.'); |
| 26731 |
} |
| 26732 |
let fnRef; |
| 26733 |
if (cacheKey instanceof Ref) { |
| 26734 |
fnRef = cacheKey; |
| 26735 |
} else if (cacheKey instanceof Dict) { |
| 26736 |
fnRef = cacheKey.objId; |
| 26737 |
} else if (cacheKey instanceof BaseStream) { |
| 26738 |
fnRef = cacheKey.dict?.objId; |
| 26739 |
} |
| 26740 |
if (fnRef) { |
| 26741 |
this._localFunctionCache.set(null, fnRef, parsedFunction); |
| 26742 |
} |
| 26743 |
} |
| 26744 |
get _localFunctionCache() { |
| 26745 |
return shadow(this, "_localFunctionCache", new LocalFunctionCache()); |
| 26746 |
} |
| 26747 |
} |
| 26748 |
function toNumberArray(arr) { |
| 26749 |
if (!Array.isArray(arr)) { |
| 26750 |
return null; |
| 26751 |
} |
| 26752 |
if (!isNumberArray(arr, null)) { |
| 26753 |
return arr.map(x => +x); |
| 26754 |
} |
| 26755 |
return arr; |
| 26756 |
} |
| 26757 |
class PDFFunction { |
| 26758 |
static getSampleArray(size, outputSize, bps, stream) { |
| 26759 |
let i, ii; |
| 26760 |
let length = 1; |
| 26761 |
for (i = 0, ii = size.length; i < ii; i++) { |
| 26762 |
length *= size[i]; |
| 26763 |
} |
| 26764 |
length *= outputSize; |
| 26765 |
const array = new Array(length); |
| 26766 |
let codeSize = 0; |
| 26767 |
let codeBuf = 0; |
| 26768 |
const sampleMul = 1.0 / (2.0 ** bps - 1); |
| 26769 |
const strBytes = stream.getBytes((length * bps + 7) / 8); |
| 26770 |
let strIdx = 0; |
| 26771 |
for (i = 0; i < length; i++) { |
| 26772 |
while (codeSize < bps) { |
| 26773 |
codeBuf <<= 8; |
| 26774 |
codeBuf |= strBytes[strIdx++]; |
| 26775 |
codeSize += 8; |
| 26776 |
} |
| 26777 |
codeSize -= bps; |
| 26778 |
array[i] = (codeBuf >> codeSize) * sampleMul; |
| 26779 |
codeBuf &= (1 << codeSize) - 1; |
| 26780 |
} |
| 26781 |
return array; |
| 26782 |
} |
| 26783 |
static parse({ |
| 26784 |
xref, |
| 26785 |
isEvalSupported, |
| 26786 |
fn |
| 26787 |
}) { |
| 26788 |
const dict = fn.dict || fn; |
| 26789 |
const typeNum = dict.get("FunctionType"); |
| 26790 |
switch (typeNum) { |
| 26791 |
case 0: |
| 26792 |
return this.constructSampled({ |
| 26793 |
xref, |
| 26794 |
isEvalSupported, |
| 26795 |
fn, |
| 26796 |
dict |
| 26797 |
}); |
| 26798 |
case 1: |
| 26799 |
break; |
| 26800 |
case 2: |
| 26801 |
return this.constructInterpolated({ |
| 26802 |
xref, |
| 26803 |
isEvalSupported, |
| 26804 |
dict |
| 26805 |
}); |
| 26806 |
case 3: |
| 26807 |
return this.constructStiched({ |
| 26808 |
xref, |
| 26809 |
isEvalSupported, |
| 26810 |
dict |
| 26811 |
}); |
| 26812 |
case 4: |
| 26813 |
return this.constructPostScript({ |
| 26814 |
xref, |
| 26815 |
isEvalSupported, |
| 26816 |
fn, |
| 26817 |
dict |
| 26818 |
}); |
| 26819 |
} |
| 26820 |
throw new FormatError("Unknown type of function"); |
| 26821 |
} |
| 26822 |
static parseArray({ |
| 26823 |
xref, |
| 26824 |
isEvalSupported, |
| 26825 |
fnObj |
| 26826 |
}) { |
| 26827 |
if (!Array.isArray(fnObj)) { |
| 26828 |
return this.parse({ |
| 26829 |
xref, |
| 26830 |
isEvalSupported, |
| 26831 |
fn: fnObj |
| 26832 |
}); |
| 26833 |
} |
| 26834 |
const fnArray = []; |
| 26835 |
for (const fn of fnObj) { |
| 26836 |
fnArray.push(this.parse({ |
| 26837 |
xref, |
| 26838 |
isEvalSupported, |
| 26839 |
fn: xref.fetchIfRef(fn) |
| 26840 |
})); |
| 26841 |
} |
| 26842 |
return function (src, srcOffset, dest, destOffset) { |
| 26843 |
for (let i = 0, ii = fnArray.length; i < ii; i++) { |
| 26844 |
fnArray[i](src, srcOffset, dest, destOffset + i); |
| 26845 |
} |
| 26846 |
}; |
| 26847 |
} |
| 26848 |
static constructSampled({ |
| 26849 |
xref, |
| 26850 |
isEvalSupported, |
| 26851 |
fn, |
| 26852 |
dict |
| 26853 |
}) { |
| 26854 |
function toMultiArray(arr) { |
| 26855 |
const inputLength = arr.length; |
| 26856 |
const out = []; |
| 26857 |
let index = 0; |
| 26858 |
for (let i = 0; i < inputLength; i += 2) { |
| 26859 |
out[index++] = [arr[i], arr[i + 1]]; |
| 26860 |
} |
| 26861 |
return out; |
| 26862 |
} |
| 26863 |
function interpolate(x, xmin, xmax, ymin, ymax) { |
| 26864 |
return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin)); |
| 26865 |
} |
| 26866 |
let domain = toNumberArray(dict.getArray("Domain")); |
| 26867 |
let range = toNumberArray(dict.getArray("Range")); |
| 26868 |
if (!domain || !range) { |
| 26869 |
throw new FormatError("No domain or range"); |
| 26870 |
} |
| 26871 |
const inputSize = domain.length / 2; |
| 26872 |
const outputSize = range.length / 2; |
| 26873 |
domain = toMultiArray(domain); |
| 26874 |
range = toMultiArray(range); |
| 26875 |
const size = toNumberArray(dict.getArray("Size")); |
| 26876 |
const bps = dict.get("BitsPerSample"); |
| 26877 |
const order = dict.get("Order") || 1; |
| 26878 |
if (order !== 1) { |
| 26879 |
info("No support for cubic spline interpolation: " + order); |
| 26880 |
} |
| 26881 |
let encode = toNumberArray(dict.getArray("Encode")); |
| 26882 |
if (!encode) { |
| 26883 |
encode = []; |
| 26884 |
for (let i = 0; i < inputSize; ++i) { |
| 26885 |
encode.push([0, size[i] - 1]); |
| 26886 |
} |
| 26887 |
} else { |
| 26888 |
encode = toMultiArray(encode); |
| 26889 |
} |
| 26890 |
let decode = toNumberArray(dict.getArray("Decode")); |
| 26891 |
decode = !decode ? range : toMultiArray(decode); |
| 26892 |
const samples = this.getSampleArray(size, outputSize, bps, fn); |
| 26893 |
return function constructSampledFn(src, srcOffset, dest, destOffset) { |
| 26894 |
const cubeVertices = 1 << inputSize; |
| 26895 |
const cubeN = new Float64Array(cubeVertices); |
| 26896 |
const cubeVertex = new Uint32Array(cubeVertices); |
| 26897 |
let i, j; |
| 26898 |
for (j = 0; j < cubeVertices; j++) { |
| 26899 |
cubeN[j] = 1; |
| 26900 |
} |
| 26901 |
let k = outputSize, |
| 26902 |
pos = 1; |
| 26903 |
for (i = 0; i < inputSize; ++i) { |
| 26904 |
const domain_2i = domain[i][0]; |
| 26905 |
const domain_2i_1 = domain[i][1]; |
| 26906 |
const xi = Math.min(Math.max(src[srcOffset + i], domain_2i), domain_2i_1); |
| 26907 |
let e = interpolate(xi, domain_2i, domain_2i_1, encode[i][0], encode[i][1]); |
| 26908 |
const size_i = size[i]; |
| 26909 |
e = Math.min(Math.max(e, 0), size_i - 1); |
| 26910 |
const e0 = e < size_i - 1 ? Math.floor(e) : e - 1; |
| 26911 |
const n0 = e0 + 1 - e; |
| 26912 |
const n1 = e - e0; |
| 26913 |
const offset0 = e0 * k; |
| 26914 |
const offset1 = offset0 + k; |
| 26915 |
for (j = 0; j < cubeVertices; j++) { |
| 26916 |
if (j & pos) { |
| 26917 |
cubeN[j] *= n1; |
| 26918 |
cubeVertex[j] += offset1; |
| 26919 |
} else { |
| 26920 |
cubeN[j] *= n0; |
| 26921 |
cubeVertex[j] += offset0; |
| 26922 |
} |
| 26923 |
} |
| 26924 |
k *= size_i; |
| 26925 |
pos <<= 1; |
| 26926 |
} |
| 26927 |
for (j = 0; j < outputSize; ++j) { |
| 26928 |
let rj = 0; |
| 26929 |
for (i = 0; i < cubeVertices; i++) { |
| 26930 |
rj += samples[cubeVertex[i] + j] * cubeN[i]; |
| 26931 |
} |
| 26932 |
rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]); |
| 26933 |
dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), range[j][1]); |
| 26934 |
} |
| 26935 |
}; |
| 26936 |
} |
| 26937 |
static constructInterpolated({ |
| 26938 |
xref, |
| 26939 |
isEvalSupported, |
| 26940 |
dict |
| 26941 |
}) { |
| 26942 |
const c0 = toNumberArray(dict.getArray("C0")) || [0]; |
| 26943 |
const c1 = toNumberArray(dict.getArray("C1")) || [1]; |
| 26944 |
const n = dict.get("N"); |
| 26945 |
const diff = []; |
| 26946 |
for (let i = 0, ii = c0.length; i < ii; ++i) { |
| 26947 |
diff.push(c1[i] - c0[i]); |
| 26948 |
} |
| 26949 |
const length = diff.length; |
| 26950 |
return function constructInterpolatedFn(src, srcOffset, dest, destOffset) { |
| 26951 |
const x = n === 1 ? src[srcOffset] : src[srcOffset] ** n; |
| 26952 |
for (let j = 0; j < length; ++j) { |
| 26953 |
dest[destOffset + j] = c0[j] + x * diff[j]; |
| 26954 |
} |
| 26955 |
}; |
| 26956 |
} |
| 26957 |
static constructStiched({ |
| 26958 |
xref, |
| 26959 |
isEvalSupported, |
| 26960 |
dict |
| 26961 |
}) { |
| 26962 |
const domain = toNumberArray(dict.getArray("Domain")); |
| 26963 |
if (!domain) { |
| 26964 |
throw new FormatError("No domain"); |
| 26965 |
} |
| 26966 |
const inputSize = domain.length / 2; |
| 26967 |
if (inputSize !== 1) { |
| 26968 |
throw new FormatError("Bad domain for stiched function"); |
| 26969 |
} |
| 26970 |
const fns = []; |
| 26971 |
for (const fn of dict.get("Functions")) { |
| 26972 |
fns.push(this.parse({ |
| 26973 |
xref, |
| 26974 |
isEvalSupported, |
| 26975 |
fn: xref.fetchIfRef(fn) |
| 26976 |
})); |
| 26977 |
} |
| 26978 |
const bounds = toNumberArray(dict.getArray("Bounds")); |
| 26979 |
const encode = toNumberArray(dict.getArray("Encode")); |
| 26980 |
const tmpBuf = new Float32Array(1); |
| 26981 |
return function constructStichedFn(src, srcOffset, dest, destOffset) { |
| 26982 |
const clip = function constructStichedFromIRClip(v, min, max) { |
| 26983 |
if (v > max) { |
| 26984 |
v = max; |
| 26985 |
} else if (v < min) { |
| 26986 |
v = min; |
| 26987 |
} |
| 26988 |
return v; |
| 26989 |
}; |
| 26990 |
const v = clip(src[srcOffset], domain[0], domain[1]); |
| 26991 |
const length = bounds.length; |
| 26992 |
let i; |
| 26993 |
for (i = 0; i < length; ++i) { |
| 26994 |
if (v < bounds[i]) { |
| 26995 |
break; |
| 26996 |
} |
| 26997 |
} |
| 26998 |
let dmin = domain[0]; |
| 26999 |
if (i > 0) { |
| 27000 |
dmin = bounds[i - 1]; |
| 27001 |
} |
| 27002 |
let dmax = domain[1]; |
| 27003 |
if (i < bounds.length) { |
| 27004 |
dmax = bounds[i]; |
| 27005 |
} |
| 27006 |
const rmin = encode[2 * i]; |
| 27007 |
const rmax = encode[2 * i + 1]; |
| 27008 |
tmpBuf[0] = dmin === dmax ? rmin : rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin); |
| 27009 |
fns[i](tmpBuf, 0, dest, destOffset); |
| 27010 |
}; |
| 27011 |
} |
| 27012 |
static constructPostScript({ |
| 27013 |
xref, |
| 27014 |
isEvalSupported, |
| 27015 |
fn, |
| 27016 |
dict |
| 27017 |
}) { |
| 27018 |
const domain = toNumberArray(dict.getArray("Domain")); |
| 27019 |
const range = toNumberArray(dict.getArray("Range")); |
| 27020 |
if (!domain) { |
| 27021 |
throw new FormatError("No domain."); |
| 27022 |
} |
| 27023 |
if (!range) { |
| 27024 |
throw new FormatError("No range."); |
| 27025 |
} |
| 27026 |
const lexer = new PostScriptLexer(fn); |
| 27027 |
const parser = new PostScriptParser(lexer); |
| 27028 |
const code = parser.parse(); |
| 27029 |
if (isEvalSupported && FeatureTest.isEvalSupported) { |
| 27030 |
const compiled = new PostScriptCompiler().compile(code, domain, range); |
| 27031 |
if (compiled) { |
| 27032 |
return new Function("src", "srcOffset", "dest", "destOffset", compiled); |
| 27033 |
} |
| 27034 |
} |
| 27035 |
info("Unable to compile PS function"); |
| 27036 |
const numOutputs = range.length >> 1; |
| 27037 |
const numInputs = domain.length >> 1; |
| 27038 |
const evaluator = new PostScriptEvaluator(code); |
| 27039 |
const cache = Object.create(null); |
| 27040 |
const MAX_CACHE_SIZE = 2048 * 4; |
| 27041 |
let cache_available = MAX_CACHE_SIZE; |
| 27042 |
const tmpBuf = new Float32Array(numInputs); |
| 27043 |
return function constructPostScriptFn(src, srcOffset, dest, destOffset) { |
| 27044 |
let i, value; |
| 27045 |
let key = ""; |
| 27046 |
const input = tmpBuf; |
| 27047 |
for (i = 0; i < numInputs; i++) { |
| 27048 |
value = src[srcOffset + i]; |
| 27049 |
input[i] = value; |
| 27050 |
key += value + "_"; |
| 27051 |
} |
| 27052 |
const cachedValue = cache[key]; |
| 27053 |
if (cachedValue !== undefined) { |
| 27054 |
dest.set(cachedValue, destOffset); |
| 27055 |
return; |
| 27056 |
} |
| 27057 |
const output = new Float32Array(numOutputs); |
| 27058 |
const stack = evaluator.execute(input); |
| 27059 |
const stackIndex = stack.length - numOutputs; |
| 27060 |
for (i = 0; i < numOutputs; i++) { |
| 27061 |
value = stack[stackIndex + i]; |
| 27062 |
let bound = range[i * 2]; |
| 27063 |
if (value < bound) { |
| 27064 |
value = bound; |
| 27065 |
} else { |
| 27066 |
bound = range[i * 2 + 1]; |
| 27067 |
if (value > bound) { |
| 27068 |
value = bound; |
| 27069 |
} |
| 27070 |
} |
| 27071 |
output[i] = value; |
| 27072 |
} |
| 27073 |
if (cache_available > 0) { |
| 27074 |
cache_available--; |
| 27075 |
cache[key] = output; |
| 27076 |
} |
| 27077 |
dest.set(output, destOffset); |
| 27078 |
}; |
| 27079 |
} |
| 27080 |
} |
| 27081 |
function isPDFFunction(v) { |
| 27082 |
let fnDict; |
| 27083 |
if (v instanceof Dict) { |
| 27084 |
fnDict = v; |
| 27085 |
} else if (v instanceof BaseStream) { |
| 27086 |
fnDict = v.dict; |
| 27087 |
} else { |
| 27088 |
return false; |
| 27089 |
} |
| 27090 |
return fnDict.has("FunctionType"); |
| 27091 |
} |
| 27092 |
class PostScriptStack { |
| 27093 |
static MAX_STACK_SIZE = 100; |
| 27094 |
constructor(initialStack) { |
| 27095 |
this.stack = initialStack ? Array.from(initialStack) : []; |
| 27096 |
} |
| 27097 |
push(value) { |
| 27098 |
if (this.stack.length >= PostScriptStack.MAX_STACK_SIZE) { |
| 27099 |
throw new Error("PostScript function stack overflow."); |
| 27100 |
} |
| 27101 |
this.stack.push(value); |
| 27102 |
} |
| 27103 |
pop() { |
| 27104 |
if (this.stack.length <= 0) { |
| 27105 |
throw new Error("PostScript function stack underflow."); |
| 27106 |
} |
| 27107 |
return this.stack.pop(); |
| 27108 |
} |
| 27109 |
copy(n) { |
| 27110 |
if (this.stack.length + n >= PostScriptStack.MAX_STACK_SIZE) { |
| 27111 |
throw new Error("PostScript function stack overflow."); |
| 27112 |
} |
| 27113 |
const stack = this.stack; |
| 27114 |
for (let i = stack.length - n, j = n - 1; j >= 0; j--, i++) { |
| 27115 |
stack.push(stack[i]); |
| 27116 |
} |
| 27117 |
} |
| 27118 |
index(n) { |
| 27119 |
this.push(this.stack[this.stack.length - n - 1]); |
| 27120 |
} |
| 27121 |
roll(n, p) { |
| 27122 |
const stack = this.stack; |
| 27123 |
const l = stack.length - n; |
| 27124 |
const r = stack.length - 1; |
| 27125 |
const c = l + (p - Math.floor(p / n) * n); |
| 27126 |
for (let i = l, j = r; i < j; i++, j--) { |
| 27127 |
const t = stack[i]; |
| 27128 |
stack[i] = stack[j]; |
| 27129 |
stack[j] = t; |
| 27130 |
} |
| 27131 |
for (let i = l, j = c - 1; i < j; i++, j--) { |
| 27132 |
const t = stack[i]; |
| 27133 |
stack[i] = stack[j]; |
| 27134 |
stack[j] = t; |
| 27135 |
} |
| 27136 |
for (let i = c, j = r; i < j; i++, j--) { |
| 27137 |
const t = stack[i]; |
| 27138 |
stack[i] = stack[j]; |
| 27139 |
stack[j] = t; |
| 27140 |
} |
| 27141 |
} |
| 27142 |
} |
| 27143 |
class PostScriptEvaluator { |
| 27144 |
constructor(operators) { |
| 27145 |
this.operators = operators; |
| 27146 |
} |
| 27147 |
execute(initialStack) { |
| 27148 |
const stack = new PostScriptStack(initialStack); |
| 27149 |
let counter = 0; |
| 27150 |
const operators = this.operators; |
| 27151 |
const length = operators.length; |
| 27152 |
let operator, a, b; |
| 27153 |
while (counter < length) { |
| 27154 |
operator = operators[counter++]; |
| 27155 |
if (typeof operator === "number") { |
| 27156 |
stack.push(operator); |
| 27157 |
continue; |
| 27158 |
} |
| 27159 |
switch (operator) { |
| 27160 |
case "jz": |
| 27161 |
b = stack.pop(); |
| 27162 |
a = stack.pop(); |
| 27163 |
if (!a) { |
| 27164 |
counter = b; |
| 27165 |
} |
| 27166 |
break; |
| 27167 |
case "j": |
| 27168 |
a = stack.pop(); |
| 27169 |
counter = a; |
| 27170 |
break; |
| 27171 |
case "abs": |
| 27172 |
a = stack.pop(); |
| 27173 |
stack.push(Math.abs(a)); |
| 27174 |
break; |
| 27175 |
case "add": |
| 27176 |
b = stack.pop(); |
| 27177 |
a = stack.pop(); |
| 27178 |
stack.push(a + b); |
| 27179 |
break; |
| 27180 |
case "and": |
| 27181 |
b = stack.pop(); |
| 27182 |
a = stack.pop(); |
| 27183 |
if (typeof a === "boolean" && typeof b === "boolean") { |
| 27184 |
stack.push(a && b); |
| 27185 |
} else { |
| 27186 |
stack.push(a & b); |
| 27187 |
} |
| 27188 |
break; |
| 27189 |
case "atan": |
| 27190 |
b = stack.pop(); |
| 27191 |
a = stack.pop(); |
| 27192 |
a = Math.atan2(a, b) / Math.PI * 180; |
| 27193 |
if (a < 0) { |
| 27194 |
a += 360; |
| 27195 |
} |
| 27196 |
stack.push(a); |
| 27197 |
break; |
| 27198 |
case "bitshift": |
| 27199 |
b = stack.pop(); |
| 27200 |
a = stack.pop(); |
| 27201 |
if (a > 0) { |
| 27202 |
stack.push(a << b); |
| 27203 |
} else { |
| 27204 |
stack.push(a >> b); |
| 27205 |
} |
| 27206 |
break; |
| 27207 |
case "ceiling": |
| 27208 |
a = stack.pop(); |
| 27209 |
stack.push(Math.ceil(a)); |
| 27210 |
break; |
| 27211 |
case "copy": |
| 27212 |
a = stack.pop(); |
| 27213 |
stack.copy(a); |
| 27214 |
break; |
| 27215 |
case "cos": |
| 27216 |
a = stack.pop(); |
| 27217 |
stack.push(Math.cos(a % 360 / 180 * Math.PI)); |
| 27218 |
break; |
| 27219 |
case "cvi": |
| 27220 |
a = stack.pop() | 0; |
| 27221 |
stack.push(a); |
| 27222 |
break; |
| 27223 |
case "cvr": |
| 27224 |
break; |
| 27225 |
case "div": |
| 27226 |
b = stack.pop(); |
| 27227 |
a = stack.pop(); |
| 27228 |
stack.push(a / b); |
| 27229 |
break; |
| 27230 |
case "dup": |
| 27231 |
stack.copy(1); |
| 27232 |
break; |
| 27233 |
case "eq": |
| 27234 |
b = stack.pop(); |
| 27235 |
a = stack.pop(); |
| 27236 |
stack.push(a === b); |
| 27237 |
break; |
| 27238 |
case "exch": |
| 27239 |
stack.roll(2, 1); |
| 27240 |
break; |
| 27241 |
case "exp": |
| 27242 |
b = stack.pop(); |
| 27243 |
a = stack.pop(); |
| 27244 |
stack.push(a ** b); |
| 27245 |
break; |
| 27246 |
case "false": |
| 27247 |
stack.push(false); |
| 27248 |
break; |
| 27249 |
case "floor": |
| 27250 |
a = stack.pop(); |
| 27251 |
stack.push(Math.floor(a)); |
| 27252 |
break; |
| 27253 |
case "ge": |
| 27254 |
b = stack.pop(); |
| 27255 |
a = stack.pop(); |
| 27256 |
stack.push(a >= b); |
| 27257 |
break; |
| 27258 |
case "gt": |
| 27259 |
b = stack.pop(); |
| 27260 |
a = stack.pop(); |
| 27261 |
stack.push(a > b); |
| 27262 |
break; |
| 27263 |
case "idiv": |
| 27264 |
b = stack.pop(); |
| 27265 |
a = stack.pop(); |
| 27266 |
stack.push(a / b | 0); |
| 27267 |
break; |
| 27268 |
case "index": |
| 27269 |
a = stack.pop(); |
| 27270 |
stack.index(a); |
| 27271 |
break; |
| 27272 |
case "le": |
| 27273 |
b = stack.pop(); |
| 27274 |
a = stack.pop(); |
| 27275 |
stack.push(a <= b); |
| 27276 |
break; |
| 27277 |
case "ln": |
| 27278 |
a = stack.pop(); |
| 27279 |
stack.push(Math.log(a)); |
| 27280 |
break; |
| 27281 |
case "log": |
| 27282 |
a = stack.pop(); |
| 27283 |
stack.push(Math.log10(a)); |
| 27284 |
break; |
| 27285 |
case "lt": |
| 27286 |
b = stack.pop(); |
| 27287 |
a = stack.pop(); |
| 27288 |
stack.push(a < b); |
| 27289 |
break; |
| 27290 |
case "mod": |
| 27291 |
b = stack.pop(); |
| 27292 |
a = stack.pop(); |
| 27293 |
stack.push(a % b); |
| 27294 |
break; |
| 27295 |
case "mul": |
| 27296 |
b = stack.pop(); |
| 27297 |
a = stack.pop(); |
| 27298 |
stack.push(a * b); |
| 27299 |
break; |
| 27300 |
case "ne": |
| 27301 |
b = stack.pop(); |
| 27302 |
a = stack.pop(); |
| 27303 |
stack.push(a !== b); |
| 27304 |
break; |
| 27305 |
case "neg": |
| 27306 |
a = stack.pop(); |
| 27307 |
stack.push(-a); |
| 27308 |
break; |
| 27309 |
case "not": |
| 27310 |
a = stack.pop(); |
| 27311 |
if (typeof a === "boolean") { |
| 27312 |
stack.push(!a); |
| 27313 |
} else { |
| 27314 |
stack.push(~a); |
| 27315 |
} |
| 27316 |
break; |
| 27317 |
case "or": |
| 27318 |
b = stack.pop(); |
| 27319 |
a = stack.pop(); |
| 27320 |
if (typeof a === "boolean" && typeof b === "boolean") { |
| 27321 |
stack.push(a || b); |
| 27322 |
} else { |
| 27323 |
stack.push(a | b); |
| 27324 |
} |
| 27325 |
break; |
| 27326 |
case "pop": |
| 27327 |
stack.pop(); |
| 27328 |
break; |
| 27329 |
case "roll": |
| 27330 |
b = stack.pop(); |
| 27331 |
a = stack.pop(); |
| 27332 |
stack.roll(a, b); |
| 27333 |
break; |
| 27334 |
case "round": |
| 27335 |
a = stack.pop(); |
| 27336 |
stack.push(Math.round(a)); |
| 27337 |
break; |
| 27338 |
case "sin": |
| 27339 |
a = stack.pop(); |
| 27340 |
stack.push(Math.sin(a % 360 / 180 * Math.PI)); |
| 27341 |
break; |
| 27342 |
case "sqrt": |
| 27343 |
a = stack.pop(); |
| 27344 |
stack.push(Math.sqrt(a)); |
| 27345 |
break; |
| 27346 |
case "sub": |
| 27347 |
b = stack.pop(); |
| 27348 |
a = stack.pop(); |
| 27349 |
stack.push(a - b); |
| 27350 |
break; |
| 27351 |
case "true": |
| 27352 |
stack.push(true); |
| 27353 |
break; |
| 27354 |
case "truncate": |
| 27355 |
a = stack.pop(); |
| 27356 |
a = a < 0 ? Math.ceil(a) : Math.floor(a); |
| 27357 |
stack.push(a); |
| 27358 |
break; |
| 27359 |
case "xor": |
| 27360 |
b = stack.pop(); |
| 27361 |
a = stack.pop(); |
| 27362 |
if (typeof a === "boolean" && typeof b === "boolean") { |
| 27363 |
stack.push(a !== b); |
| 27364 |
} else { |
| 27365 |
stack.push(a ^ b); |
| 27366 |
} |
| 27367 |
break; |
| 27368 |
default: |
| 27369 |
throw new FormatError(`Unknown operator ${operator}`); |
| 27370 |
} |
| 27371 |
} |
| 27372 |
return stack.stack; |
| 27373 |
} |
| 27374 |
} |
| 27375 |
class AstNode { |
| 27376 |
constructor(type) { |
| 27377 |
this.type = type; |
| 27378 |
} |
| 27379 |
visit(visitor) { |
| 27380 |
unreachable("abstract method"); |
| 27381 |
} |
| 27382 |
} |
| 27383 |
class AstArgument extends AstNode { |
| 27384 |
constructor(index, min, max) { |
| 27385 |
super("args"); |
| 27386 |
this.index = index; |
| 27387 |
this.min = min; |
| 27388 |
this.max = max; |
| 27389 |
} |
| 27390 |
visit(visitor) { |
| 27391 |
visitor.visitArgument(this); |
| 27392 |
} |
| 27393 |
} |
| 27394 |
class AstLiteral extends AstNode { |
| 27395 |
constructor(number) { |
| 27396 |
super("literal"); |
| 27397 |
this.number = number; |
| 27398 |
this.min = number; |
| 27399 |
this.max = number; |
| 27400 |
} |
| 27401 |
visit(visitor) { |
| 27402 |
visitor.visitLiteral(this); |
| 27403 |
} |
| 27404 |
} |
| 27405 |
class AstBinaryOperation extends AstNode { |
| 27406 |
constructor(op, arg1, arg2, min, max) { |
| 27407 |
super("binary"); |
| 27408 |
this.op = op; |
| 27409 |
this.arg1 = arg1; |
| 27410 |
this.arg2 = arg2; |
| 27411 |
this.min = min; |
| 27412 |
this.max = max; |
| 27413 |
} |
| 27414 |
visit(visitor) { |
| 27415 |
visitor.visitBinaryOperation(this); |
| 27416 |
} |
| 27417 |
} |
| 27418 |
class AstMin extends AstNode { |
| 27419 |
constructor(arg, max) { |
| 27420 |
super("max"); |
| 27421 |
this.arg = arg; |
| 27422 |
this.min = arg.min; |
| 27423 |
this.max = max; |
| 27424 |
} |
| 27425 |
visit(visitor) { |
| 27426 |
visitor.visitMin(this); |
| 27427 |
} |
| 27428 |
} |
| 27429 |
class AstVariable extends AstNode { |
| 27430 |
constructor(index, min, max) { |
| 27431 |
super("var"); |
| 27432 |
this.index = index; |
| 27433 |
this.min = min; |
| 27434 |
this.max = max; |
| 27435 |
} |
| 27436 |
visit(visitor) { |
| 27437 |
visitor.visitVariable(this); |
| 27438 |
} |
| 27439 |
} |
| 27440 |
class AstVariableDefinition extends AstNode { |
| 27441 |
constructor(variable, arg) { |
| 27442 |
super("definition"); |
| 27443 |
this.variable = variable; |
| 27444 |
this.arg = arg; |
| 27445 |
} |
| 27446 |
visit(visitor) { |
| 27447 |
visitor.visitVariableDefinition(this); |
| 27448 |
} |
| 27449 |
} |
| 27450 |
class ExpressionBuilderVisitor { |
| 27451 |
constructor() { |
| 27452 |
this.parts = []; |
| 27453 |
} |
| 27454 |
visitArgument(arg) { |
| 27455 |
this.parts.push("Math.max(", arg.min, ", Math.min(", arg.max, ", src[srcOffset + ", arg.index, "]))"); |
| 27456 |
} |
| 27457 |
visitVariable(variable) { |
| 27458 |
this.parts.push("v", variable.index); |
| 27459 |
} |
| 27460 |
visitLiteral(literal) { |
| 27461 |
this.parts.push(literal.number); |
| 27462 |
} |
| 27463 |
visitBinaryOperation(operation) { |
| 27464 |
this.parts.push("("); |
| 27465 |
operation.arg1.visit(this); |
| 27466 |
this.parts.push(" ", operation.op, " "); |
| 27467 |
operation.arg2.visit(this); |
| 27468 |
this.parts.push(")"); |
| 27469 |
} |
| 27470 |
visitVariableDefinition(definition) { |
| 27471 |
this.parts.push("var "); |
| 27472 |
definition.variable.visit(this); |
| 27473 |
this.parts.push(" = "); |
| 27474 |
definition.arg.visit(this); |
| 27475 |
this.parts.push(";"); |
| 27476 |
} |
| 27477 |
visitMin(max) { |
| 27478 |
this.parts.push("Math.min("); |
| 27479 |
max.arg.visit(this); |
| 27480 |
this.parts.push(", ", max.max, ")"); |
| 27481 |
} |
| 27482 |
toString() { |
| 27483 |
return this.parts.join(""); |
| 27484 |
} |
| 27485 |
} |
| 27486 |
function buildAddOperation(num1, num2) { |
| 27487 |
if (num2.type === "literal" && num2.number === 0) { |
| 27488 |
return num1; |
| 27489 |
} |
| 27490 |
if (num1.type === "literal" && num1.number === 0) { |
| 27491 |
return num2; |
| 27492 |
} |
| 27493 |
if (num2.type === "literal" && num1.type === "literal") { |
| 27494 |
return new AstLiteral(num1.number + num2.number); |
| 27495 |
} |
| 27496 |
return new AstBinaryOperation("+", num1, num2, num1.min + num2.min, num1.max + num2.max); |
| 27497 |
} |
| 27498 |
function buildMulOperation(num1, num2) { |
| 27499 |
if (num2.type === "literal") { |
| 27500 |
if (num2.number === 0) { |
| 27501 |
return new AstLiteral(0); |
| 27502 |
} else if (num2.number === 1) { |
| 27503 |
return num1; |
| 27504 |
} else if (num1.type === "literal") { |
| 27505 |
return new AstLiteral(num1.number * num2.number); |
| 27506 |
} |
| 27507 |
} |
| 27508 |
if (num1.type === "literal") { |
| 27509 |
if (num1.number === 0) { |
| 27510 |
return new AstLiteral(0); |
| 27511 |
} else if (num1.number === 1) { |
| 27512 |
return num2; |
| 27513 |
} |
| 27514 |
} |
| 27515 |
const min = Math.min(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); |
| 27516 |
const max = Math.max(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); |
| 27517 |
return new AstBinaryOperation("*", num1, num2, min, max); |
| 27518 |
} |
| 27519 |
function buildSubOperation(num1, num2) { |
| 27520 |
if (num2.type === "literal") { |
| 27521 |
if (num2.number === 0) { |
| 27522 |
return num1; |
| 27523 |
} else if (num1.type === "literal") { |
| 27524 |
return new AstLiteral(num1.number - num2.number); |
| 27525 |
} |
| 27526 |
} |
| 27527 |
if (num2.type === "binary" && num2.op === "-" && num1.type === "literal" && num1.number === 1 && num2.arg1.type === "literal" && num2.arg1.number === 1) { |
| 27528 |
return num2.arg2; |
| 27529 |
} |
| 27530 |
return new AstBinaryOperation("-", num1, num2, num1.min - num2.max, num1.max - num2.min); |
| 27531 |
} |
| 27532 |
function buildMinOperation(num1, max) { |
| 27533 |
if (num1.min >= max) { |
| 27534 |
return new AstLiteral(max); |
| 27535 |
} else if (num1.max <= max) { |
| 27536 |
return num1; |
| 27537 |
} |
| 27538 |
return new AstMin(num1, max); |
| 27539 |
} |
| 27540 |
class PostScriptCompiler { |
| 27541 |
compile(code, domain, range) { |
| 27542 |
const stack = []; |
| 27543 |
const instructions = []; |
| 27544 |
const inputSize = domain.length >> 1, |
| 27545 |
outputSize = range.length >> 1; |
| 27546 |
let lastRegister = 0; |
| 27547 |
let n, j; |
| 27548 |
let num1, num2, ast1, ast2, tmpVar, item; |
| 27549 |
for (let i = 0; i < inputSize; i++) { |
| 27550 |
stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); |
| 27551 |
} |
| 27552 |
for (let i = 0, ii = code.length; i < ii; i++) { |
| 27553 |
item = code[i]; |
| 27554 |
if (typeof item === "number") { |
| 27555 |
stack.push(new AstLiteral(item)); |
| 27556 |
continue; |
| 27557 |
} |
| 27558 |
switch (item) { |
| 27559 |
case "add": |
| 27560 |
if (stack.length < 2) { |
| 27561 |
return null; |
| 27562 |
} |
| 27563 |
num2 = stack.pop(); |
| 27564 |
num1 = stack.pop(); |
| 27565 |
stack.push(buildAddOperation(num1, num2)); |
| 27566 |
break; |
| 27567 |
case "cvr": |
| 27568 |
if (stack.length < 1) { |
| 27569 |
return null; |
| 27570 |
} |
| 27571 |
break; |
| 27572 |
case "mul": |
| 27573 |
if (stack.length < 2) { |
| 27574 |
return null; |
| 27575 |
} |
| 27576 |
num2 = stack.pop(); |
| 27577 |
num1 = stack.pop(); |
| 27578 |
stack.push(buildMulOperation(num1, num2)); |
| 27579 |
break; |
| 27580 |
case "sub": |
| 27581 |
if (stack.length < 2) { |
| 27582 |
return null; |
| 27583 |
} |
| 27584 |
num2 = stack.pop(); |
| 27585 |
num1 = stack.pop(); |
| 27586 |
stack.push(buildSubOperation(num1, num2)); |
| 27587 |
break; |
| 27588 |
case "exch": |
| 27589 |
if (stack.length < 2) { |
| 27590 |
return null; |
| 27591 |
} |
| 27592 |
ast1 = stack.pop(); |
| 27593 |
ast2 = stack.pop(); |
| 27594 |
stack.push(ast1, ast2); |
| 27595 |
break; |
| 27596 |
case "pop": |
| 27597 |
if (stack.length < 1) { |
| 27598 |
return null; |
| 27599 |
} |
| 27600 |
stack.pop(); |
| 27601 |
break; |
| 27602 |
case "index": |
| 27603 |
if (stack.length < 1) { |
| 27604 |
return null; |
| 27605 |
} |
| 27606 |
num1 = stack.pop(); |
| 27607 |
if (num1.type !== "literal") { |
| 27608 |
return null; |
| 27609 |
} |
| 27610 |
n = num1.number; |
| 27611 |
if (n < 0 || !Number.isInteger(n) || stack.length < n) { |
| 27612 |
return null; |
| 27613 |
} |
| 27614 |
ast1 = stack[stack.length - n - 1]; |
| 27615 |
if (ast1.type === "literal" || ast1.type === "var") { |
| 27616 |
stack.push(ast1); |
| 27617 |
break; |
| 27618 |
} |
| 27619 |
tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); |
| 27620 |
stack[stack.length - n - 1] = tmpVar; |
| 27621 |
stack.push(tmpVar); |
| 27622 |
instructions.push(new AstVariableDefinition(tmpVar, ast1)); |
| 27623 |
break; |
| 27624 |
case "dup": |
| 27625 |
if (stack.length < 1) { |
| 27626 |
return null; |
| 27627 |
} |
| 27628 |
if (typeof code[i + 1] === "number" && code[i + 2] === "gt" && code[i + 3] === i + 7 && code[i + 4] === "jz" && code[i + 5] === "pop" && code[i + 6] === code[i + 1]) { |
| 27629 |
num1 = stack.pop(); |
| 27630 |
stack.push(buildMinOperation(num1, code[i + 1])); |
| 27631 |
i += 6; |
| 27632 |
break; |
| 27633 |
} |
| 27634 |
ast1 = stack.at(-1); |
| 27635 |
if (ast1.type === "literal" || ast1.type === "var") { |
| 27636 |
stack.push(ast1); |
| 27637 |
break; |
| 27638 |
} |
| 27639 |
tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); |
| 27640 |
stack[stack.length - 1] = tmpVar; |
| 27641 |
stack.push(tmpVar); |
| 27642 |
instructions.push(new AstVariableDefinition(tmpVar, ast1)); |
| 27643 |
break; |
| 27644 |
case "roll": |
| 27645 |
if (stack.length < 2) { |
| 27646 |
return null; |
| 27647 |
} |
| 27648 |
num2 = stack.pop(); |
| 27649 |
num1 = stack.pop(); |
| 27650 |
if (num2.type !== "literal" || num1.type !== "literal") { |
| 27651 |
return null; |
| 27652 |
} |
| 27653 |
j = num2.number; |
| 27654 |
n = num1.number; |
| 27655 |
if (n <= 0 || !Number.isInteger(n) || !Number.isInteger(j) || stack.length < n) { |
| 27656 |
return null; |
| 27657 |
} |
| 27658 |
j = (j % n + n) % n; |
| 27659 |
if (j === 0) { |
| 27660 |
break; |
| 27661 |
} |
| 27662 |
stack.push(...stack.splice(stack.length - n, n - j)); |
| 27663 |
break; |
| 27664 |
default: |
| 27665 |
return null; |
| 27666 |
} |
| 27667 |
} |
| 27668 |
if (stack.length !== outputSize) { |
| 27669 |
return null; |
| 27670 |
} |
| 27671 |
const result = []; |
| 27672 |
for (const instruction of instructions) { |
| 27673 |
const statementBuilder = new ExpressionBuilderVisitor(); |
| 27674 |
instruction.visit(statementBuilder); |
| 27675 |
result.push(statementBuilder.toString()); |
| 27676 |
} |
| 27677 |
for (let i = 0, ii = stack.length; i < ii; i++) { |
| 27678 |
const expr = stack[i], |
| 27679 |
statementBuilder = new ExpressionBuilderVisitor(); |
| 27680 |
expr.visit(statementBuilder); |
| 27681 |
const min = range[i * 2], |
| 27682 |
max = range[i * 2 + 1]; |
| 27683 |
const out = [statementBuilder.toString()]; |
| 27684 |
if (min > expr.min) { |
| 27685 |
out.unshift("Math.max(", min, ", "); |
| 27686 |
out.push(")"); |
| 27687 |
} |
| 27688 |
if (max < expr.max) { |
| 27689 |
out.unshift("Math.min(", max, ", "); |
| 27690 |
out.push(")"); |
| 27691 |
} |
| 27692 |
out.unshift("dest[destOffset + ", i, "] = "); |
| 27693 |
out.push(";"); |
| 27694 |
result.push(out.join("")); |
| 27695 |
} |
| 27696 |
return result.join("\n"); |
| 27697 |
} |
| 27698 |
} |
| 27699 |
|
| 27700 |
;// ./src/core/bidi.js |
| 27701 |
|
| 27702 |
const baseTypes = ["BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "S", "B", "S", "WS", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "B", "B", "B", "S", "WS", "ON", "ON", "ET", "ET", "ET", "ON", "ON", "ON", "ON", "ON", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "ON", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "ON", "ON", "ON", "BN", "BN", "BN", "BN", "BN", "BN", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "CS", "ON", "ET", "ET", "ET", "ET", "ON", "ON", "ON", "ON", "L", "ON", "ON", "BN", "ON", "ON", "ET", "ET", "EN", "EN", "ON", "L", "ON", "ON", "ON", "EN", "L", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "L", "L", "L", "L", "L", "L", "L", "L"]; |
| 27703 |
const arabicTypes = ["AN", "AN", "AN", "AN", "AN", "AN", "ON", "ON", "AL", "ET", "ET", "AL", "CS", "AL", "ON", "ON", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "ET", "AN", "AN", "AL", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "ON", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "NSM", "NSM", "ON", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "AL", "AL", "AL", "AL", "AL", "AL"]; |
| 27704 |
function isOdd(i) { |
| 27705 |
return (i & 1) !== 0; |
| 27706 |
} |
| 27707 |
function isEven(i) { |
| 27708 |
return (i & 1) === 0; |
| 27709 |
} |
| 27710 |
function findUnequal(arr, start, value) { |
| 27711 |
let j, jj; |
| 27712 |
for (j = start, jj = arr.length; j < jj; ++j) { |
| 27713 |
if (arr[j] !== value) { |
| 27714 |
return j; |
| 27715 |
} |
| 27716 |
} |
| 27717 |
return j; |
| 27718 |
} |
| 27719 |
function setValues(arr, start, end, value) { |
| 27720 |
for (let j = start; j < end; ++j) { |
| 27721 |
arr[j] = value; |
| 27722 |
} |
| 27723 |
} |
| 27724 |
function reverseValues(arr, start, end) { |
| 27725 |
for (let i = start, j = end - 1; i < j; ++i, --j) { |
| 27726 |
const temp = arr[i]; |
| 27727 |
arr[i] = arr[j]; |
| 27728 |
arr[j] = temp; |
| 27729 |
} |
| 27730 |
} |
| 27731 |
function createBidiText(str, isLTR, vertical = false) { |
| 27732 |
let dir = "ltr"; |
| 27733 |
if (vertical) { |
| 27734 |
dir = "ttb"; |
| 27735 |
} else if (!isLTR) { |
| 27736 |
dir = "rtl"; |
| 27737 |
} |
| 27738 |
return { |
| 27739 |
str, |
| 27740 |
dir |
| 27741 |
}; |
| 27742 |
} |
| 27743 |
const chars = []; |
| 27744 |
const types = []; |
| 27745 |
function bidi(str, startLevel = -1, vertical = false) { |
| 27746 |
let isLTR = true; |
| 27747 |
const strLength = str.length; |
| 27748 |
if (strLength === 0 || vertical) { |
| 27749 |
return createBidiText(str, isLTR, vertical); |
| 27750 |
} |
| 27751 |
chars.length = strLength; |
| 27752 |
types.length = strLength; |
| 27753 |
let numBidi = 0; |
| 27754 |
let i, ii; |
| 27755 |
for (i = 0; i < strLength; ++i) { |
| 27756 |
chars[i] = str.charAt(i); |
| 27757 |
const charCode = str.charCodeAt(i); |
| 27758 |
let charType = "L"; |
| 27759 |
if (charCode <= 0x00ff) { |
| 27760 |
charType = baseTypes[charCode]; |
| 27761 |
} else if (0x0590 <= charCode && charCode <= 0x05f4) { |
| 27762 |
charType = "R"; |
| 27763 |
} else if (0x0600 <= charCode && charCode <= 0x06ff) { |
| 27764 |
charType = arabicTypes[charCode & 0xff]; |
| 27765 |
if (!charType) { |
| 27766 |
warn("Bidi: invalid Unicode character " + charCode.toString(16)); |
| 27767 |
} |
| 27768 |
} else if (0x0700 <= charCode && charCode <= 0x08ac || 0xfb50 <= charCode && charCode <= 0xfdff || 0xfe70 <= charCode && charCode <= 0xfeff) { |
| 27769 |
charType = "AL"; |
| 27770 |
} |
| 27771 |
if (charType === "R" || charType === "AL" || charType === "AN") { |
| 27772 |
numBidi++; |
| 27773 |
} |
| 27774 |
types[i] = charType; |
| 27775 |
} |
| 27776 |
if (numBidi === 0) { |
| 27777 |
isLTR = true; |
| 27778 |
return createBidiText(str, isLTR); |
| 27779 |
} |
| 27780 |
if (startLevel === -1) { |
| 27781 |
if (numBidi / strLength < 0.3 && strLength > 4) { |
| 27782 |
isLTR = true; |
| 27783 |
startLevel = 0; |
| 27784 |
} else { |
| 27785 |
isLTR = false; |
| 27786 |
startLevel = 1; |
| 27787 |
} |
| 27788 |
} |
| 27789 |
const levels = []; |
| 27790 |
for (i = 0; i < strLength; ++i) { |
| 27791 |
levels[i] = startLevel; |
| 27792 |
} |
| 27793 |
const e = isOdd(startLevel) ? "R" : "L"; |
| 27794 |
const sor = e; |
| 27795 |
const eor = sor; |
| 27796 |
let lastType = sor; |
| 27797 |
for (i = 0; i < strLength; ++i) { |
| 27798 |
if (types[i] === "NSM") { |
| 27799 |
types[i] = lastType; |
| 27800 |
} else { |
| 27801 |
lastType = types[i]; |
| 27802 |
} |
| 27803 |
} |
| 27804 |
lastType = sor; |
| 27805 |
let t; |
| 27806 |
for (i = 0; i < strLength; ++i) { |
| 27807 |
t = types[i]; |
| 27808 |
if (t === "EN") { |
| 27809 |
types[i] = lastType === "AL" ? "AN" : "EN"; |
| 27810 |
} else if (t === "R" || t === "L" || t === "AL") { |
| 27811 |
lastType = t; |
| 27812 |
} |
| 27813 |
} |
| 27814 |
for (i = 0; i < strLength; ++i) { |
| 27815 |
t = types[i]; |
| 27816 |
if (t === "AL") { |
| 27817 |
types[i] = "R"; |
| 27818 |
} |
| 27819 |
} |
| 27820 |
for (i = 1; i < strLength - 1; ++i) { |
| 27821 |
if (types[i] === "ES" && types[i - 1] === "EN" && types[i + 1] === "EN") { |
| 27822 |
types[i] = "EN"; |
| 27823 |
} |
| 27824 |
if (types[i] === "CS" && (types[i - 1] === "EN" || types[i - 1] === "AN") && types[i + 1] === types[i - 1]) { |
| 27825 |
types[i] = types[i - 1]; |
| 27826 |
} |
| 27827 |
} |
| 27828 |
for (i = 0; i < strLength; ++i) { |
| 27829 |
if (types[i] === "EN") { |
| 27830 |
for (let j = i - 1; j >= 0; --j) { |
| 27831 |
if (types[j] !== "ET") { |
| 27832 |
break; |
| 27833 |
} |
| 27834 |
types[j] = "EN"; |
| 27835 |
} |
| 27836 |
for (let j = i + 1; j < strLength; ++j) { |
| 27837 |
if (types[j] !== "ET") { |
| 27838 |
break; |
| 27839 |
} |
| 27840 |
types[j] = "EN"; |
| 27841 |
} |
| 27842 |
} |
| 27843 |
} |
| 27844 |
for (i = 0; i < strLength; ++i) { |
| 27845 |
t = types[i]; |
| 27846 |
if (t === "WS" || t === "ES" || t === "ET" || t === "CS") { |
| 27847 |
types[i] = "ON"; |
| 27848 |
} |
| 27849 |
} |
| 27850 |
lastType = sor; |
| 27851 |
for (i = 0; i < strLength; ++i) { |
| 27852 |
t = types[i]; |
| 27853 |
if (t === "EN") { |
| 27854 |
types[i] = lastType === "L" ? "L" : "EN"; |
| 27855 |
} else if (t === "R" || t === "L") { |
| 27856 |
lastType = t; |
| 27857 |
} |
| 27858 |
} |
| 27859 |
for (i = 0; i < strLength; ++i) { |
| 27860 |
if (types[i] === "ON") { |
| 27861 |
const end = findUnequal(types, i + 1, "ON"); |
| 27862 |
let before = sor; |
| 27863 |
if (i > 0) { |
| 27864 |
before = types[i - 1]; |
| 27865 |
} |
| 27866 |
let after = eor; |
| 27867 |
if (end + 1 < strLength) { |
| 27868 |
after = types[end + 1]; |
| 27869 |
} |
| 27870 |
if (before !== "L") { |
| 27871 |
before = "R"; |
| 27872 |
} |
| 27873 |
if (after !== "L") { |
| 27874 |
after = "R"; |
| 27875 |
} |
| 27876 |
if (before === after) { |
| 27877 |
setValues(types, i, end, before); |
| 27878 |
} |
| 27879 |
i = end - 1; |
| 27880 |
} |
| 27881 |
} |
| 27882 |
for (i = 0; i < strLength; ++i) { |
| 27883 |
if (types[i] === "ON") { |
| 27884 |
types[i] = e; |
| 27885 |
} |
| 27886 |
} |
| 27887 |
for (i = 0; i < strLength; ++i) { |
| 27888 |
t = types[i]; |
| 27889 |
if (isEven(levels[i])) { |
| 27890 |
if (t === "R") { |
| 27891 |
levels[i] += 1; |
| 27892 |
} else if (t === "AN" || t === "EN") { |
| 27893 |
levels[i] += 2; |
| 27894 |
} |
| 27895 |
} else if (t === "L" || t === "AN" || t === "EN") { |
| 27896 |
levels[i] += 1; |
| 27897 |
} |
| 27898 |
} |
| 27899 |
let highestLevel = -1; |
| 27900 |
let lowestOddLevel = 99; |
| 27901 |
let level; |
| 27902 |
for (i = 0, ii = levels.length; i < ii; ++i) { |
| 27903 |
level = levels[i]; |
| 27904 |
if (highestLevel < level) { |
| 27905 |
highestLevel = level; |
| 27906 |
} |
| 27907 |
if (lowestOddLevel > level && isOdd(level)) { |
| 27908 |
lowestOddLevel = level; |
| 27909 |
} |
| 27910 |
} |
| 27911 |
for (level = highestLevel; level >= lowestOddLevel; --level) { |
| 27912 |
let start = -1; |
| 27913 |
for (i = 0, ii = levels.length; i < ii; ++i) { |
| 27914 |
if (levels[i] < level) { |
| 27915 |
if (start >= 0) { |
| 27916 |
reverseValues(chars, start, i); |
| 27917 |
start = -1; |
| 27918 |
} |
| 27919 |
} else if (start < 0) { |
| 27920 |
start = i; |
| 27921 |
} |
| 27922 |
} |
| 27923 |
if (start >= 0) { |
| 27924 |
reverseValues(chars, start, levels.length); |
| 27925 |
} |
| 27926 |
} |
| 27927 |
for (i = 0, ii = chars.length; i < ii; ++i) { |
| 27928 |
const ch = chars[i]; |
| 27929 |
if (ch === "<" || ch === ">") { |
| 27930 |
chars[i] = ""; |
| 27931 |
} |
| 27932 |
} |
| 27933 |
return createBidiText(chars.join(""), isLTR); |
| 27934 |
} |
| 27935 |
|
| 27936 |
;// ./src/core/font_substitutions.js |
| 27937 |
|
| 27938 |
|
| 27939 |
|
| 27940 |
const NORMAL = { |
| 27941 |
style: "normal", |
| 27942 |
weight: "normal" |
| 27943 |
}; |
| 27944 |
const BOLD = { |
| 27945 |
style: "normal", |
| 27946 |
weight: "bold" |
| 27947 |
}; |
| 27948 |
const ITALIC = { |
| 27949 |
style: "italic", |
| 27950 |
weight: "normal" |
| 27951 |
}; |
| 27952 |
const BOLDITALIC = { |
| 27953 |
style: "italic", |
| 27954 |
weight: "bold" |
| 27955 |
}; |
| 27956 |
const substitutionMap = new Map([["Times-Roman", { |
| 27957 |
local: ["Times New Roman", "Times-Roman", "Times", "Liberation Serif", "Nimbus Roman", "Nimbus Roman L", "Tinos", "Thorndale", "TeX Gyre Termes", "FreeSerif", "Linux Libertine O", "Libertinus Serif", "DejaVu Serif", "Bitstream Vera Serif", "Ubuntu"], |
| 27958 |
style: NORMAL, |
| 27959 |
ultimate: "serif" |
| 27960 |
}], ["Times-Bold", { |
| 27961 |
alias: "Times-Roman", |
| 27962 |
style: BOLD, |
| 27963 |
ultimate: "serif" |
| 27964 |
}], ["Times-Italic", { |
| 27965 |
alias: "Times-Roman", |
| 27966 |
style: ITALIC, |
| 27967 |
ultimate: "serif" |
| 27968 |
}], ["Times-BoldItalic", { |
| 27969 |
alias: "Times-Roman", |
| 27970 |
style: BOLDITALIC, |
| 27971 |
ultimate: "serif" |
| 27972 |
}], ["Helvetica", { |
| 27973 |
local: ["Helvetica", "Helvetica Neue", "Arial", "Arial Nova", "Liberation Sans", "Arimo", "Nimbus Sans", "Nimbus Sans L", "A030", "TeX Gyre Heros", "FreeSans", "DejaVu Sans", "Albany", "Bitstream Vera Sans", "Arial Unicode MS", "Microsoft Sans Serif", "Apple Symbols", "Cantarell"], |
| 27974 |
path: "LiberationSans-Regular.ttf", |
| 27975 |
style: NORMAL, |
| 27976 |
ultimate: "sans-serif" |
| 27977 |
}], ["Helvetica-Bold", { |
| 27978 |
alias: "Helvetica", |
| 27979 |
path: "LiberationSans-Bold.ttf", |
| 27980 |
style: BOLD, |
| 27981 |
ultimate: "sans-serif" |
| 27982 |
}], ["Helvetica-Oblique", { |
| 27983 |
alias: "Helvetica", |
| 27984 |
path: "LiberationSans-Italic.ttf", |
| 27985 |
style: ITALIC, |
| 27986 |
ultimate: "sans-serif" |
| 27987 |
}], ["Helvetica-BoldOblique", { |
| 27988 |
alias: "Helvetica", |
| 27989 |
path: "LiberationSans-BoldItalic.ttf", |
| 27990 |
style: BOLDITALIC, |
| 27991 |
ultimate: "sans-serif" |
| 27992 |
}], ["Courier", { |
| 27993 |
local: ["Courier", "Courier New", "Liberation Mono", "Nimbus Mono", "Nimbus Mono L", "Cousine", "Cumberland", "TeX Gyre Cursor", "FreeMono", "Linux Libertine Mono O", "Libertinus Mono"], |
| 27994 |
style: NORMAL, |
| 27995 |
ultimate: "monospace" |
| 27996 |
}], ["Courier-Bold", { |
| 27997 |
alias: "Courier", |
| 27998 |
style: BOLD, |
| 27999 |
ultimate: "monospace" |
| 28000 |
}], ["Courier-Oblique", { |
| 28001 |
alias: "Courier", |
| 28002 |
style: ITALIC, |
| 28003 |
ultimate: "monospace" |
| 28004 |
}], ["Courier-BoldOblique", { |
| 28005 |
alias: "Courier", |
| 28006 |
style: BOLDITALIC, |
| 28007 |
ultimate: "monospace" |
| 28008 |
}], ["ArialBlack", { |
| 28009 |
local: ["Arial Black"], |
| 28010 |
style: { |
| 28011 |
style: "normal", |
| 28012 |
weight: "900" |
| 28013 |
}, |
| 28014 |
fallback: "Helvetica-Bold" |
| 28015 |
}], ["ArialBlack-Bold", { |
| 28016 |
alias: "ArialBlack" |
| 28017 |
}], ["ArialBlack-Italic", { |
| 28018 |
alias: "ArialBlack", |
| 28019 |
style: { |
| 28020 |
style: "italic", |
| 28021 |
weight: "900" |
| 28022 |
}, |
| 28023 |
fallback: "Helvetica-BoldOblique" |
| 28024 |
}], ["ArialBlack-BoldItalic", { |
| 28025 |
alias: "ArialBlack-Italic" |
| 28026 |
}], ["ArialNarrow", { |
| 28027 |
local: ["Arial Narrow", "Liberation Sans Narrow", "Helvetica Condensed", "Nimbus Sans Narrow", "TeX Gyre Heros Cn"], |
| 28028 |
style: NORMAL, |
| 28029 |
fallback: "Helvetica" |
| 28030 |
}], ["ArialNarrow-Bold", { |
| 28031 |
alias: "ArialNarrow", |
| 28032 |
style: BOLD, |
| 28033 |
fallback: "Helvetica-Bold" |
| 28034 |
}], ["ArialNarrow-Italic", { |
| 28035 |
alias: "ArialNarrow", |
| 28036 |
style: ITALIC, |
| 28037 |
fallback: "Helvetica-Oblique" |
| 28038 |
}], ["ArialNarrow-BoldItalic", { |
| 28039 |
alias: "ArialNarrow", |
| 28040 |
style: BOLDITALIC, |
| 28041 |
fallback: "Helvetica-BoldOblique" |
| 28042 |
}], ["Calibri", { |
| 28043 |
local: ["Calibri", "Carlito"], |
| 28044 |
style: NORMAL, |
| 28045 |
fallback: "Helvetica" |
| 28046 |
}], ["Calibri-Bold", { |
| 28047 |
alias: "Calibri", |
| 28048 |
style: BOLD, |
| 28049 |
fallback: "Helvetica-Bold" |
| 28050 |
}], ["Calibri-Italic", { |
| 28051 |
alias: "Calibri", |
| 28052 |
style: ITALIC, |
| 28053 |
fallback: "Helvetica-Oblique" |
| 28054 |
}], ["Calibri-BoldItalic", { |
| 28055 |
alias: "Calibri", |
| 28056 |
style: BOLDITALIC, |
| 28057 |
fallback: "Helvetica-BoldOblique" |
| 28058 |
}], ["Wingdings", { |
| 28059 |
local: ["Wingdings", "URW Dingbats"], |
| 28060 |
style: NORMAL |
| 28061 |
}], ["Wingdings-Regular", { |
| 28062 |
alias: "Wingdings" |
| 28063 |
}], ["Wingdings-Bold", { |
| 28064 |
alias: "Wingdings" |
| 28065 |
}]]); |
| 28066 |
const fontAliases = new Map([["Arial-Black", "ArialBlack"]]); |
| 28067 |
function getStyleToAppend(style) { |
| 28068 |
switch (style) { |
| 28069 |
case BOLD: |
| 28070 |
return "Bold"; |
| 28071 |
case ITALIC: |
| 28072 |
return "Italic"; |
| 28073 |
case BOLDITALIC: |
| 28074 |
return "Bold Italic"; |
| 28075 |
default: |
| 28076 |
if (style?.weight === "bold") { |
| 28077 |
return "Bold"; |
| 28078 |
} |
| 28079 |
if (style?.style === "italic") { |
| 28080 |
return "Italic"; |
| 28081 |
} |
| 28082 |
} |
| 28083 |
return ""; |
| 28084 |
} |
| 28085 |
function getFamilyName(str) { |
| 28086 |
const keywords = new Set(["thin", "extralight", "ultralight", "demilight", "semilight", "light", "book", "regular", "normal", "medium", "demibold", "semibold", "bold", "extrabold", "ultrabold", "black", "heavy", "extrablack", "ultrablack", "roman", "italic", "oblique", "ultracondensed", "extracondensed", "condensed", "semicondensed", "normal", "semiexpanded", "expanded", "extraexpanded", "ultraexpanded", "bolditalic"]); |
| 28087 |
return str.split(/[- ,+]+/g).filter(tok => !keywords.has(tok.toLowerCase())).join(" "); |
| 28088 |
} |
| 28089 |
function generateFont({ |
| 28090 |
alias, |
| 28091 |
local, |
| 28092 |
path, |
| 28093 |
fallback, |
| 28094 |
style, |
| 28095 |
ultimate |
| 28096 |
}, src, localFontPath, useFallback = true, usePath = true, append = "") { |
| 28097 |
const result = { |
| 28098 |
style: null, |
| 28099 |
ultimate: null |
| 28100 |
}; |
| 28101 |
if (local) { |
| 28102 |
const extra = append ? ` ${append}` : ""; |
| 28103 |
for (const name of local) { |
| 28104 |
src.push(`local(${name}${extra})`); |
| 28105 |
} |
| 28106 |
} |
| 28107 |
if (alias) { |
| 28108 |
const substitution = substitutionMap.get(alias); |
| 28109 |
const aliasAppend = append || getStyleToAppend(style); |
| 28110 |
Object.assign(result, generateFont(substitution, src, localFontPath, useFallback && !fallback, usePath && !path, aliasAppend)); |
| 28111 |
} |
| 28112 |
if (style) { |
| 28113 |
result.style = style; |
| 28114 |
} |
| 28115 |
if (ultimate) { |
| 28116 |
result.ultimate = ultimate; |
| 28117 |
} |
| 28118 |
if (useFallback && fallback) { |
| 28119 |
const fallbackInfo = substitutionMap.get(fallback); |
| 28120 |
const { |
| 28121 |
ultimate: fallbackUltimate |
| 28122 |
} = generateFont(fallbackInfo, src, localFontPath, useFallback, usePath && !path, append); |
| 28123 |
result.ultimate ||= fallbackUltimate; |
| 28124 |
} |
| 28125 |
if (usePath && path && localFontPath) { |
| 28126 |
src.push(`url(${localFontPath}${path})`); |
| 28127 |
} |
| 28128 |
return result; |
| 28129 |
} |
| 28130 |
function getFontSubstitution(systemFontCache, idFactory, localFontPath, baseFontName, standardFontName, type) { |
| 28131 |
if (baseFontName.startsWith("InvalidPDFjsFont_")) { |
| 28132 |
return null; |
| 28133 |
} |
| 28134 |
if ((type === "TrueType" || type === "Type1") && /^[A-Z]{6}\+/.test(baseFontName)) { |
| 28135 |
baseFontName = baseFontName.slice(7); |
| 28136 |
} |
| 28137 |
baseFontName = normalizeFontName(baseFontName); |
| 28138 |
const key = baseFontName; |
| 28139 |
let substitutionInfo = systemFontCache.get(key); |
| 28140 |
if (substitutionInfo) { |
| 28141 |
return substitutionInfo; |
| 28142 |
} |
| 28143 |
let substitution = substitutionMap.get(baseFontName); |
| 28144 |
if (!substitution) { |
| 28145 |
for (const [alias, subst] of fontAliases) { |
| 28146 |
if (baseFontName.startsWith(alias)) { |
| 28147 |
baseFontName = `${subst}${baseFontName.substring(alias.length)}`; |
| 28148 |
substitution = substitutionMap.get(baseFontName); |
| 28149 |
break; |
| 28150 |
} |
| 28151 |
} |
| 28152 |
} |
| 28153 |
let mustAddBaseFont = false; |
| 28154 |
if (!substitution) { |
| 28155 |
substitution = substitutionMap.get(standardFontName); |
| 28156 |
mustAddBaseFont = true; |
| 28157 |
} |
| 28158 |
const loadedName = `${idFactory.getDocId()}_s${idFactory.createFontId()}`; |
| 28159 |
if (!substitution) { |
| 28160 |
if (!validateFontName(baseFontName)) { |
| 28161 |
warn(`Cannot substitute the font because of its name: ${baseFontName}`); |
| 28162 |
systemFontCache.set(key, null); |
| 28163 |
return null; |
| 28164 |
} |
| 28165 |
const bold = /bold/gi.test(baseFontName); |
| 28166 |
const italic = /oblique|italic/gi.test(baseFontName); |
| 28167 |
const style = bold && italic && BOLDITALIC || bold && BOLD || italic && ITALIC || NORMAL; |
| 28168 |
substitutionInfo = { |
| 28169 |
css: `"${getFamilyName(baseFontName)}",${loadedName}`, |
| 28170 |
guessFallback: true, |
| 28171 |
loadedName, |
| 28172 |
baseFontName, |
| 28173 |
src: `local(${baseFontName})`, |
| 28174 |
style |
| 28175 |
}; |
| 28176 |
systemFontCache.set(key, substitutionInfo); |
| 28177 |
return substitutionInfo; |
| 28178 |
} |
| 28179 |
const src = []; |
| 28180 |
if (mustAddBaseFont && validateFontName(baseFontName)) { |
| 28181 |
src.push(`local(${baseFontName})`); |
| 28182 |
} |
| 28183 |
const { |
| 28184 |
style, |
| 28185 |
ultimate |
| 28186 |
} = generateFont(substitution, src, localFontPath); |
| 28187 |
const guessFallback = ultimate === null; |
| 28188 |
const fallback = guessFallback ? "" : `,${ultimate}`; |
| 28189 |
substitutionInfo = { |
| 28190 |
css: `"${getFamilyName(baseFontName)}",${loadedName}${fallback}`, |
| 28191 |
guessFallback, |
| 28192 |
loadedName, |
| 28193 |
baseFontName, |
| 28194 |
src: src.join(","), |
| 28195 |
style |
| 28196 |
}; |
| 28197 |
systemFontCache.set(key, substitutionInfo); |
| 28198 |
return substitutionInfo; |
| 28199 |
} |
| 28200 |
|
| 28201 |
;// ./src/core/image_resizer.js |
| 28202 |
|
| 28203 |
const MIN_IMAGE_DIM = 2048; |
| 28204 |
const MAX_IMAGE_DIM = 65537; |
| 28205 |
const MAX_ERROR = 128; |
| 28206 |
class ImageResizer { |
| 28207 |
constructor(imgData, isMask) { |
| 28208 |
this._imgData = imgData; |
| 28209 |
this._isMask = isMask; |
| 28210 |
} |
| 28211 |
static needsToBeResized(width, height) { |
| 28212 |
if (width <= this._goodSquareLength && height <= this._goodSquareLength) { |
| 28213 |
return false; |
| 28214 |
} |
| 28215 |
const { |
| 28216 |
MAX_DIM |
| 28217 |
} = this; |
| 28218 |
if (width > MAX_DIM || height > MAX_DIM) { |
| 28219 |
return true; |
| 28220 |
} |
| 28221 |
const area = width * height; |
| 28222 |
if (this._hasMaxArea) { |
| 28223 |
return area > this.MAX_AREA; |
| 28224 |
} |
| 28225 |
if (area < this._goodSquareLength ** 2) { |
| 28226 |
return false; |
| 28227 |
} |
| 28228 |
if (this._areGoodDims(width, height)) { |
| 28229 |
this._goodSquareLength = Math.max(this._goodSquareLength, Math.floor(Math.sqrt(width * height))); |
| 28230 |
return false; |
| 28231 |
} |
| 28232 |
this._goodSquareLength = this._guessMax(this._goodSquareLength, MAX_DIM, MAX_ERROR, 0); |
| 28233 |
const maxArea = this.MAX_AREA = this._goodSquareLength ** 2; |
| 28234 |
return area > maxArea; |
| 28235 |
} |
| 28236 |
static get MAX_DIM() { |
| 28237 |
return shadow(this, "MAX_DIM", this._guessMax(MIN_IMAGE_DIM, MAX_IMAGE_DIM, 0, 1)); |
| 28238 |
} |
| 28239 |
static get MAX_AREA() { |
| 28240 |
this._hasMaxArea = true; |
| 28241 |
return shadow(this, "MAX_AREA", this._guessMax(ImageResizer._goodSquareLength, this.MAX_DIM, MAX_ERROR, 0) ** 2); |
| 28242 |
} |
| 28243 |
static set MAX_AREA(area) { |
| 28244 |
if (area >= 0) { |
| 28245 |
this._hasMaxArea = true; |
| 28246 |
shadow(this, "MAX_AREA", area); |
| 28247 |
} |
| 28248 |
} |
| 28249 |
static setMaxArea(area) { |
| 28250 |
if (!this._hasMaxArea) { |
| 28251 |
this.MAX_AREA = area >> 2; |
| 28252 |
} |
| 28253 |
} |
| 28254 |
static _areGoodDims(width, height) { |
| 28255 |
try { |
| 28256 |
const canvas = new OffscreenCanvas(width, height); |
| 28257 |
const ctx = canvas.getContext("2d"); |
| 28258 |
ctx.fillRect(0, 0, 1, 1); |
| 28259 |
const opacity = ctx.getImageData(0, 0, 1, 1).data[3]; |
| 28260 |
canvas.width = canvas.height = 1; |
| 28261 |
return opacity !== 0; |
| 28262 |
} catch { |
| 28263 |
return false; |
| 28264 |
} |
| 28265 |
} |
| 28266 |
static _guessMax(start, end, tolerance, defaultHeight) { |
| 28267 |
while (start + tolerance + 1 < end) { |
| 28268 |
const middle = Math.floor((start + end) / 2); |
| 28269 |
const height = defaultHeight || middle; |
| 28270 |
if (this._areGoodDims(middle, height)) { |
| 28271 |
start = middle; |
| 28272 |
} else { |
| 28273 |
end = middle; |
| 28274 |
} |
| 28275 |
} |
| 28276 |
return start; |
| 28277 |
} |
| 28278 |
static async createImage(imgData, isMask = false) { |
| 28279 |
return new ImageResizer(imgData, isMask)._createImage(); |
| 28280 |
} |
| 28281 |
async _createImage() { |
| 28282 |
const data = this._encodeBMP(); |
| 28283 |
const blob = new Blob([data.buffer], { |
| 28284 |
type: "image/bmp" |
| 28285 |
}); |
| 28286 |
const bitmapPromise = createImageBitmap(blob); |
| 28287 |
const { |
| 28288 |
MAX_AREA, |
| 28289 |
MAX_DIM |
| 28290 |
} = ImageResizer; |
| 28291 |
const { |
| 28292 |
_imgData: imgData |
| 28293 |
} = this; |
| 28294 |
const { |
| 28295 |
width, |
| 28296 |
height |
| 28297 |
} = imgData; |
| 28298 |
const minFactor = Math.max(width / MAX_DIM, height / MAX_DIM, Math.sqrt(width * height / MAX_AREA)); |
| 28299 |
const firstFactor = Math.max(minFactor, 2); |
| 28300 |
const factor = Math.round(10 * (minFactor + 1.25)) / 10 / firstFactor; |
| 28301 |
const N = Math.floor(Math.log2(factor)); |
| 28302 |
const steps = new Array(N + 2).fill(2); |
| 28303 |
steps[0] = firstFactor; |
| 28304 |
steps.splice(-1, 1, factor / (1 << N)); |
| 28305 |
let newWidth = width; |
| 28306 |
let newHeight = height; |
| 28307 |
let bitmap = await bitmapPromise; |
| 28308 |
for (const step of steps) { |
| 28309 |
const prevWidth = newWidth; |
| 28310 |
const prevHeight = newHeight; |
| 28311 |
newWidth = Math.floor(newWidth / step) - 1; |
| 28312 |
newHeight = Math.floor(newHeight / step) - 1; |
| 28313 |
const canvas = new OffscreenCanvas(newWidth, newHeight); |
| 28314 |
const ctx = canvas.getContext("2d"); |
| 28315 |
ctx.drawImage(bitmap, 0, 0, prevWidth, prevHeight, 0, 0, newWidth, newHeight); |
| 28316 |
bitmap = canvas.transferToImageBitmap(); |
| 28317 |
} |
| 28318 |
imgData.data = null; |
| 28319 |
imgData.bitmap = bitmap; |
| 28320 |
imgData.width = newWidth; |
| 28321 |
imgData.height = newHeight; |
| 28322 |
return imgData; |
| 28323 |
} |
| 28324 |
_encodeBMP() { |
| 28325 |
const { |
| 28326 |
width, |
| 28327 |
height, |
| 28328 |
kind |
| 28329 |
} = this._imgData; |
| 28330 |
let data = this._imgData.data; |
| 28331 |
let bitPerPixel; |
| 28332 |
let colorTable = new Uint8Array(0); |
| 28333 |
let maskTable = colorTable; |
| 28334 |
let compression = 0; |
| 28335 |
switch (kind) { |
| 28336 |
case ImageKind.GRAYSCALE_1BPP: |
| 28337 |
{ |
| 28338 |
bitPerPixel = 1; |
| 28339 |
colorTable = new Uint8Array(this._isMask ? [255, 255, 255, 255, 0, 0, 0, 0] : [0, 0, 0, 0, 255, 255, 255, 255]); |
| 28340 |
const rowLen = width + 7 >> 3; |
| 28341 |
const rowSize = rowLen + 3 & -4; |
| 28342 |
if (rowLen !== rowSize) { |
| 28343 |
const newData = new Uint8Array(rowSize * height); |
| 28344 |
let k = 0; |
| 28345 |
for (let i = 0, ii = height * rowLen; i < ii; i += rowLen, k += rowSize) { |
| 28346 |
newData.set(data.subarray(i, i + rowLen), k); |
| 28347 |
} |
| 28348 |
data = newData; |
| 28349 |
} |
| 28350 |
break; |
| 28351 |
} |
| 28352 |
case ImageKind.RGB_24BPP: |
| 28353 |
{ |
| 28354 |
bitPerPixel = 24; |
| 28355 |
if (width & 3) { |
| 28356 |
const rowLen = 3 * width; |
| 28357 |
const rowSize = rowLen + 3 & -4; |
| 28358 |
const extraLen = rowSize - rowLen; |
| 28359 |
const newData = new Uint8Array(rowSize * height); |
| 28360 |
let k = 0; |
| 28361 |
for (let i = 0, ii = height * rowLen; i < ii; i += rowLen) { |
| 28362 |
const row = data.subarray(i, i + rowLen); |
| 28363 |
for (let j = 0; j < rowLen; j += 3) { |
| 28364 |
newData[k++] = row[j + 2]; |
| 28365 |
newData[k++] = row[j + 1]; |
| 28366 |
newData[k++] = row[j]; |
| 28367 |
} |
| 28368 |
k += extraLen; |
| 28369 |
} |
| 28370 |
data = newData; |
| 28371 |
} else { |
| 28372 |
for (let i = 0, ii = data.length; i < ii; i += 3) { |
| 28373 |
const tmp = data[i]; |
| 28374 |
data[i] = data[i + 2]; |
| 28375 |
data[i + 2] = tmp; |
| 28376 |
} |
| 28377 |
} |
| 28378 |
break; |
| 28379 |
} |
| 28380 |
case ImageKind.RGBA_32BPP: |
| 28381 |
bitPerPixel = 32; |
| 28382 |
compression = 3; |
| 28383 |
maskTable = new Uint8Array(4 + 4 + 4 + 4 + 52); |
| 28384 |
const view = new DataView(maskTable.buffer); |
| 28385 |
if (FeatureTest.isLittleEndian) { |
| 28386 |
view.setUint32(0, 0x000000ff, true); |
| 28387 |
view.setUint32(4, 0x0000ff00, true); |
| 28388 |
view.setUint32(8, 0x00ff0000, true); |
| 28389 |
view.setUint32(12, 0xff000000, true); |
| 28390 |
} else { |
| 28391 |
view.setUint32(0, 0xff000000, true); |
| 28392 |
view.setUint32(4, 0x00ff0000, true); |
| 28393 |
view.setUint32(8, 0x0000ff00, true); |
| 28394 |
view.setUint32(12, 0x000000ff, true); |
| 28395 |
} |
| 28396 |
break; |
| 28397 |
default: |
| 28398 |
throw new Error("invalid format"); |
| 28399 |
} |
| 28400 |
let i = 0; |
| 28401 |
const headerLength = 40 + maskTable.length; |
| 28402 |
const fileLength = 14 + headerLength + colorTable.length + data.length; |
| 28403 |
const bmpData = new Uint8Array(fileLength); |
| 28404 |
const view = new DataView(bmpData.buffer); |
| 28405 |
view.setUint16(i, 0x4d42, true); |
| 28406 |
i += 2; |
| 28407 |
view.setUint32(i, fileLength, true); |
| 28408 |
i += 4; |
| 28409 |
view.setUint32(i, 0, true); |
| 28410 |
i += 4; |
| 28411 |
view.setUint32(i, 14 + headerLength + colorTable.length, true); |
| 28412 |
i += 4; |
| 28413 |
view.setUint32(i, headerLength, true); |
| 28414 |
i += 4; |
| 28415 |
view.setInt32(i, width, true); |
| 28416 |
i += 4; |
| 28417 |
view.setInt32(i, -height, true); |
| 28418 |
i += 4; |
| 28419 |
view.setUint16(i, 1, true); |
| 28420 |
i += 2; |
| 28421 |
view.setUint16(i, bitPerPixel, true); |
| 28422 |
i += 2; |
| 28423 |
view.setUint32(i, compression, true); |
| 28424 |
i += 4; |
| 28425 |
view.setUint32(i, 0, true); |
| 28426 |
i += 4; |
| 28427 |
view.setInt32(i, 0, true); |
| 28428 |
i += 4; |
| 28429 |
view.setInt32(i, 0, true); |
| 28430 |
i += 4; |
| 28431 |
view.setUint32(i, colorTable.length / 4, true); |
| 28432 |
i += 4; |
| 28433 |
view.setUint32(i, 0, true); |
| 28434 |
i += 4; |
| 28435 |
bmpData.set(maskTable, i); |
| 28436 |
i += maskTable.length; |
| 28437 |
bmpData.set(colorTable, i); |
| 28438 |
i += colorTable.length; |
| 28439 |
bmpData.set(data, i); |
| 28440 |
return bmpData; |
| 28441 |
} |
| 28442 |
} |
| 28443 |
ImageResizer._goodSquareLength = MIN_IMAGE_DIM; |
| 28444 |
|
| 28445 |
;// ./src/shared/murmurhash3.js |
| 28446 |
const SEED = 0xc3d2e1f0; |
| 28447 |
const MASK_HIGH = 0xffff0000; |
| 28448 |
const MASK_LOW = 0xffff; |
| 28449 |
class MurmurHash3_64 { |
| 28450 |
constructor(seed) { |
| 28451 |
this.h1 = seed ? seed & 0xffffffff : SEED; |
| 28452 |
this.h2 = seed ? seed & 0xffffffff : SEED; |
| 28453 |
} |
| 28454 |
update(input) { |
| 28455 |
let data, length; |
| 28456 |
if (typeof input === "string") { |
| 28457 |
data = new Uint8Array(input.length * 2); |
| 28458 |
length = 0; |
| 28459 |
for (let i = 0, ii = input.length; i < ii; i++) { |
| 28460 |
const code = input.charCodeAt(i); |
| 28461 |
if (code <= 0xff) { |
| 28462 |
data[length++] = code; |
| 28463 |
} else { |
| 28464 |
data[length++] = code >>> 8; |
| 28465 |
data[length++] = code & 0xff; |
| 28466 |
} |
| 28467 |
} |
| 28468 |
} else if (ArrayBuffer.isView(input)) { |
| 28469 |
data = input.slice(); |
| 28470 |
length = data.byteLength; |
| 28471 |
} else { |
| 28472 |
throw new Error("Invalid data format, must be a string or TypedArray."); |
| 28473 |
} |
| 28474 |
const blockCounts = length >> 2; |
| 28475 |
const tailLength = length - blockCounts * 4; |
| 28476 |
const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts); |
| 28477 |
let k1 = 0, |
| 28478 |
k2 = 0; |
| 28479 |
let h1 = this.h1, |
| 28480 |
h2 = this.h2; |
| 28481 |
const C1 = 0xcc9e2d51, |
| 28482 |
C2 = 0x1b873593; |
| 28483 |
const C1_LOW = C1 & MASK_LOW, |
| 28484 |
C2_LOW = C2 & MASK_LOW; |
| 28485 |
for (let i = 0; i < blockCounts; i++) { |
| 28486 |
if (i & 1) { |
| 28487 |
k1 = dataUint32[i]; |
| 28488 |
k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; |
| 28489 |
k1 = k1 << 15 | k1 >>> 17; |
| 28490 |
k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; |
| 28491 |
h1 ^= k1; |
| 28492 |
h1 = h1 << 13 | h1 >>> 19; |
| 28493 |
h1 = h1 * 5 + 0xe6546b64; |
| 28494 |
} else { |
| 28495 |
k2 = dataUint32[i]; |
| 28496 |
k2 = k2 * C1 & MASK_HIGH | k2 * C1_LOW & MASK_LOW; |
| 28497 |
k2 = k2 << 15 | k2 >>> 17; |
| 28498 |
k2 = k2 * C2 & MASK_HIGH | k2 * C2_LOW & MASK_LOW; |
| 28499 |
h2 ^= k2; |
| 28500 |
h2 = h2 << 13 | h2 >>> 19; |
| 28501 |
h2 = h2 * 5 + 0xe6546b64; |
| 28502 |
} |
| 28503 |
} |
| 28504 |
k1 = 0; |
| 28505 |
switch (tailLength) { |
| 28506 |
case 3: |
| 28507 |
k1 ^= data[blockCounts * 4 + 2] << 16; |
| 28508 |
case 2: |
| 28509 |
k1 ^= data[blockCounts * 4 + 1] << 8; |
| 28510 |
case 1: |
| 28511 |
k1 ^= data[blockCounts * 4]; |
| 28512 |
k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; |
| 28513 |
k1 = k1 << 15 | k1 >>> 17; |
| 28514 |
k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; |
| 28515 |
if (blockCounts & 1) { |
| 28516 |
h1 ^= k1; |
| 28517 |
} else { |
| 28518 |
h2 ^= k1; |
| 28519 |
} |
| 28520 |
} |
| 28521 |
this.h1 = h1; |
| 28522 |
this.h2 = h2; |
| 28523 |
} |
| 28524 |
hexdigest() { |
| 28525 |
let h1 = this.h1, |
| 28526 |
h2 = this.h2; |
| 28527 |
h1 ^= h2 >>> 1; |
| 28528 |
h1 = h1 * 0xed558ccd & MASK_HIGH | h1 * 0x8ccd & MASK_LOW; |
| 28529 |
h2 = h2 * 0xff51afd7 & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16; |
| 28530 |
h1 ^= h2 >>> 1; |
| 28531 |
h1 = h1 * 0x1a85ec53 & MASK_HIGH | h1 * 0xec53 & MASK_LOW; |
| 28532 |
h2 = h2 * 0xc4ceb9fe & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16; |
| 28533 |
h1 ^= h2 >>> 1; |
| 28534 |
return (h1 >>> 0).toString(16).padStart(8, "0") + (h2 >>> 0).toString(16).padStart(8, "0"); |
| 28535 |
} |
| 28536 |
} |
| 28537 |
|
| 28538 |
;// ./src/core/operator_list.js |
| 28539 |
|
| 28540 |
function addState(parentState, pattern, checkFn, iterateFn, processFn) { |
| 28541 |
let state = parentState; |
| 28542 |
for (let i = 0, ii = pattern.length - 1; i < ii; i++) { |
| 28543 |
const item = pattern[i]; |
| 28544 |
state = state[item] ||= []; |
| 28545 |
} |
| 28546 |
state[pattern.at(-1)] = { |
| 28547 |
checkFn, |
| 28548 |
iterateFn, |
| 28549 |
processFn |
| 28550 |
}; |
| 28551 |
} |
| 28552 |
const InitialState = []; |
| 28553 |
addState(InitialState, [OPS.save, OPS.transform, OPS.paintInlineImageXObject, OPS.restore], null, function iterateInlineImageGroup(context, i) { |
| 28554 |
const fnArray = context.fnArray; |
| 28555 |
const iFirstSave = context.iCurr - 3; |
| 28556 |
const pos = (i - iFirstSave) % 4; |
| 28557 |
switch (pos) { |
| 28558 |
case 0: |
| 28559 |
return fnArray[i] === OPS.save; |
| 28560 |
case 1: |
| 28561 |
return fnArray[i] === OPS.transform; |
| 28562 |
case 2: |
| 28563 |
return fnArray[i] === OPS.paintInlineImageXObject; |
| 28564 |
case 3: |
| 28565 |
return fnArray[i] === OPS.restore; |
| 28566 |
} |
| 28567 |
throw new Error(`iterateInlineImageGroup - invalid pos: ${pos}`); |
| 28568 |
}, function foundInlineImageGroup(context, i) { |
| 28569 |
const MIN_IMAGES_IN_INLINE_IMAGES_BLOCK = 10; |
| 28570 |
const MAX_IMAGES_IN_INLINE_IMAGES_BLOCK = 200; |
| 28571 |
const MAX_WIDTH = 1000; |
| 28572 |
const IMAGE_PADDING = 1; |
| 28573 |
const fnArray = context.fnArray, |
| 28574 |
argsArray = context.argsArray; |
| 28575 |
const curr = context.iCurr; |
| 28576 |
const iFirstSave = curr - 3; |
| 28577 |
const iFirstTransform = curr - 2; |
| 28578 |
const iFirstPIIXO = curr - 1; |
| 28579 |
const count = Math.min(Math.floor((i - iFirstSave) / 4), MAX_IMAGES_IN_INLINE_IMAGES_BLOCK); |
| 28580 |
if (count < MIN_IMAGES_IN_INLINE_IMAGES_BLOCK) { |
| 28581 |
return i - (i - iFirstSave) % 4; |
| 28582 |
} |
| 28583 |
let maxX = 0; |
| 28584 |
const map = []; |
| 28585 |
let maxLineHeight = 0; |
| 28586 |
let currentX = IMAGE_PADDING, |
| 28587 |
currentY = IMAGE_PADDING; |
| 28588 |
for (let q = 0; q < count; q++) { |
| 28589 |
const transform = argsArray[iFirstTransform + (q << 2)]; |
| 28590 |
const img = argsArray[iFirstPIIXO + (q << 2)][0]; |
| 28591 |
if (currentX + img.width > MAX_WIDTH) { |
| 28592 |
maxX = Math.max(maxX, currentX); |
| 28593 |
currentY += maxLineHeight + 2 * IMAGE_PADDING; |
| 28594 |
currentX = 0; |
| 28595 |
maxLineHeight = 0; |
| 28596 |
} |
| 28597 |
map.push({ |
| 28598 |
transform, |
| 28599 |
x: currentX, |
| 28600 |
y: currentY, |
| 28601 |
w: img.width, |
| 28602 |
h: img.height |
| 28603 |
}); |
| 28604 |
currentX += img.width + 2 * IMAGE_PADDING; |
| 28605 |
maxLineHeight = Math.max(maxLineHeight, img.height); |
| 28606 |
} |
| 28607 |
const imgWidth = Math.max(maxX, currentX) + IMAGE_PADDING; |
| 28608 |
const imgHeight = currentY + maxLineHeight + IMAGE_PADDING; |
| 28609 |
const imgData = new Uint8Array(imgWidth * imgHeight * 4); |
| 28610 |
const imgRowSize = imgWidth << 2; |
| 28611 |
for (let q = 0; q < count; q++) { |
| 28612 |
const data = argsArray[iFirstPIIXO + (q << 2)][0].data; |
| 28613 |
const rowSize = map[q].w << 2; |
| 28614 |
let dataOffset = 0; |
| 28615 |
let offset = map[q].x + map[q].y * imgWidth << 2; |
| 28616 |
imgData.set(data.subarray(0, rowSize), offset - imgRowSize); |
| 28617 |
for (let k = 0, kk = map[q].h; k < kk; k++) { |
| 28618 |
imgData.set(data.subarray(dataOffset, dataOffset + rowSize), offset); |
| 28619 |
dataOffset += rowSize; |
| 28620 |
offset += imgRowSize; |
| 28621 |
} |
| 28622 |
imgData.set(data.subarray(dataOffset - rowSize, dataOffset), offset); |
| 28623 |
while (offset >= 0) { |
| 28624 |
data[offset - 4] = data[offset]; |
| 28625 |
data[offset - 3] = data[offset + 1]; |
| 28626 |
data[offset - 2] = data[offset + 2]; |
| 28627 |
data[offset - 1] = data[offset + 3]; |
| 28628 |
data[offset + rowSize] = data[offset + rowSize - 4]; |
| 28629 |
data[offset + rowSize + 1] = data[offset + rowSize - 3]; |
| 28630 |
data[offset + rowSize + 2] = data[offset + rowSize - 2]; |
| 28631 |
data[offset + rowSize + 3] = data[offset + rowSize - 1]; |
| 28632 |
offset -= imgRowSize; |
| 28633 |
} |
| 28634 |
} |
| 28635 |
const img = { |
| 28636 |
width: imgWidth, |
| 28637 |
height: imgHeight |
| 28638 |
}; |
| 28639 |
if (context.isOffscreenCanvasSupported) { |
| 28640 |
const canvas = new OffscreenCanvas(imgWidth, imgHeight); |
| 28641 |
const ctx = canvas.getContext("2d"); |
| 28642 |
ctx.putImageData(new ImageData(new Uint8ClampedArray(imgData.buffer), imgWidth, imgHeight), 0, 0); |
| 28643 |
img.bitmap = canvas.transferToImageBitmap(); |
| 28644 |
img.data = null; |
| 28645 |
} else { |
| 28646 |
img.kind = ImageKind.RGBA_32BPP; |
| 28647 |
img.data = imgData; |
| 28648 |
} |
| 28649 |
fnArray.splice(iFirstSave, count * 4, OPS.paintInlineImageXObjectGroup); |
| 28650 |
argsArray.splice(iFirstSave, count * 4, [img, map]); |
| 28651 |
return iFirstSave + 1; |
| 28652 |
}); |
| 28653 |
addState(InitialState, [OPS.save, OPS.transform, OPS.paintImageMaskXObject, OPS.restore], null, function iterateImageMaskGroup(context, i) { |
| 28654 |
const fnArray = context.fnArray; |
| 28655 |
const iFirstSave = context.iCurr - 3; |
| 28656 |
const pos = (i - iFirstSave) % 4; |
| 28657 |
switch (pos) { |
| 28658 |
case 0: |
| 28659 |
return fnArray[i] === OPS.save; |
| 28660 |
case 1: |
| 28661 |
return fnArray[i] === OPS.transform; |
| 28662 |
case 2: |
| 28663 |
return fnArray[i] === OPS.paintImageMaskXObject; |
| 28664 |
case 3: |
| 28665 |
return fnArray[i] === OPS.restore; |
| 28666 |
} |
| 28667 |
throw new Error(`iterateImageMaskGroup - invalid pos: ${pos}`); |
| 28668 |
}, function foundImageMaskGroup(context, i) { |
| 28669 |
const MIN_IMAGES_IN_MASKS_BLOCK = 10; |
| 28670 |
const MAX_IMAGES_IN_MASKS_BLOCK = 100; |
| 28671 |
const MAX_SAME_IMAGES_IN_MASKS_BLOCK = 1000; |
| 28672 |
const fnArray = context.fnArray, |
| 28673 |
argsArray = context.argsArray; |
| 28674 |
const curr = context.iCurr; |
| 28675 |
const iFirstSave = curr - 3; |
| 28676 |
const iFirstTransform = curr - 2; |
| 28677 |
const iFirstPIMXO = curr - 1; |
| 28678 |
let count = Math.floor((i - iFirstSave) / 4); |
| 28679 |
if (count < MIN_IMAGES_IN_MASKS_BLOCK) { |
| 28680 |
return i - (i - iFirstSave) % 4; |
| 28681 |
} |
| 28682 |
let isSameImage = false; |
| 28683 |
let iTransform, transformArgs; |
| 28684 |
const firstPIMXOArg0 = argsArray[iFirstPIMXO][0]; |
| 28685 |
const firstTransformArg0 = argsArray[iFirstTransform][0], |
| 28686 |
firstTransformArg1 = argsArray[iFirstTransform][1], |
| 28687 |
firstTransformArg2 = argsArray[iFirstTransform][2], |
| 28688 |
firstTransformArg3 = argsArray[iFirstTransform][3]; |
| 28689 |
if (firstTransformArg1 === firstTransformArg2) { |
| 28690 |
isSameImage = true; |
| 28691 |
iTransform = iFirstTransform + 4; |
| 28692 |
let iPIMXO = iFirstPIMXO + 4; |
| 28693 |
for (let q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) { |
| 28694 |
transformArgs = argsArray[iTransform]; |
| 28695 |
if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || transformArgs[0] !== firstTransformArg0 || transformArgs[1] !== firstTransformArg1 || transformArgs[2] !== firstTransformArg2 || transformArgs[3] !== firstTransformArg3) { |
| 28696 |
if (q < MIN_IMAGES_IN_MASKS_BLOCK) { |
| 28697 |
isSameImage = false; |
| 28698 |
} else { |
| 28699 |
count = q; |
| 28700 |
} |
| 28701 |
break; |
| 28702 |
} |
| 28703 |
} |
| 28704 |
} |
| 28705 |
if (isSameImage) { |
| 28706 |
count = Math.min(count, MAX_SAME_IMAGES_IN_MASKS_BLOCK); |
| 28707 |
const positions = new Float32Array(count * 2); |
| 28708 |
iTransform = iFirstTransform; |
| 28709 |
for (let q = 0; q < count; q++, iTransform += 4) { |
| 28710 |
transformArgs = argsArray[iTransform]; |
| 28711 |
positions[q << 1] = transformArgs[4]; |
| 28712 |
positions[(q << 1) + 1] = transformArgs[5]; |
| 28713 |
} |
| 28714 |
fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectRepeat); |
| 28715 |
argsArray.splice(iFirstSave, count * 4, [firstPIMXOArg0, firstTransformArg0, firstTransformArg1, firstTransformArg2, firstTransformArg3, positions]); |
| 28716 |
} else { |
| 28717 |
count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK); |
| 28718 |
const images = []; |
| 28719 |
for (let q = 0; q < count; q++) { |
| 28720 |
transformArgs = argsArray[iFirstTransform + (q << 2)]; |
| 28721 |
const maskParams = argsArray[iFirstPIMXO + (q << 2)][0]; |
| 28722 |
images.push({ |
| 28723 |
data: maskParams.data, |
| 28724 |
width: maskParams.width, |
| 28725 |
height: maskParams.height, |
| 28726 |
interpolate: maskParams.interpolate, |
| 28727 |
count: maskParams.count, |
| 28728 |
transform: transformArgs |
| 28729 |
}); |
| 28730 |
} |
| 28731 |
fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectGroup); |
| 28732 |
argsArray.splice(iFirstSave, count * 4, [images]); |
| 28733 |
} |
| 28734 |
return iFirstSave + 1; |
| 28735 |
}); |
| 28736 |
addState(InitialState, [OPS.save, OPS.transform, OPS.paintImageXObject, OPS.restore], function (context) { |
| 28737 |
const argsArray = context.argsArray; |
| 28738 |
const iFirstTransform = context.iCurr - 2; |
| 28739 |
return argsArray[iFirstTransform][1] === 0 && argsArray[iFirstTransform][2] === 0; |
| 28740 |
}, function iterateImageGroup(context, i) { |
| 28741 |
const fnArray = context.fnArray, |
| 28742 |
argsArray = context.argsArray; |
| 28743 |
const iFirstSave = context.iCurr - 3; |
| 28744 |
const pos = (i - iFirstSave) % 4; |
| 28745 |
switch (pos) { |
| 28746 |
case 0: |
| 28747 |
return fnArray[i] === OPS.save; |
| 28748 |
case 1: |
| 28749 |
if (fnArray[i] !== OPS.transform) { |
| 28750 |
return false; |
| 28751 |
} |
| 28752 |
const iFirstTransform = context.iCurr - 2; |
| 28753 |
const firstTransformArg0 = argsArray[iFirstTransform][0]; |
| 28754 |
const firstTransformArg3 = argsArray[iFirstTransform][3]; |
| 28755 |
if (argsArray[i][0] !== firstTransformArg0 || argsArray[i][1] !== 0 || argsArray[i][2] !== 0 || argsArray[i][3] !== firstTransformArg3) { |
| 28756 |
return false; |
| 28757 |
} |
| 28758 |
return true; |
| 28759 |
case 2: |
| 28760 |
if (fnArray[i] !== OPS.paintImageXObject) { |
| 28761 |
return false; |
| 28762 |
} |
| 28763 |
const iFirstPIXO = context.iCurr - 1; |
| 28764 |
const firstPIXOArg0 = argsArray[iFirstPIXO][0]; |
| 28765 |
if (argsArray[i][0] !== firstPIXOArg0) { |
| 28766 |
return false; |
| 28767 |
} |
| 28768 |
return true; |
| 28769 |
case 3: |
| 28770 |
return fnArray[i] === OPS.restore; |
| 28771 |
} |
| 28772 |
throw new Error(`iterateImageGroup - invalid pos: ${pos}`); |
| 28773 |
}, function (context, i) { |
| 28774 |
const MIN_IMAGES_IN_BLOCK = 3; |
| 28775 |
const MAX_IMAGES_IN_BLOCK = 1000; |
| 28776 |
const fnArray = context.fnArray, |
| 28777 |
argsArray = context.argsArray; |
| 28778 |
const curr = context.iCurr; |
| 28779 |
const iFirstSave = curr - 3; |
| 28780 |
const iFirstTransform = curr - 2; |
| 28781 |
const iFirstPIXO = curr - 1; |
| 28782 |
const firstPIXOArg0 = argsArray[iFirstPIXO][0]; |
| 28783 |
const firstTransformArg0 = argsArray[iFirstTransform][0]; |
| 28784 |
const firstTransformArg3 = argsArray[iFirstTransform][3]; |
| 28785 |
const count = Math.min(Math.floor((i - iFirstSave) / 4), MAX_IMAGES_IN_BLOCK); |
| 28786 |
if (count < MIN_IMAGES_IN_BLOCK) { |
| 28787 |
return i - (i - iFirstSave) % 4; |
| 28788 |
} |
| 28789 |
const positions = new Float32Array(count * 2); |
| 28790 |
let iTransform = iFirstTransform; |
| 28791 |
for (let q = 0; q < count; q++, iTransform += 4) { |
| 28792 |
const transformArgs = argsArray[iTransform]; |
| 28793 |
positions[q << 1] = transformArgs[4]; |
| 28794 |
positions[(q << 1) + 1] = transformArgs[5]; |
| 28795 |
} |
| 28796 |
const args = [firstPIXOArg0, firstTransformArg0, firstTransformArg3, positions]; |
| 28797 |
fnArray.splice(iFirstSave, count * 4, OPS.paintImageXObjectRepeat); |
| 28798 |
argsArray.splice(iFirstSave, count * 4, args); |
| 28799 |
return iFirstSave + 1; |
| 28800 |
}); |
| 28801 |
addState(InitialState, [OPS.beginText, OPS.setFont, OPS.setTextMatrix, OPS.showText, OPS.endText], null, function iterateShowTextGroup(context, i) { |
| 28802 |
const fnArray = context.fnArray, |
| 28803 |
argsArray = context.argsArray; |
| 28804 |
const iFirstSave = context.iCurr - 4; |
| 28805 |
const pos = (i - iFirstSave) % 5; |
| 28806 |
switch (pos) { |
| 28807 |
case 0: |
| 28808 |
return fnArray[i] === OPS.beginText; |
| 28809 |
case 1: |
| 28810 |
return fnArray[i] === OPS.setFont; |
| 28811 |
case 2: |
| 28812 |
return fnArray[i] === OPS.setTextMatrix; |
| 28813 |
case 3: |
| 28814 |
if (fnArray[i] !== OPS.showText) { |
| 28815 |
return false; |
| 28816 |
} |
| 28817 |
const iFirstSetFont = context.iCurr - 3; |
| 28818 |
const firstSetFontArg0 = argsArray[iFirstSetFont][0]; |
| 28819 |
const firstSetFontArg1 = argsArray[iFirstSetFont][1]; |
| 28820 |
if (argsArray[i][0] !== firstSetFontArg0 || argsArray[i][1] !== firstSetFontArg1) { |
| 28821 |
return false; |
| 28822 |
} |
| 28823 |
return true; |
| 28824 |
case 4: |
| 28825 |
return fnArray[i] === OPS.endText; |
| 28826 |
} |
| 28827 |
throw new Error(`iterateShowTextGroup - invalid pos: ${pos}`); |
| 28828 |
}, function (context, i) { |
| 28829 |
const MIN_CHARS_IN_BLOCK = 3; |
| 28830 |
const MAX_CHARS_IN_BLOCK = 1000; |
| 28831 |
const fnArray = context.fnArray, |
| 28832 |
argsArray = context.argsArray; |
| 28833 |
const curr = context.iCurr; |
| 28834 |
const iFirstBeginText = curr - 4; |
| 28835 |
const iFirstSetFont = curr - 3; |
| 28836 |
const iFirstSetTextMatrix = curr - 2; |
| 28837 |
const iFirstShowText = curr - 1; |
| 28838 |
const iFirstEndText = curr; |
| 28839 |
const firstSetFontArg0 = argsArray[iFirstSetFont][0]; |
| 28840 |
const firstSetFontArg1 = argsArray[iFirstSetFont][1]; |
| 28841 |
let count = Math.min(Math.floor((i - iFirstBeginText) / 5), MAX_CHARS_IN_BLOCK); |
| 28842 |
if (count < MIN_CHARS_IN_BLOCK) { |
| 28843 |
return i - (i - iFirstBeginText) % 5; |
| 28844 |
} |
| 28845 |
let iFirst = iFirstBeginText; |
| 28846 |
if (iFirstBeginText >= 4 && fnArray[iFirstBeginText - 4] === fnArray[iFirstSetFont] && fnArray[iFirstBeginText - 3] === fnArray[iFirstSetTextMatrix] && fnArray[iFirstBeginText - 2] === fnArray[iFirstShowText] && fnArray[iFirstBeginText - 1] === fnArray[iFirstEndText] && argsArray[iFirstBeginText - 4][0] === firstSetFontArg0 && argsArray[iFirstBeginText - 4][1] === firstSetFontArg1) { |
| 28847 |
count++; |
| 28848 |
iFirst -= 5; |
| 28849 |
} |
| 28850 |
let iEndText = iFirst + 4; |
| 28851 |
for (let q = 1; q < count; q++) { |
| 28852 |
fnArray.splice(iEndText, 3); |
| 28853 |
argsArray.splice(iEndText, 3); |
| 28854 |
iEndText += 2; |
| 28855 |
} |
| 28856 |
return iEndText + 1; |
| 28857 |
}); |
| 28858 |
class NullOptimizer { |
| 28859 |
constructor(queue) { |
| 28860 |
this.queue = queue; |
| 28861 |
} |
| 28862 |
_optimize() {} |
| 28863 |
push(fn, args) { |
| 28864 |
this.queue.fnArray.push(fn); |
| 28865 |
this.queue.argsArray.push(args); |
| 28866 |
this._optimize(); |
| 28867 |
} |
| 28868 |
flush() {} |
| 28869 |
reset() {} |
| 28870 |
} |
| 28871 |
class QueueOptimizer extends NullOptimizer { |
| 28872 |
constructor(queue) { |
| 28873 |
super(queue); |
| 28874 |
this.state = null; |
| 28875 |
this.context = { |
| 28876 |
iCurr: 0, |
| 28877 |
fnArray: queue.fnArray, |
| 28878 |
argsArray: queue.argsArray, |
| 28879 |
isOffscreenCanvasSupported: false |
| 28880 |
}; |
| 28881 |
this.match = null; |
| 28882 |
this.lastProcessed = 0; |
| 28883 |
} |
| 28884 |
set isOffscreenCanvasSupported(value) { |
| 28885 |
this.context.isOffscreenCanvasSupported = value; |
| 28886 |
} |
| 28887 |
_optimize() { |
| 28888 |
const fnArray = this.queue.fnArray; |
| 28889 |
let i = this.lastProcessed, |
| 28890 |
ii = fnArray.length; |
| 28891 |
let state = this.state; |
| 28892 |
let match = this.match; |
| 28893 |
if (!state && !match && i + 1 === ii && !InitialState[fnArray[i]]) { |
| 28894 |
this.lastProcessed = ii; |
| 28895 |
return; |
| 28896 |
} |
| 28897 |
const context = this.context; |
| 28898 |
while (i < ii) { |
| 28899 |
if (match) { |
| 28900 |
const iterate = (0, match.iterateFn)(context, i); |
| 28901 |
if (iterate) { |
| 28902 |
i++; |
| 28903 |
continue; |
| 28904 |
} |
| 28905 |
i = (0, match.processFn)(context, i + 1); |
| 28906 |
ii = fnArray.length; |
| 28907 |
match = null; |
| 28908 |
state = null; |
| 28909 |
if (i >= ii) { |
| 28910 |
break; |
| 28911 |
} |
| 28912 |
} |
| 28913 |
state = (state || InitialState)[fnArray[i]]; |
| 28914 |
if (!state || Array.isArray(state)) { |
| 28915 |
i++; |
| 28916 |
continue; |
| 28917 |
} |
| 28918 |
context.iCurr = i; |
| 28919 |
i++; |
| 28920 |
if (state.checkFn && !(0, state.checkFn)(context)) { |
| 28921 |
state = null; |
| 28922 |
continue; |
| 28923 |
} |
| 28924 |
match = state; |
| 28925 |
state = null; |
| 28926 |
} |
| 28927 |
this.state = state; |
| 28928 |
this.match = match; |
| 28929 |
this.lastProcessed = i; |
| 28930 |
} |
| 28931 |
flush() { |
| 28932 |
while (this.match) { |
| 28933 |
const length = this.queue.fnArray.length; |
| 28934 |
this.lastProcessed = (0, this.match.processFn)(this.context, length); |
| 28935 |
this.match = null; |
| 28936 |
this.state = null; |
| 28937 |
this._optimize(); |
| 28938 |
} |
| 28939 |
} |
| 28940 |
reset() { |
| 28941 |
this.state = null; |
| 28942 |
this.match = null; |
| 28943 |
this.lastProcessed = 0; |
| 28944 |
} |
| 28945 |
} |
| 28946 |
class OperatorList { |
| 28947 |
static CHUNK_SIZE = 1000; |
| 28948 |
static CHUNK_SIZE_ABOUT = this.CHUNK_SIZE - 5; |
| 28949 |
constructor(intent = 0, streamSink) { |
| 28950 |
this._streamSink = streamSink; |
| 28951 |
this.fnArray = []; |
| 28952 |
this.argsArray = []; |
| 28953 |
this.optimizer = streamSink && !(intent & RenderingIntentFlag.OPLIST) ? new QueueOptimizer(this) : new NullOptimizer(this); |
| 28954 |
this.dependencies = new Set(); |
| 28955 |
this._totalLength = 0; |
| 28956 |
this.weight = 0; |
| 28957 |
this._resolved = streamSink ? null : Promise.resolve(); |
| 28958 |
} |
| 28959 |
set isOffscreenCanvasSupported(value) { |
| 28960 |
this.optimizer.isOffscreenCanvasSupported = value; |
| 28961 |
} |
| 28962 |
get length() { |
| 28963 |
return this.argsArray.length; |
| 28964 |
} |
| 28965 |
get ready() { |
| 28966 |
return this._resolved || this._streamSink.ready; |
| 28967 |
} |
| 28968 |
get totalLength() { |
| 28969 |
return this._totalLength + this.length; |
| 28970 |
} |
| 28971 |
addOp(fn, args) { |
| 28972 |
this.optimizer.push(fn, args); |
| 28973 |
this.weight++; |
| 28974 |
if (this._streamSink) { |
| 28975 |
if (this.weight >= OperatorList.CHUNK_SIZE) { |
| 28976 |
this.flush(); |
| 28977 |
} else if (this.weight >= OperatorList.CHUNK_SIZE_ABOUT && (fn === OPS.restore || fn === OPS.endText)) { |
| 28978 |
this.flush(); |
| 28979 |
} |
| 28980 |
} |
| 28981 |
} |
| 28982 |
addImageOps(fn, args, optionalContent) { |
| 28983 |
if (optionalContent !== undefined) { |
| 28984 |
this.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); |
| 28985 |
} |
| 28986 |
this.addOp(fn, args); |
| 28987 |
if (optionalContent !== undefined) { |
| 28988 |
this.addOp(OPS.endMarkedContent, []); |
| 28989 |
} |
| 28990 |
} |
| 28991 |
addDependency(dependency) { |
| 28992 |
if (this.dependencies.has(dependency)) { |
| 28993 |
return; |
| 28994 |
} |
| 28995 |
this.dependencies.add(dependency); |
| 28996 |
this.addOp(OPS.dependency, [dependency]); |
| 28997 |
} |
| 28998 |
addDependencies(dependencies) { |
| 28999 |
for (const dependency of dependencies) { |
| 29000 |
this.addDependency(dependency); |
| 29001 |
} |
| 29002 |
} |
| 29003 |
addOpList(opList) { |
| 29004 |
if (!(opList instanceof OperatorList)) { |
| 29005 |
warn('addOpList - ignoring invalid "opList" parameter.'); |
| 29006 |
return; |
| 29007 |
} |
| 29008 |
for (const dependency of opList.dependencies) { |
| 29009 |
this.dependencies.add(dependency); |
| 29010 |
} |
| 29011 |
for (let i = 0, ii = opList.length; i < ii; i++) { |
| 29012 |
this.addOp(opList.fnArray[i], opList.argsArray[i]); |
| 29013 |
} |
| 29014 |
} |
| 29015 |
getIR() { |
| 29016 |
return { |
| 29017 |
fnArray: this.fnArray, |
| 29018 |
argsArray: this.argsArray, |
| 29019 |
length: this.length |
| 29020 |
}; |
| 29021 |
} |
| 29022 |
get _transfers() { |
| 29023 |
const transfers = []; |
| 29024 |
const { |
| 29025 |
fnArray, |
| 29026 |
argsArray, |
| 29027 |
length |
| 29028 |
} = this; |
| 29029 |
for (let i = 0; i < length; i++) { |
| 29030 |
switch (fnArray[i]) { |
| 29031 |
case OPS.paintInlineImageXObject: |
| 29032 |
case OPS.paintInlineImageXObjectGroup: |
| 29033 |
case OPS.paintImageMaskXObject: |
| 29034 |
const arg = argsArray[i][0]; |
| 29035 |
if (!arg.cached && arg.data?.buffer instanceof ArrayBuffer) { |
| 29036 |
transfers.push(arg.data.buffer); |
| 29037 |
} |
| 29038 |
break; |
| 29039 |
} |
| 29040 |
} |
| 29041 |
return transfers; |
| 29042 |
} |
| 29043 |
flush(lastChunk = false, separateAnnots = null) { |
| 29044 |
this.optimizer.flush(); |
| 29045 |
const length = this.length; |
| 29046 |
this._totalLength += length; |
| 29047 |
this._streamSink.enqueue({ |
| 29048 |
fnArray: this.fnArray, |
| 29049 |
argsArray: this.argsArray, |
| 29050 |
lastChunk, |
| 29051 |
separateAnnots, |
| 29052 |
length |
| 29053 |
}, 1, this._transfers); |
| 29054 |
this.dependencies.clear(); |
| 29055 |
this.fnArray.length = 0; |
| 29056 |
this.argsArray.length = 0; |
| 29057 |
this.weight = 0; |
| 29058 |
this.optimizer.reset(); |
| 29059 |
} |
| 29060 |
} |
| 29061 |
|
| 29062 |
;// ./src/core/image.js |
| 29063 |
|
| 29064 |
|
| 29065 |
|
| 29066 |
|
| 29067 |
|
| 29068 |
|
| 29069 |
|
| 29070 |
|
| 29071 |
|
| 29072 |
function decodeAndClamp(value, addend, coefficient, max) { |
| 29073 |
value = addend + value * coefficient; |
| 29074 |
if (value < 0) { |
| 29075 |
value = 0; |
| 29076 |
} else if (value > max) { |
| 29077 |
value = max; |
| 29078 |
} |
| 29079 |
return value; |
| 29080 |
} |
| 29081 |
function resizeImageMask(src, bpc, w1, h1, w2, h2) { |
| 29082 |
const length = w2 * h2; |
| 29083 |
let dest; |
| 29084 |
if (bpc <= 8) { |
| 29085 |
dest = new Uint8Array(length); |
| 29086 |
} else if (bpc <= 16) { |
| 29087 |
dest = new Uint16Array(length); |
| 29088 |
} else { |
| 29089 |
dest = new Uint32Array(length); |
| 29090 |
} |
| 29091 |
const xRatio = w1 / w2; |
| 29092 |
const yRatio = h1 / h2; |
| 29093 |
let i, |
| 29094 |
j, |
| 29095 |
py, |
| 29096 |
newIndex = 0, |
| 29097 |
oldIndex; |
| 29098 |
const xScaled = new Uint16Array(w2); |
| 29099 |
const w1Scanline = w1; |
| 29100 |
for (i = 0; i < w2; i++) { |
| 29101 |
xScaled[i] = Math.floor(i * xRatio); |
| 29102 |
} |
| 29103 |
for (i = 0; i < h2; i++) { |
| 29104 |
py = Math.floor(i * yRatio) * w1Scanline; |
| 29105 |
for (j = 0; j < w2; j++) { |
| 29106 |
oldIndex = py + xScaled[j]; |
| 29107 |
dest[newIndex++] = src[oldIndex]; |
| 29108 |
} |
| 29109 |
} |
| 29110 |
return dest; |
| 29111 |
} |
| 29112 |
class PDFImage { |
| 29113 |
constructor({ |
| 29114 |
xref, |
| 29115 |
res, |
| 29116 |
image, |
| 29117 |
isInline = false, |
| 29118 |
smask = null, |
| 29119 |
mask = null, |
| 29120 |
isMask = false, |
| 29121 |
pdfFunctionFactory, |
| 29122 |
localColorSpaceCache |
| 29123 |
}) { |
| 29124 |
this.image = image; |
| 29125 |
const dict = image.dict; |
| 29126 |
const filter = dict.get("F", "Filter"); |
| 29127 |
let filterName; |
| 29128 |
if (filter instanceof Name) { |
| 29129 |
filterName = filter.name; |
| 29130 |
} else if (Array.isArray(filter)) { |
| 29131 |
const filterZero = xref.fetchIfRef(filter[0]); |
| 29132 |
if (filterZero instanceof Name) { |
| 29133 |
filterName = filterZero.name; |
| 29134 |
} |
| 29135 |
} |
| 29136 |
switch (filterName) { |
| 29137 |
case "JPXDecode": |
| 29138 |
({ |
| 29139 |
width: image.width, |
| 29140 |
height: image.height, |
| 29141 |
componentsCount: image.numComps, |
| 29142 |
bitsPerComponent: image.bitsPerComponent |
| 29143 |
} = JpxImage.parseImageProperties(image.stream)); |
| 29144 |
image.stream.reset(); |
| 29145 |
this.jpxDecoderOptions = { |
| 29146 |
numComponents: 0, |
| 29147 |
isIndexedColormap: false, |
| 29148 |
smaskInData: dict.has("SMaskInData") |
| 29149 |
}; |
| 29150 |
break; |
| 29151 |
case "JBIG2Decode": |
| 29152 |
image.bitsPerComponent = 1; |
| 29153 |
image.numComps = 1; |
| 29154 |
break; |
| 29155 |
} |
| 29156 |
let width = dict.get("W", "Width"); |
| 29157 |
let height = dict.get("H", "Height"); |
| 29158 |
if (Number.isInteger(image.width) && image.width > 0 && Number.isInteger(image.height) && image.height > 0 && (image.width !== width || image.height !== height)) { |
| 29159 |
warn("PDFImage - using the Width/Height of the image data, " + "rather than the image dictionary."); |
| 29160 |
width = image.width; |
| 29161 |
height = image.height; |
| 29162 |
} |
| 29163 |
if (width < 1 || height < 1) { |
| 29164 |
throw new FormatError(`Invalid image width: ${width} or height: ${height}`); |
| 29165 |
} |
| 29166 |
this.width = width; |
| 29167 |
this.height = height; |
| 29168 |
this.interpolate = dict.get("I", "Interpolate"); |
| 29169 |
this.imageMask = dict.get("IM", "ImageMask") || false; |
| 29170 |
this.matte = dict.get("Matte") || false; |
| 29171 |
let bitsPerComponent = image.bitsPerComponent; |
| 29172 |
if (!bitsPerComponent) { |
| 29173 |
bitsPerComponent = dict.get("BPC", "BitsPerComponent"); |
| 29174 |
if (!bitsPerComponent) { |
| 29175 |
if (this.imageMask) { |
| 29176 |
bitsPerComponent = 1; |
| 29177 |
} else { |
| 29178 |
throw new FormatError(`Bits per component missing in image: ${this.imageMask}`); |
| 29179 |
} |
| 29180 |
} |
| 29181 |
} |
| 29182 |
this.bpc = bitsPerComponent; |
| 29183 |
if (!this.imageMask) { |
| 29184 |
let colorSpace = dict.getRaw("CS") || dict.getRaw("ColorSpace"); |
| 29185 |
const hasColorSpace = !!colorSpace; |
| 29186 |
if (!hasColorSpace) { |
| 29187 |
if (this.jpxDecoderOptions) { |
| 29188 |
colorSpace = Name.get("DeviceRGBA"); |
| 29189 |
} else { |
| 29190 |
switch (image.numComps) { |
| 29191 |
case 1: |
| 29192 |
colorSpace = Name.get("DeviceGray"); |
| 29193 |
break; |
| 29194 |
case 3: |
| 29195 |
colorSpace = Name.get("DeviceRGB"); |
| 29196 |
break; |
| 29197 |
case 4: |
| 29198 |
colorSpace = Name.get("DeviceCMYK"); |
| 29199 |
break; |
| 29200 |
default: |
| 29201 |
throw new Error(`Images with ${image.numComps} color components not supported.`); |
| 29202 |
} |
| 29203 |
} |
| 29204 |
} else if (this.jpxDecoderOptions?.smaskInData) { |
| 29205 |
colorSpace = Name.get("DeviceRGBA"); |
| 29206 |
} |
| 29207 |
this.colorSpace = ColorSpace.parse({ |
| 29208 |
cs: colorSpace, |
| 29209 |
xref, |
| 29210 |
resources: isInline ? res : null, |
| 29211 |
pdfFunctionFactory, |
| 29212 |
localColorSpaceCache |
| 29213 |
}); |
| 29214 |
this.numComps = this.colorSpace.numComps; |
| 29215 |
if (this.jpxDecoderOptions) { |
| 29216 |
this.jpxDecoderOptions.numComponents = hasColorSpace ? this.numComp : 0; |
| 29217 |
this.jpxDecoderOptions.isIndexedColormap = this.colorSpace.name === "Indexed"; |
| 29218 |
} |
| 29219 |
} |
| 29220 |
this.decode = dict.getArray("D", "Decode"); |
| 29221 |
this.needsDecode = false; |
| 29222 |
if (this.decode && (this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode, bitsPerComponent) || isMask && !ColorSpace.isDefaultDecode(this.decode, 1))) { |
| 29223 |
this.needsDecode = true; |
| 29224 |
const max = (1 << bitsPerComponent) - 1; |
| 29225 |
this.decodeCoefficients = []; |
| 29226 |
this.decodeAddends = []; |
| 29227 |
const isIndexed = this.colorSpace?.name === "Indexed"; |
| 29228 |
for (let i = 0, j = 0; i < this.decode.length; i += 2, ++j) { |
| 29229 |
const dmin = this.decode[i]; |
| 29230 |
const dmax = this.decode[i + 1]; |
| 29231 |
this.decodeCoefficients[j] = isIndexed ? (dmax - dmin) / max : dmax - dmin; |
| 29232 |
this.decodeAddends[j] = isIndexed ? dmin : max * dmin; |
| 29233 |
} |
| 29234 |
} |
| 29235 |
if (smask) { |
| 29236 |
this.smask = new PDFImage({ |
| 29237 |
xref, |
| 29238 |
res, |
| 29239 |
image: smask, |
| 29240 |
isInline, |
| 29241 |
pdfFunctionFactory, |
| 29242 |
localColorSpaceCache |
| 29243 |
}); |
| 29244 |
} else if (mask) { |
| 29245 |
if (mask instanceof BaseStream) { |
| 29246 |
const maskDict = mask.dict, |
| 29247 |
imageMask = maskDict.get("IM", "ImageMask"); |
| 29248 |
if (!imageMask) { |
| 29249 |
warn("Ignoring /Mask in image without /ImageMask."); |
| 29250 |
} else { |
| 29251 |
this.mask = new PDFImage({ |
| 29252 |
xref, |
| 29253 |
res, |
| 29254 |
image: mask, |
| 29255 |
isInline, |
| 29256 |
isMask: true, |
| 29257 |
pdfFunctionFactory, |
| 29258 |
localColorSpaceCache |
| 29259 |
}); |
| 29260 |
} |
| 29261 |
} else { |
| 29262 |
this.mask = mask; |
| 29263 |
} |
| 29264 |
} |
| 29265 |
} |
| 29266 |
static async buildImage({ |
| 29267 |
xref, |
| 29268 |
res, |
| 29269 |
image, |
| 29270 |
isInline = false, |
| 29271 |
pdfFunctionFactory, |
| 29272 |
localColorSpaceCache |
| 29273 |
}) { |
| 29274 |
const imageData = image; |
| 29275 |
let smaskData = null; |
| 29276 |
let maskData = null; |
| 29277 |
const smask = image.dict.get("SMask"); |
| 29278 |
const mask = image.dict.get("Mask"); |
| 29279 |
if (smask) { |
| 29280 |
if (smask instanceof BaseStream) { |
| 29281 |
smaskData = smask; |
| 29282 |
} else { |
| 29283 |
warn("Unsupported /SMask format."); |
| 29284 |
} |
| 29285 |
} else if (mask) { |
| 29286 |
if (mask instanceof BaseStream || Array.isArray(mask)) { |
| 29287 |
maskData = mask; |
| 29288 |
} else { |
| 29289 |
warn("Unsupported /Mask format."); |
| 29290 |
} |
| 29291 |
} |
| 29292 |
return new PDFImage({ |
| 29293 |
xref, |
| 29294 |
res, |
| 29295 |
image: imageData, |
| 29296 |
isInline, |
| 29297 |
smask: smaskData, |
| 29298 |
mask: maskData, |
| 29299 |
pdfFunctionFactory, |
| 29300 |
localColorSpaceCache |
| 29301 |
}); |
| 29302 |
} |
| 29303 |
static createRawMask({ |
| 29304 |
imgArray, |
| 29305 |
width, |
| 29306 |
height, |
| 29307 |
imageIsFromDecodeStream, |
| 29308 |
inverseDecode, |
| 29309 |
interpolate |
| 29310 |
}) { |
| 29311 |
const computedLength = (width + 7 >> 3) * height; |
| 29312 |
const actualLength = imgArray.byteLength; |
| 29313 |
const haveFullData = computedLength === actualLength; |
| 29314 |
let data, i; |
| 29315 |
if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) { |
| 29316 |
data = imgArray; |
| 29317 |
} else if (!inverseDecode) { |
| 29318 |
data = new Uint8Array(imgArray); |
| 29319 |
} else { |
| 29320 |
data = new Uint8Array(computedLength); |
| 29321 |
data.set(imgArray); |
| 29322 |
data.fill(0xff, actualLength); |
| 29323 |
} |
| 29324 |
if (inverseDecode) { |
| 29325 |
for (i = 0; i < actualLength; i++) { |
| 29326 |
data[i] ^= 0xff; |
| 29327 |
} |
| 29328 |
} |
| 29329 |
return { |
| 29330 |
data, |
| 29331 |
width, |
| 29332 |
height, |
| 29333 |
interpolate |
| 29334 |
}; |
| 29335 |
} |
| 29336 |
static async createMask({ |
| 29337 |
imgArray, |
| 29338 |
width, |
| 29339 |
height, |
| 29340 |
imageIsFromDecodeStream, |
| 29341 |
inverseDecode, |
| 29342 |
interpolate, |
| 29343 |
isOffscreenCanvasSupported = false |
| 29344 |
}) { |
| 29345 |
const isSingleOpaquePixel = width === 1 && height === 1 && inverseDecode === (imgArray.length === 0 || !!(imgArray[0] & 128)); |
| 29346 |
if (isSingleOpaquePixel) { |
| 29347 |
return { |
| 29348 |
isSingleOpaquePixel |
| 29349 |
}; |
| 29350 |
} |
| 29351 |
if (isOffscreenCanvasSupported) { |
| 29352 |
if (ImageResizer.needsToBeResized(width, height)) { |
| 29353 |
const data = new Uint8ClampedArray(width * height * 4); |
| 29354 |
convertBlackAndWhiteToRGBA({ |
| 29355 |
src: imgArray, |
| 29356 |
dest: data, |
| 29357 |
width, |
| 29358 |
height, |
| 29359 |
nonBlackColor: 0, |
| 29360 |
inverseDecode |
| 29361 |
}); |
| 29362 |
return ImageResizer.createImage({ |
| 29363 |
kind: ImageKind.RGBA_32BPP, |
| 29364 |
data, |
| 29365 |
width, |
| 29366 |
height, |
| 29367 |
interpolate |
| 29368 |
}); |
| 29369 |
} |
| 29370 |
const canvas = new OffscreenCanvas(width, height); |
| 29371 |
const ctx = canvas.getContext("2d"); |
| 29372 |
const imgData = ctx.createImageData(width, height); |
| 29373 |
convertBlackAndWhiteToRGBA({ |
| 29374 |
src: imgArray, |
| 29375 |
dest: imgData.data, |
| 29376 |
width, |
| 29377 |
height, |
| 29378 |
nonBlackColor: 0, |
| 29379 |
inverseDecode |
| 29380 |
}); |
| 29381 |
ctx.putImageData(imgData, 0, 0); |
| 29382 |
const bitmap = canvas.transferToImageBitmap(); |
| 29383 |
return { |
| 29384 |
data: null, |
| 29385 |
width, |
| 29386 |
height, |
| 29387 |
interpolate, |
| 29388 |
bitmap |
| 29389 |
}; |
| 29390 |
} |
| 29391 |
return this.createRawMask({ |
| 29392 |
imgArray, |
| 29393 |
width, |
| 29394 |
height, |
| 29395 |
inverseDecode, |
| 29396 |
imageIsFromDecodeStream, |
| 29397 |
interpolate |
| 29398 |
}); |
| 29399 |
} |
| 29400 |
get drawWidth() { |
| 29401 |
return Math.max(this.width, this.smask?.width || 0, this.mask?.width || 0); |
| 29402 |
} |
| 29403 |
get drawHeight() { |
| 29404 |
return Math.max(this.height, this.smask?.height || 0, this.mask?.height || 0); |
| 29405 |
} |
| 29406 |
decodeBuffer(buffer) { |
| 29407 |
const bpc = this.bpc; |
| 29408 |
const numComps = this.numComps; |
| 29409 |
const decodeAddends = this.decodeAddends; |
| 29410 |
const decodeCoefficients = this.decodeCoefficients; |
| 29411 |
const max = (1 << bpc) - 1; |
| 29412 |
let i, ii; |
| 29413 |
if (bpc === 1) { |
| 29414 |
for (i = 0, ii = buffer.length; i < ii; i++) { |
| 29415 |
buffer[i] = +!buffer[i]; |
| 29416 |
} |
| 29417 |
return; |
| 29418 |
} |
| 29419 |
let index = 0; |
| 29420 |
for (i = 0, ii = this.width * this.height; i < ii; i++) { |
| 29421 |
for (let j = 0; j < numComps; j++) { |
| 29422 |
buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], decodeCoefficients[j], max); |
| 29423 |
index++; |
| 29424 |
} |
| 29425 |
} |
| 29426 |
} |
| 29427 |
getComponents(buffer) { |
| 29428 |
const bpc = this.bpc; |
| 29429 |
if (bpc === 8) { |
| 29430 |
return buffer; |
| 29431 |
} |
| 29432 |
const width = this.width; |
| 29433 |
const height = this.height; |
| 29434 |
const numComps = this.numComps; |
| 29435 |
const length = width * height * numComps; |
| 29436 |
let bufferPos = 0; |
| 29437 |
let output; |
| 29438 |
if (bpc <= 8) { |
| 29439 |
output = new Uint8Array(length); |
| 29440 |
} else if (bpc <= 16) { |
| 29441 |
output = new Uint16Array(length); |
| 29442 |
} else { |
| 29443 |
output = new Uint32Array(length); |
| 29444 |
} |
| 29445 |
const rowComps = width * numComps; |
| 29446 |
const max = (1 << bpc) - 1; |
| 29447 |
let i = 0, |
| 29448 |
ii, |
| 29449 |
buf; |
| 29450 |
if (bpc === 1) { |
| 29451 |
let mask, loop1End, loop2End; |
| 29452 |
for (let j = 0; j < height; j++) { |
| 29453 |
loop1End = i + (rowComps & ~7); |
| 29454 |
loop2End = i + rowComps; |
| 29455 |
while (i < loop1End) { |
| 29456 |
buf = buffer[bufferPos++]; |
| 29457 |
output[i] = buf >> 7 & 1; |
| 29458 |
output[i + 1] = buf >> 6 & 1; |
| 29459 |
output[i + 2] = buf >> 5 & 1; |
| 29460 |
output[i + 3] = buf >> 4 & 1; |
| 29461 |
output[i + 4] = buf >> 3 & 1; |
| 29462 |
output[i + 5] = buf >> 2 & 1; |
| 29463 |
output[i + 6] = buf >> 1 & 1; |
| 29464 |
output[i + 7] = buf & 1; |
| 29465 |
i += 8; |
| 29466 |
} |
| 29467 |
if (i < loop2End) { |
| 29468 |
buf = buffer[bufferPos++]; |
| 29469 |
mask = 128; |
| 29470 |
while (i < loop2End) { |
| 29471 |
output[i++] = +!!(buf & mask); |
| 29472 |
mask >>= 1; |
| 29473 |
} |
| 29474 |
} |
| 29475 |
} |
| 29476 |
} else { |
| 29477 |
let bits = 0; |
| 29478 |
buf = 0; |
| 29479 |
for (i = 0, ii = length; i < ii; ++i) { |
| 29480 |
if (i % rowComps === 0) { |
| 29481 |
buf = 0; |
| 29482 |
bits = 0; |
| 29483 |
} |
| 29484 |
while (bits < bpc) { |
| 29485 |
buf = buf << 8 | buffer[bufferPos++]; |
| 29486 |
bits += 8; |
| 29487 |
} |
| 29488 |
const remainingBits = bits - bpc; |
| 29489 |
let value = buf >> remainingBits; |
| 29490 |
if (value < 0) { |
| 29491 |
value = 0; |
| 29492 |
} else if (value > max) { |
| 29493 |
value = max; |
| 29494 |
} |
| 29495 |
output[i] = value; |
| 29496 |
buf &= (1 << remainingBits) - 1; |
| 29497 |
bits = remainingBits; |
| 29498 |
} |
| 29499 |
} |
| 29500 |
return output; |
| 29501 |
} |
| 29502 |
async fillOpacity(rgbaBuf, width, height, actualHeight, image) { |
| 29503 |
const smask = this.smask; |
| 29504 |
const mask = this.mask; |
| 29505 |
let alphaBuf, sw, sh, i, ii, j; |
| 29506 |
if (smask) { |
| 29507 |
sw = smask.width; |
| 29508 |
sh = smask.height; |
| 29509 |
alphaBuf = new Uint8ClampedArray(sw * sh); |
| 29510 |
await smask.fillGrayBuffer(alphaBuf); |
| 29511 |
if (sw !== width || sh !== height) { |
| 29512 |
alphaBuf = resizeImageMask(alphaBuf, smask.bpc, sw, sh, width, height); |
| 29513 |
} |
| 29514 |
} else if (mask) { |
| 29515 |
if (mask instanceof PDFImage) { |
| 29516 |
sw = mask.width; |
| 29517 |
sh = mask.height; |
| 29518 |
alphaBuf = new Uint8ClampedArray(sw * sh); |
| 29519 |
mask.numComps = 1; |
| 29520 |
await mask.fillGrayBuffer(alphaBuf); |
| 29521 |
for (i = 0, ii = sw * sh; i < ii; ++i) { |
| 29522 |
alphaBuf[i] = 255 - alphaBuf[i]; |
| 29523 |
} |
| 29524 |
if (sw !== width || sh !== height) { |
| 29525 |
alphaBuf = resizeImageMask(alphaBuf, mask.bpc, sw, sh, width, height); |
| 29526 |
} |
| 29527 |
} else if (Array.isArray(mask)) { |
| 29528 |
alphaBuf = new Uint8ClampedArray(width * height); |
| 29529 |
const numComps = this.numComps; |
| 29530 |
for (i = 0, ii = width * height; i < ii; ++i) { |
| 29531 |
let opacity = 0; |
| 29532 |
const imageOffset = i * numComps; |
| 29533 |
for (j = 0; j < numComps; ++j) { |
| 29534 |
const color = image[imageOffset + j]; |
| 29535 |
const maskOffset = j * 2; |
| 29536 |
if (color < mask[maskOffset] || color > mask[maskOffset + 1]) { |
| 29537 |
opacity = 255; |
| 29538 |
break; |
| 29539 |
} |
| 29540 |
} |
| 29541 |
alphaBuf[i] = opacity; |
| 29542 |
} |
| 29543 |
} else { |
| 29544 |
throw new FormatError("Unknown mask format."); |
| 29545 |
} |
| 29546 |
} |
| 29547 |
if (alphaBuf) { |
| 29548 |
for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { |
| 29549 |
rgbaBuf[j] = alphaBuf[i]; |
| 29550 |
} |
| 29551 |
} else { |
| 29552 |
for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { |
| 29553 |
rgbaBuf[j] = 255; |
| 29554 |
} |
| 29555 |
} |
| 29556 |
} |
| 29557 |
undoPreblend(buffer, width, height) { |
| 29558 |
const matte = this.smask?.matte; |
| 29559 |
if (!matte) { |
| 29560 |
return; |
| 29561 |
} |
| 29562 |
const matteRgb = this.colorSpace.getRgb(matte, 0); |
| 29563 |
const matteR = matteRgb[0]; |
| 29564 |
const matteG = matteRgb[1]; |
| 29565 |
const matteB = matteRgb[2]; |
| 29566 |
const length = width * height * 4; |
| 29567 |
for (let i = 0; i < length; i += 4) { |
| 29568 |
const alpha = buffer[i + 3]; |
| 29569 |
if (alpha === 0) { |
| 29570 |
buffer[i] = 255; |
| 29571 |
buffer[i + 1] = 255; |
| 29572 |
buffer[i + 2] = 255; |
| 29573 |
continue; |
| 29574 |
} |
| 29575 |
const k = 255 / alpha; |
| 29576 |
buffer[i] = (buffer[i] - matteR) * k + matteR; |
| 29577 |
buffer[i + 1] = (buffer[i + 1] - matteG) * k + matteG; |
| 29578 |
buffer[i + 2] = (buffer[i + 2] - matteB) * k + matteB; |
| 29579 |
} |
| 29580 |
} |
| 29581 |
async createImageData(forceRGBA = false, isOffscreenCanvasSupported = false) { |
| 29582 |
const drawWidth = this.drawWidth; |
| 29583 |
const drawHeight = this.drawHeight; |
| 29584 |
const imgData = { |
| 29585 |
width: drawWidth, |
| 29586 |
height: drawHeight, |
| 29587 |
interpolate: this.interpolate, |
| 29588 |
kind: 0, |
| 29589 |
data: null |
| 29590 |
}; |
| 29591 |
const numComps = this.numComps; |
| 29592 |
const originalWidth = this.width; |
| 29593 |
const originalHeight = this.height; |
| 29594 |
const bpc = this.bpc; |
| 29595 |
const rowBytes = originalWidth * numComps * bpc + 7 >> 3; |
| 29596 |
const mustBeResized = isOffscreenCanvasSupported && ImageResizer.needsToBeResized(drawWidth, drawHeight); |
| 29597 |
if (this.colorSpace.name === "DeviceRGBA") { |
| 29598 |
imgData.kind = ImageKind.RGBA_32BPP; |
| 29599 |
const imgArray = imgData.data = await this.getImageBytes(originalHeight * originalWidth * 4, {}); |
| 29600 |
if (isOffscreenCanvasSupported) { |
| 29601 |
if (!mustBeResized) { |
| 29602 |
return this.createBitmap(ImageKind.RGBA_32BPP, drawWidth, drawHeight, imgArray); |
| 29603 |
} |
| 29604 |
return ImageResizer.createImage(imgData, false); |
| 29605 |
} |
| 29606 |
return imgData; |
| 29607 |
} |
| 29608 |
if (!forceRGBA) { |
| 29609 |
let kind; |
| 29610 |
if (this.colorSpace.name === "DeviceGray" && bpc === 1) { |
| 29611 |
kind = ImageKind.GRAYSCALE_1BPP; |
| 29612 |
} else if (this.colorSpace.name === "DeviceRGB" && bpc === 8 && !this.needsDecode) { |
| 29613 |
kind = ImageKind.RGB_24BPP; |
| 29614 |
} |
| 29615 |
if (kind && !this.smask && !this.mask && drawWidth === originalWidth && drawHeight === originalHeight) { |
| 29616 |
const data = await this.getImageBytes(originalHeight * rowBytes, {}); |
| 29617 |
if (isOffscreenCanvasSupported) { |
| 29618 |
if (mustBeResized) { |
| 29619 |
return ImageResizer.createImage({ |
| 29620 |
data, |
| 29621 |
kind, |
| 29622 |
width: drawWidth, |
| 29623 |
height: drawHeight, |
| 29624 |
interpolate: this.interpolate |
| 29625 |
}, this.needsDecode); |
| 29626 |
} |
| 29627 |
return this.createBitmap(kind, originalWidth, originalHeight, data); |
| 29628 |
} |
| 29629 |
imgData.kind = kind; |
| 29630 |
imgData.data = data; |
| 29631 |
if (this.needsDecode) { |
| 29632 |
assert(kind === ImageKind.GRAYSCALE_1BPP, "PDFImage.createImageData: The image must be grayscale."); |
| 29633 |
const buffer = imgData.data; |
| 29634 |
for (let i = 0, ii = buffer.length; i < ii; i++) { |
| 29635 |
buffer[i] ^= 0xff; |
| 29636 |
} |
| 29637 |
} |
| 29638 |
return imgData; |
| 29639 |
} |
| 29640 |
if (this.image instanceof JpegStream && !this.smask && !this.mask && !this.needsDecode) { |
| 29641 |
let imageLength = originalHeight * rowBytes; |
| 29642 |
if (isOffscreenCanvasSupported && !mustBeResized) { |
| 29643 |
let isHandled = false; |
| 29644 |
switch (this.colorSpace.name) { |
| 29645 |
case "DeviceGray": |
| 29646 |
imageLength *= 4; |
| 29647 |
isHandled = true; |
| 29648 |
break; |
| 29649 |
case "DeviceRGB": |
| 29650 |
imageLength = imageLength / 3 * 4; |
| 29651 |
isHandled = true; |
| 29652 |
break; |
| 29653 |
case "DeviceCMYK": |
| 29654 |
isHandled = true; |
| 29655 |
break; |
| 29656 |
} |
| 29657 |
if (isHandled) { |
| 29658 |
const rgba = await this.getImageBytes(imageLength, { |
| 29659 |
drawWidth, |
| 29660 |
drawHeight, |
| 29661 |
forceRGBA: true |
| 29662 |
}); |
| 29663 |
return this.createBitmap(ImageKind.RGBA_32BPP, drawWidth, drawHeight, rgba); |
| 29664 |
} |
| 29665 |
} else { |
| 29666 |
switch (this.colorSpace.name) { |
| 29667 |
case "DeviceGray": |
| 29668 |
imageLength *= 3; |
| 29669 |
case "DeviceRGB": |
| 29670 |
case "DeviceCMYK": |
| 29671 |
imgData.kind = ImageKind.RGB_24BPP; |
| 29672 |
imgData.data = await this.getImageBytes(imageLength, { |
| 29673 |
drawWidth, |
| 29674 |
drawHeight, |
| 29675 |
forceRGB: true |
| 29676 |
}); |
| 29677 |
if (mustBeResized) { |
| 29678 |
return ImageResizer.createImage(imgData); |
| 29679 |
} |
| 29680 |
return imgData; |
| 29681 |
} |
| 29682 |
} |
| 29683 |
} |
| 29684 |
} |
| 29685 |
const imgArray = await this.getImageBytes(originalHeight * rowBytes, { |
| 29686 |
internal: true |
| 29687 |
}); |
| 29688 |
const actualHeight = 0 | imgArray.length / rowBytes * drawHeight / originalHeight; |
| 29689 |
const comps = this.getComponents(imgArray); |
| 29690 |
let alpha01, maybeUndoPreblend; |
| 29691 |
let canvas, ctx, canvasImgData, data; |
| 29692 |
if (isOffscreenCanvasSupported && !mustBeResized) { |
| 29693 |
canvas = new OffscreenCanvas(drawWidth, drawHeight); |
| 29694 |
ctx = canvas.getContext("2d"); |
| 29695 |
canvasImgData = ctx.createImageData(drawWidth, drawHeight); |
| 29696 |
data = canvasImgData.data; |
| 29697 |
} |
| 29698 |
imgData.kind = ImageKind.RGBA_32BPP; |
| 29699 |
if (!forceRGBA && !this.smask && !this.mask) { |
| 29700 |
if (!isOffscreenCanvasSupported || mustBeResized) { |
| 29701 |
imgData.kind = ImageKind.RGB_24BPP; |
| 29702 |
data = new Uint8ClampedArray(drawWidth * drawHeight * 3); |
| 29703 |
alpha01 = 0; |
| 29704 |
} else { |
| 29705 |
const arr = new Uint32Array(data.buffer); |
| 29706 |
arr.fill(FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff); |
| 29707 |
alpha01 = 1; |
| 29708 |
} |
| 29709 |
maybeUndoPreblend = false; |
| 29710 |
} else { |
| 29711 |
if (!isOffscreenCanvasSupported || mustBeResized) { |
| 29712 |
data = new Uint8ClampedArray(drawWidth * drawHeight * 4); |
| 29713 |
} |
| 29714 |
alpha01 = 1; |
| 29715 |
maybeUndoPreblend = true; |
| 29716 |
await this.fillOpacity(data, drawWidth, drawHeight, actualHeight, comps); |
| 29717 |
} |
| 29718 |
if (this.needsDecode) { |
| 29719 |
this.decodeBuffer(comps); |
| 29720 |
} |
| 29721 |
this.colorSpace.fillRgb(data, originalWidth, originalHeight, drawWidth, drawHeight, actualHeight, bpc, comps, alpha01); |
| 29722 |
if (maybeUndoPreblend) { |
| 29723 |
this.undoPreblend(data, drawWidth, actualHeight); |
| 29724 |
} |
| 29725 |
if (isOffscreenCanvasSupported && !mustBeResized) { |
| 29726 |
ctx.putImageData(canvasImgData, 0, 0); |
| 29727 |
const bitmap = canvas.transferToImageBitmap(); |
| 29728 |
return { |
| 29729 |
data: null, |
| 29730 |
width: drawWidth, |
| 29731 |
height: drawHeight, |
| 29732 |
bitmap, |
| 29733 |
interpolate: this.interpolate |
| 29734 |
}; |
| 29735 |
} |
| 29736 |
imgData.data = data; |
| 29737 |
if (mustBeResized) { |
| 29738 |
return ImageResizer.createImage(imgData); |
| 29739 |
} |
| 29740 |
return imgData; |
| 29741 |
} |
| 29742 |
async fillGrayBuffer(buffer) { |
| 29743 |
const numComps = this.numComps; |
| 29744 |
if (numComps !== 1) { |
| 29745 |
throw new FormatError(`Reading gray scale from a color image: ${numComps}`); |
| 29746 |
} |
| 29747 |
const width = this.width; |
| 29748 |
const height = this.height; |
| 29749 |
const bpc = this.bpc; |
| 29750 |
const rowBytes = width * numComps * bpc + 7 >> 3; |
| 29751 |
const imgArray = await this.getImageBytes(height * rowBytes, { |
| 29752 |
internal: true |
| 29753 |
}); |
| 29754 |
const comps = this.getComponents(imgArray); |
| 29755 |
let i, length; |
| 29756 |
if (bpc === 1) { |
| 29757 |
length = width * height; |
| 29758 |
if (this.needsDecode) { |
| 29759 |
for (i = 0; i < length; ++i) { |
| 29760 |
buffer[i] = comps[i] - 1 & 255; |
| 29761 |
} |
| 29762 |
} else { |
| 29763 |
for (i = 0; i < length; ++i) { |
| 29764 |
buffer[i] = -comps[i] & 255; |
| 29765 |
} |
| 29766 |
} |
| 29767 |
return; |
| 29768 |
} |
| 29769 |
if (this.needsDecode) { |
| 29770 |
this.decodeBuffer(comps); |
| 29771 |
} |
| 29772 |
length = width * height; |
| 29773 |
const scale = 255 / ((1 << bpc) - 1); |
| 29774 |
for (i = 0; i < length; ++i) { |
| 29775 |
buffer[i] = scale * comps[i]; |
| 29776 |
} |
| 29777 |
} |
| 29778 |
createBitmap(kind, width, height, src) { |
| 29779 |
const canvas = new OffscreenCanvas(width, height); |
| 29780 |
const ctx = canvas.getContext("2d"); |
| 29781 |
let imgData; |
| 29782 |
if (kind === ImageKind.RGBA_32BPP) { |
| 29783 |
imgData = new ImageData(src, width, height); |
| 29784 |
} else { |
| 29785 |
imgData = ctx.createImageData(width, height); |
| 29786 |
convertToRGBA({ |
| 29787 |
kind, |
| 29788 |
src, |
| 29789 |
dest: new Uint32Array(imgData.data.buffer), |
| 29790 |
width, |
| 29791 |
height, |
| 29792 |
inverseDecode: this.needsDecode |
| 29793 |
}); |
| 29794 |
} |
| 29795 |
ctx.putImageData(imgData, 0, 0); |
| 29796 |
const bitmap = canvas.transferToImageBitmap(); |
| 29797 |
return { |
| 29798 |
data: null, |
| 29799 |
width, |
| 29800 |
height, |
| 29801 |
bitmap, |
| 29802 |
interpolate: this.interpolate |
| 29803 |
}; |
| 29804 |
} |
| 29805 |
async getImageBytes(length, { |
| 29806 |
drawWidth, |
| 29807 |
drawHeight, |
| 29808 |
forceRGBA = false, |
| 29809 |
forceRGB = false, |
| 29810 |
internal = false |
| 29811 |
}) { |
| 29812 |
this.image.reset(); |
| 29813 |
this.image.drawWidth = drawWidth || this.width; |
| 29814 |
this.image.drawHeight = drawHeight || this.height; |
| 29815 |
this.image.forceRGBA = !!forceRGBA; |
| 29816 |
this.image.forceRGB = !!forceRGB; |
| 29817 |
const imageBytes = await this.image.getImageData(length, this.jpxDecoderOptions); |
| 29818 |
if (internal || this.image instanceof DecodeStream) { |
| 29819 |
return imageBytes; |
| 29820 |
} |
| 29821 |
assert(imageBytes instanceof Uint8Array, 'PDFImage.getImageBytes: Unsupported "imageBytes" type.'); |
| 29822 |
return new Uint8Array(imageBytes); |
| 29823 |
} |
| 29824 |
} |
| 29825 |
|
| 29826 |
;// ./src/core/evaluator.js |
| 29827 |
|
| 29828 |
|
| 29829 |
|
| 29830 |
|
| 29831 |
|
| 29832 |
|
| 29833 |
|
| 29834 |
|
| 29835 |
|
| 29836 |
|
| 29837 |
|
| 29838 |
|
| 29839 |
|
| 29840 |
|
| 29841 |
|
| 29842 |
|
| 29843 |
|
| 29844 |
|
| 29845 |
|
| 29846 |
|
| 29847 |
|
| 29848 |
|
| 29849 |
|
| 29850 |
|
| 29851 |
|
| 29852 |
|
| 29853 |
|
| 29854 |
const DefaultPartialEvaluatorOptions = Object.freeze({ |
| 29855 |
maxImageSize: -1, |
| 29856 |
disableFontFace: false, |
| 29857 |
ignoreErrors: false, |
| 29858 |
isEvalSupported: true, |
| 29859 |
isOffscreenCanvasSupported: false, |
| 29860 |
canvasMaxAreaInBytes: -1, |
| 29861 |
fontExtraProperties: false, |
| 29862 |
useSystemFonts: true, |
| 29863 |
cMapUrl: null, |
| 29864 |
standardFontDataUrl: null |
| 29865 |
}); |
| 29866 |
const PatternType = { |
| 29867 |
TILING: 1, |
| 29868 |
SHADING: 2 |
| 29869 |
}; |
| 29870 |
const TEXT_CHUNK_BATCH_SIZE = 10; |
| 29871 |
const deferred = Promise.resolve(); |
| 29872 |
function normalizeBlendMode(value, parsingArray = false) { |
| 29873 |
if (Array.isArray(value)) { |
| 29874 |
for (const val of value) { |
| 29875 |
const maybeBM = normalizeBlendMode(val, true); |
| 29876 |
if (maybeBM) { |
| 29877 |
return maybeBM; |
| 29878 |
} |
| 29879 |
} |
| 29880 |
warn(`Unsupported blend mode Array: ${value}`); |
| 29881 |
return "source-over"; |
| 29882 |
} |
| 29883 |
if (!(value instanceof Name)) { |
| 29884 |
if (parsingArray) { |
| 29885 |
return null; |
| 29886 |
} |
| 29887 |
return "source-over"; |
| 29888 |
} |
| 29889 |
switch (value.name) { |
| 29890 |
case "Normal": |
| 29891 |
case "Compatible": |
| 29892 |
return "source-over"; |
| 29893 |
case "Multiply": |
| 29894 |
return "multiply"; |
| 29895 |
case "Screen": |
| 29896 |
return "screen"; |
| 29897 |
case "Overlay": |
| 29898 |
return "overlay"; |
| 29899 |
case "Darken": |
| 29900 |
return "darken"; |
| 29901 |
case "Lighten": |
| 29902 |
return "lighten"; |
| 29903 |
case "ColorDodge": |
| 29904 |
return "color-dodge"; |
| 29905 |
case "ColorBurn": |
| 29906 |
return "color-burn"; |
| 29907 |
case "HardLight": |
| 29908 |
return "hard-light"; |
| 29909 |
case "SoftLight": |
| 29910 |
return "soft-light"; |
| 29911 |
case "Difference": |
| 29912 |
return "difference"; |
| 29913 |
case "Exclusion": |
| 29914 |
return "exclusion"; |
| 29915 |
case "Hue": |
| 29916 |
return "hue"; |
| 29917 |
case "Saturation": |
| 29918 |
return "saturation"; |
| 29919 |
case "Color": |
| 29920 |
return "color"; |
| 29921 |
case "Luminosity": |
| 29922 |
return "luminosity"; |
| 29923 |
} |
| 29924 |
if (parsingArray) { |
| 29925 |
return null; |
| 29926 |
} |
| 29927 |
warn(`Unsupported blend mode: ${value.name}`); |
| 29928 |
return "source-over"; |
| 29929 |
} |
| 29930 |
function addLocallyCachedImageOps(opList, data) { |
| 29931 |
if (data.objId) { |
| 29932 |
opList.addDependency(data.objId); |
| 29933 |
} |
| 29934 |
opList.addImageOps(data.fn, data.args, data.optionalContent); |
| 29935 |
if (data.fn === OPS.paintImageMaskXObject && data.args[0]?.count > 0) { |
| 29936 |
data.args[0].count++; |
| 29937 |
} |
| 29938 |
} |
| 29939 |
class TimeSlotManager { |
| 29940 |
static TIME_SLOT_DURATION_MS = 20; |
| 29941 |
static CHECK_TIME_EVERY = 100; |
| 29942 |
constructor() { |
| 29943 |
this.reset(); |
| 29944 |
} |
| 29945 |
check() { |
| 29946 |
if (++this.checked < TimeSlotManager.CHECK_TIME_EVERY) { |
| 29947 |
return false; |
| 29948 |
} |
| 29949 |
this.checked = 0; |
| 29950 |
return this.endTime <= Date.now(); |
| 29951 |
} |
| 29952 |
reset() { |
| 29953 |
this.endTime = Date.now() + TimeSlotManager.TIME_SLOT_DURATION_MS; |
| 29954 |
this.checked = 0; |
| 29955 |
} |
| 29956 |
} |
| 29957 |
class PartialEvaluator { |
| 29958 |
constructor({ |
| 29959 |
xref, |
| 29960 |
handler, |
| 29961 |
pageIndex, |
| 29962 |
idFactory, |
| 29963 |
fontCache, |
| 29964 |
builtInCMapCache, |
| 29965 |
standardFontDataCache, |
| 29966 |
globalImageCache, |
| 29967 |
systemFontCache, |
| 29968 |
options = null |
| 29969 |
}) { |
| 29970 |
this.xref = xref; |
| 29971 |
this.handler = handler; |
| 29972 |
this.pageIndex = pageIndex; |
| 29973 |
this.idFactory = idFactory; |
| 29974 |
this.fontCache = fontCache; |
| 29975 |
this.builtInCMapCache = builtInCMapCache; |
| 29976 |
this.standardFontDataCache = standardFontDataCache; |
| 29977 |
this.globalImageCache = globalImageCache; |
| 29978 |
this.systemFontCache = systemFontCache; |
| 29979 |
this.options = options || DefaultPartialEvaluatorOptions; |
| 29980 |
this.type3FontRefs = null; |
| 29981 |
this._regionalImageCache = new RegionalImageCache(); |
| 29982 |
this._fetchBuiltInCMapBound = this.fetchBuiltInCMap.bind(this); |
| 29983 |
ImageResizer.setMaxArea(this.options.canvasMaxAreaInBytes); |
| 29984 |
} |
| 29985 |
get _pdfFunctionFactory() { |
| 29986 |
const pdfFunctionFactory = new PDFFunctionFactory({ |
| 29987 |
xref: this.xref, |
| 29988 |
isEvalSupported: this.options.isEvalSupported |
| 29989 |
}); |
| 29990 |
return shadow(this, "_pdfFunctionFactory", pdfFunctionFactory); |
| 29991 |
} |
| 29992 |
get parsingType3Font() { |
| 29993 |
return !!this.type3FontRefs; |
| 29994 |
} |
| 29995 |
clone(newOptions = null) { |
| 29996 |
const newEvaluator = Object.create(this); |
| 29997 |
newEvaluator.options = Object.assign(Object.create(null), this.options, newOptions); |
| 29998 |
return newEvaluator; |
| 29999 |
} |
| 30000 |
hasBlendModes(resources, nonBlendModesSet) { |
| 30001 |
if (!(resources instanceof Dict)) { |
| 30002 |
return false; |
| 30003 |
} |
| 30004 |
if (resources.objId && nonBlendModesSet.has(resources.objId)) { |
| 30005 |
return false; |
| 30006 |
} |
| 30007 |
const processed = new RefSet(nonBlendModesSet); |
| 30008 |
if (resources.objId) { |
| 30009 |
processed.put(resources.objId); |
| 30010 |
} |
| 30011 |
const nodes = [resources], |
| 30012 |
xref = this.xref; |
| 30013 |
while (nodes.length) { |
| 30014 |
const node = nodes.shift(); |
| 30015 |
const graphicStates = node.get("ExtGState"); |
| 30016 |
if (graphicStates instanceof Dict) { |
| 30017 |
for (let graphicState of graphicStates.getRawValues()) { |
| 30018 |
if (graphicState instanceof Ref) { |
| 30019 |
if (processed.has(graphicState)) { |
| 30020 |
continue; |
| 30021 |
} |
| 30022 |
try { |
| 30023 |
graphicState = xref.fetch(graphicState); |
| 30024 |
} catch (ex) { |
| 30025 |
processed.put(graphicState); |
| 30026 |
info(`hasBlendModes - ignoring ExtGState: "${ex}".`); |
| 30027 |
continue; |
| 30028 |
} |
| 30029 |
} |
| 30030 |
if (!(graphicState instanceof Dict)) { |
| 30031 |
continue; |
| 30032 |
} |
| 30033 |
if (graphicState.objId) { |
| 30034 |
processed.put(graphicState.objId); |
| 30035 |
} |
| 30036 |
const bm = graphicState.get("BM"); |
| 30037 |
if (bm instanceof Name) { |
| 30038 |
if (bm.name !== "Normal") { |
| 30039 |
return true; |
| 30040 |
} |
| 30041 |
continue; |
| 30042 |
} |
| 30043 |
if (bm !== undefined && Array.isArray(bm)) { |
| 30044 |
for (const element of bm) { |
| 30045 |
if (element instanceof Name && element.name !== "Normal") { |
| 30046 |
return true; |
| 30047 |
} |
| 30048 |
} |
| 30049 |
} |
| 30050 |
} |
| 30051 |
} |
| 30052 |
const xObjects = node.get("XObject"); |
| 30053 |
if (!(xObjects instanceof Dict)) { |
| 30054 |
continue; |
| 30055 |
} |
| 30056 |
for (let xObject of xObjects.getRawValues()) { |
| 30057 |
if (xObject instanceof Ref) { |
| 30058 |
if (processed.has(xObject)) { |
| 30059 |
continue; |
| 30060 |
} |
| 30061 |
try { |
| 30062 |
xObject = xref.fetch(xObject); |
| 30063 |
} catch (ex) { |
| 30064 |
processed.put(xObject); |
| 30065 |
info(`hasBlendModes - ignoring XObject: "${ex}".`); |
| 30066 |
continue; |
| 30067 |
} |
| 30068 |
} |
| 30069 |
if (!(xObject instanceof BaseStream)) { |
| 30070 |
continue; |
| 30071 |
} |
| 30072 |
if (xObject.dict.objId) { |
| 30073 |
processed.put(xObject.dict.objId); |
| 30074 |
} |
| 30075 |
const xResources = xObject.dict.get("Resources"); |
| 30076 |
if (!(xResources instanceof Dict)) { |
| 30077 |
continue; |
| 30078 |
} |
| 30079 |
if (xResources.objId && processed.has(xResources.objId)) { |
| 30080 |
continue; |
| 30081 |
} |
| 30082 |
nodes.push(xResources); |
| 30083 |
if (xResources.objId) { |
| 30084 |
processed.put(xResources.objId); |
| 30085 |
} |
| 30086 |
} |
| 30087 |
} |
| 30088 |
for (const ref of processed) { |
| 30089 |
nonBlendModesSet.put(ref); |
| 30090 |
} |
| 30091 |
return false; |
| 30092 |
} |
| 30093 |
async fetchBuiltInCMap(name) { |
| 30094 |
const cachedData = this.builtInCMapCache.get(name); |
| 30095 |
if (cachedData) { |
| 30096 |
return cachedData; |
| 30097 |
} |
| 30098 |
let data; |
| 30099 |
if (this.options.cMapUrl !== null) { |
| 30100 |
const url = `${this.options.cMapUrl}${name}.bcmap`; |
| 30101 |
const response = await fetch(url); |
| 30102 |
if (!response.ok) { |
| 30103 |
throw new Error(`fetchBuiltInCMap: failed to fetch file "${url}" with "${response.statusText}".`); |
| 30104 |
} |
| 30105 |
data = { |
| 30106 |
cMapData: new Uint8Array(await response.arrayBuffer()), |
| 30107 |
compressionType: CMapCompressionType.BINARY |
| 30108 |
}; |
| 30109 |
} else { |
| 30110 |
data = await this.handler.sendWithPromise("FetchBuiltInCMap", { |
| 30111 |
name |
| 30112 |
}); |
| 30113 |
} |
| 30114 |
if (data.compressionType !== CMapCompressionType.NONE) { |
| 30115 |
this.builtInCMapCache.set(name, data); |
| 30116 |
} |
| 30117 |
return data; |
| 30118 |
} |
| 30119 |
async fetchStandardFontData(name) { |
| 30120 |
const cachedData = this.standardFontDataCache.get(name); |
| 30121 |
if (cachedData) { |
| 30122 |
return new Stream(cachedData); |
| 30123 |
} |
| 30124 |
if (this.options.useSystemFonts && name !== "Symbol" && name !== "ZapfDingbats") { |
| 30125 |
return null; |
| 30126 |
} |
| 30127 |
const standardFontNameToFileName = getFontNameToFileMap(), |
| 30128 |
filename = standardFontNameToFileName[name]; |
| 30129 |
let data; |
| 30130 |
if (this.options.standardFontDataUrl !== null) { |
| 30131 |
const url = `${this.options.standardFontDataUrl}${filename}`; |
| 30132 |
const response = await fetch(url); |
| 30133 |
if (!response.ok) { |
| 30134 |
warn(`fetchStandardFontData: failed to fetch file "${url}" with "${response.statusText}".`); |
| 30135 |
} else { |
| 30136 |
data = new Uint8Array(await response.arrayBuffer()); |
| 30137 |
} |
| 30138 |
} else { |
| 30139 |
try { |
| 30140 |
data = await this.handler.sendWithPromise("FetchStandardFontData", { |
| 30141 |
filename |
| 30142 |
}); |
| 30143 |
} catch (e) { |
| 30144 |
warn(`fetchStandardFontData: failed to fetch file "${filename}" with "${e}".`); |
| 30145 |
} |
| 30146 |
} |
| 30147 |
if (!data) { |
| 30148 |
return null; |
| 30149 |
} |
| 30150 |
this.standardFontDataCache.set(name, data); |
| 30151 |
return new Stream(data); |
| 30152 |
} |
| 30153 |
async buildFormXObject(resources, xobj, smask, operatorList, task, initialState, localColorSpaceCache) { |
| 30154 |
const dict = xobj.dict; |
| 30155 |
const matrix = lookupMatrix(dict.getArray("Matrix"), null); |
| 30156 |
const bbox = lookupNormalRect(dict.getArray("BBox"), null); |
| 30157 |
let optionalContent, groupOptions; |
| 30158 |
if (dict.has("OC")) { |
| 30159 |
optionalContent = await this.parseMarkedContentProps(dict.get("OC"), resources); |
| 30160 |
} |
| 30161 |
if (optionalContent !== undefined) { |
| 30162 |
operatorList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); |
| 30163 |
} |
| 30164 |
const group = dict.get("Group"); |
| 30165 |
if (group) { |
| 30166 |
groupOptions = { |
| 30167 |
matrix, |
| 30168 |
bbox, |
| 30169 |
smask, |
| 30170 |
isolated: false, |
| 30171 |
knockout: false |
| 30172 |
}; |
| 30173 |
const groupSubtype = group.get("S"); |
| 30174 |
let colorSpace = null; |
| 30175 |
if (isName(groupSubtype, "Transparency")) { |
| 30176 |
groupOptions.isolated = group.get("I") || false; |
| 30177 |
groupOptions.knockout = group.get("K") || false; |
| 30178 |
if (group.has("CS")) { |
| 30179 |
const cs = group.getRaw("CS"); |
| 30180 |
const cachedColorSpace = ColorSpace.getCached(cs, this.xref, localColorSpaceCache); |
| 30181 |
if (cachedColorSpace) { |
| 30182 |
colorSpace = cachedColorSpace; |
| 30183 |
} else { |
| 30184 |
colorSpace = await this.parseColorSpace({ |
| 30185 |
cs, |
| 30186 |
resources, |
| 30187 |
localColorSpaceCache |
| 30188 |
}); |
| 30189 |
} |
| 30190 |
} |
| 30191 |
} |
| 30192 |
if (smask?.backdrop) { |
| 30193 |
colorSpace ||= ColorSpace.singletons.rgb; |
| 30194 |
smask.backdrop = colorSpace.getRgb(smask.backdrop, 0); |
| 30195 |
} |
| 30196 |
operatorList.addOp(OPS.beginGroup, [groupOptions]); |
| 30197 |
} |
| 30198 |
const args = group ? [matrix, null] : [matrix, bbox]; |
| 30199 |
operatorList.addOp(OPS.paintFormXObjectBegin, args); |
| 30200 |
await this.getOperatorList({ |
| 30201 |
stream: xobj, |
| 30202 |
task, |
| 30203 |
resources: dict.get("Resources") || resources, |
| 30204 |
operatorList, |
| 30205 |
initialState |
| 30206 |
}); |
| 30207 |
operatorList.addOp(OPS.paintFormXObjectEnd, []); |
| 30208 |
if (group) { |
| 30209 |
operatorList.addOp(OPS.endGroup, [groupOptions]); |
| 30210 |
} |
| 30211 |
if (optionalContent !== undefined) { |
| 30212 |
operatorList.addOp(OPS.endMarkedContent, []); |
| 30213 |
} |
| 30214 |
} |
| 30215 |
_sendImgData(objId, imgData, cacheGlobally = false) { |
| 30216 |
const transfers = imgData ? [imgData.bitmap || imgData.data.buffer] : null; |
| 30217 |
if (this.parsingType3Font || cacheGlobally) { |
| 30218 |
return this.handler.send("commonobj", [objId, "Image", imgData], transfers); |
| 30219 |
} |
| 30220 |
return this.handler.send("obj", [objId, this.pageIndex, "Image", imgData], transfers); |
| 30221 |
} |
| 30222 |
async buildPaintImageXObject({ |
| 30223 |
resources, |
| 30224 |
image, |
| 30225 |
isInline = false, |
| 30226 |
operatorList, |
| 30227 |
cacheKey, |
| 30228 |
localImageCache, |
| 30229 |
localColorSpaceCache |
| 30230 |
}) { |
| 30231 |
const dict = image.dict; |
| 30232 |
const imageRef = dict.objId; |
| 30233 |
const w = dict.get("W", "Width"); |
| 30234 |
const h = dict.get("H", "Height"); |
| 30235 |
if (!(w && typeof w === "number") || !(h && typeof h === "number")) { |
| 30236 |
warn("Image dimensions are missing, or not numbers."); |
| 30237 |
return; |
| 30238 |
} |
| 30239 |
const maxImageSize = this.options.maxImageSize; |
| 30240 |
if (maxImageSize !== -1 && w * h > maxImageSize) { |
| 30241 |
const msg = "Image exceeded maximum allowed size and was removed."; |
| 30242 |
if (this.options.ignoreErrors) { |
| 30243 |
warn(msg); |
| 30244 |
return; |
| 30245 |
} |
| 30246 |
throw new Error(msg); |
| 30247 |
} |
| 30248 |
let optionalContent; |
| 30249 |
if (dict.has("OC")) { |
| 30250 |
optionalContent = await this.parseMarkedContentProps(dict.get("OC"), resources); |
| 30251 |
} |
| 30252 |
const imageMask = dict.get("IM", "ImageMask") || false; |
| 30253 |
let imgData, args; |
| 30254 |
if (imageMask) { |
| 30255 |
const interpolate = dict.get("I", "Interpolate"); |
| 30256 |
const bitStrideLength = w + 7 >> 3; |
| 30257 |
const imgArray = image.getBytes(bitStrideLength * h); |
| 30258 |
const decode = dict.getArray("D", "Decode"); |
| 30259 |
if (this.parsingType3Font) { |
| 30260 |
imgData = PDFImage.createRawMask({ |
| 30261 |
imgArray, |
| 30262 |
width: w, |
| 30263 |
height: h, |
| 30264 |
imageIsFromDecodeStream: image instanceof DecodeStream, |
| 30265 |
inverseDecode: decode?.[0] > 0, |
| 30266 |
interpolate |
| 30267 |
}); |
| 30268 |
imgData.cached = !!cacheKey; |
| 30269 |
args = [imgData]; |
| 30270 |
operatorList.addImageOps(OPS.paintImageMaskXObject, args, optionalContent); |
| 30271 |
if (cacheKey) { |
| 30272 |
const cacheData = { |
| 30273 |
fn: OPS.paintImageMaskXObject, |
| 30274 |
args, |
| 30275 |
optionalContent |
| 30276 |
}; |
| 30277 |
localImageCache.set(cacheKey, imageRef, cacheData); |
| 30278 |
if (imageRef) { |
| 30279 |
this._regionalImageCache.set(null, imageRef, cacheData); |
| 30280 |
} |
| 30281 |
} |
| 30282 |
return; |
| 30283 |
} |
| 30284 |
imgData = await PDFImage.createMask({ |
| 30285 |
imgArray, |
| 30286 |
width: w, |
| 30287 |
height: h, |
| 30288 |
imageIsFromDecodeStream: image instanceof DecodeStream, |
| 30289 |
inverseDecode: decode?.[0] > 0, |
| 30290 |
interpolate, |
| 30291 |
isOffscreenCanvasSupported: this.options.isOffscreenCanvasSupported |
| 30292 |
}); |
| 30293 |
if (imgData.isSingleOpaquePixel) { |
| 30294 |
operatorList.addImageOps(OPS.paintSolidColorImageMask, [], optionalContent); |
| 30295 |
if (cacheKey) { |
| 30296 |
const cacheData = { |
| 30297 |
fn: OPS.paintSolidColorImageMask, |
| 30298 |
args: [], |
| 30299 |
optionalContent |
| 30300 |
}; |
| 30301 |
localImageCache.set(cacheKey, imageRef, cacheData); |
| 30302 |
if (imageRef) { |
| 30303 |
this._regionalImageCache.set(null, imageRef, cacheData); |
| 30304 |
} |
| 30305 |
} |
| 30306 |
return; |
| 30307 |
} |
| 30308 |
const objId = `mask_${this.idFactory.createObjId()}`; |
| 30309 |
operatorList.addDependency(objId); |
| 30310 |
imgData.dataLen = imgData.bitmap ? imgData.width * imgData.height * 4 : imgData.data.length; |
| 30311 |
this._sendImgData(objId, imgData); |
| 30312 |
args = [{ |
| 30313 |
data: objId, |
| 30314 |
width: imgData.width, |
| 30315 |
height: imgData.height, |
| 30316 |
interpolate: imgData.interpolate, |
| 30317 |
count: 1 |
| 30318 |
}]; |
| 30319 |
operatorList.addImageOps(OPS.paintImageMaskXObject, args, optionalContent); |
| 30320 |
if (cacheKey) { |
| 30321 |
const cacheData = { |
| 30322 |
objId, |
| 30323 |
fn: OPS.paintImageMaskXObject, |
| 30324 |
args, |
| 30325 |
optionalContent |
| 30326 |
}; |
| 30327 |
localImageCache.set(cacheKey, imageRef, cacheData); |
| 30328 |
if (imageRef) { |
| 30329 |
this._regionalImageCache.set(null, imageRef, cacheData); |
| 30330 |
} |
| 30331 |
} |
| 30332 |
return; |
| 30333 |
} |
| 30334 |
const SMALL_IMAGE_DIMENSIONS = 200; |
| 30335 |
if (isInline && w + h < SMALL_IMAGE_DIMENSIONS && !dict.has("SMask") && !dict.has("Mask")) { |
| 30336 |
try { |
| 30337 |
const imageObj = new PDFImage({ |
| 30338 |
xref: this.xref, |
| 30339 |
res: resources, |
| 30340 |
image, |
| 30341 |
isInline, |
| 30342 |
pdfFunctionFactory: this._pdfFunctionFactory, |
| 30343 |
localColorSpaceCache |
| 30344 |
}); |
| 30345 |
imgData = await imageObj.createImageData(true, false); |
| 30346 |
operatorList.isOffscreenCanvasSupported = this.options.isOffscreenCanvasSupported; |
| 30347 |
operatorList.addImageOps(OPS.paintInlineImageXObject, [imgData], optionalContent); |
| 30348 |
} catch (reason) { |
| 30349 |
const msg = `Unable to decode inline image: "${reason}".`; |
| 30350 |
if (!this.options.ignoreErrors) { |
| 30351 |
throw new Error(msg); |
| 30352 |
} |
| 30353 |
warn(msg); |
| 30354 |
} |
| 30355 |
return; |
| 30356 |
} |
| 30357 |
let objId = `img_${this.idFactory.createObjId()}`, |
| 30358 |
cacheGlobally = false; |
| 30359 |
if (this.parsingType3Font) { |
| 30360 |
objId = `${this.idFactory.getDocId()}_type3_${objId}`; |
| 30361 |
} else if (cacheKey && imageRef) { |
| 30362 |
cacheGlobally = this.globalImageCache.shouldCache(imageRef, this.pageIndex); |
| 30363 |
if (cacheGlobally) { |
| 30364 |
assert(!isInline, "Cannot cache an inline image globally."); |
| 30365 |
objId = `${this.idFactory.getDocId()}_${objId}`; |
| 30366 |
} |
| 30367 |
} |
| 30368 |
operatorList.addDependency(objId); |
| 30369 |
args = [objId, w, h]; |
| 30370 |
operatorList.addImageOps(OPS.paintImageXObject, args, optionalContent); |
| 30371 |
if (cacheGlobally) { |
| 30372 |
if (this.globalImageCache.hasDecodeFailed(imageRef)) { |
| 30373 |
this.globalImageCache.setData(imageRef, { |
| 30374 |
objId, |
| 30375 |
fn: OPS.paintImageXObject, |
| 30376 |
args, |
| 30377 |
optionalContent, |
| 30378 |
byteSize: 0 |
| 30379 |
}); |
| 30380 |
this._sendImgData(objId, null, cacheGlobally); |
| 30381 |
return; |
| 30382 |
} |
| 30383 |
if (w * h > 250000 || dict.has("SMask") || dict.has("Mask")) { |
| 30384 |
const localLength = await this.handler.sendWithPromise("commonobj", [objId, "CopyLocalImage", { |
| 30385 |
imageRef |
| 30386 |
}]); |
| 30387 |
if (localLength) { |
| 30388 |
this.globalImageCache.setData(imageRef, { |
| 30389 |
objId, |
| 30390 |
fn: OPS.paintImageXObject, |
| 30391 |
args, |
| 30392 |
optionalContent, |
| 30393 |
byteSize: 0 |
| 30394 |
}); |
| 30395 |
this.globalImageCache.addByteSize(imageRef, localLength); |
| 30396 |
return; |
| 30397 |
} |
| 30398 |
} |
| 30399 |
} |
| 30400 |
PDFImage.buildImage({ |
| 30401 |
xref: this.xref, |
| 30402 |
res: resources, |
| 30403 |
image, |
| 30404 |
isInline, |
| 30405 |
pdfFunctionFactory: this._pdfFunctionFactory, |
| 30406 |
localColorSpaceCache |
| 30407 |
}).then(async imageObj => { |
| 30408 |
imgData = await imageObj.createImageData(false, this.options.isOffscreenCanvasSupported); |
| 30409 |
imgData.dataLen = imgData.bitmap ? imgData.width * imgData.height * 4 : imgData.data.length; |
| 30410 |
imgData.ref = imageRef; |
| 30411 |
if (cacheGlobally) { |
| 30412 |
this.globalImageCache.addByteSize(imageRef, imgData.dataLen); |
| 30413 |
} |
| 30414 |
return this._sendImgData(objId, imgData, cacheGlobally); |
| 30415 |
}).catch(reason => { |
| 30416 |
warn(`Unable to decode image "${objId}": "${reason}".`); |
| 30417 |
if (imageRef) { |
| 30418 |
this.globalImageCache.addDecodeFailed(imageRef); |
| 30419 |
} |
| 30420 |
return this._sendImgData(objId, null, cacheGlobally); |
| 30421 |
}); |
| 30422 |
if (cacheKey) { |
| 30423 |
const cacheData = { |
| 30424 |
objId, |
| 30425 |
fn: OPS.paintImageXObject, |
| 30426 |
args, |
| 30427 |
optionalContent |
| 30428 |
}; |
| 30429 |
localImageCache.set(cacheKey, imageRef, cacheData); |
| 30430 |
if (imageRef) { |
| 30431 |
this._regionalImageCache.set(null, imageRef, cacheData); |
| 30432 |
if (cacheGlobally) { |
| 30433 |
this.globalImageCache.setData(imageRef, { |
| 30434 |
objId, |
| 30435 |
fn: OPS.paintImageXObject, |
| 30436 |
args, |
| 30437 |
optionalContent, |
| 30438 |
byteSize: 0 |
| 30439 |
}); |
| 30440 |
} |
| 30441 |
} |
| 30442 |
} |
| 30443 |
} |
| 30444 |
handleSMask(smask, resources, operatorList, task, stateManager, localColorSpaceCache) { |
| 30445 |
const smaskContent = smask.get("G"); |
| 30446 |
const smaskOptions = { |
| 30447 |
subtype: smask.get("S").name, |
| 30448 |
backdrop: smask.get("BC") |
| 30449 |
}; |
| 30450 |
const transferObj = smask.get("TR"); |
| 30451 |
if (isPDFFunction(transferObj)) { |
| 30452 |
const transferFn = this._pdfFunctionFactory.create(transferObj); |
| 30453 |
const transferMap = new Uint8Array(256); |
| 30454 |
const tmp = new Float32Array(1); |
| 30455 |
for (let i = 0; i < 256; i++) { |
| 30456 |
tmp[0] = i / 255; |
| 30457 |
transferFn(tmp, 0, tmp, 0); |
| 30458 |
transferMap[i] = tmp[0] * 255 | 0; |
| 30459 |
} |
| 30460 |
smaskOptions.transferMap = transferMap; |
| 30461 |
} |
| 30462 |
return this.buildFormXObject(resources, smaskContent, smaskOptions, operatorList, task, stateManager.state.clone(), localColorSpaceCache); |
| 30463 |
} |
| 30464 |
handleTransferFunction(tr) { |
| 30465 |
let transferArray; |
| 30466 |
if (Array.isArray(tr)) { |
| 30467 |
transferArray = tr; |
| 30468 |
} else if (isPDFFunction(tr)) { |
| 30469 |
transferArray = [tr]; |
| 30470 |
} else { |
| 30471 |
return null; |
| 30472 |
} |
| 30473 |
const transferMaps = []; |
| 30474 |
let numFns = 0, |
| 30475 |
numEffectfulFns = 0; |
| 30476 |
for (const entry of transferArray) { |
| 30477 |
const transferObj = this.xref.fetchIfRef(entry); |
| 30478 |
numFns++; |
| 30479 |
if (isName(transferObj, "Identity")) { |
| 30480 |
transferMaps.push(null); |
| 30481 |
continue; |
| 30482 |
} else if (!isPDFFunction(transferObj)) { |
| 30483 |
return null; |
| 30484 |
} |
| 30485 |
const transferFn = this._pdfFunctionFactory.create(transferObj); |
| 30486 |
const transferMap = new Uint8Array(256), |
| 30487 |
tmp = new Float32Array(1); |
| 30488 |
for (let j = 0; j < 256; j++) { |
| 30489 |
tmp[0] = j / 255; |
| 30490 |
transferFn(tmp, 0, tmp, 0); |
| 30491 |
transferMap[j] = tmp[0] * 255 | 0; |
| 30492 |
} |
| 30493 |
transferMaps.push(transferMap); |
| 30494 |
numEffectfulFns++; |
| 30495 |
} |
| 30496 |
if (!(numFns === 1 || numFns === 4)) { |
| 30497 |
return null; |
| 30498 |
} |
| 30499 |
if (numEffectfulFns === 0) { |
| 30500 |
return null; |
| 30501 |
} |
| 30502 |
return transferMaps; |
| 30503 |
} |
| 30504 |
handleTilingType(fn, color, resources, pattern, patternDict, operatorList, task, localTilingPatternCache) { |
| 30505 |
const tilingOpList = new OperatorList(); |
| 30506 |
const patternResources = Dict.merge({ |
| 30507 |
xref: this.xref, |
| 30508 |
dictArray: [patternDict.get("Resources"), resources] |
| 30509 |
}); |
| 30510 |
return this.getOperatorList({ |
| 30511 |
stream: pattern, |
| 30512 |
task, |
| 30513 |
resources: patternResources, |
| 30514 |
operatorList: tilingOpList |
| 30515 |
}).then(function () { |
| 30516 |
const operatorListIR = tilingOpList.getIR(); |
| 30517 |
const tilingPatternIR = getTilingPatternIR(operatorListIR, patternDict, color); |
| 30518 |
operatorList.addDependencies(tilingOpList.dependencies); |
| 30519 |
operatorList.addOp(fn, tilingPatternIR); |
| 30520 |
if (patternDict.objId) { |
| 30521 |
localTilingPatternCache.set(null, patternDict.objId, { |
| 30522 |
operatorListIR, |
| 30523 |
dict: patternDict |
| 30524 |
}); |
| 30525 |
} |
| 30526 |
}).catch(reason => { |
| 30527 |
if (reason instanceof AbortException) { |
| 30528 |
return; |
| 30529 |
} |
| 30530 |
if (this.options.ignoreErrors) { |
| 30531 |
warn(`handleTilingType - ignoring pattern: "${reason}".`); |
| 30532 |
return; |
| 30533 |
} |
| 30534 |
throw reason; |
| 30535 |
}); |
| 30536 |
} |
| 30537 |
async handleSetFont(resources, fontArgs, fontRef, operatorList, task, state, fallbackFontDict = null, cssFontInfo = null) { |
| 30538 |
const fontName = fontArgs?.[0] instanceof Name ? fontArgs[0].name : null; |
| 30539 |
let translated = await this.loadFont(fontName, fontRef, resources, fallbackFontDict, cssFontInfo); |
| 30540 |
if (translated.font.isType3Font) { |
| 30541 |
try { |
| 30542 |
await translated.loadType3Data(this, resources, task); |
| 30543 |
operatorList.addDependencies(translated.type3Dependencies); |
| 30544 |
} catch (reason) { |
| 30545 |
translated = new TranslatedFont({ |
| 30546 |
loadedName: "g_font_error", |
| 30547 |
font: new ErrorFont(`Type3 font load error: ${reason}`), |
| 30548 |
dict: translated.font, |
| 30549 |
evaluatorOptions: this.options |
| 30550 |
}); |
| 30551 |
} |
| 30552 |
} |
| 30553 |
state.font = translated.font; |
| 30554 |
translated.send(this.handler); |
| 30555 |
return translated.loadedName; |
| 30556 |
} |
| 30557 |
handleText(chars, state) { |
| 30558 |
const font = state.font; |
| 30559 |
const glyphs = font.charsToGlyphs(chars); |
| 30560 |
if (font.data) { |
| 30561 |
const isAddToPathSet = !!(state.textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG); |
| 30562 |
if (isAddToPathSet || state.fillColorSpace.name === "Pattern" || font.disableFontFace || this.options.disableFontFace) { |
| 30563 |
PartialEvaluator.buildFontPaths(font, glyphs, this.handler, this.options); |
| 30564 |
} |
| 30565 |
} |
| 30566 |
return glyphs; |
| 30567 |
} |
| 30568 |
ensureStateFont(state) { |
| 30569 |
if (state.font) { |
| 30570 |
return; |
| 30571 |
} |
| 30572 |
const reason = new FormatError("Missing setFont (Tf) operator before text rendering operator."); |
| 30573 |
if (this.options.ignoreErrors) { |
| 30574 |
warn(`ensureStateFont: "${reason}".`); |
| 30575 |
return; |
| 30576 |
} |
| 30577 |
throw reason; |
| 30578 |
} |
| 30579 |
async setGState({ |
| 30580 |
resources, |
| 30581 |
gState, |
| 30582 |
operatorList, |
| 30583 |
cacheKey, |
| 30584 |
task, |
| 30585 |
stateManager, |
| 30586 |
localGStateCache, |
| 30587 |
localColorSpaceCache |
| 30588 |
}) { |
| 30589 |
const gStateRef = gState.objId; |
| 30590 |
let isSimpleGState = true; |
| 30591 |
const gStateObj = []; |
| 30592 |
let promise = Promise.resolve(); |
| 30593 |
for (const key of gState.getKeys()) { |
| 30594 |
const value = gState.get(key); |
| 30595 |
switch (key) { |
| 30596 |
case "Type": |
| 30597 |
break; |
| 30598 |
case "LW": |
| 30599 |
case "LC": |
| 30600 |
case "LJ": |
| 30601 |
case "ML": |
| 30602 |
case "D": |
| 30603 |
case "RI": |
| 30604 |
case "FL": |
| 30605 |
case "CA": |
| 30606 |
case "ca": |
| 30607 |
gStateObj.push([key, value]); |
| 30608 |
break; |
| 30609 |
case "Font": |
| 30610 |
isSimpleGState = false; |
| 30611 |
promise = promise.then(() => this.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) { |
| 30612 |
operatorList.addDependency(loadedName); |
| 30613 |
gStateObj.push([key, [loadedName, value[1]]]); |
| 30614 |
})); |
| 30615 |
break; |
| 30616 |
case "BM": |
| 30617 |
gStateObj.push([key, normalizeBlendMode(value)]); |
| 30618 |
break; |
| 30619 |
case "SMask": |
| 30620 |
if (isName(value, "None")) { |
| 30621 |
gStateObj.push([key, false]); |
| 30622 |
break; |
| 30623 |
} |
| 30624 |
if (value instanceof Dict) { |
| 30625 |
isSimpleGState = false; |
| 30626 |
promise = promise.then(() => this.handleSMask(value, resources, operatorList, task, stateManager, localColorSpaceCache)); |
| 30627 |
gStateObj.push([key, true]); |
| 30628 |
} else { |
| 30629 |
warn("Unsupported SMask type"); |
| 30630 |
} |
| 30631 |
break; |
| 30632 |
case "TR": |
| 30633 |
const transferMaps = this.handleTransferFunction(value); |
| 30634 |
gStateObj.push([key, transferMaps]); |
| 30635 |
break; |
| 30636 |
case "OP": |
| 30637 |
case "op": |
| 30638 |
case "OPM": |
| 30639 |
case "BG": |
| 30640 |
case "BG2": |
| 30641 |
case "UCR": |
| 30642 |
case "UCR2": |
| 30643 |
case "TR2": |
| 30644 |
case "HT": |
| 30645 |
case "SM": |
| 30646 |
case "SA": |
| 30647 |
case "AIS": |
| 30648 |
case "TK": |
| 30649 |
info("graphic state operator " + key); |
| 30650 |
break; |
| 30651 |
default: |
| 30652 |
info("Unknown graphic state operator " + key); |
| 30653 |
break; |
| 30654 |
} |
| 30655 |
} |
| 30656 |
await promise; |
| 30657 |
if (gStateObj.length > 0) { |
| 30658 |
operatorList.addOp(OPS.setGState, [gStateObj]); |
| 30659 |
} |
| 30660 |
if (isSimpleGState) { |
| 30661 |
localGStateCache.set(cacheKey, gStateRef, gStateObj); |
| 30662 |
} |
| 30663 |
} |
| 30664 |
loadFont(fontName, font, resources, fallbackFontDict = null, cssFontInfo = null) { |
| 30665 |
const errorFont = async () => { |
| 30666 |
return new TranslatedFont({ |
| 30667 |
loadedName: "g_font_error", |
| 30668 |
font: new ErrorFont(`Font "${fontName}" is not available.`), |
| 30669 |
dict: font, |
| 30670 |
evaluatorOptions: this.options |
| 30671 |
}); |
| 30672 |
}; |
| 30673 |
let fontRef; |
| 30674 |
if (font) { |
| 30675 |
if (font instanceof Ref) { |
| 30676 |
fontRef = font; |
| 30677 |
} |
| 30678 |
} else { |
| 30679 |
const fontRes = resources.get("Font"); |
| 30680 |
if (fontRes) { |
| 30681 |
fontRef = fontRes.getRaw(fontName); |
| 30682 |
} |
| 30683 |
} |
| 30684 |
if (fontRef) { |
| 30685 |
if (this.type3FontRefs?.has(fontRef)) { |
| 30686 |
return errorFont(); |
| 30687 |
} |
| 30688 |
if (this.fontCache.has(fontRef)) { |
| 30689 |
return this.fontCache.get(fontRef); |
| 30690 |
} |
| 30691 |
try { |
| 30692 |
font = this.xref.fetchIfRef(fontRef); |
| 30693 |
} catch (ex) { |
| 30694 |
warn(`loadFont - lookup failed: "${ex}".`); |
| 30695 |
} |
| 30696 |
} |
| 30697 |
if (!(font instanceof Dict)) { |
| 30698 |
if (!this.options.ignoreErrors && !this.parsingType3Font) { |
| 30699 |
warn(`Font "${fontName}" is not available.`); |
| 30700 |
return errorFont(); |
| 30701 |
} |
| 30702 |
warn(`Font "${fontName}" is not available -- attempting to fallback to a default font.`); |
| 30703 |
font = fallbackFontDict || PartialEvaluator.fallbackFontDict; |
| 30704 |
} |
| 30705 |
if (font.cacheKey && this.fontCache.has(font.cacheKey)) { |
| 30706 |
return this.fontCache.get(font.cacheKey); |
| 30707 |
} |
| 30708 |
const { |
| 30709 |
promise, |
| 30710 |
resolve |
| 30711 |
} = Promise.withResolvers(); |
| 30712 |
let preEvaluatedFont; |
| 30713 |
try { |
| 30714 |
preEvaluatedFont = this.preEvaluateFont(font); |
| 30715 |
preEvaluatedFont.cssFontInfo = cssFontInfo; |
| 30716 |
} catch (reason) { |
| 30717 |
warn(`loadFont - preEvaluateFont failed: "${reason}".`); |
| 30718 |
return errorFont(); |
| 30719 |
} |
| 30720 |
const { |
| 30721 |
descriptor, |
| 30722 |
hash |
| 30723 |
} = preEvaluatedFont; |
| 30724 |
const fontRefIsRef = fontRef instanceof Ref; |
| 30725 |
let fontID; |
| 30726 |
if (hash && descriptor instanceof Dict) { |
| 30727 |
const fontAliases = descriptor.fontAliases ||= Object.create(null); |
| 30728 |
if (fontAliases[hash]) { |
| 30729 |
const aliasFontRef = fontAliases[hash].aliasRef; |
| 30730 |
if (fontRefIsRef && aliasFontRef && this.fontCache.has(aliasFontRef)) { |
| 30731 |
this.fontCache.putAlias(fontRef, aliasFontRef); |
| 30732 |
return this.fontCache.get(fontRef); |
| 30733 |
} |
| 30734 |
} else { |
| 30735 |
fontAliases[hash] = { |
| 30736 |
fontID: this.idFactory.createFontId() |
| 30737 |
}; |
| 30738 |
} |
| 30739 |
if (fontRefIsRef) { |
| 30740 |
fontAliases[hash].aliasRef = fontRef; |
| 30741 |
} |
| 30742 |
fontID = fontAliases[hash].fontID; |
| 30743 |
} else { |
| 30744 |
fontID = this.idFactory.createFontId(); |
| 30745 |
} |
| 30746 |
assert(fontID?.startsWith("f"), 'The "fontID" must be (correctly) defined.'); |
| 30747 |
if (fontRefIsRef) { |
| 30748 |
this.fontCache.put(fontRef, promise); |
| 30749 |
} else { |
| 30750 |
font.cacheKey = `cacheKey_${fontID}`; |
| 30751 |
this.fontCache.put(font.cacheKey, promise); |
| 30752 |
} |
| 30753 |
font.loadedName = `${this.idFactory.getDocId()}_${fontID}`; |
| 30754 |
this.translateFont(preEvaluatedFont).then(translatedFont => { |
| 30755 |
resolve(new TranslatedFont({ |
| 30756 |
loadedName: font.loadedName, |
| 30757 |
font: translatedFont, |
| 30758 |
dict: font, |
| 30759 |
evaluatorOptions: this.options |
| 30760 |
})); |
| 30761 |
}).catch(reason => { |
| 30762 |
warn(`loadFont - translateFont failed: "${reason}".`); |
| 30763 |
resolve(new TranslatedFont({ |
| 30764 |
loadedName: font.loadedName, |
| 30765 |
font: new ErrorFont(reason instanceof Error ? reason.message : reason), |
| 30766 |
dict: font, |
| 30767 |
evaluatorOptions: this.options |
| 30768 |
})); |
| 30769 |
}); |
| 30770 |
return promise; |
| 30771 |
} |
| 30772 |
buildPath(operatorList, fn, args, parsingText = false) { |
| 30773 |
const lastIndex = operatorList.length - 1; |
| 30774 |
if (!args) { |
| 30775 |
args = []; |
| 30776 |
} |
| 30777 |
if (lastIndex < 0 || operatorList.fnArray[lastIndex] !== OPS.constructPath) { |
| 30778 |
if (parsingText) { |
| 30779 |
warn(`Encountered path operator "${fn}" inside of a text object.`); |
| 30780 |
operatorList.addOp(OPS.save, null); |
| 30781 |
} |
| 30782 |
let minMax; |
| 30783 |
switch (fn) { |
| 30784 |
case OPS.rectangle: |
| 30785 |
const x = args[0] + args[2]; |
| 30786 |
const y = args[1] + args[3]; |
| 30787 |
minMax = [Math.min(args[0], x), Math.min(args[1], y), Math.max(args[0], x), Math.max(args[1], y)]; |
| 30788 |
break; |
| 30789 |
case OPS.moveTo: |
| 30790 |
case OPS.lineTo: |
| 30791 |
minMax = [args[0], args[1], args[0], args[1]]; |
| 30792 |
break; |
| 30793 |
default: |
| 30794 |
minMax = [Infinity, Infinity, -Infinity, -Infinity]; |
| 30795 |
break; |
| 30796 |
} |
| 30797 |
operatorList.addOp(OPS.constructPath, [[fn], args, minMax]); |
| 30798 |
if (parsingText) { |
| 30799 |
operatorList.addOp(OPS.restore, null); |
| 30800 |
} |
| 30801 |
} else { |
| 30802 |
const opArgs = operatorList.argsArray[lastIndex]; |
| 30803 |
opArgs[0].push(fn); |
| 30804 |
opArgs[1].push(...args); |
| 30805 |
const minMax = opArgs[2]; |
| 30806 |
switch (fn) { |
| 30807 |
case OPS.rectangle: |
| 30808 |
const x = args[0] + args[2]; |
| 30809 |
const y = args[1] + args[3]; |
| 30810 |
minMax[0] = Math.min(minMax[0], args[0], x); |
| 30811 |
minMax[1] = Math.min(minMax[1], args[1], y); |
| 30812 |
minMax[2] = Math.max(minMax[2], args[0], x); |
| 30813 |
minMax[3] = Math.max(minMax[3], args[1], y); |
| 30814 |
break; |
| 30815 |
case OPS.moveTo: |
| 30816 |
case OPS.lineTo: |
| 30817 |
minMax[0] = Math.min(minMax[0], args[0]); |
| 30818 |
minMax[1] = Math.min(minMax[1], args[1]); |
| 30819 |
minMax[2] = Math.max(minMax[2], args[0]); |
| 30820 |
minMax[3] = Math.max(minMax[3], args[1]); |
| 30821 |
break; |
| 30822 |
} |
| 30823 |
} |
| 30824 |
} |
| 30825 |
parseColorSpace({ |
| 30826 |
cs, |
| 30827 |
resources, |
| 30828 |
localColorSpaceCache |
| 30829 |
}) { |
| 30830 |
return ColorSpace.parseAsync({ |
| 30831 |
cs, |
| 30832 |
xref: this.xref, |
| 30833 |
resources, |
| 30834 |
pdfFunctionFactory: this._pdfFunctionFactory, |
| 30835 |
localColorSpaceCache |
| 30836 |
}).catch(reason => { |
| 30837 |
if (reason instanceof AbortException) { |
| 30838 |
return null; |
| 30839 |
} |
| 30840 |
if (this.options.ignoreErrors) { |
| 30841 |
warn(`parseColorSpace - ignoring ColorSpace: "${reason}".`); |
| 30842 |
return null; |
| 30843 |
} |
| 30844 |
throw reason; |
| 30845 |
}); |
| 30846 |
} |
| 30847 |
parseShading({ |
| 30848 |
shading, |
| 30849 |
resources, |
| 30850 |
localColorSpaceCache, |
| 30851 |
localShadingPatternCache |
| 30852 |
}) { |
| 30853 |
let id = localShadingPatternCache.get(shading); |
| 30854 |
if (id) { |
| 30855 |
return id; |
| 30856 |
} |
| 30857 |
let patternIR; |
| 30858 |
try { |
| 30859 |
const shadingFill = Pattern.parseShading(shading, this.xref, resources, this._pdfFunctionFactory, localColorSpaceCache); |
| 30860 |
patternIR = shadingFill.getIR(); |
| 30861 |
} catch (reason) { |
| 30862 |
if (reason instanceof AbortException) { |
| 30863 |
return null; |
| 30864 |
} |
| 30865 |
if (this.options.ignoreErrors) { |
| 30866 |
warn(`parseShading - ignoring shading: "${reason}".`); |
| 30867 |
localShadingPatternCache.set(shading, null); |
| 30868 |
return null; |
| 30869 |
} |
| 30870 |
throw reason; |
| 30871 |
} |
| 30872 |
id = `pattern_${this.idFactory.createObjId()}`; |
| 30873 |
if (this.parsingType3Font) { |
| 30874 |
id = `${this.idFactory.getDocId()}_type3_${id}`; |
| 30875 |
} |
| 30876 |
localShadingPatternCache.set(shading, id); |
| 30877 |
if (this.parsingType3Font) { |
| 30878 |
this.handler.send("commonobj", [id, "Pattern", patternIR]); |
| 30879 |
} else { |
| 30880 |
this.handler.send("obj", [id, this.pageIndex, "Pattern", patternIR]); |
| 30881 |
} |
| 30882 |
return id; |
| 30883 |
} |
| 30884 |
handleColorN(operatorList, fn, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache) { |
| 30885 |
const patternName = args.pop(); |
| 30886 |
if (patternName instanceof Name) { |
| 30887 |
const rawPattern = patterns.getRaw(patternName.name); |
| 30888 |
const localTilingPattern = rawPattern instanceof Ref && localTilingPatternCache.getByRef(rawPattern); |
| 30889 |
if (localTilingPattern) { |
| 30890 |
try { |
| 30891 |
const color = cs.base ? cs.base.getRgb(args, 0) : null; |
| 30892 |
const tilingPatternIR = getTilingPatternIR(localTilingPattern.operatorListIR, localTilingPattern.dict, color); |
| 30893 |
operatorList.addOp(fn, tilingPatternIR); |
| 30894 |
return undefined; |
| 30895 |
} catch {} |
| 30896 |
} |
| 30897 |
const pattern = this.xref.fetchIfRef(rawPattern); |
| 30898 |
if (pattern) { |
| 30899 |
const dict = pattern instanceof BaseStream ? pattern.dict : pattern; |
| 30900 |
const typeNum = dict.get("PatternType"); |
| 30901 |
if (typeNum === PatternType.TILING) { |
| 30902 |
const color = cs.base ? cs.base.getRgb(args, 0) : null; |
| 30903 |
return this.handleTilingType(fn, color, resources, pattern, dict, operatorList, task, localTilingPatternCache); |
| 30904 |
} else if (typeNum === PatternType.SHADING) { |
| 30905 |
const shading = dict.get("Shading"); |
| 30906 |
const objId = this.parseShading({ |
| 30907 |
shading, |
| 30908 |
resources, |
| 30909 |
localColorSpaceCache, |
| 30910 |
localShadingPatternCache |
| 30911 |
}); |
| 30912 |
if (objId) { |
| 30913 |
const matrix = lookupMatrix(dict.getArray("Matrix"), null); |
| 30914 |
operatorList.addOp(fn, ["Shading", objId, matrix]); |
| 30915 |
} |
| 30916 |
return undefined; |
| 30917 |
} |
| 30918 |
throw new FormatError(`Unknown PatternType: ${typeNum}`); |
| 30919 |
} |
| 30920 |
} |
| 30921 |
throw new FormatError(`Unknown PatternName: ${patternName}`); |
| 30922 |
} |
| 30923 |
_parseVisibilityExpression(array, nestingCounter, currentResult) { |
| 30924 |
const MAX_NESTING = 10; |
| 30925 |
if (++nestingCounter > MAX_NESTING) { |
| 30926 |
warn("Visibility expression is too deeply nested"); |
| 30927 |
return; |
| 30928 |
} |
| 30929 |
const length = array.length; |
| 30930 |
const operator = this.xref.fetchIfRef(array[0]); |
| 30931 |
if (length < 2 || !(operator instanceof Name)) { |
| 30932 |
warn("Invalid visibility expression"); |
| 30933 |
return; |
| 30934 |
} |
| 30935 |
switch (operator.name) { |
| 30936 |
case "And": |
| 30937 |
case "Or": |
| 30938 |
case "Not": |
| 30939 |
currentResult.push(operator.name); |
| 30940 |
break; |
| 30941 |
default: |
| 30942 |
warn(`Invalid operator ${operator.name} in visibility expression`); |
| 30943 |
return; |
| 30944 |
} |
| 30945 |
for (let i = 1; i < length; i++) { |
| 30946 |
const raw = array[i]; |
| 30947 |
const object = this.xref.fetchIfRef(raw); |
| 30948 |
if (Array.isArray(object)) { |
| 30949 |
const nestedResult = []; |
| 30950 |
currentResult.push(nestedResult); |
| 30951 |
this._parseVisibilityExpression(object, nestingCounter, nestedResult); |
| 30952 |
} else if (raw instanceof Ref) { |
| 30953 |
currentResult.push(raw.toString()); |
| 30954 |
} |
| 30955 |
} |
| 30956 |
} |
| 30957 |
async parseMarkedContentProps(contentProperties, resources) { |
| 30958 |
let optionalContent; |
| 30959 |
if (contentProperties instanceof Name) { |
| 30960 |
const properties = resources.get("Properties"); |
| 30961 |
optionalContent = properties.get(contentProperties.name); |
| 30962 |
} else if (contentProperties instanceof Dict) { |
| 30963 |
optionalContent = contentProperties; |
| 30964 |
} else { |
| 30965 |
throw new FormatError("Optional content properties malformed."); |
| 30966 |
} |
| 30967 |
const optionalContentType = optionalContent.get("Type")?.name; |
| 30968 |
if (optionalContentType === "OCG") { |
| 30969 |
return { |
| 30970 |
type: optionalContentType, |
| 30971 |
id: optionalContent.objId |
| 30972 |
}; |
| 30973 |
} else if (optionalContentType === "OCMD") { |
| 30974 |
const expression = optionalContent.get("VE"); |
| 30975 |
if (Array.isArray(expression)) { |
| 30976 |
const result = []; |
| 30977 |
this._parseVisibilityExpression(expression, 0, result); |
| 30978 |
if (result.length > 0) { |
| 30979 |
return { |
| 30980 |
type: "OCMD", |
| 30981 |
expression: result |
| 30982 |
}; |
| 30983 |
} |
| 30984 |
} |
| 30985 |
const optionalContentGroups = optionalContent.get("OCGs"); |
| 30986 |
if (Array.isArray(optionalContentGroups) || optionalContentGroups instanceof Dict) { |
| 30987 |
const groupIds = []; |
| 30988 |
if (Array.isArray(optionalContentGroups)) { |
| 30989 |
for (const ocg of optionalContentGroups) { |
| 30990 |
groupIds.push(ocg.toString()); |
| 30991 |
} |
| 30992 |
} else { |
| 30993 |
groupIds.push(optionalContentGroups.objId); |
| 30994 |
} |
| 30995 |
return { |
| 30996 |
type: optionalContentType, |
| 30997 |
ids: groupIds, |
| 30998 |
policy: optionalContent.get("P") instanceof Name ? optionalContent.get("P").name : null, |
| 30999 |
expression: null |
| 31000 |
}; |
| 31001 |
} else if (optionalContentGroups instanceof Ref) { |
| 31002 |
return { |
| 31003 |
type: optionalContentType, |
| 31004 |
id: optionalContentGroups.toString() |
| 31005 |
}; |
| 31006 |
} |
| 31007 |
} |
| 31008 |
return null; |
| 31009 |
} |
| 31010 |
getOperatorList({ |
| 31011 |
stream, |
| 31012 |
task, |
| 31013 |
resources, |
| 31014 |
operatorList, |
| 31015 |
initialState = null, |
| 31016 |
fallbackFontDict = null |
| 31017 |
}) { |
| 31018 |
resources ||= Dict.empty; |
| 31019 |
initialState ||= new EvalState(); |
| 31020 |
if (!operatorList) { |
| 31021 |
throw new Error('getOperatorList: missing "operatorList" parameter'); |
| 31022 |
} |
| 31023 |
const self = this; |
| 31024 |
const xref = this.xref; |
| 31025 |
let parsingText = false; |
| 31026 |
const localImageCache = new LocalImageCache(); |
| 31027 |
const localColorSpaceCache = new LocalColorSpaceCache(); |
| 31028 |
const localGStateCache = new LocalGStateCache(); |
| 31029 |
const localTilingPatternCache = new LocalTilingPatternCache(); |
| 31030 |
const localShadingPatternCache = new Map(); |
| 31031 |
const xobjs = resources.get("XObject") || Dict.empty; |
| 31032 |
const patterns = resources.get("Pattern") || Dict.empty; |
| 31033 |
const stateManager = new StateManager(initialState); |
| 31034 |
const preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); |
| 31035 |
const timeSlotManager = new TimeSlotManager(); |
| 31036 |
function closePendingRestoreOPS(argument) { |
| 31037 |
for (let i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) { |
| 31038 |
operatorList.addOp(OPS.restore, []); |
| 31039 |
} |
| 31040 |
} |
| 31041 |
return new Promise(function promiseBody(resolve, reject) { |
| 31042 |
const next = function (promise) { |
| 31043 |
Promise.all([promise, operatorList.ready]).then(function () { |
| 31044 |
try { |
| 31045 |
promiseBody(resolve, reject); |
| 31046 |
} catch (ex) { |
| 31047 |
reject(ex); |
| 31048 |
} |
| 31049 |
}, reject); |
| 31050 |
}; |
| 31051 |
task.ensureNotTerminated(); |
| 31052 |
timeSlotManager.reset(); |
| 31053 |
const operation = {}; |
| 31054 |
let stop, i, ii, cs, name, isValidName; |
| 31055 |
while (!(stop = timeSlotManager.check())) { |
| 31056 |
operation.args = null; |
| 31057 |
if (!preprocessor.read(operation)) { |
| 31058 |
break; |
| 31059 |
} |
| 31060 |
let args = operation.args; |
| 31061 |
let fn = operation.fn; |
| 31062 |
switch (fn | 0) { |
| 31063 |
case OPS.paintXObject: |
| 31064 |
isValidName = args[0] instanceof Name; |
| 31065 |
name = args[0].name; |
| 31066 |
if (isValidName) { |
| 31067 |
const localImage = localImageCache.getByName(name); |
| 31068 |
if (localImage) { |
| 31069 |
addLocallyCachedImageOps(operatorList, localImage); |
| 31070 |
args = null; |
| 31071 |
continue; |
| 31072 |
} |
| 31073 |
} |
| 31074 |
next(new Promise(function (resolveXObject, rejectXObject) { |
| 31075 |
if (!isValidName) { |
| 31076 |
throw new FormatError("XObject must be referred to by name."); |
| 31077 |
} |
| 31078 |
let xobj = xobjs.getRaw(name); |
| 31079 |
if (xobj instanceof Ref) { |
| 31080 |
const localImage = localImageCache.getByRef(xobj) || self._regionalImageCache.getByRef(xobj); |
| 31081 |
if (localImage) { |
| 31082 |
addLocallyCachedImageOps(operatorList, localImage); |
| 31083 |
resolveXObject(); |
| 31084 |
return; |
| 31085 |
} |
| 31086 |
const globalImage = self.globalImageCache.getData(xobj, self.pageIndex); |
| 31087 |
if (globalImage) { |
| 31088 |
operatorList.addDependency(globalImage.objId); |
| 31089 |
operatorList.addImageOps(globalImage.fn, globalImage.args, globalImage.optionalContent); |
| 31090 |
resolveXObject(); |
| 31091 |
return; |
| 31092 |
} |
| 31093 |
xobj = xref.fetch(xobj); |
| 31094 |
} |
| 31095 |
if (!(xobj instanceof BaseStream)) { |
| 31096 |
throw new FormatError("XObject should be a stream"); |
| 31097 |
} |
| 31098 |
const type = xobj.dict.get("Subtype"); |
| 31099 |
if (!(type instanceof Name)) { |
| 31100 |
throw new FormatError("XObject should have a Name subtype"); |
| 31101 |
} |
| 31102 |
if (type.name === "Form") { |
| 31103 |
stateManager.save(); |
| 31104 |
self.buildFormXObject(resources, xobj, null, operatorList, task, stateManager.state.clone(), localColorSpaceCache).then(function () { |
| 31105 |
stateManager.restore(); |
| 31106 |
resolveXObject(); |
| 31107 |
}, rejectXObject); |
| 31108 |
return; |
| 31109 |
} else if (type.name === "Image") { |
| 31110 |
self.buildPaintImageXObject({ |
| 31111 |
resources, |
| 31112 |
image: xobj, |
| 31113 |
operatorList, |
| 31114 |
cacheKey: name, |
| 31115 |
localImageCache, |
| 31116 |
localColorSpaceCache |
| 31117 |
}).then(resolveXObject, rejectXObject); |
| 31118 |
return; |
| 31119 |
} else if (type.name === "PS") { |
| 31120 |
info("Ignored XObject subtype PS"); |
| 31121 |
} else { |
| 31122 |
throw new FormatError(`Unhandled XObject subtype ${type.name}`); |
| 31123 |
} |
| 31124 |
resolveXObject(); |
| 31125 |
}).catch(function (reason) { |
| 31126 |
if (reason instanceof AbortException) { |
| 31127 |
return; |
| 31128 |
} |
| 31129 |
if (self.options.ignoreErrors) { |
| 31130 |
warn(`getOperatorList - ignoring XObject: "${reason}".`); |
| 31131 |
return; |
| 31132 |
} |
| 31133 |
throw reason; |
| 31134 |
})); |
| 31135 |
return; |
| 31136 |
case OPS.setFont: |
| 31137 |
var fontSize = args[1]; |
| 31138 |
next(self.handleSetFont(resources, args, null, operatorList, task, stateManager.state, fallbackFontDict).then(function (loadedName) { |
| 31139 |
operatorList.addDependency(loadedName); |
| 31140 |
operatorList.addOp(OPS.setFont, [loadedName, fontSize]); |
| 31141 |
})); |
| 31142 |
return; |
| 31143 |
case OPS.beginText: |
| 31144 |
parsingText = true; |
| 31145 |
break; |
| 31146 |
case OPS.endText: |
| 31147 |
parsingText = false; |
| 31148 |
break; |
| 31149 |
case OPS.endInlineImage: |
| 31150 |
var cacheKey = args[0].cacheKey; |
| 31151 |
if (cacheKey) { |
| 31152 |
const localImage = localImageCache.getByName(cacheKey); |
| 31153 |
if (localImage) { |
| 31154 |
addLocallyCachedImageOps(operatorList, localImage); |
| 31155 |
args = null; |
| 31156 |
continue; |
| 31157 |
} |
| 31158 |
} |
| 31159 |
next(self.buildPaintImageXObject({ |
| 31160 |
resources, |
| 31161 |
image: args[0], |
| 31162 |
isInline: true, |
| 31163 |
operatorList, |
| 31164 |
cacheKey, |
| 31165 |
localImageCache, |
| 31166 |
localColorSpaceCache |
| 31167 |
})); |
| 31168 |
return; |
| 31169 |
case OPS.showText: |
| 31170 |
if (!stateManager.state.font) { |
| 31171 |
self.ensureStateFont(stateManager.state); |
| 31172 |
continue; |
| 31173 |
} |
| 31174 |
args[0] = self.handleText(args[0], stateManager.state); |
| 31175 |
break; |
| 31176 |
case OPS.showSpacedText: |
| 31177 |
if (!stateManager.state.font) { |
| 31178 |
self.ensureStateFont(stateManager.state); |
| 31179 |
continue; |
| 31180 |
} |
| 31181 |
var combinedGlyphs = []; |
| 31182 |
var state = stateManager.state; |
| 31183 |
for (const arrItem of args[0]) { |
| 31184 |
if (typeof arrItem === "string") { |
| 31185 |
combinedGlyphs.push(...self.handleText(arrItem, state)); |
| 31186 |
} else if (typeof arrItem === "number") { |
| 31187 |
combinedGlyphs.push(arrItem); |
| 31188 |
} |
| 31189 |
} |
| 31190 |
args[0] = combinedGlyphs; |
| 31191 |
fn = OPS.showText; |
| 31192 |
break; |
| 31193 |
case OPS.nextLineShowText: |
| 31194 |
if (!stateManager.state.font) { |
| 31195 |
self.ensureStateFont(stateManager.state); |
| 31196 |
continue; |
| 31197 |
} |
| 31198 |
operatorList.addOp(OPS.nextLine); |
| 31199 |
args[0] = self.handleText(args[0], stateManager.state); |
| 31200 |
fn = OPS.showText; |
| 31201 |
break; |
| 31202 |
case OPS.nextLineSetSpacingShowText: |
| 31203 |
if (!stateManager.state.font) { |
| 31204 |
self.ensureStateFont(stateManager.state); |
| 31205 |
continue; |
| 31206 |
} |
| 31207 |
operatorList.addOp(OPS.nextLine); |
| 31208 |
operatorList.addOp(OPS.setWordSpacing, [args.shift()]); |
| 31209 |
operatorList.addOp(OPS.setCharSpacing, [args.shift()]); |
| 31210 |
args[0] = self.handleText(args[0], stateManager.state); |
| 31211 |
fn = OPS.showText; |
| 31212 |
break; |
| 31213 |
case OPS.setTextRenderingMode: |
| 31214 |
stateManager.state.textRenderingMode = args[0]; |
| 31215 |
break; |
| 31216 |
case OPS.setFillColorSpace: |
| 31217 |
{ |
| 31218 |
const cachedColorSpace = ColorSpace.getCached(args[0], xref, localColorSpaceCache); |
| 31219 |
if (cachedColorSpace) { |
| 31220 |
stateManager.state.fillColorSpace = cachedColorSpace; |
| 31221 |
continue; |
| 31222 |
} |
| 31223 |
next(self.parseColorSpace({ |
| 31224 |
cs: args[0], |
| 31225 |
resources, |
| 31226 |
localColorSpaceCache |
| 31227 |
}).then(function (colorSpace) { |
| 31228 |
stateManager.state.fillColorSpace = colorSpace || ColorSpace.singletons.gray; |
| 31229 |
})); |
| 31230 |
return; |
| 31231 |
} |
| 31232 |
case OPS.setStrokeColorSpace: |
| 31233 |
{ |
| 31234 |
const cachedColorSpace = ColorSpace.getCached(args[0], xref, localColorSpaceCache); |
| 31235 |
if (cachedColorSpace) { |
| 31236 |
stateManager.state.strokeColorSpace = cachedColorSpace; |
| 31237 |
continue; |
| 31238 |
} |
| 31239 |
next(self.parseColorSpace({ |
| 31240 |
cs: args[0], |
| 31241 |
resources, |
| 31242 |
localColorSpaceCache |
| 31243 |
}).then(function (colorSpace) { |
| 31244 |
stateManager.state.strokeColorSpace = colorSpace || ColorSpace.singletons.gray; |
| 31245 |
})); |
| 31246 |
return; |
| 31247 |
} |
| 31248 |
case OPS.setFillColor: |
| 31249 |
cs = stateManager.state.fillColorSpace; |
| 31250 |
args = cs.getRgb(args, 0); |
| 31251 |
fn = OPS.setFillRGBColor; |
| 31252 |
break; |
| 31253 |
case OPS.setStrokeColor: |
| 31254 |
cs = stateManager.state.strokeColorSpace; |
| 31255 |
args = cs.getRgb(args, 0); |
| 31256 |
fn = OPS.setStrokeRGBColor; |
| 31257 |
break; |
| 31258 |
case OPS.setFillGray: |
| 31259 |
stateManager.state.fillColorSpace = ColorSpace.singletons.gray; |
| 31260 |
args = ColorSpace.singletons.gray.getRgb(args, 0); |
| 31261 |
fn = OPS.setFillRGBColor; |
| 31262 |
break; |
| 31263 |
case OPS.setStrokeGray: |
| 31264 |
stateManager.state.strokeColorSpace = ColorSpace.singletons.gray; |
| 31265 |
args = ColorSpace.singletons.gray.getRgb(args, 0); |
| 31266 |
fn = OPS.setStrokeRGBColor; |
| 31267 |
break; |
| 31268 |
case OPS.setFillCMYKColor: |
| 31269 |
stateManager.state.fillColorSpace = ColorSpace.singletons.cmyk; |
| 31270 |
args = ColorSpace.singletons.cmyk.getRgb(args, 0); |
| 31271 |
fn = OPS.setFillRGBColor; |
| 31272 |
break; |
| 31273 |
case OPS.setStrokeCMYKColor: |
| 31274 |
stateManager.state.strokeColorSpace = ColorSpace.singletons.cmyk; |
| 31275 |
args = ColorSpace.singletons.cmyk.getRgb(args, 0); |
| 31276 |
fn = OPS.setStrokeRGBColor; |
| 31277 |
break; |
| 31278 |
case OPS.setFillRGBColor: |
| 31279 |
stateManager.state.fillColorSpace = ColorSpace.singletons.rgb; |
| 31280 |
args = ColorSpace.singletons.rgb.getRgb(args, 0); |
| 31281 |
break; |
| 31282 |
case OPS.setStrokeRGBColor: |
| 31283 |
stateManager.state.strokeColorSpace = ColorSpace.singletons.rgb; |
| 31284 |
args = ColorSpace.singletons.rgb.getRgb(args, 0); |
| 31285 |
break; |
| 31286 |
case OPS.setFillColorN: |
| 31287 |
cs = stateManager.state.patternFillColorSpace; |
| 31288 |
if (!cs) { |
| 31289 |
args = []; |
| 31290 |
fn = OPS.setFillTransparent; |
| 31291 |
break; |
| 31292 |
} |
| 31293 |
if (cs.name === "Pattern") { |
| 31294 |
next(self.handleColorN(operatorList, OPS.setFillColorN, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache)); |
| 31295 |
return; |
| 31296 |
} |
| 31297 |
args = cs.getRgb(args, 0); |
| 31298 |
fn = OPS.setFillRGBColor; |
| 31299 |
break; |
| 31300 |
case OPS.setStrokeColorN: |
| 31301 |
cs = stateManager.state.patternStrokeColorSpace; |
| 31302 |
if (!cs) { |
| 31303 |
args = []; |
| 31304 |
fn = OPS.setStrokeTransparent; |
| 31305 |
break; |
| 31306 |
} |
| 31307 |
if (cs.name === "Pattern") { |
| 31308 |
next(self.handleColorN(operatorList, OPS.setStrokeColorN, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache)); |
| 31309 |
return; |
| 31310 |
} |
| 31311 |
args = cs.getRgb(args, 0); |
| 31312 |
fn = OPS.setStrokeRGBColor; |
| 31313 |
break; |
| 31314 |
case OPS.shadingFill: |
| 31315 |
let shading; |
| 31316 |
try { |
| 31317 |
const shadingRes = resources.get("Shading"); |
| 31318 |
if (!shadingRes) { |
| 31319 |
throw new FormatError("No shading resource found"); |
| 31320 |
} |
| 31321 |
shading = shadingRes.get(args[0].name); |
| 31322 |
if (!shading) { |
| 31323 |
throw new FormatError("No shading object found"); |
| 31324 |
} |
| 31325 |
} catch (reason) { |
| 31326 |
if (reason instanceof AbortException) { |
| 31327 |
continue; |
| 31328 |
} |
| 31329 |
if (self.options.ignoreErrors) { |
| 31330 |
warn(`getOperatorList - ignoring Shading: "${reason}".`); |
| 31331 |
continue; |
| 31332 |
} |
| 31333 |
throw reason; |
| 31334 |
} |
| 31335 |
const patternId = self.parseShading({ |
| 31336 |
shading, |
| 31337 |
resources, |
| 31338 |
localColorSpaceCache, |
| 31339 |
localShadingPatternCache |
| 31340 |
}); |
| 31341 |
if (!patternId) { |
| 31342 |
continue; |
| 31343 |
} |
| 31344 |
args = [patternId]; |
| 31345 |
fn = OPS.shadingFill; |
| 31346 |
break; |
| 31347 |
case OPS.setGState: |
| 31348 |
isValidName = args[0] instanceof Name; |
| 31349 |
name = args[0].name; |
| 31350 |
if (isValidName) { |
| 31351 |
const localGStateObj = localGStateCache.getByName(name); |
| 31352 |
if (localGStateObj) { |
| 31353 |
if (localGStateObj.length > 0) { |
| 31354 |
operatorList.addOp(OPS.setGState, [localGStateObj]); |
| 31355 |
} |
| 31356 |
args = null; |
| 31357 |
continue; |
| 31358 |
} |
| 31359 |
} |
| 31360 |
next(new Promise(function (resolveGState, rejectGState) { |
| 31361 |
if (!isValidName) { |
| 31362 |
throw new FormatError("GState must be referred to by name."); |
| 31363 |
} |
| 31364 |
const extGState = resources.get("ExtGState"); |
| 31365 |
if (!(extGState instanceof Dict)) { |
| 31366 |
throw new FormatError("ExtGState should be a dictionary."); |
| 31367 |
} |
| 31368 |
const gState = extGState.get(name); |
| 31369 |
if (!(gState instanceof Dict)) { |
| 31370 |
throw new FormatError("GState should be a dictionary."); |
| 31371 |
} |
| 31372 |
self.setGState({ |
| 31373 |
resources, |
| 31374 |
gState, |
| 31375 |
operatorList, |
| 31376 |
cacheKey: name, |
| 31377 |
task, |
| 31378 |
stateManager, |
| 31379 |
localGStateCache, |
| 31380 |
localColorSpaceCache |
| 31381 |
}).then(resolveGState, rejectGState); |
| 31382 |
}).catch(function (reason) { |
| 31383 |
if (reason instanceof AbortException) { |
| 31384 |
return; |
| 31385 |
} |
| 31386 |
if (self.options.ignoreErrors) { |
| 31387 |
warn(`getOperatorList - ignoring ExtGState: "${reason}".`); |
| 31388 |
return; |
| 31389 |
} |
| 31390 |
throw reason; |
| 31391 |
})); |
| 31392 |
return; |
| 31393 |
case OPS.moveTo: |
| 31394 |
case OPS.lineTo: |
| 31395 |
case OPS.curveTo: |
| 31396 |
case OPS.curveTo2: |
| 31397 |
case OPS.curveTo3: |
| 31398 |
case OPS.closePath: |
| 31399 |
case OPS.rectangle: |
| 31400 |
self.buildPath(operatorList, fn, args, parsingText); |
| 31401 |
continue; |
| 31402 |
case OPS.markPoint: |
| 31403 |
case OPS.markPointProps: |
| 31404 |
case OPS.beginCompat: |
| 31405 |
case OPS.endCompat: |
| 31406 |
continue; |
| 31407 |
case OPS.beginMarkedContentProps: |
| 31408 |
if (!(args[0] instanceof Name)) { |
| 31409 |
warn(`Expected name for beginMarkedContentProps arg0=${args[0]}`); |
| 31410 |
operatorList.addOp(OPS.beginMarkedContentProps, ["OC", null]); |
| 31411 |
continue; |
| 31412 |
} |
| 31413 |
if (args[0].name === "OC") { |
| 31414 |
next(self.parseMarkedContentProps(args[1], resources).then(data => { |
| 31415 |
operatorList.addOp(OPS.beginMarkedContentProps, ["OC", data]); |
| 31416 |
}).catch(reason => { |
| 31417 |
if (reason instanceof AbortException) { |
| 31418 |
return; |
| 31419 |
} |
| 31420 |
if (self.options.ignoreErrors) { |
| 31421 |
warn(`getOperatorList - ignoring beginMarkedContentProps: "${reason}".`); |
| 31422 |
operatorList.addOp(OPS.beginMarkedContentProps, ["OC", null]); |
| 31423 |
return; |
| 31424 |
} |
| 31425 |
throw reason; |
| 31426 |
})); |
| 31427 |
return; |
| 31428 |
} |
| 31429 |
args = [args[0].name, args[1] instanceof Dict ? args[1].get("MCID") : null]; |
| 31430 |
break; |
| 31431 |
case OPS.beginMarkedContent: |
| 31432 |
case OPS.endMarkedContent: |
| 31433 |
default: |
| 31434 |
if (args !== null) { |
| 31435 |
for (i = 0, ii = args.length; i < ii; i++) { |
| 31436 |
if (args[i] instanceof Dict) { |
| 31437 |
break; |
| 31438 |
} |
| 31439 |
} |
| 31440 |
if (i < ii) { |
| 31441 |
warn("getOperatorList - ignoring operator: " + fn); |
| 31442 |
continue; |
| 31443 |
} |
| 31444 |
} |
| 31445 |
} |
| 31446 |
operatorList.addOp(fn, args); |
| 31447 |
} |
| 31448 |
if (stop) { |
| 31449 |
next(deferred); |
| 31450 |
return; |
| 31451 |
} |
| 31452 |
closePendingRestoreOPS(); |
| 31453 |
resolve(); |
| 31454 |
}).catch(reason => { |
| 31455 |
if (reason instanceof AbortException) { |
| 31456 |
return; |
| 31457 |
} |
| 31458 |
if (this.options.ignoreErrors) { |
| 31459 |
warn(`getOperatorList - ignoring errors during "${task.name}" ` + `task: "${reason}".`); |
| 31460 |
closePendingRestoreOPS(); |
| 31461 |
return; |
| 31462 |
} |
| 31463 |
throw reason; |
| 31464 |
}); |
| 31465 |
} |
| 31466 |
getTextContent({ |
| 31467 |
stream, |
| 31468 |
task, |
| 31469 |
resources, |
| 31470 |
stateManager = null, |
| 31471 |
includeMarkedContent = false, |
| 31472 |
sink, |
| 31473 |
seenStyles = new Set(), |
| 31474 |
viewBox, |
| 31475 |
lang = null, |
| 31476 |
markedContentData = null, |
| 31477 |
disableNormalization = false, |
| 31478 |
keepWhiteSpace = false |
| 31479 |
}) { |
| 31480 |
resources ||= Dict.empty; |
| 31481 |
stateManager ||= new StateManager(new TextState()); |
| 31482 |
if (includeMarkedContent) { |
| 31483 |
markedContentData ||= { |
| 31484 |
level: 0 |
| 31485 |
}; |
| 31486 |
} |
| 31487 |
const textContent = { |
| 31488 |
items: [], |
| 31489 |
styles: Object.create(null), |
| 31490 |
lang |
| 31491 |
}; |
| 31492 |
const textContentItem = { |
| 31493 |
initialized: false, |
| 31494 |
str: [], |
| 31495 |
totalWidth: 0, |
| 31496 |
totalHeight: 0, |
| 31497 |
width: 0, |
| 31498 |
height: 0, |
| 31499 |
vertical: false, |
| 31500 |
prevTransform: null, |
| 31501 |
textAdvanceScale: 0, |
| 31502 |
spaceInFlowMin: 0, |
| 31503 |
spaceInFlowMax: 0, |
| 31504 |
trackingSpaceMin: Infinity, |
| 31505 |
negativeSpaceMax: -Infinity, |
| 31506 |
notASpace: -Infinity, |
| 31507 |
transform: null, |
| 31508 |
fontName: null, |
| 31509 |
hasEOL: false |
| 31510 |
}; |
| 31511 |
const twoLastChars = [" ", " "]; |
| 31512 |
let twoLastCharsPos = 0; |
| 31513 |
function saveLastChar(char) { |
| 31514 |
const nextPos = (twoLastCharsPos + 1) % 2; |
| 31515 |
const ret = twoLastChars[twoLastCharsPos] !== " " && twoLastChars[nextPos] === " "; |
| 31516 |
twoLastChars[twoLastCharsPos] = char; |
| 31517 |
twoLastCharsPos = nextPos; |
| 31518 |
return !keepWhiteSpace && ret; |
| 31519 |
} |
| 31520 |
function shouldAddWhitepsace() { |
| 31521 |
return !keepWhiteSpace && twoLastChars[twoLastCharsPos] !== " " && twoLastChars[(twoLastCharsPos + 1) % 2] === " "; |
| 31522 |
} |
| 31523 |
function resetLastChars() { |
| 31524 |
twoLastChars[0] = twoLastChars[1] = " "; |
| 31525 |
twoLastCharsPos = 0; |
| 31526 |
} |
| 31527 |
const TRACKING_SPACE_FACTOR = 0.102; |
| 31528 |
const NOT_A_SPACE_FACTOR = 0.03; |
| 31529 |
const NEGATIVE_SPACE_FACTOR = -0.2; |
| 31530 |
const SPACE_IN_FLOW_MIN_FACTOR = 0.102; |
| 31531 |
const SPACE_IN_FLOW_MAX_FACTOR = 0.6; |
| 31532 |
const VERTICAL_SHIFT_RATIO = 0.25; |
| 31533 |
const self = this; |
| 31534 |
const xref = this.xref; |
| 31535 |
const showSpacedTextBuffer = []; |
| 31536 |
let xobjs = null; |
| 31537 |
const emptyXObjectCache = new LocalImageCache(); |
| 31538 |
const emptyGStateCache = new LocalGStateCache(); |
| 31539 |
const preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); |
| 31540 |
let textState; |
| 31541 |
function pushWhitespace({ |
| 31542 |
width = 0, |
| 31543 |
height = 0, |
| 31544 |
transform = textContentItem.prevTransform, |
| 31545 |
fontName = textContentItem.fontName |
| 31546 |
}) { |
| 31547 |
textContent.items.push({ |
| 31548 |
str: " ", |
| 31549 |
dir: "ltr", |
| 31550 |
width, |
| 31551 |
height, |
| 31552 |
transform, |
| 31553 |
fontName, |
| 31554 |
hasEOL: false |
| 31555 |
}); |
| 31556 |
} |
| 31557 |
function getCurrentTextTransform() { |
| 31558 |
const font = textState.font; |
| 31559 |
const tsm = [textState.fontSize * textState.textHScale, 0, 0, textState.fontSize, 0, textState.textRise]; |
| 31560 |
if (font.isType3Font && (textState.fontSize <= 1 || font.isCharBBox) && !isArrayEqual(textState.fontMatrix, FONT_IDENTITY_MATRIX)) { |
| 31561 |
const glyphHeight = font.bbox[3] - font.bbox[1]; |
| 31562 |
if (glyphHeight > 0) { |
| 31563 |
tsm[3] *= glyphHeight * textState.fontMatrix[3]; |
| 31564 |
} |
| 31565 |
} |
| 31566 |
return Util.transform(textState.ctm, Util.transform(textState.textMatrix, tsm)); |
| 31567 |
} |
| 31568 |
function ensureTextContentItem() { |
| 31569 |
if (textContentItem.initialized) { |
| 31570 |
return textContentItem; |
| 31571 |
} |
| 31572 |
const { |
| 31573 |
font, |
| 31574 |
loadedName |
| 31575 |
} = textState; |
| 31576 |
if (!seenStyles.has(loadedName)) { |
| 31577 |
seenStyles.add(loadedName); |
| 31578 |
textContent.styles[loadedName] = { |
| 31579 |
fontFamily: font.fallbackName, |
| 31580 |
ascent: font.ascent, |
| 31581 |
descent: font.descent, |
| 31582 |
vertical: font.vertical |
| 31583 |
}; |
| 31584 |
if (self.options.fontExtraProperties && font.systemFontInfo) { |
| 31585 |
const style = textContent.styles[loadedName]; |
| 31586 |
style.fontSubstitution = font.systemFontInfo.css; |
| 31587 |
style.fontSubstitutionLoadedName = font.systemFontInfo.loadedName; |
| 31588 |
} |
| 31589 |
} |
| 31590 |
textContentItem.fontName = loadedName; |
| 31591 |
const trm = textContentItem.transform = getCurrentTextTransform(); |
| 31592 |
if (!font.vertical) { |
| 31593 |
textContentItem.width = textContentItem.totalWidth = 0; |
| 31594 |
textContentItem.height = textContentItem.totalHeight = Math.hypot(trm[2], trm[3]); |
| 31595 |
textContentItem.vertical = false; |
| 31596 |
} else { |
| 31597 |
textContentItem.width = textContentItem.totalWidth = Math.hypot(trm[0], trm[1]); |
| 31598 |
textContentItem.height = textContentItem.totalHeight = 0; |
| 31599 |
textContentItem.vertical = true; |
| 31600 |
} |
| 31601 |
const scaleLineX = Math.hypot(textState.textLineMatrix[0], textState.textLineMatrix[1]); |
| 31602 |
const scaleCtmX = Math.hypot(textState.ctm[0], textState.ctm[1]); |
| 31603 |
textContentItem.textAdvanceScale = scaleCtmX * scaleLineX; |
| 31604 |
const { |
| 31605 |
fontSize |
| 31606 |
} = textState; |
| 31607 |
textContentItem.trackingSpaceMin = fontSize * TRACKING_SPACE_FACTOR; |
| 31608 |
textContentItem.notASpace = fontSize * NOT_A_SPACE_FACTOR; |
| 31609 |
textContentItem.negativeSpaceMax = fontSize * NEGATIVE_SPACE_FACTOR; |
| 31610 |
textContentItem.spaceInFlowMin = fontSize * SPACE_IN_FLOW_MIN_FACTOR; |
| 31611 |
textContentItem.spaceInFlowMax = fontSize * SPACE_IN_FLOW_MAX_FACTOR; |
| 31612 |
textContentItem.hasEOL = false; |
| 31613 |
textContentItem.initialized = true; |
| 31614 |
return textContentItem; |
| 31615 |
} |
| 31616 |
function updateAdvanceScale() { |
| 31617 |
if (!textContentItem.initialized) { |
| 31618 |
return; |
| 31619 |
} |
| 31620 |
const scaleLineX = Math.hypot(textState.textLineMatrix[0], textState.textLineMatrix[1]); |
| 31621 |
const scaleCtmX = Math.hypot(textState.ctm[0], textState.ctm[1]); |
| 31622 |
const scaleFactor = scaleCtmX * scaleLineX; |
| 31623 |
if (scaleFactor === textContentItem.textAdvanceScale) { |
| 31624 |
return; |
| 31625 |
} |
| 31626 |
if (!textContentItem.vertical) { |
| 31627 |
textContentItem.totalWidth += textContentItem.width * textContentItem.textAdvanceScale; |
| 31628 |
textContentItem.width = 0; |
| 31629 |
} else { |
| 31630 |
textContentItem.totalHeight += textContentItem.height * textContentItem.textAdvanceScale; |
| 31631 |
textContentItem.height = 0; |
| 31632 |
} |
| 31633 |
textContentItem.textAdvanceScale = scaleFactor; |
| 31634 |
} |
| 31635 |
function runBidiTransform(textChunk) { |
| 31636 |
let text = textChunk.str.join(""); |
| 31637 |
if (!disableNormalization) { |
| 31638 |
text = normalizeUnicode(text); |
| 31639 |
} |
| 31640 |
const bidiResult = bidi(text, -1, textChunk.vertical); |
| 31641 |
return { |
| 31642 |
str: bidiResult.str, |
| 31643 |
dir: bidiResult.dir, |
| 31644 |
width: Math.abs(textChunk.totalWidth), |
| 31645 |
height: Math.abs(textChunk.totalHeight), |
| 31646 |
transform: textChunk.transform, |
| 31647 |
fontName: textChunk.fontName, |
| 31648 |
hasEOL: textChunk.hasEOL |
| 31649 |
}; |
| 31650 |
} |
| 31651 |
async function handleSetFont(fontName, fontRef) { |
| 31652 |
const translated = await self.loadFont(fontName, fontRef, resources); |
| 31653 |
if (translated.font.isType3Font) { |
| 31654 |
try { |
| 31655 |
await translated.loadType3Data(self, resources, task); |
| 31656 |
} catch {} |
| 31657 |
} |
| 31658 |
textState.loadedName = translated.loadedName; |
| 31659 |
textState.font = translated.font; |
| 31660 |
textState.fontMatrix = translated.font.fontMatrix || FONT_IDENTITY_MATRIX; |
| 31661 |
} |
| 31662 |
function applyInverseRotation(x, y, matrix) { |
| 31663 |
const scale = Math.hypot(matrix[0], matrix[1]); |
| 31664 |
return [(matrix[0] * x + matrix[1] * y) / scale, (matrix[2] * x + matrix[3] * y) / scale]; |
| 31665 |
} |
| 31666 |
function compareWithLastPosition(glyphWidth) { |
| 31667 |
const currentTransform = getCurrentTextTransform(); |
| 31668 |
let posX = currentTransform[4]; |
| 31669 |
let posY = currentTransform[5]; |
| 31670 |
if (textState.font?.vertical) { |
| 31671 |
if (posX < viewBox[0] || posX > viewBox[2] || posY + glyphWidth < viewBox[1] || posY > viewBox[3]) { |
| 31672 |
return false; |
| 31673 |
} |
| 31674 |
} else if (posX + glyphWidth < viewBox[0] || posX > viewBox[2] || posY < viewBox[1] || posY > viewBox[3]) { |
| 31675 |
return false; |
| 31676 |
} |
| 31677 |
if (!textState.font || !textContentItem.prevTransform) { |
| 31678 |
return true; |
| 31679 |
} |
| 31680 |
let lastPosX = textContentItem.prevTransform[4]; |
| 31681 |
let lastPosY = textContentItem.prevTransform[5]; |
| 31682 |
if (lastPosX === posX && lastPosY === posY) { |
| 31683 |
return true; |
| 31684 |
} |
| 31685 |
let rotate = -1; |
| 31686 |
if (currentTransform[0] && currentTransform[1] === 0 && currentTransform[2] === 0) { |
| 31687 |
rotate = currentTransform[0] > 0 ? 0 : 180; |
| 31688 |
} else if (currentTransform[1] && currentTransform[0] === 0 && currentTransform[3] === 0) { |
| 31689 |
rotate = currentTransform[1] > 0 ? 90 : 270; |
| 31690 |
} |
| 31691 |
switch (rotate) { |
| 31692 |
case 0: |
| 31693 |
break; |
| 31694 |
case 90: |
| 31695 |
[posX, posY] = [posY, posX]; |
| 31696 |
[lastPosX, lastPosY] = [lastPosY, lastPosX]; |
| 31697 |
break; |
| 31698 |
case 180: |
| 31699 |
[posX, posY, lastPosX, lastPosY] = [-posX, -posY, -lastPosX, -lastPosY]; |
| 31700 |
break; |
| 31701 |
case 270: |
| 31702 |
[posX, posY] = [-posY, -posX]; |
| 31703 |
[lastPosX, lastPosY] = [-lastPosY, -lastPosX]; |
| 31704 |
break; |
| 31705 |
default: |
| 31706 |
[posX, posY] = applyInverseRotation(posX, posY, currentTransform); |
| 31707 |
[lastPosX, lastPosY] = applyInverseRotation(lastPosX, lastPosY, textContentItem.prevTransform); |
| 31708 |
} |
| 31709 |
if (textState.font.vertical) { |
| 31710 |
const advanceY = (lastPosY - posY) / textContentItem.textAdvanceScale; |
| 31711 |
const advanceX = posX - lastPosX; |
| 31712 |
const textOrientation = Math.sign(textContentItem.height); |
| 31713 |
if (advanceY < textOrientation * textContentItem.negativeSpaceMax) { |
| 31714 |
if (Math.abs(advanceX) > 0.5 * textContentItem.width) { |
| 31715 |
appendEOL(); |
| 31716 |
return true; |
| 31717 |
} |
| 31718 |
resetLastChars(); |
| 31719 |
flushTextContentItem(); |
| 31720 |
return true; |
| 31721 |
} |
| 31722 |
if (Math.abs(advanceX) > textContentItem.width) { |
| 31723 |
appendEOL(); |
| 31724 |
return true; |
| 31725 |
} |
| 31726 |
if (advanceY <= textOrientation * textContentItem.notASpace) { |
| 31727 |
resetLastChars(); |
| 31728 |
} |
| 31729 |
if (advanceY <= textOrientation * textContentItem.trackingSpaceMin) { |
| 31730 |
if (shouldAddWhitepsace()) { |
| 31731 |
resetLastChars(); |
| 31732 |
flushTextContentItem(); |
| 31733 |
pushWhitespace({ |
| 31734 |
height: Math.abs(advanceY) |
| 31735 |
}); |
| 31736 |
} else { |
| 31737 |
textContentItem.height += advanceY; |
| 31738 |
} |
| 31739 |
} else if (!addFakeSpaces(advanceY, textContentItem.prevTransform, textOrientation)) { |
| 31740 |
if (textContentItem.str.length === 0) { |
| 31741 |
resetLastChars(); |
| 31742 |
pushWhitespace({ |
| 31743 |
height: Math.abs(advanceY) |
| 31744 |
}); |
| 31745 |
} else { |
| 31746 |
textContentItem.height += advanceY; |
| 31747 |
} |
| 31748 |
} |
| 31749 |
if (Math.abs(advanceX) > textContentItem.width * VERTICAL_SHIFT_RATIO) { |
| 31750 |
flushTextContentItem(); |
| 31751 |
} |
| 31752 |
return true; |
| 31753 |
} |
| 31754 |
const advanceX = (posX - lastPosX) / textContentItem.textAdvanceScale; |
| 31755 |
const advanceY = posY - lastPosY; |
| 31756 |
const textOrientation = Math.sign(textContentItem.width); |
| 31757 |
if (advanceX < textOrientation * textContentItem.negativeSpaceMax) { |
| 31758 |
if (Math.abs(advanceY) > 0.5 * textContentItem.height) { |
| 31759 |
appendEOL(); |
| 31760 |
return true; |
| 31761 |
} |
| 31762 |
resetLastChars(); |
| 31763 |
flushTextContentItem(); |
| 31764 |
return true; |
| 31765 |
} |
| 31766 |
if (Math.abs(advanceY) > textContentItem.height) { |
| 31767 |
appendEOL(); |
| 31768 |
return true; |
| 31769 |
} |
| 31770 |
if (advanceX <= textOrientation * textContentItem.notASpace) { |
| 31771 |
resetLastChars(); |
| 31772 |
} |
| 31773 |
if (advanceX <= textOrientation * textContentItem.trackingSpaceMin) { |
| 31774 |
if (shouldAddWhitepsace()) { |
| 31775 |
resetLastChars(); |
| 31776 |
flushTextContentItem(); |
| 31777 |
pushWhitespace({ |
| 31778 |
width: Math.abs(advanceX) |
| 31779 |
}); |
| 31780 |
} else { |
| 31781 |
textContentItem.width += advanceX; |
| 31782 |
} |
| 31783 |
} else if (!addFakeSpaces(advanceX, textContentItem.prevTransform, textOrientation)) { |
| 31784 |
if (textContentItem.str.length === 0) { |
| 31785 |
resetLastChars(); |
| 31786 |
pushWhitespace({ |
| 31787 |
width: Math.abs(advanceX) |
| 31788 |
}); |
| 31789 |
} else { |
| 31790 |
textContentItem.width += advanceX; |
| 31791 |
} |
| 31792 |
} |
| 31793 |
if (Math.abs(advanceY) > textContentItem.height * VERTICAL_SHIFT_RATIO) { |
| 31794 |
flushTextContentItem(); |
| 31795 |
} |
| 31796 |
return true; |
| 31797 |
} |
| 31798 |
function buildTextContentItem({ |
| 31799 |
chars, |
| 31800 |
extraSpacing |
| 31801 |
}) { |
| 31802 |
const font = textState.font; |
| 31803 |
if (!chars) { |
| 31804 |
const charSpacing = textState.charSpacing + extraSpacing; |
| 31805 |
if (charSpacing) { |
| 31806 |
if (!font.vertical) { |
| 31807 |
textState.translateTextMatrix(charSpacing * textState.textHScale, 0); |
| 31808 |
} else { |
| 31809 |
textState.translateTextMatrix(0, -charSpacing); |
| 31810 |
} |
| 31811 |
} |
| 31812 |
if (keepWhiteSpace) { |
| 31813 |
compareWithLastPosition(0); |
| 31814 |
} |
| 31815 |
return; |
| 31816 |
} |
| 31817 |
const glyphs = font.charsToGlyphs(chars); |
| 31818 |
const scale = textState.fontMatrix[0] * textState.fontSize; |
| 31819 |
for (let i = 0, ii = glyphs.length; i < ii; i++) { |
| 31820 |
const glyph = glyphs[i]; |
| 31821 |
const { |
| 31822 |
category |
| 31823 |
} = glyph; |
| 31824 |
if (category.isInvisibleFormatMark) { |
| 31825 |
continue; |
| 31826 |
} |
| 31827 |
let charSpacing = textState.charSpacing + (i + 1 === ii ? extraSpacing : 0); |
| 31828 |
let glyphWidth = glyph.width; |
| 31829 |
if (font.vertical) { |
| 31830 |
glyphWidth = glyph.vmetric ? glyph.vmetric[0] : -glyphWidth; |
| 31831 |
} |
| 31832 |
let scaledDim = glyphWidth * scale; |
| 31833 |
if (!keepWhiteSpace && category.isWhitespace) { |
| 31834 |
if (!font.vertical) { |
| 31835 |
charSpacing += scaledDim + textState.wordSpacing; |
| 31836 |
textState.translateTextMatrix(charSpacing * textState.textHScale, 0); |
| 31837 |
} else { |
| 31838 |
charSpacing += -scaledDim + textState.wordSpacing; |
| 31839 |
textState.translateTextMatrix(0, -charSpacing); |
| 31840 |
} |
| 31841 |
saveLastChar(" "); |
| 31842 |
continue; |
| 31843 |
} |
| 31844 |
if (!category.isZeroWidthDiacritic && !compareWithLastPosition(scaledDim)) { |
| 31845 |
if (!font.vertical) { |
| 31846 |
textState.translateTextMatrix(scaledDim * textState.textHScale, 0); |
| 31847 |
} else { |
| 31848 |
textState.translateTextMatrix(0, scaledDim); |
| 31849 |
} |
| 31850 |
continue; |
| 31851 |
} |
| 31852 |
const textChunk = ensureTextContentItem(); |
| 31853 |
if (category.isZeroWidthDiacritic) { |
| 31854 |
scaledDim = 0; |
| 31855 |
} |
| 31856 |
if (!font.vertical) { |
| 31857 |
scaledDim *= textState.textHScale; |
| 31858 |
textState.translateTextMatrix(scaledDim, 0); |
| 31859 |
textChunk.width += scaledDim; |
| 31860 |
} else { |
| 31861 |
textState.translateTextMatrix(0, scaledDim); |
| 31862 |
scaledDim = Math.abs(scaledDim); |
| 31863 |
textChunk.height += scaledDim; |
| 31864 |
} |
| 31865 |
if (scaledDim) { |
| 31866 |
textChunk.prevTransform = getCurrentTextTransform(); |
| 31867 |
} |
| 31868 |
const glyphUnicode = glyph.unicode; |
| 31869 |
if (saveLastChar(glyphUnicode)) { |
| 31870 |
textChunk.str.push(" "); |
| 31871 |
} |
| 31872 |
textChunk.str.push(glyphUnicode); |
| 31873 |
if (charSpacing) { |
| 31874 |
if (!font.vertical) { |
| 31875 |
textState.translateTextMatrix(charSpacing * textState.textHScale, 0); |
| 31876 |
} else { |
| 31877 |
textState.translateTextMatrix(0, -charSpacing); |
| 31878 |
} |
| 31879 |
} |
| 31880 |
} |
| 31881 |
} |
| 31882 |
function appendEOL() { |
| 31883 |
resetLastChars(); |
| 31884 |
if (textContentItem.initialized) { |
| 31885 |
textContentItem.hasEOL = true; |
| 31886 |
flushTextContentItem(); |
| 31887 |
} else { |
| 31888 |
textContent.items.push({ |
| 31889 |
str: "", |
| 31890 |
dir: "ltr", |
| 31891 |
width: 0, |
| 31892 |
height: 0, |
| 31893 |
transform: getCurrentTextTransform(), |
| 31894 |
fontName: textState.loadedName, |
| 31895 |
hasEOL: true |
| 31896 |
}); |
| 31897 |
} |
| 31898 |
} |
| 31899 |
function addFakeSpaces(width, transf, textOrientation) { |
| 31900 |
if (textOrientation * textContentItem.spaceInFlowMin <= width && width <= textOrientation * textContentItem.spaceInFlowMax) { |
| 31901 |
if (textContentItem.initialized) { |
| 31902 |
resetLastChars(); |
| 31903 |
textContentItem.str.push(" "); |
| 31904 |
} |
| 31905 |
return false; |
| 31906 |
} |
| 31907 |
const fontName = textContentItem.fontName; |
| 31908 |
let height = 0; |
| 31909 |
if (textContentItem.vertical) { |
| 31910 |
height = width; |
| 31911 |
width = 0; |
| 31912 |
} |
| 31913 |
flushTextContentItem(); |
| 31914 |
resetLastChars(); |
| 31915 |
pushWhitespace({ |
| 31916 |
width: Math.abs(width), |
| 31917 |
height: Math.abs(height), |
| 31918 |
transform: transf || getCurrentTextTransform(), |
| 31919 |
fontName |
| 31920 |
}); |
| 31921 |
return true; |
| 31922 |
} |
| 31923 |
function flushTextContentItem() { |
| 31924 |
if (!textContentItem.initialized || !textContentItem.str) { |
| 31925 |
return; |
| 31926 |
} |
| 31927 |
if (!textContentItem.vertical) { |
| 31928 |
textContentItem.totalWidth += textContentItem.width * textContentItem.textAdvanceScale; |
| 31929 |
} else { |
| 31930 |
textContentItem.totalHeight += textContentItem.height * textContentItem.textAdvanceScale; |
| 31931 |
} |
| 31932 |
textContent.items.push(runBidiTransform(textContentItem)); |
| 31933 |
textContentItem.initialized = false; |
| 31934 |
textContentItem.str.length = 0; |
| 31935 |
} |
| 31936 |
function enqueueChunk(batch = false) { |
| 31937 |
const length = textContent.items.length; |
| 31938 |
if (length === 0) { |
| 31939 |
return; |
| 31940 |
} |
| 31941 |
if (batch && length < TEXT_CHUNK_BATCH_SIZE) { |
| 31942 |
return; |
| 31943 |
} |
| 31944 |
sink.enqueue(textContent, length); |
| 31945 |
textContent.items = []; |
| 31946 |
textContent.styles = Object.create(null); |
| 31947 |
} |
| 31948 |
const timeSlotManager = new TimeSlotManager(); |
| 31949 |
return new Promise(function promiseBody(resolve, reject) { |
| 31950 |
const next = function (promise) { |
| 31951 |
enqueueChunk(true); |
| 31952 |
Promise.all([promise, sink.ready]).then(function () { |
| 31953 |
try { |
| 31954 |
promiseBody(resolve, reject); |
| 31955 |
} catch (ex) { |
| 31956 |
reject(ex); |
| 31957 |
} |
| 31958 |
}, reject); |
| 31959 |
}; |
| 31960 |
task.ensureNotTerminated(); |
| 31961 |
timeSlotManager.reset(); |
| 31962 |
const operation = {}; |
| 31963 |
let stop, |
| 31964 |
args = []; |
| 31965 |
while (!(stop = timeSlotManager.check())) { |
| 31966 |
args.length = 0; |
| 31967 |
operation.args = args; |
| 31968 |
if (!preprocessor.read(operation)) { |
| 31969 |
break; |
| 31970 |
} |
| 31971 |
const previousState = textState; |
| 31972 |
textState = stateManager.state; |
| 31973 |
const fn = operation.fn; |
| 31974 |
args = operation.args; |
| 31975 |
switch (fn | 0) { |
| 31976 |
case OPS.setFont: |
| 31977 |
var fontNameArg = args[0].name, |
| 31978 |
fontSizeArg = args[1]; |
| 31979 |
if (textState.font && fontNameArg === textState.fontName && fontSizeArg === textState.fontSize) { |
| 31980 |
break; |
| 31981 |
} |
| 31982 |
flushTextContentItem(); |
| 31983 |
textState.fontName = fontNameArg; |
| 31984 |
textState.fontSize = fontSizeArg; |
| 31985 |
next(handleSetFont(fontNameArg, null)); |
| 31986 |
return; |
| 31987 |
case OPS.setTextRise: |
| 31988 |
textState.textRise = args[0]; |
| 31989 |
break; |
| 31990 |
case OPS.setHScale: |
| 31991 |
textState.textHScale = args[0] / 100; |
| 31992 |
break; |
| 31993 |
case OPS.setLeading: |
| 31994 |
textState.leading = args[0]; |
| 31995 |
break; |
| 31996 |
case OPS.moveText: |
| 31997 |
textState.translateTextLineMatrix(args[0], args[1]); |
| 31998 |
textState.textMatrix = textState.textLineMatrix.slice(); |
| 31999 |
break; |
| 32000 |
case OPS.setLeadingMoveText: |
| 32001 |
textState.leading = -args[1]; |
| 32002 |
textState.translateTextLineMatrix(args[0], args[1]); |
| 32003 |
textState.textMatrix = textState.textLineMatrix.slice(); |
| 32004 |
break; |
| 32005 |
case OPS.nextLine: |
| 32006 |
textState.carriageReturn(); |
| 32007 |
break; |
| 32008 |
case OPS.setTextMatrix: |
| 32009 |
textState.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); |
| 32010 |
textState.setTextLineMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); |
| 32011 |
updateAdvanceScale(); |
| 32012 |
break; |
| 32013 |
case OPS.setCharSpacing: |
| 32014 |
textState.charSpacing = args[0]; |
| 32015 |
break; |
| 32016 |
case OPS.setWordSpacing: |
| 32017 |
textState.wordSpacing = args[0]; |
| 32018 |
break; |
| 32019 |
case OPS.beginText: |
| 32020 |
textState.textMatrix = IDENTITY_MATRIX.slice(); |
| 32021 |
textState.textLineMatrix = IDENTITY_MATRIX.slice(); |
| 32022 |
break; |
| 32023 |
case OPS.showSpacedText: |
| 32024 |
if (!stateManager.state.font) { |
| 32025 |
self.ensureStateFont(stateManager.state); |
| 32026 |
continue; |
| 32027 |
} |
| 32028 |
const spaceFactor = (textState.font.vertical ? 1 : -1) * textState.fontSize / 1000; |
| 32029 |
const elements = args[0]; |
| 32030 |
for (let i = 0, ii = elements.length; i < ii; i++) { |
| 32031 |
const item = elements[i]; |
| 32032 |
if (typeof item === "string") { |
| 32033 |
showSpacedTextBuffer.push(item); |
| 32034 |
} else if (typeof item === "number" && item !== 0) { |
| 32035 |
const str = showSpacedTextBuffer.join(""); |
| 32036 |
showSpacedTextBuffer.length = 0; |
| 32037 |
buildTextContentItem({ |
| 32038 |
chars: str, |
| 32039 |
extraSpacing: item * spaceFactor |
| 32040 |
}); |
| 32041 |
} |
| 32042 |
} |
| 32043 |
if (showSpacedTextBuffer.length > 0) { |
| 32044 |
const str = showSpacedTextBuffer.join(""); |
| 32045 |
showSpacedTextBuffer.length = 0; |
| 32046 |
buildTextContentItem({ |
| 32047 |
chars: str, |
| 32048 |
extraSpacing: 0 |
| 32049 |
}); |
| 32050 |
} |
| 32051 |
break; |
| 32052 |
case OPS.showText: |
| 32053 |
if (!stateManager.state.font) { |
| 32054 |
self.ensureStateFont(stateManager.state); |
| 32055 |
continue; |
| 32056 |
} |
| 32057 |
buildTextContentItem({ |
| 32058 |
chars: args[0], |
| 32059 |
extraSpacing: 0 |
| 32060 |
}); |
| 32061 |
break; |
| 32062 |
case OPS.nextLineShowText: |
| 32063 |
if (!stateManager.state.font) { |
| 32064 |
self.ensureStateFont(stateManager.state); |
| 32065 |
continue; |
| 32066 |
} |
| 32067 |
textState.carriageReturn(); |
| 32068 |
buildTextContentItem({ |
| 32069 |
chars: args[0], |
| 32070 |
extraSpacing: 0 |
| 32071 |
}); |
| 32072 |
break; |
| 32073 |
case OPS.nextLineSetSpacingShowText: |
| 32074 |
if (!stateManager.state.font) { |
| 32075 |
self.ensureStateFont(stateManager.state); |
| 32076 |
continue; |
| 32077 |
} |
| 32078 |
textState.wordSpacing = args[0]; |
| 32079 |
textState.charSpacing = args[1]; |
| 32080 |
textState.carriageReturn(); |
| 32081 |
buildTextContentItem({ |
| 32082 |
chars: args[2], |
| 32083 |
extraSpacing: 0 |
| 32084 |
}); |
| 32085 |
break; |
| 32086 |
case OPS.paintXObject: |
| 32087 |
flushTextContentItem(); |
| 32088 |
if (!xobjs) { |
| 32089 |
xobjs = resources.get("XObject") || Dict.empty; |
| 32090 |
} |
| 32091 |
var isValidName = args[0] instanceof Name; |
| 32092 |
var name = args[0].name; |
| 32093 |
if (isValidName && emptyXObjectCache.getByName(name)) { |
| 32094 |
break; |
| 32095 |
} |
| 32096 |
next(new Promise(function (resolveXObject, rejectXObject) { |
| 32097 |
if (!isValidName) { |
| 32098 |
throw new FormatError("XObject must be referred to by name."); |
| 32099 |
} |
| 32100 |
let xobj = xobjs.getRaw(name); |
| 32101 |
if (xobj instanceof Ref) { |
| 32102 |
if (emptyXObjectCache.getByRef(xobj)) { |
| 32103 |
resolveXObject(); |
| 32104 |
return; |
| 32105 |
} |
| 32106 |
const globalImage = self.globalImageCache.getData(xobj, self.pageIndex); |
| 32107 |
if (globalImage) { |
| 32108 |
resolveXObject(); |
| 32109 |
return; |
| 32110 |
} |
| 32111 |
xobj = xref.fetch(xobj); |
| 32112 |
} |
| 32113 |
if (!(xobj instanceof BaseStream)) { |
| 32114 |
throw new FormatError("XObject should be a stream"); |
| 32115 |
} |
| 32116 |
const type = xobj.dict.get("Subtype"); |
| 32117 |
if (!(type instanceof Name)) { |
| 32118 |
throw new FormatError("XObject should have a Name subtype"); |
| 32119 |
} |
| 32120 |
if (type.name !== "Form") { |
| 32121 |
emptyXObjectCache.set(name, xobj.dict.objId, true); |
| 32122 |
resolveXObject(); |
| 32123 |
return; |
| 32124 |
} |
| 32125 |
const currentState = stateManager.state.clone(); |
| 32126 |
const xObjStateManager = new StateManager(currentState); |
| 32127 |
const matrix = lookupMatrix(xobj.dict.getArray("Matrix"), null); |
| 32128 |
if (matrix) { |
| 32129 |
xObjStateManager.transform(matrix); |
| 32130 |
} |
| 32131 |
enqueueChunk(); |
| 32132 |
const sinkWrapper = { |
| 32133 |
enqueueInvoked: false, |
| 32134 |
enqueue(chunk, size) { |
| 32135 |
this.enqueueInvoked = true; |
| 32136 |
sink.enqueue(chunk, size); |
| 32137 |
}, |
| 32138 |
get desiredSize() { |
| 32139 |
return sink.desiredSize; |
| 32140 |
}, |
| 32141 |
get ready() { |
| 32142 |
return sink.ready; |
| 32143 |
} |
| 32144 |
}; |
| 32145 |
self.getTextContent({ |
| 32146 |
stream: xobj, |
| 32147 |
task, |
| 32148 |
resources: xobj.dict.get("Resources") || resources, |
| 32149 |
stateManager: xObjStateManager, |
| 32150 |
includeMarkedContent, |
| 32151 |
sink: sinkWrapper, |
| 32152 |
seenStyles, |
| 32153 |
viewBox, |
| 32154 |
lang, |
| 32155 |
markedContentData, |
| 32156 |
disableNormalization, |
| 32157 |
keepWhiteSpace |
| 32158 |
}).then(function () { |
| 32159 |
if (!sinkWrapper.enqueueInvoked) { |
| 32160 |
emptyXObjectCache.set(name, xobj.dict.objId, true); |
| 32161 |
} |
| 32162 |
resolveXObject(); |
| 32163 |
}, rejectXObject); |
| 32164 |
}).catch(function (reason) { |
| 32165 |
if (reason instanceof AbortException) { |
| 32166 |
return; |
| 32167 |
} |
| 32168 |
if (self.options.ignoreErrors) { |
| 32169 |
warn(`getTextContent - ignoring XObject: "${reason}".`); |
| 32170 |
return; |
| 32171 |
} |
| 32172 |
throw reason; |
| 32173 |
})); |
| 32174 |
return; |
| 32175 |
case OPS.setGState: |
| 32176 |
isValidName = args[0] instanceof Name; |
| 32177 |
name = args[0].name; |
| 32178 |
if (isValidName && emptyGStateCache.getByName(name)) { |
| 32179 |
break; |
| 32180 |
} |
| 32181 |
next(new Promise(function (resolveGState, rejectGState) { |
| 32182 |
if (!isValidName) { |
| 32183 |
throw new FormatError("GState must be referred to by name."); |
| 32184 |
} |
| 32185 |
const extGState = resources.get("ExtGState"); |
| 32186 |
if (!(extGState instanceof Dict)) { |
| 32187 |
throw new FormatError("ExtGState should be a dictionary."); |
| 32188 |
} |
| 32189 |
const gState = extGState.get(name); |
| 32190 |
if (!(gState instanceof Dict)) { |
| 32191 |
throw new FormatError("GState should be a dictionary."); |
| 32192 |
} |
| 32193 |
const gStateFont = gState.get("Font"); |
| 32194 |
if (!gStateFont) { |
| 32195 |
emptyGStateCache.set(name, gState.objId, true); |
| 32196 |
resolveGState(); |
| 32197 |
return; |
| 32198 |
} |
| 32199 |
flushTextContentItem(); |
| 32200 |
textState.fontName = null; |
| 32201 |
textState.fontSize = gStateFont[1]; |
| 32202 |
handleSetFont(null, gStateFont[0]).then(resolveGState, rejectGState); |
| 32203 |
}).catch(function (reason) { |
| 32204 |
if (reason instanceof AbortException) { |
| 32205 |
return; |
| 32206 |
} |
| 32207 |
if (self.options.ignoreErrors) { |
| 32208 |
warn(`getTextContent - ignoring ExtGState: "${reason}".`); |
| 32209 |
return; |
| 32210 |
} |
| 32211 |
throw reason; |
| 32212 |
})); |
| 32213 |
return; |
| 32214 |
case OPS.beginMarkedContent: |
| 32215 |
flushTextContentItem(); |
| 32216 |
if (includeMarkedContent) { |
| 32217 |
markedContentData.level++; |
| 32218 |
textContent.items.push({ |
| 32219 |
type: "beginMarkedContent", |
| 32220 |
tag: args[0] instanceof Name ? args[0].name : null |
| 32221 |
}); |
| 32222 |
} |
| 32223 |
break; |
| 32224 |
case OPS.beginMarkedContentProps: |
| 32225 |
flushTextContentItem(); |
| 32226 |
if (includeMarkedContent) { |
| 32227 |
markedContentData.level++; |
| 32228 |
let mcid = null; |
| 32229 |
if (args[1] instanceof Dict) { |
| 32230 |
mcid = args[1].get("MCID"); |
| 32231 |
} |
| 32232 |
textContent.items.push({ |
| 32233 |
type: "beginMarkedContentProps", |
| 32234 |
id: Number.isInteger(mcid) ? `${self.idFactory.getPageObjId()}_mc${mcid}` : null, |
| 32235 |
tag: args[0] instanceof Name ? args[0].name : null |
| 32236 |
}); |
| 32237 |
} |
| 32238 |
break; |
| 32239 |
case OPS.endMarkedContent: |
| 32240 |
flushTextContentItem(); |
| 32241 |
if (includeMarkedContent) { |
| 32242 |
if (markedContentData.level === 0) { |
| 32243 |
break; |
| 32244 |
} |
| 32245 |
markedContentData.level--; |
| 32246 |
textContent.items.push({ |
| 32247 |
type: "endMarkedContent" |
| 32248 |
}); |
| 32249 |
} |
| 32250 |
break; |
| 32251 |
case OPS.restore: |
| 32252 |
if (previousState && (previousState.font !== textState.font || previousState.fontSize !== textState.fontSize || previousState.fontName !== textState.fontName)) { |
| 32253 |
flushTextContentItem(); |
| 32254 |
} |
| 32255 |
break; |
| 32256 |
} |
| 32257 |
if (textContent.items.length >= sink.desiredSize) { |
| 32258 |
stop = true; |
| 32259 |
break; |
| 32260 |
} |
| 32261 |
} |
| 32262 |
if (stop) { |
| 32263 |
next(deferred); |
| 32264 |
return; |
| 32265 |
} |
| 32266 |
flushTextContentItem(); |
| 32267 |
enqueueChunk(); |
| 32268 |
resolve(); |
| 32269 |
}).catch(reason => { |
| 32270 |
if (reason instanceof AbortException) { |
| 32271 |
return; |
| 32272 |
} |
| 32273 |
if (this.options.ignoreErrors) { |
| 32274 |
warn(`getTextContent - ignoring errors during "${task.name}" ` + `task: "${reason}".`); |
| 32275 |
flushTextContentItem(); |
| 32276 |
enqueueChunk(); |
| 32277 |
return; |
| 32278 |
} |
| 32279 |
throw reason; |
| 32280 |
}); |
| 32281 |
} |
| 32282 |
async extractDataStructures(dict, properties) { |
| 32283 |
const xref = this.xref; |
| 32284 |
let cidToGidBytes; |
| 32285 |
const toUnicodePromise = this.readToUnicode(properties.toUnicode); |
| 32286 |
if (properties.composite) { |
| 32287 |
const cidSystemInfo = dict.get("CIDSystemInfo"); |
| 32288 |
if (cidSystemInfo instanceof Dict) { |
| 32289 |
properties.cidSystemInfo = { |
| 32290 |
registry: stringToPDFString(cidSystemInfo.get("Registry")), |
| 32291 |
ordering: stringToPDFString(cidSystemInfo.get("Ordering")), |
| 32292 |
supplement: cidSystemInfo.get("Supplement") |
| 32293 |
}; |
| 32294 |
} |
| 32295 |
try { |
| 32296 |
const cidToGidMap = dict.get("CIDToGIDMap"); |
| 32297 |
if (cidToGidMap instanceof BaseStream) { |
| 32298 |
cidToGidBytes = cidToGidMap.getBytes(); |
| 32299 |
} |
| 32300 |
} catch (ex) { |
| 32301 |
if (!this.options.ignoreErrors) { |
| 32302 |
throw ex; |
| 32303 |
} |
| 32304 |
warn(`extractDataStructures - ignoring CIDToGIDMap data: "${ex}".`); |
| 32305 |
} |
| 32306 |
} |
| 32307 |
const differences = []; |
| 32308 |
let baseEncodingName = null; |
| 32309 |
let encoding; |
| 32310 |
if (dict.has("Encoding")) { |
| 32311 |
encoding = dict.get("Encoding"); |
| 32312 |
if (encoding instanceof Dict) { |
| 32313 |
baseEncodingName = encoding.get("BaseEncoding"); |
| 32314 |
baseEncodingName = baseEncodingName instanceof Name ? baseEncodingName.name : null; |
| 32315 |
if (encoding.has("Differences")) { |
| 32316 |
const diffEncoding = encoding.get("Differences"); |
| 32317 |
let index = 0; |
| 32318 |
for (const entry of diffEncoding) { |
| 32319 |
const data = xref.fetchIfRef(entry); |
| 32320 |
if (typeof data === "number") { |
| 32321 |
index = data; |
| 32322 |
} else if (data instanceof Name) { |
| 32323 |
differences[index++] = data.name; |
| 32324 |
} else { |
| 32325 |
throw new FormatError(`Invalid entry in 'Differences' array: ${data}`); |
| 32326 |
} |
| 32327 |
} |
| 32328 |
} |
| 32329 |
} else if (encoding instanceof Name) { |
| 32330 |
baseEncodingName = encoding.name; |
| 32331 |
} else { |
| 32332 |
const msg = "Encoding is not a Name nor a Dict"; |
| 32333 |
if (!this.options.ignoreErrors) { |
| 32334 |
throw new FormatError(msg); |
| 32335 |
} |
| 32336 |
warn(msg); |
| 32337 |
} |
| 32338 |
if (baseEncodingName !== "MacRomanEncoding" && baseEncodingName !== "MacExpertEncoding" && baseEncodingName !== "WinAnsiEncoding") { |
| 32339 |
baseEncodingName = null; |
| 32340 |
} |
| 32341 |
} |
| 32342 |
const nonEmbeddedFont = !properties.file || properties.isInternalFont, |
| 32343 |
isSymbolsFontName = getSymbolsFonts()[properties.name]; |
| 32344 |
if (baseEncodingName && nonEmbeddedFont && isSymbolsFontName) { |
| 32345 |
baseEncodingName = null; |
| 32346 |
} |
| 32347 |
if (baseEncodingName) { |
| 32348 |
properties.defaultEncoding = getEncoding(baseEncodingName); |
| 32349 |
} else { |
| 32350 |
const isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); |
| 32351 |
const isNonsymbolicFont = !!(properties.flags & FontFlags.Nonsymbolic); |
| 32352 |
encoding = StandardEncoding; |
| 32353 |
if (properties.type === "TrueType" && !isNonsymbolicFont) { |
| 32354 |
encoding = WinAnsiEncoding; |
| 32355 |
} |
| 32356 |
if (isSymbolicFont || isSymbolsFontName) { |
| 32357 |
encoding = MacRomanEncoding; |
| 32358 |
if (nonEmbeddedFont) { |
| 32359 |
if (/Symbol/i.test(properties.name)) { |
| 32360 |
encoding = SymbolSetEncoding; |
| 32361 |
} else if (/Dingbats/i.test(properties.name)) { |
| 32362 |
encoding = ZapfDingbatsEncoding; |
| 32363 |
} else if (/Wingdings/i.test(properties.name)) { |
| 32364 |
encoding = WinAnsiEncoding; |
| 32365 |
} |
| 32366 |
} |
| 32367 |
} |
| 32368 |
properties.defaultEncoding = encoding; |
| 32369 |
} |
| 32370 |
properties.differences = differences; |
| 32371 |
properties.baseEncodingName = baseEncodingName; |
| 32372 |
properties.hasEncoding = !!baseEncodingName || differences.length > 0; |
| 32373 |
properties.dict = dict; |
| 32374 |
properties.toUnicode = await toUnicodePromise; |
| 32375 |
const builtToUnicode = await this.buildToUnicode(properties); |
| 32376 |
properties.toUnicode = builtToUnicode; |
| 32377 |
if (cidToGidBytes) { |
| 32378 |
properties.cidToGidMap = this.readCidToGidMap(cidToGidBytes, builtToUnicode); |
| 32379 |
} |
| 32380 |
return properties; |
| 32381 |
} |
| 32382 |
_simpleFontToUnicode(properties, forceGlyphs = false) { |
| 32383 |
assert(!properties.composite, "Must be a simple font."); |
| 32384 |
const toUnicode = []; |
| 32385 |
const encoding = properties.defaultEncoding.slice(); |
| 32386 |
const baseEncodingName = properties.baseEncodingName; |
| 32387 |
const differences = properties.differences; |
| 32388 |
for (const charcode in differences) { |
| 32389 |
const glyphName = differences[charcode]; |
| 32390 |
if (glyphName === ".notdef") { |
| 32391 |
continue; |
| 32392 |
} |
| 32393 |
encoding[charcode] = glyphName; |
| 32394 |
} |
| 32395 |
const glyphsUnicodeMap = getGlyphsUnicode(); |
| 32396 |
for (const charcode in encoding) { |
| 32397 |
let glyphName = encoding[charcode]; |
| 32398 |
if (glyphName === "") { |
| 32399 |
continue; |
| 32400 |
} |
| 32401 |
let unicode = glyphsUnicodeMap[glyphName]; |
| 32402 |
if (unicode !== undefined) { |
| 32403 |
toUnicode[charcode] = String.fromCharCode(unicode); |
| 32404 |
continue; |
| 32405 |
} |
| 32406 |
let code = 0; |
| 32407 |
switch (glyphName[0]) { |
| 32408 |
case "G": |
| 32409 |
if (glyphName.length === 3) { |
| 32410 |
code = parseInt(glyphName.substring(1), 16); |
| 32411 |
} |
| 32412 |
break; |
| 32413 |
case "g": |
| 32414 |
if (glyphName.length === 5) { |
| 32415 |
code = parseInt(glyphName.substring(1), 16); |
| 32416 |
} |
| 32417 |
break; |
| 32418 |
case "C": |
| 32419 |
case "c": |
| 32420 |
if (glyphName.length >= 3 && glyphName.length <= 4) { |
| 32421 |
const codeStr = glyphName.substring(1); |
| 32422 |
if (forceGlyphs) { |
| 32423 |
code = parseInt(codeStr, 16); |
| 32424 |
break; |
| 32425 |
} |
| 32426 |
code = +codeStr; |
| 32427 |
if (Number.isNaN(code) && Number.isInteger(parseInt(codeStr, 16))) { |
| 32428 |
return this._simpleFontToUnicode(properties, true); |
| 32429 |
} |
| 32430 |
} |
| 32431 |
break; |
| 32432 |
case "u": |
| 32433 |
unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); |
| 32434 |
if (unicode !== -1) { |
| 32435 |
code = unicode; |
| 32436 |
} |
| 32437 |
break; |
| 32438 |
default: |
| 32439 |
switch (glyphName) { |
| 32440 |
case "f_h": |
| 32441 |
case "f_t": |
| 32442 |
case "T_h": |
| 32443 |
toUnicode[charcode] = glyphName.replaceAll("_", ""); |
| 32444 |
continue; |
| 32445 |
} |
| 32446 |
break; |
| 32447 |
} |
| 32448 |
if (code > 0 && code <= 0x10ffff && Number.isInteger(code)) { |
| 32449 |
if (baseEncodingName && code === +charcode) { |
| 32450 |
const baseEncoding = getEncoding(baseEncodingName); |
| 32451 |
if (baseEncoding && (glyphName = baseEncoding[charcode])) { |
| 32452 |
toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); |
| 32453 |
continue; |
| 32454 |
} |
| 32455 |
} |
| 32456 |
toUnicode[charcode] = String.fromCodePoint(code); |
| 32457 |
} |
| 32458 |
} |
| 32459 |
return toUnicode; |
| 32460 |
} |
| 32461 |
async buildToUnicode(properties) { |
| 32462 |
properties.hasIncludedToUnicodeMap = properties.toUnicode?.length > 0; |
| 32463 |
if (properties.hasIncludedToUnicodeMap) { |
| 32464 |
if (!properties.composite && properties.hasEncoding) { |
| 32465 |
properties.fallbackToUnicode = this._simpleFontToUnicode(properties); |
| 32466 |
} |
| 32467 |
return properties.toUnicode; |
| 32468 |
} |
| 32469 |
if (!properties.composite) { |
| 32470 |
return new ToUnicodeMap(this._simpleFontToUnicode(properties)); |
| 32471 |
} |
| 32472 |
if (properties.composite && (properties.cMap.builtInCMap && !(properties.cMap instanceof IdentityCMap) || properties.cidSystemInfo?.registry === "Adobe" && (properties.cidSystemInfo.ordering === "GB1" || properties.cidSystemInfo.ordering === "CNS1" || properties.cidSystemInfo.ordering === "Japan1" || properties.cidSystemInfo.ordering === "Korea1"))) { |
| 32473 |
const { |
| 32474 |
registry, |
| 32475 |
ordering |
| 32476 |
} = properties.cidSystemInfo; |
| 32477 |
const ucs2CMapName = Name.get(`${registry}-${ordering}-UCS2`); |
| 32478 |
const ucs2CMap = await CMapFactory.create({ |
| 32479 |
encoding: ucs2CMapName, |
| 32480 |
fetchBuiltInCMap: this._fetchBuiltInCMapBound, |
| 32481 |
useCMap: null |
| 32482 |
}); |
| 32483 |
const toUnicode = [], |
| 32484 |
buf = []; |
| 32485 |
properties.cMap.forEach(function (charcode, cid) { |
| 32486 |
if (cid > 0xffff) { |
| 32487 |
throw new FormatError("Max size of CID is 65,535"); |
| 32488 |
} |
| 32489 |
const ucs2 = ucs2CMap.lookup(cid); |
| 32490 |
if (ucs2) { |
| 32491 |
buf.length = 0; |
| 32492 |
for (let i = 0, ii = ucs2.length; i < ii; i += 2) { |
| 32493 |
buf.push((ucs2.charCodeAt(i) << 8) + ucs2.charCodeAt(i + 1)); |
| 32494 |
} |
| 32495 |
toUnicode[charcode] = String.fromCharCode(...buf); |
| 32496 |
} |
| 32497 |
}); |
| 32498 |
return new ToUnicodeMap(toUnicode); |
| 32499 |
} |
| 32500 |
return new IdentityToUnicodeMap(properties.firstChar, properties.lastChar); |
| 32501 |
} |
| 32502 |
async readToUnicode(cmapObj) { |
| 32503 |
if (!cmapObj) { |
| 32504 |
return null; |
| 32505 |
} |
| 32506 |
if (cmapObj instanceof Name) { |
| 32507 |
const cmap = await CMapFactory.create({ |
| 32508 |
encoding: cmapObj, |
| 32509 |
fetchBuiltInCMap: this._fetchBuiltInCMapBound, |
| 32510 |
useCMap: null |
| 32511 |
}); |
| 32512 |
if (cmap instanceof IdentityCMap) { |
| 32513 |
return new IdentityToUnicodeMap(0, 0xffff); |
| 32514 |
} |
| 32515 |
return new ToUnicodeMap(cmap.getMap()); |
| 32516 |
} |
| 32517 |
if (cmapObj instanceof BaseStream) { |
| 32518 |
try { |
| 32519 |
const cmap = await CMapFactory.create({ |
| 32520 |
encoding: cmapObj, |
| 32521 |
fetchBuiltInCMap: this._fetchBuiltInCMapBound, |
| 32522 |
useCMap: null |
| 32523 |
}); |
| 32524 |
if (cmap instanceof IdentityCMap) { |
| 32525 |
return new IdentityToUnicodeMap(0, 0xffff); |
| 32526 |
} |
| 32527 |
const map = new Array(cmap.length); |
| 32528 |
cmap.forEach(function (charCode, token) { |
| 32529 |
if (typeof token === "number") { |
| 32530 |
map[charCode] = String.fromCodePoint(token); |
| 32531 |
return; |
| 32532 |
} |
| 32533 |
if (token.length % 2 !== 0) { |
| 32534 |
token = "\u0000" + token; |
| 32535 |
} |
| 32536 |
const str = []; |
| 32537 |
for (let k = 0; k < token.length; k += 2) { |
| 32538 |
const w1 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); |
| 32539 |
if ((w1 & 0xf800) !== 0xd800) { |
| 32540 |
str.push(w1); |
| 32541 |
continue; |
| 32542 |
} |
| 32543 |
k += 2; |
| 32544 |
const w2 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); |
| 32545 |
str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); |
| 32546 |
} |
| 32547 |
map[charCode] = String.fromCodePoint(...str); |
| 32548 |
}); |
| 32549 |
return new ToUnicodeMap(map); |
| 32550 |
} catch (reason) { |
| 32551 |
if (reason instanceof AbortException) { |
| 32552 |
return null; |
| 32553 |
} |
| 32554 |
if (this.options.ignoreErrors) { |
| 32555 |
warn(`readToUnicode - ignoring ToUnicode data: "${reason}".`); |
| 32556 |
return null; |
| 32557 |
} |
| 32558 |
throw reason; |
| 32559 |
} |
| 32560 |
} |
| 32561 |
return null; |
| 32562 |
} |
| 32563 |
readCidToGidMap(glyphsData, toUnicode) { |
| 32564 |
const result = []; |
| 32565 |
for (let j = 0, jj = glyphsData.length; j < jj; j++) { |
| 32566 |
const glyphID = glyphsData[j++] << 8 | glyphsData[j]; |
| 32567 |
const code = j >> 1; |
| 32568 |
if (glyphID === 0 && !toUnicode.has(code)) { |
| 32569 |
continue; |
| 32570 |
} |
| 32571 |
result[code] = glyphID; |
| 32572 |
} |
| 32573 |
return result; |
| 32574 |
} |
| 32575 |
extractWidths(dict, descriptor, properties) { |
| 32576 |
const xref = this.xref; |
| 32577 |
let glyphsWidths = []; |
| 32578 |
let defaultWidth = 0; |
| 32579 |
const glyphsVMetrics = []; |
| 32580 |
let defaultVMetrics; |
| 32581 |
if (properties.composite) { |
| 32582 |
const dw = dict.get("DW"); |
| 32583 |
defaultWidth = typeof dw === "number" ? Math.ceil(dw) : 1000; |
| 32584 |
const widths = dict.get("W"); |
| 32585 |
if (Array.isArray(widths)) { |
| 32586 |
for (let i = 0, ii = widths.length; i < ii; i++) { |
| 32587 |
let start = xref.fetchIfRef(widths[i++]); |
| 32588 |
if (!Number.isInteger(start)) { |
| 32589 |
break; |
| 32590 |
} |
| 32591 |
const code = xref.fetchIfRef(widths[i]); |
| 32592 |
if (Array.isArray(code)) { |
| 32593 |
for (const c of code) { |
| 32594 |
const width = xref.fetchIfRef(c); |
| 32595 |
if (typeof width === "number") { |
| 32596 |
glyphsWidths[start] = width; |
| 32597 |
} |
| 32598 |
start++; |
| 32599 |
} |
| 32600 |
} else if (Number.isInteger(code)) { |
| 32601 |
const width = xref.fetchIfRef(widths[++i]); |
| 32602 |
if (typeof width !== "number") { |
| 32603 |
continue; |
| 32604 |
} |
| 32605 |
for (let j = start; j <= code; j++) { |
| 32606 |
glyphsWidths[j] = width; |
| 32607 |
} |
| 32608 |
} else { |
| 32609 |
break; |
| 32610 |
} |
| 32611 |
} |
| 32612 |
} |
| 32613 |
if (properties.vertical) { |
| 32614 |
const dw2 = dict.getArray("DW2"); |
| 32615 |
let vmetrics = isNumberArray(dw2, 2) ? dw2 : [880, -1000]; |
| 32616 |
defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]]; |
| 32617 |
vmetrics = dict.get("W2"); |
| 32618 |
if (Array.isArray(vmetrics)) { |
| 32619 |
for (let i = 0, ii = vmetrics.length; i < ii; i++) { |
| 32620 |
let start = xref.fetchIfRef(vmetrics[i++]); |
| 32621 |
if (!Number.isInteger(start)) { |
| 32622 |
break; |
| 32623 |
} |
| 32624 |
const code = xref.fetchIfRef(vmetrics[i]); |
| 32625 |
if (Array.isArray(code)) { |
| 32626 |
for (let j = 0, jj = code.length; j < jj; j++) { |
| 32627 |
const vmetric = [xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j])]; |
| 32628 |
if (isNumberArray(vmetric, null)) { |
| 32629 |
glyphsVMetrics[start] = vmetric; |
| 32630 |
} |
| 32631 |
start++; |
| 32632 |
} |
| 32633 |
} else if (Number.isInteger(code)) { |
| 32634 |
const vmetric = [xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i])]; |
| 32635 |
if (!isNumberArray(vmetric, null)) { |
| 32636 |
continue; |
| 32637 |
} |
| 32638 |
for (let j = start; j <= code; j++) { |
| 32639 |
glyphsVMetrics[j] = vmetric; |
| 32640 |
} |
| 32641 |
} else { |
| 32642 |
break; |
| 32643 |
} |
| 32644 |
} |
| 32645 |
} |
| 32646 |
} |
| 32647 |
} else { |
| 32648 |
const widths = dict.get("Widths"); |
| 32649 |
if (Array.isArray(widths)) { |
| 32650 |
let j = properties.firstChar; |
| 32651 |
for (const w of widths) { |
| 32652 |
const width = xref.fetchIfRef(w); |
| 32653 |
if (typeof width === "number") { |
| 32654 |
glyphsWidths[j] = width; |
| 32655 |
} |
| 32656 |
j++; |
| 32657 |
} |
| 32658 |
const missingWidth = descriptor.get("MissingWidth"); |
| 32659 |
defaultWidth = typeof missingWidth === "number" ? missingWidth : 0; |
| 32660 |
} else { |
| 32661 |
const baseFontName = dict.get("BaseFont"); |
| 32662 |
if (baseFontName instanceof Name) { |
| 32663 |
const metrics = this.getBaseFontMetrics(baseFontName.name); |
| 32664 |
glyphsWidths = this.buildCharCodeToWidth(metrics.widths, properties); |
| 32665 |
defaultWidth = metrics.defaultWidth; |
| 32666 |
} |
| 32667 |
} |
| 32668 |
} |
| 32669 |
let isMonospace = true; |
| 32670 |
let firstWidth = defaultWidth; |
| 32671 |
for (const glyph in glyphsWidths) { |
| 32672 |
const glyphWidth = glyphsWidths[glyph]; |
| 32673 |
if (!glyphWidth) { |
| 32674 |
continue; |
| 32675 |
} |
| 32676 |
if (!firstWidth) { |
| 32677 |
firstWidth = glyphWidth; |
| 32678 |
continue; |
| 32679 |
} |
| 32680 |
if (firstWidth !== glyphWidth) { |
| 32681 |
isMonospace = false; |
| 32682 |
break; |
| 32683 |
} |
| 32684 |
} |
| 32685 |
if (isMonospace) { |
| 32686 |
properties.flags |= FontFlags.FixedPitch; |
| 32687 |
} else { |
| 32688 |
properties.flags &= ~FontFlags.FixedPitch; |
| 32689 |
} |
| 32690 |
properties.defaultWidth = defaultWidth; |
| 32691 |
properties.widths = glyphsWidths; |
| 32692 |
properties.defaultVMetrics = defaultVMetrics; |
| 32693 |
properties.vmetrics = glyphsVMetrics; |
| 32694 |
} |
| 32695 |
isSerifFont(baseFontName) { |
| 32696 |
const fontNameWoStyle = baseFontName.split("-", 1)[0]; |
| 32697 |
return fontNameWoStyle in getSerifFonts() || /serif/gi.test(fontNameWoStyle); |
| 32698 |
} |
| 32699 |
getBaseFontMetrics(name) { |
| 32700 |
let defaultWidth = 0; |
| 32701 |
let widths = Object.create(null); |
| 32702 |
let monospace = false; |
| 32703 |
const stdFontMap = getStdFontMap(); |
| 32704 |
let lookupName = stdFontMap[name] || name; |
| 32705 |
const Metrics = getMetrics(); |
| 32706 |
if (!(lookupName in Metrics)) { |
| 32707 |
lookupName = this.isSerifFont(name) ? "Times-Roman" : "Helvetica"; |
| 32708 |
} |
| 32709 |
const glyphWidths = Metrics[lookupName]; |
| 32710 |
if (typeof glyphWidths === "number") { |
| 32711 |
defaultWidth = glyphWidths; |
| 32712 |
monospace = true; |
| 32713 |
} else { |
| 32714 |
widths = glyphWidths(); |
| 32715 |
} |
| 32716 |
return { |
| 32717 |
defaultWidth, |
| 32718 |
monospace, |
| 32719 |
widths |
| 32720 |
}; |
| 32721 |
} |
| 32722 |
buildCharCodeToWidth(widthsByGlyphName, properties) { |
| 32723 |
const widths = Object.create(null); |
| 32724 |
const differences = properties.differences; |
| 32725 |
const encoding = properties.defaultEncoding; |
| 32726 |
for (let charCode = 0; charCode < 256; charCode++) { |
| 32727 |
if (charCode in differences && widthsByGlyphName[differences[charCode]]) { |
| 32728 |
widths[charCode] = widthsByGlyphName[differences[charCode]]; |
| 32729 |
continue; |
| 32730 |
} |
| 32731 |
if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) { |
| 32732 |
widths[charCode] = widthsByGlyphName[encoding[charCode]]; |
| 32733 |
continue; |
| 32734 |
} |
| 32735 |
} |
| 32736 |
return widths; |
| 32737 |
} |
| 32738 |
preEvaluateFont(dict) { |
| 32739 |
const baseDict = dict; |
| 32740 |
let type = dict.get("Subtype"); |
| 32741 |
if (!(type instanceof Name)) { |
| 32742 |
throw new FormatError("invalid font Subtype"); |
| 32743 |
} |
| 32744 |
let composite = false; |
| 32745 |
let hash; |
| 32746 |
if (type.name === "Type0") { |
| 32747 |
const df = dict.get("DescendantFonts"); |
| 32748 |
if (!df) { |
| 32749 |
throw new FormatError("Descendant fonts are not specified"); |
| 32750 |
} |
| 32751 |
dict = Array.isArray(df) ? this.xref.fetchIfRef(df[0]) : df; |
| 32752 |
if (!(dict instanceof Dict)) { |
| 32753 |
throw new FormatError("Descendant font is not a dictionary."); |
| 32754 |
} |
| 32755 |
type = dict.get("Subtype"); |
| 32756 |
if (!(type instanceof Name)) { |
| 32757 |
throw new FormatError("invalid font Subtype"); |
| 32758 |
} |
| 32759 |
composite = true; |
| 32760 |
} |
| 32761 |
let firstChar = dict.get("FirstChar"); |
| 32762 |
if (!Number.isInteger(firstChar)) { |
| 32763 |
firstChar = 0; |
| 32764 |
} |
| 32765 |
let lastChar = dict.get("LastChar"); |
| 32766 |
if (!Number.isInteger(lastChar)) { |
| 32767 |
lastChar = composite ? 0xffff : 0xff; |
| 32768 |
} |
| 32769 |
const descriptor = dict.get("FontDescriptor"); |
| 32770 |
const toUnicode = dict.get("ToUnicode") || baseDict.get("ToUnicode"); |
| 32771 |
if (descriptor) { |
| 32772 |
hash = new MurmurHash3_64(); |
| 32773 |
const encoding = baseDict.getRaw("Encoding"); |
| 32774 |
if (encoding instanceof Name) { |
| 32775 |
hash.update(encoding.name); |
| 32776 |
} else if (encoding instanceof Ref) { |
| 32777 |
hash.update(encoding.toString()); |
| 32778 |
} else if (encoding instanceof Dict) { |
| 32779 |
for (const entry of encoding.getRawValues()) { |
| 32780 |
if (entry instanceof Name) { |
| 32781 |
hash.update(entry.name); |
| 32782 |
} else if (entry instanceof Ref) { |
| 32783 |
hash.update(entry.toString()); |
| 32784 |
} else if (Array.isArray(entry)) { |
| 32785 |
const diffLength = entry.length, |
| 32786 |
diffBuf = new Array(diffLength); |
| 32787 |
for (let j = 0; j < diffLength; j++) { |
| 32788 |
const diffEntry = entry[j]; |
| 32789 |
if (diffEntry instanceof Name) { |
| 32790 |
diffBuf[j] = diffEntry.name; |
| 32791 |
} else if (typeof diffEntry === "number" || diffEntry instanceof Ref) { |
| 32792 |
diffBuf[j] = diffEntry.toString(); |
| 32793 |
} |
| 32794 |
} |
| 32795 |
hash.update(diffBuf.join()); |
| 32796 |
} |
| 32797 |
} |
| 32798 |
} |
| 32799 |
hash.update(`${firstChar}-${lastChar}`); |
| 32800 |
if (toUnicode instanceof BaseStream) { |
| 32801 |
const stream = toUnicode.str || toUnicode; |
| 32802 |
const uint8array = stream.buffer ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : new Uint8Array(stream.bytes.buffer, stream.start, stream.end - stream.start); |
| 32803 |
hash.update(uint8array); |
| 32804 |
} else if (toUnicode instanceof Name) { |
| 32805 |
hash.update(toUnicode.name); |
| 32806 |
} |
| 32807 |
const widths = dict.get("Widths") || baseDict.get("Widths"); |
| 32808 |
if (Array.isArray(widths)) { |
| 32809 |
const widthsBuf = []; |
| 32810 |
for (const entry of widths) { |
| 32811 |
if (typeof entry === "number" || entry instanceof Ref) { |
| 32812 |
widthsBuf.push(entry.toString()); |
| 32813 |
} |
| 32814 |
} |
| 32815 |
hash.update(widthsBuf.join()); |
| 32816 |
} |
| 32817 |
if (composite) { |
| 32818 |
hash.update("compositeFont"); |
| 32819 |
const compositeWidths = dict.get("W") || baseDict.get("W"); |
| 32820 |
if (Array.isArray(compositeWidths)) { |
| 32821 |
const widthsBuf = []; |
| 32822 |
for (const entry of compositeWidths) { |
| 32823 |
if (typeof entry === "number" || entry instanceof Ref) { |
| 32824 |
widthsBuf.push(entry.toString()); |
| 32825 |
} else if (Array.isArray(entry)) { |
| 32826 |
const subWidthsBuf = []; |
| 32827 |
for (const element of entry) { |
| 32828 |
if (typeof element === "number" || element instanceof Ref) { |
| 32829 |
subWidthsBuf.push(element.toString()); |
| 32830 |
} |
| 32831 |
} |
| 32832 |
widthsBuf.push(`[${subWidthsBuf.join()}]`); |
| 32833 |
} |
| 32834 |
} |
| 32835 |
hash.update(widthsBuf.join()); |
| 32836 |
} |
| 32837 |
const cidToGidMap = dict.getRaw("CIDToGIDMap") || baseDict.getRaw("CIDToGIDMap"); |
| 32838 |
if (cidToGidMap instanceof Name) { |
| 32839 |
hash.update(cidToGidMap.name); |
| 32840 |
} else if (cidToGidMap instanceof Ref) { |
| 32841 |
hash.update(cidToGidMap.toString()); |
| 32842 |
} else if (cidToGidMap instanceof BaseStream) { |
| 32843 |
hash.update(cidToGidMap.peekBytes()); |
| 32844 |
} |
| 32845 |
} |
| 32846 |
} |
| 32847 |
return { |
| 32848 |
descriptor, |
| 32849 |
dict, |
| 32850 |
baseDict, |
| 32851 |
composite, |
| 32852 |
type: type.name, |
| 32853 |
firstChar, |
| 32854 |
lastChar, |
| 32855 |
toUnicode, |
| 32856 |
hash: hash ? hash.hexdigest() : "" |
| 32857 |
}; |
| 32858 |
} |
| 32859 |
async translateFont({ |
| 32860 |
descriptor, |
| 32861 |
dict, |
| 32862 |
baseDict, |
| 32863 |
composite, |
| 32864 |
type, |
| 32865 |
firstChar, |
| 32866 |
lastChar, |
| 32867 |
toUnicode, |
| 32868 |
cssFontInfo |
| 32869 |
}) { |
| 32870 |
const isType3Font = type === "Type3"; |
| 32871 |
if (!descriptor) { |
| 32872 |
if (isType3Font) { |
| 32873 |
const bbox = lookupNormalRect(dict.getArray("FontBBox"), [0, 0, 0, 0]); |
| 32874 |
descriptor = new Dict(null); |
| 32875 |
descriptor.set("FontName", Name.get(type)); |
| 32876 |
descriptor.set("FontBBox", bbox); |
| 32877 |
} else { |
| 32878 |
let baseFontName = dict.get("BaseFont"); |
| 32879 |
if (!(baseFontName instanceof Name)) { |
| 32880 |
throw new FormatError("Base font is not specified"); |
| 32881 |
} |
| 32882 |
baseFontName = baseFontName.name.replaceAll(/[,_]/g, "-"); |
| 32883 |
const metrics = this.getBaseFontMetrics(baseFontName); |
| 32884 |
const fontNameWoStyle = baseFontName.split("-", 1)[0]; |
| 32885 |
const flags = (this.isSerifFont(fontNameWoStyle) ? FontFlags.Serif : 0) | (metrics.monospace ? FontFlags.FixedPitch : 0) | (getSymbolsFonts()[fontNameWoStyle] ? FontFlags.Symbolic : FontFlags.Nonsymbolic); |
| 32886 |
const properties = { |
| 32887 |
type, |
| 32888 |
name: baseFontName, |
| 32889 |
loadedName: baseDict.loadedName, |
| 32890 |
systemFontInfo: null, |
| 32891 |
widths: metrics.widths, |
| 32892 |
defaultWidth: metrics.defaultWidth, |
| 32893 |
isSimulatedFlags: true, |
| 32894 |
flags, |
| 32895 |
firstChar, |
| 32896 |
lastChar, |
| 32897 |
toUnicode, |
| 32898 |
xHeight: 0, |
| 32899 |
capHeight: 0, |
| 32900 |
italicAngle: 0, |
| 32901 |
isType3Font |
| 32902 |
}; |
| 32903 |
const widths = dict.get("Widths"); |
| 32904 |
const standardFontName = getStandardFontName(baseFontName); |
| 32905 |
let file = null; |
| 32906 |
if (standardFontName) { |
| 32907 |
file = await this.fetchStandardFontData(standardFontName); |
| 32908 |
properties.isInternalFont = !!file; |
| 32909 |
} |
| 32910 |
if (!properties.isInternalFont && this.options.useSystemFonts) { |
| 32911 |
properties.systemFontInfo = getFontSubstitution(this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, baseFontName, standardFontName, type); |
| 32912 |
} |
| 32913 |
const newProperties = await this.extractDataStructures(dict, properties); |
| 32914 |
if (Array.isArray(widths)) { |
| 32915 |
const glyphWidths = []; |
| 32916 |
let j = firstChar; |
| 32917 |
for (const w of widths) { |
| 32918 |
const width = this.xref.fetchIfRef(w); |
| 32919 |
if (typeof width === "number") { |
| 32920 |
glyphWidths[j] = width; |
| 32921 |
} |
| 32922 |
j++; |
| 32923 |
} |
| 32924 |
newProperties.widths = glyphWidths; |
| 32925 |
} else { |
| 32926 |
newProperties.widths = this.buildCharCodeToWidth(metrics.widths, newProperties); |
| 32927 |
} |
| 32928 |
return new Font(baseFontName, file, newProperties); |
| 32929 |
} |
| 32930 |
} |
| 32931 |
let fontName = descriptor.get("FontName"); |
| 32932 |
let baseFont = dict.get("BaseFont"); |
| 32933 |
if (typeof fontName === "string") { |
| 32934 |
fontName = Name.get(fontName); |
| 32935 |
} |
| 32936 |
if (typeof baseFont === "string") { |
| 32937 |
baseFont = Name.get(baseFont); |
| 32938 |
} |
| 32939 |
const fontNameStr = fontName?.name; |
| 32940 |
const baseFontStr = baseFont?.name; |
| 32941 |
if (!isType3Font && fontNameStr !== baseFontStr) { |
| 32942 |
info(`The FontDescriptor's FontName is "${fontNameStr}" but ` + `should be the same as the Font's BaseFont "${baseFontStr}".`); |
| 32943 |
if (fontNameStr && baseFontStr && (baseFontStr.startsWith(fontNameStr) || !isKnownFontName(fontNameStr) && isKnownFontName(baseFontStr))) { |
| 32944 |
fontName = null; |
| 32945 |
} |
| 32946 |
} |
| 32947 |
fontName ||= baseFont; |
| 32948 |
if (!(fontName instanceof Name)) { |
| 32949 |
throw new FormatError("invalid font name"); |
| 32950 |
} |
| 32951 |
let fontFile, subtype, length1, length2, length3; |
| 32952 |
try { |
| 32953 |
fontFile = descriptor.get("FontFile", "FontFile2", "FontFile3"); |
| 32954 |
} catch (ex) { |
| 32955 |
if (!this.options.ignoreErrors) { |
| 32956 |
throw ex; |
| 32957 |
} |
| 32958 |
warn(`translateFont - fetching "${fontName.name}" font file: "${ex}".`); |
| 32959 |
fontFile = new NullStream(); |
| 32960 |
} |
| 32961 |
let isInternalFont = false; |
| 32962 |
let glyphScaleFactors = null; |
| 32963 |
let systemFontInfo = null; |
| 32964 |
if (fontFile) { |
| 32965 |
if (fontFile.dict) { |
| 32966 |
const subtypeEntry = fontFile.dict.get("Subtype"); |
| 32967 |
if (subtypeEntry instanceof Name) { |
| 32968 |
subtype = subtypeEntry.name; |
| 32969 |
} |
| 32970 |
length1 = fontFile.dict.get("Length1"); |
| 32971 |
length2 = fontFile.dict.get("Length2"); |
| 32972 |
length3 = fontFile.dict.get("Length3"); |
| 32973 |
} |
| 32974 |
} else if (cssFontInfo) { |
| 32975 |
const standardFontName = getXfaFontName(fontName.name); |
| 32976 |
if (standardFontName) { |
| 32977 |
cssFontInfo.fontFamily = `${cssFontInfo.fontFamily}-PdfJS-XFA`; |
| 32978 |
cssFontInfo.metrics = standardFontName.metrics || null; |
| 32979 |
glyphScaleFactors = standardFontName.factors || null; |
| 32980 |
fontFile = await this.fetchStandardFontData(standardFontName.name); |
| 32981 |
isInternalFont = !!fontFile; |
| 32982 |
baseDict = dict = getXfaFontDict(fontName.name); |
| 32983 |
composite = true; |
| 32984 |
} |
| 32985 |
} else if (!isType3Font) { |
| 32986 |
const standardFontName = getStandardFontName(fontName.name); |
| 32987 |
if (standardFontName) { |
| 32988 |
fontFile = await this.fetchStandardFontData(standardFontName); |
| 32989 |
isInternalFont = !!fontFile; |
| 32990 |
} |
| 32991 |
if (!isInternalFont && this.options.useSystemFonts) { |
| 32992 |
systemFontInfo = getFontSubstitution(this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, fontName.name, standardFontName, type); |
| 32993 |
} |
| 32994 |
} |
| 32995 |
const fontMatrix = lookupMatrix(dict.getArray("FontMatrix"), FONT_IDENTITY_MATRIX); |
| 32996 |
const bbox = lookupNormalRect(descriptor.getArray("FontBBox") || dict.getArray("FontBBox"), undefined); |
| 32997 |
let ascent = descriptor.get("Ascent"); |
| 32998 |
if (typeof ascent !== "number") { |
| 32999 |
ascent = undefined; |
| 33000 |
} |
| 33001 |
let descent = descriptor.get("Descent"); |
| 33002 |
if (typeof descent !== "number") { |
| 33003 |
descent = undefined; |
| 33004 |
} |
| 33005 |
let xHeight = descriptor.get("XHeight"); |
| 33006 |
if (typeof xHeight !== "number") { |
| 33007 |
xHeight = 0; |
| 33008 |
} |
| 33009 |
let capHeight = descriptor.get("CapHeight"); |
| 33010 |
if (typeof capHeight !== "number") { |
| 33011 |
capHeight = 0; |
| 33012 |
} |
| 33013 |
let flags = descriptor.get("Flags"); |
| 33014 |
if (!Number.isInteger(flags)) { |
| 33015 |
flags = 0; |
| 33016 |
} |
| 33017 |
let italicAngle = descriptor.get("ItalicAngle"); |
| 33018 |
if (typeof italicAngle !== "number") { |
| 33019 |
italicAngle = 0; |
| 33020 |
} |
| 33021 |
const properties = { |
| 33022 |
type, |
| 33023 |
name: fontName.name, |
| 33024 |
subtype, |
| 33025 |
file: fontFile, |
| 33026 |
length1, |
| 33027 |
length2, |
| 33028 |
length3, |
| 33029 |
isInternalFont, |
| 33030 |
loadedName: baseDict.loadedName, |
| 33031 |
composite, |
| 33032 |
fixedPitch: false, |
| 33033 |
fontMatrix, |
| 33034 |
firstChar, |
| 33035 |
lastChar, |
| 33036 |
toUnicode, |
| 33037 |
bbox, |
| 33038 |
ascent, |
| 33039 |
descent, |
| 33040 |
xHeight, |
| 33041 |
capHeight, |
| 33042 |
flags, |
| 33043 |
italicAngle, |
| 33044 |
isType3Font, |
| 33045 |
cssFontInfo, |
| 33046 |
scaleFactors: glyphScaleFactors, |
| 33047 |
systemFontInfo |
| 33048 |
}; |
| 33049 |
if (composite) { |
| 33050 |
const cidEncoding = baseDict.get("Encoding"); |
| 33051 |
if (cidEncoding instanceof Name) { |
| 33052 |
properties.cidEncoding = cidEncoding.name; |
| 33053 |
} |
| 33054 |
const cMap = await CMapFactory.create({ |
| 33055 |
encoding: cidEncoding, |
| 33056 |
fetchBuiltInCMap: this._fetchBuiltInCMapBound, |
| 33057 |
useCMap: null |
| 33058 |
}); |
| 33059 |
properties.cMap = cMap; |
| 33060 |
properties.vertical = properties.cMap.vertical; |
| 33061 |
} |
| 33062 |
const newProperties = await this.extractDataStructures(dict, properties); |
| 33063 |
this.extractWidths(dict, descriptor, newProperties); |
| 33064 |
return new Font(fontName.name, fontFile, newProperties); |
| 33065 |
} |
| 33066 |
static buildFontPaths(font, glyphs, handler, evaluatorOptions) { |
| 33067 |
function buildPath(fontChar) { |
| 33068 |
const glyphName = `${font.loadedName}_path_${fontChar}`; |
| 33069 |
try { |
| 33070 |
if (font.renderer.hasBuiltPath(fontChar)) { |
| 33071 |
return; |
| 33072 |
} |
| 33073 |
handler.send("commonobj", [glyphName, "FontPath", font.renderer.getPathJs(fontChar)]); |
| 33074 |
} catch (reason) { |
| 33075 |
if (evaluatorOptions.ignoreErrors) { |
| 33076 |
warn(`buildFontPaths - ignoring ${glyphName} glyph: "${reason}".`); |
| 33077 |
return; |
| 33078 |
} |
| 33079 |
throw reason; |
| 33080 |
} |
| 33081 |
} |
| 33082 |
for (const glyph of glyphs) { |
| 33083 |
buildPath(glyph.fontChar); |
| 33084 |
const accent = glyph.accent; |
| 33085 |
if (accent?.fontChar) { |
| 33086 |
buildPath(accent.fontChar); |
| 33087 |
} |
| 33088 |
} |
| 33089 |
} |
| 33090 |
static get fallbackFontDict() { |
| 33091 |
const dict = new Dict(); |
| 33092 |
dict.set("BaseFont", Name.get("Helvetica")); |
| 33093 |
dict.set("Type", Name.get("FallbackType")); |
| 33094 |
dict.set("Subtype", Name.get("FallbackType")); |
| 33095 |
dict.set("Encoding", Name.get("WinAnsiEncoding")); |
| 33096 |
return shadow(this, "fallbackFontDict", dict); |
| 33097 |
} |
| 33098 |
} |
| 33099 |
class TranslatedFont { |
| 33100 |
constructor({ |
| 33101 |
loadedName, |
| 33102 |
font, |
| 33103 |
dict, |
| 33104 |
evaluatorOptions |
| 33105 |
}) { |
| 33106 |
this.loadedName = loadedName; |
| 33107 |
this.font = font; |
| 33108 |
this.dict = dict; |
| 33109 |
this._evaluatorOptions = evaluatorOptions || DefaultPartialEvaluatorOptions; |
| 33110 |
this.type3Loaded = null; |
| 33111 |
this.type3Dependencies = font.isType3Font ? new Set() : null; |
| 33112 |
this.sent = false; |
| 33113 |
} |
| 33114 |
send(handler) { |
| 33115 |
if (this.sent) { |
| 33116 |
return; |
| 33117 |
} |
| 33118 |
this.sent = true; |
| 33119 |
handler.send("commonobj", [this.loadedName, "Font", this.font.exportData(this._evaluatorOptions.fontExtraProperties)]); |
| 33120 |
} |
| 33121 |
fallback(handler) { |
| 33122 |
if (!this.font.data) { |
| 33123 |
return; |
| 33124 |
} |
| 33125 |
this.font.disableFontFace = true; |
| 33126 |
PartialEvaluator.buildFontPaths(this.font, this.font.glyphCacheValues, handler, this._evaluatorOptions); |
| 33127 |
} |
| 33128 |
loadType3Data(evaluator, resources, task) { |
| 33129 |
if (this.type3Loaded) { |
| 33130 |
return this.type3Loaded; |
| 33131 |
} |
| 33132 |
if (!this.font.isType3Font) { |
| 33133 |
throw new Error("Must be a Type3 font."); |
| 33134 |
} |
| 33135 |
const type3Evaluator = evaluator.clone({ |
| 33136 |
ignoreErrors: false |
| 33137 |
}); |
| 33138 |
const type3FontRefs = new RefSet(evaluator.type3FontRefs); |
| 33139 |
if (this.dict.objId && !type3FontRefs.has(this.dict.objId)) { |
| 33140 |
type3FontRefs.put(this.dict.objId); |
| 33141 |
} |
| 33142 |
type3Evaluator.type3FontRefs = type3FontRefs; |
| 33143 |
const translatedFont = this.font, |
| 33144 |
type3Dependencies = this.type3Dependencies; |
| 33145 |
let loadCharProcsPromise = Promise.resolve(); |
| 33146 |
const charProcs = this.dict.get("CharProcs"); |
| 33147 |
const fontResources = this.dict.get("Resources") || resources; |
| 33148 |
const charProcOperatorList = Object.create(null); |
| 33149 |
const fontBBox = Util.normalizeRect(translatedFont.bbox || [0, 0, 0, 0]), |
| 33150 |
width = fontBBox[2] - fontBBox[0], |
| 33151 |
height = fontBBox[3] - fontBBox[1]; |
| 33152 |
const fontBBoxSize = Math.hypot(width, height); |
| 33153 |
for (const key of charProcs.getKeys()) { |
| 33154 |
loadCharProcsPromise = loadCharProcsPromise.then(() => { |
| 33155 |
const glyphStream = charProcs.get(key); |
| 33156 |
const operatorList = new OperatorList(); |
| 33157 |
return type3Evaluator.getOperatorList({ |
| 33158 |
stream: glyphStream, |
| 33159 |
task, |
| 33160 |
resources: fontResources, |
| 33161 |
operatorList |
| 33162 |
}).then(() => { |
| 33163 |
if (operatorList.fnArray[0] === OPS.setCharWidthAndBounds) { |
| 33164 |
this._removeType3ColorOperators(operatorList, fontBBoxSize); |
| 33165 |
} |
| 33166 |
charProcOperatorList[key] = operatorList.getIR(); |
| 33167 |
for (const dependency of operatorList.dependencies) { |
| 33168 |
type3Dependencies.add(dependency); |
| 33169 |
} |
| 33170 |
}).catch(function (reason) { |
| 33171 |
warn(`Type3 font resource "${key}" is not available.`); |
| 33172 |
const dummyOperatorList = new OperatorList(); |
| 33173 |
charProcOperatorList[key] = dummyOperatorList.getIR(); |
| 33174 |
}); |
| 33175 |
}); |
| 33176 |
} |
| 33177 |
this.type3Loaded = loadCharProcsPromise.then(() => { |
| 33178 |
translatedFont.charProcOperatorList = charProcOperatorList; |
| 33179 |
if (this._bbox) { |
| 33180 |
translatedFont.isCharBBox = true; |
| 33181 |
translatedFont.bbox = this._bbox; |
| 33182 |
} |
| 33183 |
}); |
| 33184 |
return this.type3Loaded; |
| 33185 |
} |
| 33186 |
_removeType3ColorOperators(operatorList, fontBBoxSize = NaN) { |
| 33187 |
const charBBox = Util.normalizeRect(operatorList.argsArray[0].slice(2)), |
| 33188 |
width = charBBox[2] - charBBox[0], |
| 33189 |
height = charBBox[3] - charBBox[1]; |
| 33190 |
const charBBoxSize = Math.hypot(width, height); |
| 33191 |
if (width === 0 || height === 0) { |
| 33192 |
operatorList.fnArray.splice(0, 1); |
| 33193 |
operatorList.argsArray.splice(0, 1); |
| 33194 |
} else if (fontBBoxSize === 0 || Math.round(charBBoxSize / fontBBoxSize) >= 10) { |
| 33195 |
if (!this._bbox) { |
| 33196 |
this._bbox = [Infinity, Infinity, -Infinity, -Infinity]; |
| 33197 |
} |
| 33198 |
this._bbox[0] = Math.min(this._bbox[0], charBBox[0]); |
| 33199 |
this._bbox[1] = Math.min(this._bbox[1], charBBox[1]); |
| 33200 |
this._bbox[2] = Math.max(this._bbox[2], charBBox[2]); |
| 33201 |
this._bbox[3] = Math.max(this._bbox[3], charBBox[3]); |
| 33202 |
} |
| 33203 |
let i = 0, |
| 33204 |
ii = operatorList.length; |
| 33205 |
while (i < ii) { |
| 33206 |
switch (operatorList.fnArray[i]) { |
| 33207 |
case OPS.setCharWidthAndBounds: |
| 33208 |
break; |
| 33209 |
case OPS.setStrokeColorSpace: |
| 33210 |
case OPS.setFillColorSpace: |
| 33211 |
case OPS.setStrokeColor: |
| 33212 |
case OPS.setStrokeColorN: |
| 33213 |
case OPS.setFillColor: |
| 33214 |
case OPS.setFillColorN: |
| 33215 |
case OPS.setStrokeGray: |
| 33216 |
case OPS.setFillGray: |
| 33217 |
case OPS.setStrokeRGBColor: |
| 33218 |
case OPS.setFillRGBColor: |
| 33219 |
case OPS.setStrokeCMYKColor: |
| 33220 |
case OPS.setFillCMYKColor: |
| 33221 |
case OPS.shadingFill: |
| 33222 |
case OPS.setRenderingIntent: |
| 33223 |
operatorList.fnArray.splice(i, 1); |
| 33224 |
operatorList.argsArray.splice(i, 1); |
| 33225 |
ii--; |
| 33226 |
continue; |
| 33227 |
case OPS.setGState: |
| 33228 |
const [gStateObj] = operatorList.argsArray[i]; |
| 33229 |
let j = 0, |
| 33230 |
jj = gStateObj.length; |
| 33231 |
while (j < jj) { |
| 33232 |
const [gStateKey] = gStateObj[j]; |
| 33233 |
switch (gStateKey) { |
| 33234 |
case "TR": |
| 33235 |
case "TR2": |
| 33236 |
case "HT": |
| 33237 |
case "BG": |
| 33238 |
case "BG2": |
| 33239 |
case "UCR": |
| 33240 |
case "UCR2": |
| 33241 |
gStateObj.splice(j, 1); |
| 33242 |
jj--; |
| 33243 |
continue; |
| 33244 |
} |
| 33245 |
j++; |
| 33246 |
} |
| 33247 |
break; |
| 33248 |
} |
| 33249 |
i++; |
| 33250 |
} |
| 33251 |
} |
| 33252 |
} |
| 33253 |
class StateManager { |
| 33254 |
constructor(initialState = new EvalState()) { |
| 33255 |
this.state = initialState; |
| 33256 |
this.stateStack = []; |
| 33257 |
} |
| 33258 |
save() { |
| 33259 |
const old = this.state; |
| 33260 |
this.stateStack.push(this.state); |
| 33261 |
this.state = old.clone(); |
| 33262 |
} |
| 33263 |
restore() { |
| 33264 |
const prev = this.stateStack.pop(); |
| 33265 |
if (prev) { |
| 33266 |
this.state = prev; |
| 33267 |
} |
| 33268 |
} |
| 33269 |
transform(args) { |
| 33270 |
this.state.ctm = Util.transform(this.state.ctm, args); |
| 33271 |
} |
| 33272 |
} |
| 33273 |
class TextState { |
| 33274 |
constructor() { |
| 33275 |
this.ctm = new Float32Array(IDENTITY_MATRIX); |
| 33276 |
this.fontName = null; |
| 33277 |
this.fontSize = 0; |
| 33278 |
this.loadedName = null; |
| 33279 |
this.font = null; |
| 33280 |
this.fontMatrix = FONT_IDENTITY_MATRIX; |
| 33281 |
this.textMatrix = IDENTITY_MATRIX.slice(); |
| 33282 |
this.textLineMatrix = IDENTITY_MATRIX.slice(); |
| 33283 |
this.charSpacing = 0; |
| 33284 |
this.wordSpacing = 0; |
| 33285 |
this.leading = 0; |
| 33286 |
this.textHScale = 1; |
| 33287 |
this.textRise = 0; |
| 33288 |
} |
| 33289 |
setTextMatrix(a, b, c, d, e, f) { |
| 33290 |
const m = this.textMatrix; |
| 33291 |
m[0] = a; |
| 33292 |
m[1] = b; |
| 33293 |
m[2] = c; |
| 33294 |
m[3] = d; |
| 33295 |
m[4] = e; |
| 33296 |
m[5] = f; |
| 33297 |
} |
| 33298 |
setTextLineMatrix(a, b, c, d, e, f) { |
| 33299 |
const m = this.textLineMatrix; |
| 33300 |
m[0] = a; |
| 33301 |
m[1] = b; |
| 33302 |
m[2] = c; |
| 33303 |
m[3] = d; |
| 33304 |
m[4] = e; |
| 33305 |
m[5] = f; |
| 33306 |
} |
| 33307 |
translateTextMatrix(x, y) { |
| 33308 |
const m = this.textMatrix; |
| 33309 |
m[4] = m[0] * x + m[2] * y + m[4]; |
| 33310 |
m[5] = m[1] * x + m[3] * y + m[5]; |
| 33311 |
} |
| 33312 |
translateTextLineMatrix(x, y) { |
| 33313 |
const m = this.textLineMatrix; |
| 33314 |
m[4] = m[0] * x + m[2] * y + m[4]; |
| 33315 |
m[5] = m[1] * x + m[3] * y + m[5]; |
| 33316 |
} |
| 33317 |
carriageReturn() { |
| 33318 |
this.translateTextLineMatrix(0, -this.leading); |
| 33319 |
this.textMatrix = this.textLineMatrix.slice(); |
| 33320 |
} |
| 33321 |
clone() { |
| 33322 |
const clone = Object.create(this); |
| 33323 |
clone.textMatrix = this.textMatrix.slice(); |
| 33324 |
clone.textLineMatrix = this.textLineMatrix.slice(); |
| 33325 |
clone.fontMatrix = this.fontMatrix.slice(); |
| 33326 |
return clone; |
| 33327 |
} |
| 33328 |
} |
| 33329 |
class EvalState { |
| 33330 |
constructor() { |
| 33331 |
this.ctm = new Float32Array(IDENTITY_MATRIX); |
| 33332 |
this.font = null; |
| 33333 |
this.textRenderingMode = TextRenderingMode.FILL; |
| 33334 |
this._fillColorSpace = ColorSpace.singletons.gray; |
| 33335 |
this._strokeColorSpace = ColorSpace.singletons.gray; |
| 33336 |
this.patternFillColorSpace = null; |
| 33337 |
this.patternStrokeColorSpace = null; |
| 33338 |
} |
| 33339 |
get fillColorSpace() { |
| 33340 |
return this._fillColorSpace; |
| 33341 |
} |
| 33342 |
set fillColorSpace(colorSpace) { |
| 33343 |
this._fillColorSpace = this.patternFillColorSpace = colorSpace; |
| 33344 |
} |
| 33345 |
get strokeColorSpace() { |
| 33346 |
return this._strokeColorSpace; |
| 33347 |
} |
| 33348 |
set strokeColorSpace(colorSpace) { |
| 33349 |
this._strokeColorSpace = this.patternStrokeColorSpace = colorSpace; |
| 33350 |
} |
| 33351 |
clone() { |
| 33352 |
return Object.create(this); |
| 33353 |
} |
| 33354 |
} |
| 33355 |
class EvaluatorPreprocessor { |
| 33356 |
static get opMap() { |
| 33357 |
return shadow(this, "opMap", Object.assign(Object.create(null), { |
| 33358 |
w: { |
| 33359 |
id: OPS.setLineWidth, |
| 33360 |
numArgs: 1, |
| 33361 |
variableArgs: false |
| 33362 |
}, |
| 33363 |
J: { |
| 33364 |
id: OPS.setLineCap, |
| 33365 |
numArgs: 1, |
| 33366 |
variableArgs: false |
| 33367 |
}, |
| 33368 |
j: { |
| 33369 |
id: OPS.setLineJoin, |
| 33370 |
numArgs: 1, |
| 33371 |
variableArgs: false |
| 33372 |
}, |
| 33373 |
M: { |
| 33374 |
id: OPS.setMiterLimit, |
| 33375 |
numArgs: 1, |
| 33376 |
variableArgs: false |
| 33377 |
}, |
| 33378 |
d: { |
| 33379 |
id: OPS.setDash, |
| 33380 |
numArgs: 2, |
| 33381 |
variableArgs: false |
| 33382 |
}, |
| 33383 |
ri: { |
| 33384 |
id: OPS.setRenderingIntent, |
| 33385 |
numArgs: 1, |
| 33386 |
variableArgs: false |
| 33387 |
}, |
| 33388 |
i: { |
| 33389 |
id: OPS.setFlatness, |
| 33390 |
numArgs: 1, |
| 33391 |
variableArgs: false |
| 33392 |
}, |
| 33393 |
gs: { |
| 33394 |
id: OPS.setGState, |
| 33395 |
numArgs: 1, |
| 33396 |
variableArgs: false |
| 33397 |
}, |
| 33398 |
q: { |
| 33399 |
id: OPS.save, |
| 33400 |
numArgs: 0, |
| 33401 |
variableArgs: false |
| 33402 |
}, |
| 33403 |
Q: { |
| 33404 |
id: OPS.restore, |
| 33405 |
numArgs: 0, |
| 33406 |
variableArgs: false |
| 33407 |
}, |
| 33408 |
cm: { |
| 33409 |
id: OPS.transform, |
| 33410 |
numArgs: 6, |
| 33411 |
variableArgs: false |
| 33412 |
}, |
| 33413 |
m: { |
| 33414 |
id: OPS.moveTo, |
| 33415 |
numArgs: 2, |
| 33416 |
variableArgs: false |
| 33417 |
}, |
| 33418 |
l: { |
| 33419 |
id: OPS.lineTo, |
| 33420 |
numArgs: 2, |
| 33421 |
variableArgs: false |
| 33422 |
}, |
| 33423 |
c: { |
| 33424 |
id: OPS.curveTo, |
| 33425 |
numArgs: 6, |
| 33426 |
variableArgs: false |
| 33427 |
}, |
| 33428 |
v: { |
| 33429 |
id: OPS.curveTo2, |
| 33430 |
numArgs: 4, |
| 33431 |
variableArgs: false |
| 33432 |
}, |
| 33433 |
y: { |
| 33434 |
id: OPS.curveTo3, |
| 33435 |
numArgs: 4, |
| 33436 |
variableArgs: false |
| 33437 |
}, |
| 33438 |
h: { |
| 33439 |
id: OPS.closePath, |
| 33440 |
numArgs: 0, |
| 33441 |
variableArgs: false |
| 33442 |
}, |
| 33443 |
re: { |
| 33444 |
id: OPS.rectangle, |
| 33445 |
numArgs: 4, |
| 33446 |
variableArgs: false |
| 33447 |
}, |
| 33448 |
S: { |
| 33449 |
id: OPS.stroke, |
| 33450 |
numArgs: 0, |
| 33451 |
variableArgs: false |
| 33452 |
}, |
| 33453 |
s: { |
| 33454 |
id: OPS.closeStroke, |
| 33455 |
numArgs: 0, |
| 33456 |
variableArgs: false |
| 33457 |
}, |
| 33458 |
f: { |
| 33459 |
id: OPS.fill, |
| 33460 |
numArgs: 0, |
| 33461 |
variableArgs: false |
| 33462 |
}, |
| 33463 |
F: { |
| 33464 |
id: OPS.fill, |
| 33465 |
numArgs: 0, |
| 33466 |
variableArgs: false |
| 33467 |
}, |
| 33468 |
"f*": { |
| 33469 |
id: OPS.eoFill, |
| 33470 |
numArgs: 0, |
| 33471 |
variableArgs: false |
| 33472 |
}, |
| 33473 |
B: { |
| 33474 |
id: OPS.fillStroke, |
| 33475 |
numArgs: 0, |
| 33476 |
variableArgs: false |
| 33477 |
}, |
| 33478 |
"B*": { |
| 33479 |
id: OPS.eoFillStroke, |
| 33480 |
numArgs: 0, |
| 33481 |
variableArgs: false |
| 33482 |
}, |
| 33483 |
b: { |
| 33484 |
id: OPS.closeFillStroke, |
| 33485 |
numArgs: 0, |
| 33486 |
variableArgs: false |
| 33487 |
}, |
| 33488 |
"b*": { |
| 33489 |
id: OPS.closeEOFillStroke, |
| 33490 |
numArgs: 0, |
| 33491 |
variableArgs: false |
| 33492 |
}, |
| 33493 |
n: { |
| 33494 |
id: OPS.endPath, |
| 33495 |
numArgs: 0, |
| 33496 |
variableArgs: false |
| 33497 |
}, |
| 33498 |
W: { |
| 33499 |
id: OPS.clip, |
| 33500 |
numArgs: 0, |
| 33501 |
variableArgs: false |
| 33502 |
}, |
| 33503 |
"W*": { |
| 33504 |
id: OPS.eoClip, |
| 33505 |
numArgs: 0, |
| 33506 |
variableArgs: false |
| 33507 |
}, |
| 33508 |
BT: { |
| 33509 |
id: OPS.beginText, |
| 33510 |
numArgs: 0, |
| 33511 |
variableArgs: false |
| 33512 |
}, |
| 33513 |
ET: { |
| 33514 |
id: OPS.endText, |
| 33515 |
numArgs: 0, |
| 33516 |
variableArgs: false |
| 33517 |
}, |
| 33518 |
Tc: { |
| 33519 |
id: OPS.setCharSpacing, |
| 33520 |
numArgs: 1, |
| 33521 |
variableArgs: false |
| 33522 |
}, |
| 33523 |
Tw: { |
| 33524 |
id: OPS.setWordSpacing, |
| 33525 |
numArgs: 1, |
| 33526 |
variableArgs: false |
| 33527 |
}, |
| 33528 |
Tz: { |
| 33529 |
id: OPS.setHScale, |
| 33530 |
numArgs: 1, |
| 33531 |
variableArgs: false |
| 33532 |
}, |
| 33533 |
TL: { |
| 33534 |
id: OPS.setLeading, |
| 33535 |
numArgs: 1, |
| 33536 |
variableArgs: false |
| 33537 |
}, |
| 33538 |
Tf: { |
| 33539 |
id: OPS.setFont, |
| 33540 |
numArgs: 2, |
| 33541 |
variableArgs: false |
| 33542 |
}, |
| 33543 |
Tr: { |
| 33544 |
id: OPS.setTextRenderingMode, |
| 33545 |
numArgs: 1, |
| 33546 |
variableArgs: false |
| 33547 |
}, |
| 33548 |
Ts: { |
| 33549 |
id: OPS.setTextRise, |
| 33550 |
numArgs: 1, |
| 33551 |
variableArgs: false |
| 33552 |
}, |
| 33553 |
Td: { |
| 33554 |
id: OPS.moveText, |
| 33555 |
numArgs: 2, |
| 33556 |
variableArgs: false |
| 33557 |
}, |
| 33558 |
TD: { |
| 33559 |
id: OPS.setLeadingMoveText, |
| 33560 |
numArgs: 2, |
| 33561 |
variableArgs: false |
| 33562 |
}, |
| 33563 |
Tm: { |
| 33564 |
id: OPS.setTextMatrix, |
| 33565 |
numArgs: 6, |
| 33566 |
variableArgs: false |
| 33567 |
}, |
| 33568 |
"T*": { |
| 33569 |
id: OPS.nextLine, |
| 33570 |
numArgs: 0, |
| 33571 |
variableArgs: false |
| 33572 |
}, |
| 33573 |
Tj: { |
| 33574 |
id: OPS.showText, |
| 33575 |
numArgs: 1, |
| 33576 |
variableArgs: false |
| 33577 |
}, |
| 33578 |
TJ: { |
| 33579 |
id: OPS.showSpacedText, |
| 33580 |
numArgs: 1, |
| 33581 |
variableArgs: false |
| 33582 |
}, |
| 33583 |
"'": { |
| 33584 |
id: OPS.nextLineShowText, |
| 33585 |
numArgs: 1, |
| 33586 |
variableArgs: false |
| 33587 |
}, |
| 33588 |
'"': { |
| 33589 |
id: OPS.nextLineSetSpacingShowText, |
| 33590 |
numArgs: 3, |
| 33591 |
variableArgs: false |
| 33592 |
}, |
| 33593 |
d0: { |
| 33594 |
id: OPS.setCharWidth, |
| 33595 |
numArgs: 2, |
| 33596 |
variableArgs: false |
| 33597 |
}, |
| 33598 |
d1: { |
| 33599 |
id: OPS.setCharWidthAndBounds, |
| 33600 |
numArgs: 6, |
| 33601 |
variableArgs: false |
| 33602 |
}, |
| 33603 |
CS: { |
| 33604 |
id: OPS.setStrokeColorSpace, |
| 33605 |
numArgs: 1, |
| 33606 |
variableArgs: false |
| 33607 |
}, |
| 33608 |
cs: { |
| 33609 |
id: OPS.setFillColorSpace, |
| 33610 |
numArgs: 1, |
| 33611 |
variableArgs: false |
| 33612 |
}, |
| 33613 |
SC: { |
| 33614 |
id: OPS.setStrokeColor, |
| 33615 |
numArgs: 4, |
| 33616 |
variableArgs: true |
| 33617 |
}, |
| 33618 |
SCN: { |
| 33619 |
id: OPS.setStrokeColorN, |
| 33620 |
numArgs: 33, |
| 33621 |
variableArgs: true |
| 33622 |
}, |
| 33623 |
sc: { |
| 33624 |
id: OPS.setFillColor, |
| 33625 |
numArgs: 4, |
| 33626 |
variableArgs: true |
| 33627 |
}, |
| 33628 |
scn: { |
| 33629 |
id: OPS.setFillColorN, |
| 33630 |
numArgs: 33, |
| 33631 |
variableArgs: true |
| 33632 |
}, |
| 33633 |
G: { |
| 33634 |
id: OPS.setStrokeGray, |
| 33635 |
numArgs: 1, |
| 33636 |
variableArgs: false |
| 33637 |
}, |
| 33638 |
g: { |
| 33639 |
id: OPS.setFillGray, |
| 33640 |
numArgs: 1, |
| 33641 |
variableArgs: false |
| 33642 |
}, |
| 33643 |
RG: { |
| 33644 |
id: OPS.setStrokeRGBColor, |
| 33645 |
numArgs: 3, |
| 33646 |
variableArgs: false |
| 33647 |
}, |
| 33648 |
rg: { |
| 33649 |
id: OPS.setFillRGBColor, |
| 33650 |
numArgs: 3, |
| 33651 |
variableArgs: false |
| 33652 |
}, |
| 33653 |
K: { |
| 33654 |
id: OPS.setStrokeCMYKColor, |
| 33655 |
numArgs: 4, |
| 33656 |
variableArgs: false |
| 33657 |
}, |
| 33658 |
k: { |
| 33659 |
id: OPS.setFillCMYKColor, |
| 33660 |
numArgs: 4, |
| 33661 |
variableArgs: false |
| 33662 |
}, |
| 33663 |
sh: { |
| 33664 |
id: OPS.shadingFill, |
| 33665 |
numArgs: 1, |
| 33666 |
variableArgs: false |
| 33667 |
}, |
| 33668 |
BI: { |
| 33669 |
id: OPS.beginInlineImage, |
| 33670 |
numArgs: 0, |
| 33671 |
variableArgs: false |
| 33672 |
}, |
| 33673 |
ID: { |
| 33674 |
id: OPS.beginImageData, |
| 33675 |
numArgs: 0, |
| 33676 |
variableArgs: false |
| 33677 |
}, |
| 33678 |
EI: { |
| 33679 |
id: OPS.endInlineImage, |
| 33680 |
numArgs: 1, |
| 33681 |
variableArgs: false |
| 33682 |
}, |
| 33683 |
Do: { |
| 33684 |
id: OPS.paintXObject, |
| 33685 |
numArgs: 1, |
| 33686 |
variableArgs: false |
| 33687 |
}, |
| 33688 |
MP: { |
| 33689 |
id: OPS.markPoint, |
| 33690 |
numArgs: 1, |
| 33691 |
variableArgs: false |
| 33692 |
}, |
| 33693 |
DP: { |
| 33694 |
id: OPS.markPointProps, |
| 33695 |
numArgs: 2, |
| 33696 |
variableArgs: false |
| 33697 |
}, |
| 33698 |
BMC: { |
| 33699 |
id: OPS.beginMarkedContent, |
| 33700 |
numArgs: 1, |
| 33701 |
variableArgs: false |
| 33702 |
}, |
| 33703 |
BDC: { |
| 33704 |
id: OPS.beginMarkedContentProps, |
| 33705 |
numArgs: 2, |
| 33706 |
variableArgs: false |
| 33707 |
}, |
| 33708 |
EMC: { |
| 33709 |
id: OPS.endMarkedContent, |
| 33710 |
numArgs: 0, |
| 33711 |
variableArgs: false |
| 33712 |
}, |
| 33713 |
BX: { |
| 33714 |
id: OPS.beginCompat, |
| 33715 |
numArgs: 0, |
| 33716 |
variableArgs: false |
| 33717 |
}, |
| 33718 |
EX: { |
| 33719 |
id: OPS.endCompat, |
| 33720 |
numArgs: 0, |
| 33721 |
variableArgs: false |
| 33722 |
}, |
| 33723 |
BM: null, |
| 33724 |
BD: null, |
| 33725 |
true: null, |
| 33726 |
fa: null, |
| 33727 |
fal: null, |
| 33728 |
fals: null, |
| 33729 |
false: null, |
| 33730 |
nu: null, |
| 33731 |
nul: null, |
| 33732 |
null: null |
| 33733 |
})); |
| 33734 |
} |
| 33735 |
static MAX_INVALID_PATH_OPS = 10; |
| 33736 |
constructor(stream, xref, stateManager = new StateManager()) { |
| 33737 |
this.parser = new Parser({ |
| 33738 |
lexer: new Lexer(stream, EvaluatorPreprocessor.opMap), |
| 33739 |
xref |
| 33740 |
}); |
| 33741 |
this.stateManager = stateManager; |
| 33742 |
this.nonProcessedArgs = []; |
| 33743 |
this._isPathOp = false; |
| 33744 |
this._numInvalidPathOPS = 0; |
| 33745 |
} |
| 33746 |
get savedStatesDepth() { |
| 33747 |
return this.stateManager.stateStack.length; |
| 33748 |
} |
| 33749 |
read(operation) { |
| 33750 |
let args = operation.args; |
| 33751 |
while (true) { |
| 33752 |
const obj = this.parser.getObj(); |
| 33753 |
if (obj instanceof Cmd) { |
| 33754 |
const cmd = obj.cmd; |
| 33755 |
const opSpec = EvaluatorPreprocessor.opMap[cmd]; |
| 33756 |
if (!opSpec) { |
| 33757 |
warn(`Unknown command "${cmd}".`); |
| 33758 |
continue; |
| 33759 |
} |
| 33760 |
const fn = opSpec.id; |
| 33761 |
const numArgs = opSpec.numArgs; |
| 33762 |
let argsLength = args !== null ? args.length : 0; |
| 33763 |
if (!this._isPathOp) { |
| 33764 |
this._numInvalidPathOPS = 0; |
| 33765 |
} |
| 33766 |
this._isPathOp = fn >= OPS.moveTo && fn <= OPS.endPath; |
| 33767 |
if (!opSpec.variableArgs) { |
| 33768 |
if (argsLength !== numArgs) { |
| 33769 |
const nonProcessedArgs = this.nonProcessedArgs; |
| 33770 |
while (argsLength > numArgs) { |
| 33771 |
nonProcessedArgs.push(args.shift()); |
| 33772 |
argsLength--; |
| 33773 |
} |
| 33774 |
while (argsLength < numArgs && nonProcessedArgs.length !== 0) { |
| 33775 |
if (args === null) { |
| 33776 |
args = []; |
| 33777 |
} |
| 33778 |
args.unshift(nonProcessedArgs.pop()); |
| 33779 |
argsLength++; |
| 33780 |
} |
| 33781 |
} |
| 33782 |
if (argsLength < numArgs) { |
| 33783 |
const partialMsg = `command ${cmd}: expected ${numArgs} args, ` + `but received ${argsLength} args.`; |
| 33784 |
if (this._isPathOp && ++this._numInvalidPathOPS > EvaluatorPreprocessor.MAX_INVALID_PATH_OPS) { |
| 33785 |
throw new FormatError(`Invalid ${partialMsg}`); |
| 33786 |
} |
| 33787 |
warn(`Skipping ${partialMsg}`); |
| 33788 |
if (args !== null) { |
| 33789 |
args.length = 0; |
| 33790 |
} |
| 33791 |
continue; |
| 33792 |
} |
| 33793 |
} else if (argsLength > numArgs) { |
| 33794 |
info(`Command ${cmd}: expected [0, ${numArgs}] args, ` + `but received ${argsLength} args.`); |
| 33795 |
} |
| 33796 |
this.preprocessCommand(fn, args); |
| 33797 |
operation.fn = fn; |
| 33798 |
operation.args = args; |
| 33799 |
return true; |
| 33800 |
} |
| 33801 |
if (obj === EOF) { |
| 33802 |
return false; |
| 33803 |
} |
| 33804 |
if (obj !== null) { |
| 33805 |
if (args === null) { |
| 33806 |
args = []; |
| 33807 |
} |
| 33808 |
args.push(obj); |
| 33809 |
if (args.length > 33) { |
| 33810 |
throw new FormatError("Too many arguments"); |
| 33811 |
} |
| 33812 |
} |
| 33813 |
} |
| 33814 |
} |
| 33815 |
preprocessCommand(fn, args) { |
| 33816 |
switch (fn | 0) { |
| 33817 |
case OPS.save: |
| 33818 |
this.stateManager.save(); |
| 33819 |
break; |
| 33820 |
case OPS.restore: |
| 33821 |
this.stateManager.restore(); |
| 33822 |
break; |
| 33823 |
case OPS.transform: |
| 33824 |
this.stateManager.transform(args); |
| 33825 |
break; |
| 33826 |
} |
| 33827 |
} |
| 33828 |
} |
| 33829 |
|
| 33830 |
;// ./src/core/default_appearance.js |
| 33831 |
|
| 33832 |
|
| 33833 |
|
| 33834 |
|
| 33835 |
|
| 33836 |
|
| 33837 |
|
| 33838 |
|
| 33839 |
class DefaultAppearanceEvaluator extends EvaluatorPreprocessor { |
| 33840 |
constructor(str) { |
| 33841 |
super(new StringStream(str)); |
| 33842 |
} |
| 33843 |
parse() { |
| 33844 |
const operation = { |
| 33845 |
fn: 0, |
| 33846 |
args: [] |
| 33847 |
}; |
| 33848 |
const result = { |
| 33849 |
fontSize: 0, |
| 33850 |
fontName: "", |
| 33851 |
fontColor: new Uint8ClampedArray(3) |
| 33852 |
}; |
| 33853 |
try { |
| 33854 |
while (true) { |
| 33855 |
operation.args.length = 0; |
| 33856 |
if (!this.read(operation)) { |
| 33857 |
break; |
| 33858 |
} |
| 33859 |
if (this.savedStatesDepth !== 0) { |
| 33860 |
continue; |
| 33861 |
} |
| 33862 |
const { |
| 33863 |
fn, |
| 33864 |
args |
| 33865 |
} = operation; |
| 33866 |
switch (fn | 0) { |
| 33867 |
case OPS.setFont: |
| 33868 |
const [fontName, fontSize] = args; |
| 33869 |
if (fontName instanceof Name) { |
| 33870 |
result.fontName = fontName.name; |
| 33871 |
} |
| 33872 |
if (typeof fontSize === "number" && fontSize > 0) { |
| 33873 |
result.fontSize = fontSize; |
| 33874 |
} |
| 33875 |
break; |
| 33876 |
case OPS.setFillRGBColor: |
| 33877 |
ColorSpace.singletons.rgb.getRgbItem(args, 0, result.fontColor, 0); |
| 33878 |
break; |
| 33879 |
case OPS.setFillGray: |
| 33880 |
ColorSpace.singletons.gray.getRgbItem(args, 0, result.fontColor, 0); |
| 33881 |
break; |
| 33882 |
case OPS.setFillCMYKColor: |
| 33883 |
ColorSpace.singletons.cmyk.getRgbItem(args, 0, result.fontColor, 0); |
| 33884 |
break; |
| 33885 |
} |
| 33886 |
} |
| 33887 |
} catch (reason) { |
| 33888 |
warn(`parseDefaultAppearance - ignoring errors: "${reason}".`); |
| 33889 |
} |
| 33890 |
return result; |
| 33891 |
} |
| 33892 |
} |
| 33893 |
function parseDefaultAppearance(str) { |
| 33894 |
return new DefaultAppearanceEvaluator(str).parse(); |
| 33895 |
} |
| 33896 |
class AppearanceStreamEvaluator extends EvaluatorPreprocessor { |
| 33897 |
constructor(stream, evaluatorOptions, xref) { |
| 33898 |
super(stream); |
| 33899 |
this.stream = stream; |
| 33900 |
this.evaluatorOptions = evaluatorOptions; |
| 33901 |
this.xref = xref; |
| 33902 |
this.resources = stream.dict?.get("Resources"); |
| 33903 |
} |
| 33904 |
parse() { |
| 33905 |
const operation = { |
| 33906 |
fn: 0, |
| 33907 |
args: [] |
| 33908 |
}; |
| 33909 |
let result = { |
| 33910 |
scaleFactor: 1, |
| 33911 |
fontSize: 0, |
| 33912 |
fontName: "", |
| 33913 |
fontColor: new Uint8ClampedArray(3), |
| 33914 |
fillColorSpace: ColorSpace.singletons.gray |
| 33915 |
}; |
| 33916 |
let breakLoop = false; |
| 33917 |
const stack = []; |
| 33918 |
try { |
| 33919 |
while (true) { |
| 33920 |
operation.args.length = 0; |
| 33921 |
if (breakLoop || !this.read(operation)) { |
| 33922 |
break; |
| 33923 |
} |
| 33924 |
const { |
| 33925 |
fn, |
| 33926 |
args |
| 33927 |
} = operation; |
| 33928 |
switch (fn | 0) { |
| 33929 |
case OPS.save: |
| 33930 |
stack.push({ |
| 33931 |
scaleFactor: result.scaleFactor, |
| 33932 |
fontSize: result.fontSize, |
| 33933 |
fontName: result.fontName, |
| 33934 |
fontColor: result.fontColor.slice(), |
| 33935 |
fillColorSpace: result.fillColorSpace |
| 33936 |
}); |
| 33937 |
break; |
| 33938 |
case OPS.restore: |
| 33939 |
result = stack.pop() || result; |
| 33940 |
break; |
| 33941 |
case OPS.setTextMatrix: |
| 33942 |
result.scaleFactor *= Math.hypot(args[0], args[1]); |
| 33943 |
break; |
| 33944 |
case OPS.setFont: |
| 33945 |
const [fontName, fontSize] = args; |
| 33946 |
if (fontName instanceof Name) { |
| 33947 |
result.fontName = fontName.name; |
| 33948 |
} |
| 33949 |
if (typeof fontSize === "number" && fontSize > 0) { |
| 33950 |
result.fontSize = fontSize * result.scaleFactor; |
| 33951 |
} |
| 33952 |
break; |
| 33953 |
case OPS.setFillColorSpace: |
| 33954 |
result.fillColorSpace = ColorSpace.parse({ |
| 33955 |
cs: args[0], |
| 33956 |
xref: this.xref, |
| 33957 |
resources: this.resources, |
| 33958 |
pdfFunctionFactory: this._pdfFunctionFactory, |
| 33959 |
localColorSpaceCache: this._localColorSpaceCache |
| 33960 |
}); |
| 33961 |
break; |
| 33962 |
case OPS.setFillColor: |
| 33963 |
const cs = result.fillColorSpace; |
| 33964 |
cs.getRgbItem(args, 0, result.fontColor, 0); |
| 33965 |
break; |
| 33966 |
case OPS.setFillRGBColor: |
| 33967 |
ColorSpace.singletons.rgb.getRgbItem(args, 0, result.fontColor, 0); |
| 33968 |
break; |
| 33969 |
case OPS.setFillGray: |
| 33970 |
ColorSpace.singletons.gray.getRgbItem(args, 0, result.fontColor, 0); |
| 33971 |
break; |
| 33972 |
case OPS.setFillCMYKColor: |
| 33973 |
ColorSpace.singletons.cmyk.getRgbItem(args, 0, result.fontColor, 0); |
| 33974 |
break; |
| 33975 |
case OPS.showText: |
| 33976 |
case OPS.showSpacedText: |
| 33977 |
case OPS.nextLineShowText: |
| 33978 |
case OPS.nextLineSetSpacingShowText: |
| 33979 |
breakLoop = true; |
| 33980 |
break; |
| 33981 |
} |
| 33982 |
} |
| 33983 |
} catch (reason) { |
| 33984 |
warn(`parseAppearanceStream - ignoring errors: "${reason}".`); |
| 33985 |
} |
| 33986 |
this.stream.reset(); |
| 33987 |
delete result.scaleFactor; |
| 33988 |
delete result.fillColorSpace; |
| 33989 |
return result; |
| 33990 |
} |
| 33991 |
get _localColorSpaceCache() { |
| 33992 |
return shadow(this, "_localColorSpaceCache", new LocalColorSpaceCache()); |
| 33993 |
} |
| 33994 |
get _pdfFunctionFactory() { |
| 33995 |
const pdfFunctionFactory = new PDFFunctionFactory({ |
| 33996 |
xref: this.xref, |
| 33997 |
isEvalSupported: this.evaluatorOptions.isEvalSupported |
| 33998 |
}); |
| 33999 |
return shadow(this, "_pdfFunctionFactory", pdfFunctionFactory); |
| 34000 |
} |
| 34001 |
} |
| 34002 |
function parseAppearanceStream(stream, evaluatorOptions, xref) { |
| 34003 |
return new AppearanceStreamEvaluator(stream, evaluatorOptions, xref).parse(); |
| 34004 |
} |
| 34005 |
function getPdfColor(color, isFill) { |
| 34006 |
if (color[0] === color[1] && color[1] === color[2]) { |
| 34007 |
const gray = color[0] / 255; |
| 34008 |
return `${numberToString(gray)} ${isFill ? "g" : "G"}`; |
| 34009 |
} |
| 34010 |
return Array.from(color, c => numberToString(c / 255)).join(" ") + ` ${isFill ? "rg" : "RG"}`; |
| 34011 |
} |
| 34012 |
function createDefaultAppearance({ |
| 34013 |
fontSize, |
| 34014 |
fontName, |
| 34015 |
fontColor |
| 34016 |
}) { |
| 34017 |
return `/${escapePDFName(fontName)} ${fontSize} Tf ${getPdfColor(fontColor, true)}`; |
| 34018 |
} |
| 34019 |
class FakeUnicodeFont { |
| 34020 |
constructor(xref, fontFamily) { |
| 34021 |
this.xref = xref; |
| 34022 |
this.widths = null; |
| 34023 |
this.firstChar = Infinity; |
| 34024 |
this.lastChar = -Infinity; |
| 34025 |
this.fontFamily = fontFamily; |
| 34026 |
const canvas = new OffscreenCanvas(1, 1); |
| 34027 |
this.ctxMeasure = canvas.getContext("2d", { |
| 34028 |
willReadFrequently: true |
| 34029 |
}); |
| 34030 |
if (!FakeUnicodeFont._fontNameId) { |
| 34031 |
FakeUnicodeFont._fontNameId = 1; |
| 34032 |
} |
| 34033 |
this.fontName = Name.get(`InvalidPDFjsFont_${fontFamily}_${FakeUnicodeFont._fontNameId++}`); |
| 34034 |
} |
| 34035 |
get fontDescriptorRef() { |
| 34036 |
if (!FakeUnicodeFont._fontDescriptorRef) { |
| 34037 |
const fontDescriptor = new Dict(this.xref); |
| 34038 |
fontDescriptor.set("Type", Name.get("FontDescriptor")); |
| 34039 |
fontDescriptor.set("FontName", this.fontName); |
| 34040 |
fontDescriptor.set("FontFamily", "MyriadPro Regular"); |
| 34041 |
fontDescriptor.set("FontBBox", [0, 0, 0, 0]); |
| 34042 |
fontDescriptor.set("FontStretch", Name.get("Normal")); |
| 34043 |
fontDescriptor.set("FontWeight", 400); |
| 34044 |
fontDescriptor.set("ItalicAngle", 0); |
| 34045 |
FakeUnicodeFont._fontDescriptorRef = this.xref.getNewPersistentRef(fontDescriptor); |
| 34046 |
} |
| 34047 |
return FakeUnicodeFont._fontDescriptorRef; |
| 34048 |
} |
| 34049 |
get descendantFontRef() { |
| 34050 |
const descendantFont = new Dict(this.xref); |
| 34051 |
descendantFont.set("BaseFont", this.fontName); |
| 34052 |
descendantFont.set("Type", Name.get("Font")); |
| 34053 |
descendantFont.set("Subtype", Name.get("CIDFontType0")); |
| 34054 |
descendantFont.set("CIDToGIDMap", Name.get("Identity")); |
| 34055 |
descendantFont.set("FirstChar", this.firstChar); |
| 34056 |
descendantFont.set("LastChar", this.lastChar); |
| 34057 |
descendantFont.set("FontDescriptor", this.fontDescriptorRef); |
| 34058 |
descendantFont.set("DW", 1000); |
| 34059 |
const widths = []; |
| 34060 |
const chars = [...this.widths.entries()].sort(); |
| 34061 |
let currentChar = null; |
| 34062 |
let currentWidths = null; |
| 34063 |
for (const [char, width] of chars) { |
| 34064 |
if (!currentChar) { |
| 34065 |
currentChar = char; |
| 34066 |
currentWidths = [width]; |
| 34067 |
continue; |
| 34068 |
} |
| 34069 |
if (char === currentChar + currentWidths.length) { |
| 34070 |
currentWidths.push(width); |
| 34071 |
} else { |
| 34072 |
widths.push(currentChar, currentWidths); |
| 34073 |
currentChar = char; |
| 34074 |
currentWidths = [width]; |
| 34075 |
} |
| 34076 |
} |
| 34077 |
if (currentChar) { |
| 34078 |
widths.push(currentChar, currentWidths); |
| 34079 |
} |
| 34080 |
descendantFont.set("W", widths); |
| 34081 |
const cidSystemInfo = new Dict(this.xref); |
| 34082 |
cidSystemInfo.set("Ordering", "Identity"); |
| 34083 |
cidSystemInfo.set("Registry", "Adobe"); |
| 34084 |
cidSystemInfo.set("Supplement", 0); |
| 34085 |
descendantFont.set("CIDSystemInfo", cidSystemInfo); |
| 34086 |
return this.xref.getNewPersistentRef(descendantFont); |
| 34087 |
} |
| 34088 |
get baseFontRef() { |
| 34089 |
const baseFont = new Dict(this.xref); |
| 34090 |
baseFont.set("BaseFont", this.fontName); |
| 34091 |
baseFont.set("Type", Name.get("Font")); |
| 34092 |
baseFont.set("Subtype", Name.get("Type0")); |
| 34093 |
baseFont.set("Encoding", Name.get("Identity-H")); |
| 34094 |
baseFont.set("DescendantFonts", [this.descendantFontRef]); |
| 34095 |
baseFont.set("ToUnicode", Name.get("Identity-H")); |
| 34096 |
return this.xref.getNewPersistentRef(baseFont); |
| 34097 |
} |
| 34098 |
get resources() { |
| 34099 |
const resources = new Dict(this.xref); |
| 34100 |
const font = new Dict(this.xref); |
| 34101 |
font.set(this.fontName.name, this.baseFontRef); |
| 34102 |
resources.set("Font", font); |
| 34103 |
return resources; |
| 34104 |
} |
| 34105 |
_createContext() { |
| 34106 |
this.widths = new Map(); |
| 34107 |
this.ctxMeasure.font = `1000px ${this.fontFamily}`; |
| 34108 |
return this.ctxMeasure; |
| 34109 |
} |
| 34110 |
createFontResources(text) { |
| 34111 |
const ctx = this._createContext(); |
| 34112 |
for (const line of text.split(/\r\n?|\n/)) { |
| 34113 |
for (const char of line.split("")) { |
| 34114 |
const code = char.charCodeAt(0); |
| 34115 |
if (this.widths.has(code)) { |
| 34116 |
continue; |
| 34117 |
} |
| 34118 |
const metrics = ctx.measureText(char); |
| 34119 |
const width = Math.ceil(metrics.width); |
| 34120 |
this.widths.set(code, width); |
| 34121 |
this.firstChar = Math.min(code, this.firstChar); |
| 34122 |
this.lastChar = Math.max(code, this.lastChar); |
| 34123 |
} |
| 34124 |
} |
| 34125 |
return this.resources; |
| 34126 |
} |
| 34127 |
static getFirstPositionInfo(rect, rotation, fontSize) { |
| 34128 |
const [x1, y1, x2, y2] = rect; |
| 34129 |
let w = x2 - x1; |
| 34130 |
let h = y2 - y1; |
| 34131 |
if (rotation % 180 !== 0) { |
| 34132 |
[w, h] = [h, w]; |
| 34133 |
} |
| 34134 |
const lineHeight = LINE_FACTOR * fontSize; |
| 34135 |
const lineDescent = LINE_DESCENT_FACTOR * fontSize; |
| 34136 |
return { |
| 34137 |
coords: [0, h + lineDescent - lineHeight], |
| 34138 |
bbox: [0, 0, w, h], |
| 34139 |
matrix: rotation !== 0 ? getRotationMatrix(rotation, h, lineHeight) : undefined |
| 34140 |
}; |
| 34141 |
} |
| 34142 |
createAppearance(text, rect, rotation, fontSize, bgColor, strokeAlpha) { |
| 34143 |
const ctx = this._createContext(); |
| 34144 |
const lines = []; |
| 34145 |
let maxWidth = -Infinity; |
| 34146 |
for (const line of text.split(/\r\n?|\n/)) { |
| 34147 |
lines.push(line); |
| 34148 |
const lineWidth = ctx.measureText(line).width; |
| 34149 |
maxWidth = Math.max(maxWidth, lineWidth); |
| 34150 |
for (const code of codePointIter(line)) { |
| 34151 |
const char = String.fromCodePoint(code); |
| 34152 |
let width = this.widths.get(code); |
| 34153 |
if (width === undefined) { |
| 34154 |
const metrics = ctx.measureText(char); |
| 34155 |
width = Math.ceil(metrics.width); |
| 34156 |
this.widths.set(code, width); |
| 34157 |
this.firstChar = Math.min(code, this.firstChar); |
| 34158 |
this.lastChar = Math.max(code, this.lastChar); |
| 34159 |
} |
| 34160 |
} |
| 34161 |
} |
| 34162 |
maxWidth *= fontSize / 1000; |
| 34163 |
const [x1, y1, x2, y2] = rect; |
| 34164 |
let w = x2 - x1; |
| 34165 |
let h = y2 - y1; |
| 34166 |
if (rotation % 180 !== 0) { |
| 34167 |
[w, h] = [h, w]; |
| 34168 |
} |
| 34169 |
let hscale = 1; |
| 34170 |
if (maxWidth > w) { |
| 34171 |
hscale = w / maxWidth; |
| 34172 |
} |
| 34173 |
let vscale = 1; |
| 34174 |
const lineHeight = LINE_FACTOR * fontSize; |
| 34175 |
const lineDescent = LINE_DESCENT_FACTOR * fontSize; |
| 34176 |
const maxHeight = lineHeight * lines.length; |
| 34177 |
if (maxHeight > h) { |
| 34178 |
vscale = h / maxHeight; |
| 34179 |
} |
| 34180 |
const fscale = Math.min(hscale, vscale); |
| 34181 |
const newFontSize = fontSize * fscale; |
| 34182 |
const buffer = ["q", `0 0 ${numberToString(w)} ${numberToString(h)} re W n`, `BT`, `1 0 0 1 0 ${numberToString(h + lineDescent)} Tm 0 Tc ${getPdfColor(bgColor, true)}`, `/${this.fontName.name} ${numberToString(newFontSize)} Tf`]; |
| 34183 |
const { |
| 34184 |
resources |
| 34185 |
} = this; |
| 34186 |
strokeAlpha = typeof strokeAlpha === "number" && strokeAlpha >= 0 && strokeAlpha <= 1 ? strokeAlpha : 1; |
| 34187 |
if (strokeAlpha !== 1) { |
| 34188 |
buffer.push("/R0 gs"); |
| 34189 |
const extGState = new Dict(this.xref); |
| 34190 |
const r0 = new Dict(this.xref); |
| 34191 |
r0.set("ca", strokeAlpha); |
| 34192 |
r0.set("CA", strokeAlpha); |
| 34193 |
r0.set("Type", Name.get("ExtGState")); |
| 34194 |
extGState.set("R0", r0); |
| 34195 |
resources.set("ExtGState", extGState); |
| 34196 |
} |
| 34197 |
const vShift = numberToString(lineHeight); |
| 34198 |
for (const line of lines) { |
| 34199 |
buffer.push(`0 -${vShift} Td <${stringToUTF16HexString(line)}> Tj`); |
| 34200 |
} |
| 34201 |
buffer.push("ET", "Q"); |
| 34202 |
const appearance = buffer.join("\n"); |
| 34203 |
const appearanceStreamDict = new Dict(this.xref); |
| 34204 |
appearanceStreamDict.set("Subtype", Name.get("Form")); |
| 34205 |
appearanceStreamDict.set("Type", Name.get("XObject")); |
| 34206 |
appearanceStreamDict.set("BBox", [0, 0, w, h]); |
| 34207 |
appearanceStreamDict.set("Length", appearance.length); |
| 34208 |
appearanceStreamDict.set("Resources", resources); |
| 34209 |
if (rotation) { |
| 34210 |
const matrix = getRotationMatrix(rotation, w, h); |
| 34211 |
appearanceStreamDict.set("Matrix", matrix); |
| 34212 |
} |
| 34213 |
const ap = new StringStream(appearance); |
| 34214 |
ap.dict = appearanceStreamDict; |
| 34215 |
return ap; |
| 34216 |
} |
| 34217 |
} |
| 34218 |
|
| 34219 |
;// ./src/core/name_number_tree.js |
| 34220 |
|
| 34221 |
|
| 34222 |
class NameOrNumberTree { |
| 34223 |
constructor(root, xref, type) { |
| 34224 |
this.root = root; |
| 34225 |
this.xref = xref; |
| 34226 |
this._type = type; |
| 34227 |
} |
| 34228 |
getAll() { |
| 34229 |
const map = new Map(); |
| 34230 |
if (!this.root) { |
| 34231 |
return map; |
| 34232 |
} |
| 34233 |
const xref = this.xref; |
| 34234 |
const processed = new RefSet(); |
| 34235 |
processed.put(this.root); |
| 34236 |
const queue = [this.root]; |
| 34237 |
while (queue.length > 0) { |
| 34238 |
const obj = xref.fetchIfRef(queue.shift()); |
| 34239 |
if (!(obj instanceof Dict)) { |
| 34240 |
continue; |
| 34241 |
} |
| 34242 |
if (obj.has("Kids")) { |
| 34243 |
const kids = obj.get("Kids"); |
| 34244 |
if (!Array.isArray(kids)) { |
| 34245 |
continue; |
| 34246 |
} |
| 34247 |
for (const kid of kids) { |
| 34248 |
if (processed.has(kid)) { |
| 34249 |
throw new FormatError(`Duplicate entry in "${this._type}" tree.`); |
| 34250 |
} |
| 34251 |
queue.push(kid); |
| 34252 |
processed.put(kid); |
| 34253 |
} |
| 34254 |
continue; |
| 34255 |
} |
| 34256 |
const entries = obj.get(this._type); |
| 34257 |
if (!Array.isArray(entries)) { |
| 34258 |
continue; |
| 34259 |
} |
| 34260 |
for (let i = 0, ii = entries.length; i < ii; i += 2) { |
| 34261 |
map.set(xref.fetchIfRef(entries[i]), xref.fetchIfRef(entries[i + 1])); |
| 34262 |
} |
| 34263 |
} |
| 34264 |
return map; |
| 34265 |
} |
| 34266 |
getRaw(key) { |
| 34267 |
if (!this.root) { |
| 34268 |
return null; |
| 34269 |
} |
| 34270 |
const xref = this.xref; |
| 34271 |
let kidsOrEntries = xref.fetchIfRef(this.root); |
| 34272 |
let loopCount = 0; |
| 34273 |
const MAX_LEVELS = 10; |
| 34274 |
while (kidsOrEntries.has("Kids")) { |
| 34275 |
if (++loopCount > MAX_LEVELS) { |
| 34276 |
warn(`Search depth limit reached for "${this._type}" tree.`); |
| 34277 |
return null; |
| 34278 |
} |
| 34279 |
const kids = kidsOrEntries.get("Kids"); |
| 34280 |
if (!Array.isArray(kids)) { |
| 34281 |
return null; |
| 34282 |
} |
| 34283 |
let l = 0, |
| 34284 |
r = kids.length - 1; |
| 34285 |
while (l <= r) { |
| 34286 |
const m = l + r >> 1; |
| 34287 |
const kid = xref.fetchIfRef(kids[m]); |
| 34288 |
const limits = kid.get("Limits"); |
| 34289 |
if (key < xref.fetchIfRef(limits[0])) { |
| 34290 |
r = m - 1; |
| 34291 |
} else if (key > xref.fetchIfRef(limits[1])) { |
| 34292 |
l = m + 1; |
| 34293 |
} else { |
| 34294 |
kidsOrEntries = kid; |
| 34295 |
break; |
| 34296 |
} |
| 34297 |
} |
| 34298 |
if (l > r) { |
| 34299 |
return null; |
| 34300 |
} |
| 34301 |
} |
| 34302 |
const entries = kidsOrEntries.get(this._type); |
| 34303 |
if (Array.isArray(entries)) { |
| 34304 |
let l = 0, |
| 34305 |
r = entries.length - 2; |
| 34306 |
while (l <= r) { |
| 34307 |
const tmp = l + r >> 1, |
| 34308 |
m = tmp + (tmp & 1); |
| 34309 |
const currentKey = xref.fetchIfRef(entries[m]); |
| 34310 |
if (key < currentKey) { |
| 34311 |
r = m - 2; |
| 34312 |
} else if (key > currentKey) { |
| 34313 |
l = m + 2; |
| 34314 |
} else { |
| 34315 |
return entries[m + 1]; |
| 34316 |
} |
| 34317 |
} |
| 34318 |
} |
| 34319 |
return null; |
| 34320 |
} |
| 34321 |
get(key) { |
| 34322 |
return this.xref.fetchIfRef(this.getRaw(key)); |
| 34323 |
} |
| 34324 |
} |
| 34325 |
class NameTree extends NameOrNumberTree { |
| 34326 |
constructor(root, xref) { |
| 34327 |
super(root, xref, "Names"); |
| 34328 |
} |
| 34329 |
} |
| 34330 |
class NumberTree extends NameOrNumberTree { |
| 34331 |
constructor(root, xref) { |
| 34332 |
super(root, xref, "Nums"); |
| 34333 |
} |
| 34334 |
} |
| 34335 |
|
| 34336 |
;// ./src/core/cleanup_helper.js |
| 34337 |
|
| 34338 |
|
| 34339 |
|
| 34340 |
|
| 34341 |
function clearGlobalCaches() { |
| 34342 |
clearPatternCaches(); |
| 34343 |
clearPrimitiveCaches(); |
| 34344 |
clearUnicodeCaches(); |
| 34345 |
JpxImage.cleanup(); |
| 34346 |
} |
| 34347 |
|
| 34348 |
;// ./src/core/file_spec.js |
| 34349 |
|
| 34350 |
|
| 34351 |
|
| 34352 |
function pickPlatformItem(dict) { |
| 34353 |
if (!(dict instanceof Dict)) { |
| 34354 |
return null; |
| 34355 |
} |
| 34356 |
if (dict.has("UF")) { |
| 34357 |
return dict.get("UF"); |
| 34358 |
} else if (dict.has("F")) { |
| 34359 |
return dict.get("F"); |
| 34360 |
} else if (dict.has("Unix")) { |
| 34361 |
return dict.get("Unix"); |
| 34362 |
} else if (dict.has("Mac")) { |
| 34363 |
return dict.get("Mac"); |
| 34364 |
} else if (dict.has("DOS")) { |
| 34365 |
return dict.get("DOS"); |
| 34366 |
} |
| 34367 |
return null; |
| 34368 |
} |
| 34369 |
function stripPath(str) { |
| 34370 |
return str.substring(str.lastIndexOf("/") + 1); |
| 34371 |
} |
| 34372 |
class FileSpec { |
| 34373 |
#contentAvailable = false; |
| 34374 |
constructor(root, xref, skipContent = false) { |
| 34375 |
if (!(root instanceof Dict)) { |
| 34376 |
return; |
| 34377 |
} |
| 34378 |
this.xref = xref; |
| 34379 |
this.root = root; |
| 34380 |
if (root.has("FS")) { |
| 34381 |
this.fs = root.get("FS"); |
| 34382 |
} |
| 34383 |
if (root.has("RF")) { |
| 34384 |
warn("Related file specifications are not supported"); |
| 34385 |
} |
| 34386 |
if (!skipContent) { |
| 34387 |
if (root.has("EF")) { |
| 34388 |
this.#contentAvailable = true; |
| 34389 |
} else { |
| 34390 |
warn("Non-embedded file specifications are not supported"); |
| 34391 |
} |
| 34392 |
} |
| 34393 |
} |
| 34394 |
get filename() { |
| 34395 |
let filename = ""; |
| 34396 |
const item = pickPlatformItem(this.root); |
| 34397 |
if (item && typeof item === "string") { |
| 34398 |
filename = stringToPDFString(item).replaceAll("\\\\", "\\").replaceAll("\\/", "/").replaceAll("\\", "/"); |
| 34399 |
} |
| 34400 |
return shadow(this, "filename", filename || "unnamed"); |
| 34401 |
} |
| 34402 |
get content() { |
| 34403 |
if (!this.#contentAvailable) { |
| 34404 |
return null; |
| 34405 |
} |
| 34406 |
this._contentRef ||= pickPlatformItem(this.root?.get("EF")); |
| 34407 |
let content = null; |
| 34408 |
if (this._contentRef) { |
| 34409 |
const fileObj = this.xref.fetchIfRef(this._contentRef); |
| 34410 |
if (fileObj instanceof BaseStream) { |
| 34411 |
content = fileObj.getBytes(); |
| 34412 |
} else { |
| 34413 |
warn("Embedded file specification points to non-existing/invalid content"); |
| 34414 |
} |
| 34415 |
} else { |
| 34416 |
warn("Embedded file specification does not have any content"); |
| 34417 |
} |
| 34418 |
return content; |
| 34419 |
} |
| 34420 |
get description() { |
| 34421 |
let description = ""; |
| 34422 |
const desc = this.root?.get("Desc"); |
| 34423 |
if (desc && typeof desc === "string") { |
| 34424 |
description = stringToPDFString(desc); |
| 34425 |
} |
| 34426 |
return shadow(this, "description", description); |
| 34427 |
} |
| 34428 |
get serializable() { |
| 34429 |
return { |
| 34430 |
rawFilename: this.filename, |
| 34431 |
filename: stripPath(this.filename), |
| 34432 |
content: this.content, |
| 34433 |
description: this.description |
| 34434 |
}; |
| 34435 |
} |
| 34436 |
} |
| 34437 |
|
| 34438 |
;// ./src/core/xml_parser.js |
| 34439 |
|
| 34440 |
const XMLParserErrorCode = { |
| 34441 |
NoError: 0, |
| 34442 |
EndOfDocument: -1, |
| 34443 |
UnterminatedCdat: -2, |
| 34444 |
UnterminatedXmlDeclaration: -3, |
| 34445 |
UnterminatedDoctypeDeclaration: -4, |
| 34446 |
UnterminatedComment: -5, |
| 34447 |
MalformedElement: -6, |
| 34448 |
OutOfMemory: -7, |
| 34449 |
UnterminatedAttributeValue: -8, |
| 34450 |
UnterminatedElement: -9, |
| 34451 |
ElementNeverBegun: -10 |
| 34452 |
}; |
| 34453 |
function isWhitespace(s, index) { |
| 34454 |
const ch = s[index]; |
| 34455 |
return ch === " " || ch === "\n" || ch === "\r" || ch === "\t"; |
| 34456 |
} |
| 34457 |
function isWhitespaceString(s) { |
| 34458 |
for (let i = 0, ii = s.length; i < ii; i++) { |
| 34459 |
if (!isWhitespace(s, i)) { |
| 34460 |
return false; |
| 34461 |
} |
| 34462 |
} |
| 34463 |
return true; |
| 34464 |
} |
| 34465 |
class XMLParserBase { |
| 34466 |
_resolveEntities(s) { |
| 34467 |
return s.replaceAll(/&([^;]+);/g, (all, entity) => { |
| 34468 |
if (entity.substring(0, 2) === "#x") { |
| 34469 |
return String.fromCodePoint(parseInt(entity.substring(2), 16)); |
| 34470 |
} else if (entity.substring(0, 1) === "#") { |
| 34471 |
return String.fromCodePoint(parseInt(entity.substring(1), 10)); |
| 34472 |
} |
| 34473 |
switch (entity) { |
| 34474 |
case "lt": |
| 34475 |
return "<"; |
| 34476 |
case "gt": |
| 34477 |
return ">"; |
| 34478 |
case "amp": |
| 34479 |
return "&"; |
| 34480 |
case "quot": |
| 34481 |
return '"'; |
| 34482 |
case "apos": |
| 34483 |
return "'"; |
| 34484 |
} |
| 34485 |
return this.onResolveEntity(entity); |
| 34486 |
}); |
| 34487 |
} |
| 34488 |
_parseContent(s, start) { |
| 34489 |
const attributes = []; |
| 34490 |
let pos = start; |
| 34491 |
function skipWs() { |
| 34492 |
while (pos < s.length && isWhitespace(s, pos)) { |
| 34493 |
++pos; |
| 34494 |
} |
| 34495 |
} |
| 34496 |
while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== ">" && s[pos] !== "/") { |
| 34497 |
++pos; |
| 34498 |
} |
| 34499 |
const name = s.substring(start, pos); |
| 34500 |
skipWs(); |
| 34501 |
while (pos < s.length && s[pos] !== ">" && s[pos] !== "/" && s[pos] !== "?") { |
| 34502 |
skipWs(); |
| 34503 |
let attrName = "", |
| 34504 |
attrValue = ""; |
| 34505 |
while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== "=") { |
| 34506 |
attrName += s[pos]; |
| 34507 |
++pos; |
| 34508 |
} |
| 34509 |
skipWs(); |
| 34510 |
if (s[pos] !== "=") { |
| 34511 |
return null; |
| 34512 |
} |
| 34513 |
++pos; |
| 34514 |
skipWs(); |
| 34515 |
const attrEndChar = s[pos]; |
| 34516 |
if (attrEndChar !== '"' && attrEndChar !== "'") { |
| 34517 |
return null; |
| 34518 |
} |
| 34519 |
const attrEndIndex = s.indexOf(attrEndChar, ++pos); |
| 34520 |
if (attrEndIndex < 0) { |
| 34521 |
return null; |
| 34522 |
} |
| 34523 |
attrValue = s.substring(pos, attrEndIndex); |
| 34524 |
attributes.push({ |
| 34525 |
name: attrName, |
| 34526 |
value: this._resolveEntities(attrValue) |
| 34527 |
}); |
| 34528 |
pos = attrEndIndex + 1; |
| 34529 |
skipWs(); |
| 34530 |
} |
| 34531 |
return { |
| 34532 |
name, |
| 34533 |
attributes, |
| 34534 |
parsed: pos - start |
| 34535 |
}; |
| 34536 |
} |
| 34537 |
_parseProcessingInstruction(s, start) { |
| 34538 |
let pos = start; |
| 34539 |
function skipWs() { |
| 34540 |
while (pos < s.length && isWhitespace(s, pos)) { |
| 34541 |
++pos; |
| 34542 |
} |
| 34543 |
} |
| 34544 |
while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== ">" && s[pos] !== "?" && s[pos] !== "/") { |
| 34545 |
++pos; |
| 34546 |
} |
| 34547 |
const name = s.substring(start, pos); |
| 34548 |
skipWs(); |
| 34549 |
const attrStart = pos; |
| 34550 |
while (pos < s.length && (s[pos] !== "?" || s[pos + 1] !== ">")) { |
| 34551 |
++pos; |
| 34552 |
} |
| 34553 |
const value = s.substring(attrStart, pos); |
| 34554 |
return { |
| 34555 |
name, |
| 34556 |
value, |
| 34557 |
parsed: pos - start |
| 34558 |
}; |
| 34559 |
} |
| 34560 |
parseXml(s) { |
| 34561 |
let i = 0; |
| 34562 |
while (i < s.length) { |
| 34563 |
const ch = s[i]; |
| 34564 |
let j = i; |
| 34565 |
if (ch === "<") { |
| 34566 |
++j; |
| 34567 |
const ch2 = s[j]; |
| 34568 |
let q; |
| 34569 |
switch (ch2) { |
| 34570 |
case "/": |
| 34571 |
++j; |
| 34572 |
q = s.indexOf(">", j); |
| 34573 |
if (q < 0) { |
| 34574 |
this.onError(XMLParserErrorCode.UnterminatedElement); |
| 34575 |
return; |
| 34576 |
} |
| 34577 |
this.onEndElement(s.substring(j, q)); |
| 34578 |
j = q + 1; |
| 34579 |
break; |
| 34580 |
case "?": |
| 34581 |
++j; |
| 34582 |
const pi = this._parseProcessingInstruction(s, j); |
| 34583 |
if (s.substring(j + pi.parsed, j + pi.parsed + 2) !== "?>") { |
| 34584 |
this.onError(XMLParserErrorCode.UnterminatedXmlDeclaration); |
| 34585 |
return; |
| 34586 |
} |
| 34587 |
this.onPi(pi.name, pi.value); |
| 34588 |
j += pi.parsed + 2; |
| 34589 |
break; |
| 34590 |
case "!": |
| 34591 |
if (s.substring(j + 1, j + 3) === "--") { |
| 34592 |
q = s.indexOf("-->", j + 3); |
| 34593 |
if (q < 0) { |
| 34594 |
this.onError(XMLParserErrorCode.UnterminatedComment); |
| 34595 |
return; |
| 34596 |
} |
| 34597 |
this.onComment(s.substring(j + 3, q)); |
| 34598 |
j = q + 3; |
| 34599 |
} else if (s.substring(j + 1, j + 8) === "[CDATA[") { |
| 34600 |
q = s.indexOf("]]>", j + 8); |
| 34601 |
if (q < 0) { |
| 34602 |
this.onError(XMLParserErrorCode.UnterminatedCdat); |
| 34603 |
return; |
| 34604 |
} |
| 34605 |
this.onCdata(s.substring(j + 8, q)); |
| 34606 |
j = q + 3; |
| 34607 |
} else if (s.substring(j + 1, j + 8) === "DOCTYPE") { |
| 34608 |
const q2 = s.indexOf("[", j + 8); |
| 34609 |
let complexDoctype = false; |
| 34610 |
q = s.indexOf(">", j + 8); |
| 34611 |
if (q < 0) { |
| 34612 |
this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration); |
| 34613 |
return; |
| 34614 |
} |
| 34615 |
if (q2 > 0 && q > q2) { |
| 34616 |
q = s.indexOf("]>", j + 8); |
| 34617 |
if (q < 0) { |
| 34618 |
this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration); |
| 34619 |
return; |
| 34620 |
} |
| 34621 |
complexDoctype = true; |
| 34622 |
} |
| 34623 |
const doctypeContent = s.substring(j + 8, q + (complexDoctype ? 1 : 0)); |
| 34624 |
this.onDoctype(doctypeContent); |
| 34625 |
j = q + (complexDoctype ? 2 : 1); |
| 34626 |
} else { |
| 34627 |
this.onError(XMLParserErrorCode.MalformedElement); |
| 34628 |
return; |
| 34629 |
} |
| 34630 |
break; |
| 34631 |
default: |
| 34632 |
const content = this._parseContent(s, j); |
| 34633 |
if (content === null) { |
| 34634 |
this.onError(XMLParserErrorCode.MalformedElement); |
| 34635 |
return; |
| 34636 |
} |
| 34637 |
let isClosed = false; |
| 34638 |
if (s.substring(j + content.parsed, j + content.parsed + 2) === "/>") { |
| 34639 |
isClosed = true; |
| 34640 |
} else if (s.substring(j + content.parsed, j + content.parsed + 1) !== ">") { |
| 34641 |
this.onError(XMLParserErrorCode.UnterminatedElement); |
| 34642 |
return; |
| 34643 |
} |
| 34644 |
this.onBeginElement(content.name, content.attributes, isClosed); |
| 34645 |
j += content.parsed + (isClosed ? 2 : 1); |
| 34646 |
break; |
| 34647 |
} |
| 34648 |
} else { |
| 34649 |
while (j < s.length && s[j] !== "<") { |
| 34650 |
j++; |
| 34651 |
} |
| 34652 |
const text = s.substring(i, j); |
| 34653 |
this.onText(this._resolveEntities(text)); |
| 34654 |
} |
| 34655 |
i = j; |
| 34656 |
} |
| 34657 |
} |
| 34658 |
onResolveEntity(name) { |
| 34659 |
return `&${name};`; |
| 34660 |
} |
| 34661 |
onPi(name, value) {} |
| 34662 |
onComment(text) {} |
| 34663 |
onCdata(text) {} |
| 34664 |
onDoctype(doctypeContent) {} |
| 34665 |
onText(text) {} |
| 34666 |
onBeginElement(name, attributes, isEmpty) {} |
| 34667 |
onEndElement(name) {} |
| 34668 |
onError(code) {} |
| 34669 |
} |
| 34670 |
class SimpleDOMNode { |
| 34671 |
constructor(nodeName, nodeValue) { |
| 34672 |
this.nodeName = nodeName; |
| 34673 |
this.nodeValue = nodeValue; |
| 34674 |
Object.defineProperty(this, "parentNode", { |
| 34675 |
value: null, |
| 34676 |
writable: true |
| 34677 |
}); |
| 34678 |
} |
| 34679 |
get firstChild() { |
| 34680 |
return this.childNodes?.[0]; |
| 34681 |
} |
| 34682 |
get nextSibling() { |
| 34683 |
const childNodes = this.parentNode.childNodes; |
| 34684 |
if (!childNodes) { |
| 34685 |
return undefined; |
| 34686 |
} |
| 34687 |
const index = childNodes.indexOf(this); |
| 34688 |
if (index === -1) { |
| 34689 |
return undefined; |
| 34690 |
} |
| 34691 |
return childNodes[index + 1]; |
| 34692 |
} |
| 34693 |
get textContent() { |
| 34694 |
if (!this.childNodes) { |
| 34695 |
return this.nodeValue || ""; |
| 34696 |
} |
| 34697 |
return this.childNodes.map(function (child) { |
| 34698 |
return child.textContent; |
| 34699 |
}).join(""); |
| 34700 |
} |
| 34701 |
get children() { |
| 34702 |
return this.childNodes || []; |
| 34703 |
} |
| 34704 |
hasChildNodes() { |
| 34705 |
return this.childNodes?.length > 0; |
| 34706 |
} |
| 34707 |
searchNode(paths, pos) { |
| 34708 |
if (pos >= paths.length) { |
| 34709 |
return this; |
| 34710 |
} |
| 34711 |
const component = paths[pos]; |
| 34712 |
if (component.name.startsWith("#") && pos < paths.length - 1) { |
| 34713 |
return this.searchNode(paths, pos + 1); |
| 34714 |
} |
| 34715 |
const stack = []; |
| 34716 |
let node = this; |
| 34717 |
while (true) { |
| 34718 |
if (component.name === node.nodeName) { |
| 34719 |
if (component.pos === 0) { |
| 34720 |
const res = node.searchNode(paths, pos + 1); |
| 34721 |
if (res !== null) { |
| 34722 |
return res; |
| 34723 |
} |
| 34724 |
} else if (stack.length === 0) { |
| 34725 |
return null; |
| 34726 |
} else { |
| 34727 |
const [parent] = stack.pop(); |
| 34728 |
let siblingPos = 0; |
| 34729 |
for (const child of parent.childNodes) { |
| 34730 |
if (component.name === child.nodeName) { |
| 34731 |
if (siblingPos === component.pos) { |
| 34732 |
return child.searchNode(paths, pos + 1); |
| 34733 |
} |
| 34734 |
siblingPos++; |
| 34735 |
} |
| 34736 |
} |
| 34737 |
return node.searchNode(paths, pos + 1); |
| 34738 |
} |
| 34739 |
} |
| 34740 |
if (node.childNodes?.length > 0) { |
| 34741 |
stack.push([node, 0]); |
| 34742 |
node = node.childNodes[0]; |
| 34743 |
} else if (stack.length === 0) { |
| 34744 |
return null; |
| 34745 |
} else { |
| 34746 |
while (stack.length !== 0) { |
| 34747 |
const [parent, currentPos] = stack.pop(); |
| 34748 |
const newPos = currentPos + 1; |
| 34749 |
if (newPos < parent.childNodes.length) { |
| 34750 |
stack.push([parent, newPos]); |
| 34751 |
node = parent.childNodes[newPos]; |
| 34752 |
break; |
| 34753 |
} |
| 34754 |
} |
| 34755 |
if (stack.length === 0) { |
| 34756 |
return null; |
| 34757 |
} |
| 34758 |
} |
| 34759 |
} |
| 34760 |
} |
| 34761 |
dump(buffer) { |
| 34762 |
if (this.nodeName === "#text") { |
| 34763 |
buffer.push(encodeToXmlString(this.nodeValue)); |
| 34764 |
return; |
| 34765 |
} |
| 34766 |
buffer.push(`<${this.nodeName}`); |
| 34767 |
if (this.attributes) { |
| 34768 |
for (const attribute of this.attributes) { |
| 34769 |
buffer.push(` ${attribute.name}="${encodeToXmlString(attribute.value)}"`); |
| 34770 |
} |
| 34771 |
} |
| 34772 |
if (this.hasChildNodes()) { |
| 34773 |
buffer.push(">"); |
| 34774 |
for (const child of this.childNodes) { |
| 34775 |
child.dump(buffer); |
| 34776 |
} |
| 34777 |
buffer.push(`</${this.nodeName}>`); |
| 34778 |
} else if (this.nodeValue) { |
| 34779 |
buffer.push(`>${encodeToXmlString(this.nodeValue)}</${this.nodeName}>`); |
| 34780 |
} else { |
| 34781 |
buffer.push("/>"); |
| 34782 |
} |
| 34783 |
} |
| 34784 |
} |
| 34785 |
class SimpleXMLParser extends XMLParserBase { |
| 34786 |
constructor({ |
| 34787 |
hasAttributes = false, |
| 34788 |
lowerCaseName = false |
| 34789 |
}) { |
| 34790 |
super(); |
| 34791 |
this._currentFragment = null; |
| 34792 |
this._stack = null; |
| 34793 |
this._errorCode = XMLParserErrorCode.NoError; |
| 34794 |
this._hasAttributes = hasAttributes; |
| 34795 |
this._lowerCaseName = lowerCaseName; |
| 34796 |
} |
| 34797 |
parseFromString(data) { |
| 34798 |
this._currentFragment = []; |
| 34799 |
this._stack = []; |
| 34800 |
this._errorCode = XMLParserErrorCode.NoError; |
| 34801 |
this.parseXml(data); |
| 34802 |
if (this._errorCode !== XMLParserErrorCode.NoError) { |
| 34803 |
return undefined; |
| 34804 |
} |
| 34805 |
const [documentElement] = this._currentFragment; |
| 34806 |
if (!documentElement) { |
| 34807 |
return undefined; |
| 34808 |
} |
| 34809 |
return { |
| 34810 |
documentElement |
| 34811 |
}; |
| 34812 |
} |
| 34813 |
onText(text) { |
| 34814 |
if (isWhitespaceString(text)) { |
| 34815 |
return; |
| 34816 |
} |
| 34817 |
const node = new SimpleDOMNode("#text", text); |
| 34818 |
this._currentFragment.push(node); |
| 34819 |
} |
| 34820 |
onCdata(text) { |
| 34821 |
const node = new SimpleDOMNode("#text", text); |
| 34822 |
this._currentFragment.push(node); |
| 34823 |
} |
| 34824 |
onBeginElement(name, attributes, isEmpty) { |
| 34825 |
if (this._lowerCaseName) { |
| 34826 |
name = name.toLowerCase(); |
| 34827 |
} |
| 34828 |
const node = new SimpleDOMNode(name); |
| 34829 |
node.childNodes = []; |
| 34830 |
if (this._hasAttributes) { |
| 34831 |
node.attributes = attributes; |
| 34832 |
} |
| 34833 |
this._currentFragment.push(node); |
| 34834 |
if (isEmpty) { |
| 34835 |
return; |
| 34836 |
} |
| 34837 |
this._stack.push(this._currentFragment); |
| 34838 |
this._currentFragment = node.childNodes; |
| 34839 |
} |
| 34840 |
onEndElement(name) { |
| 34841 |
this._currentFragment = this._stack.pop() || []; |
| 34842 |
const lastElement = this._currentFragment.at(-1); |
| 34843 |
if (!lastElement) { |
| 34844 |
return null; |
| 34845 |
} |
| 34846 |
for (const childNode of lastElement.childNodes) { |
| 34847 |
childNode.parentNode = lastElement; |
| 34848 |
} |
| 34849 |
return lastElement; |
| 34850 |
} |
| 34851 |
onError(code) { |
| 34852 |
this._errorCode = code; |
| 34853 |
} |
| 34854 |
} |
| 34855 |
|
| 34856 |
;// ./src/core/metadata_parser.js |
| 34857 |
|
| 34858 |
class MetadataParser { |
| 34859 |
constructor(data) { |
| 34860 |
data = this._repair(data); |
| 34861 |
const parser = new SimpleXMLParser({ |
| 34862 |
lowerCaseName: true |
| 34863 |
}); |
| 34864 |
const xmlDocument = parser.parseFromString(data); |
| 34865 |
this._metadataMap = new Map(); |
| 34866 |
this._data = data; |
| 34867 |
if (xmlDocument) { |
| 34868 |
this._parse(xmlDocument); |
| 34869 |
} |
| 34870 |
} |
| 34871 |
_repair(data) { |
| 34872 |
return data.replace(/^[^<]+/, "").replaceAll(/>\\376\\377([^<]+)/g, function (all, codes) { |
| 34873 |
const bytes = codes.replaceAll(/\\([0-3])([0-7])([0-7])/g, function (code, d1, d2, d3) { |
| 34874 |
return String.fromCharCode(d1 * 64 + d2 * 8 + d3 * 1); |
| 34875 |
}).replaceAll(/&(amp|apos|gt|lt|quot);/g, function (str, name) { |
| 34876 |
switch (name) { |
| 34877 |
case "amp": |
| 34878 |
return "&"; |
| 34879 |
case "apos": |
| 34880 |
return "'"; |
| 34881 |
case "gt": |
| 34882 |
return ">"; |
| 34883 |
case "lt": |
| 34884 |
return "<"; |
| 34885 |
case "quot": |
| 34886 |
return '"'; |
| 34887 |
} |
| 34888 |
throw new Error(`_repair: ${name} isn't defined.`); |
| 34889 |
}); |
| 34890 |
const charBuf = [">"]; |
| 34891 |
for (let i = 0, ii = bytes.length; i < ii; i += 2) { |
| 34892 |
const code = bytes.charCodeAt(i) * 256 + bytes.charCodeAt(i + 1); |
| 34893 |
if (code >= 32 && code < 127 && code !== 60 && code !== 62 && code !== 38) { |
| 34894 |
charBuf.push(String.fromCharCode(code)); |
| 34895 |
} else { |
| 34896 |
charBuf.push("&#x" + (0x10000 + code).toString(16).substring(1) + ";"); |
| 34897 |
} |
| 34898 |
} |
| 34899 |
return charBuf.join(""); |
| 34900 |
}); |
| 34901 |
} |
| 34902 |
_getSequence(entry) { |
| 34903 |
const name = entry.nodeName; |
| 34904 |
if (name !== "rdf:bag" && name !== "rdf:seq" && name !== "rdf:alt") { |
| 34905 |
return null; |
| 34906 |
} |
| 34907 |
return entry.childNodes.filter(node => node.nodeName === "rdf:li"); |
| 34908 |
} |
| 34909 |
_parseArray(entry) { |
| 34910 |
if (!entry.hasChildNodes()) { |
| 34911 |
return; |
| 34912 |
} |
| 34913 |
const [seqNode] = entry.childNodes; |
| 34914 |
const sequence = this._getSequence(seqNode) || []; |
| 34915 |
this._metadataMap.set(entry.nodeName, sequence.map(node => node.textContent.trim())); |
| 34916 |
} |
| 34917 |
_parse(xmlDocument) { |
| 34918 |
let rdf = xmlDocument.documentElement; |
| 34919 |
if (rdf.nodeName !== "rdf:rdf") { |
| 34920 |
rdf = rdf.firstChild; |
| 34921 |
while (rdf && rdf.nodeName !== "rdf:rdf") { |
| 34922 |
rdf = rdf.nextSibling; |
| 34923 |
} |
| 34924 |
} |
| 34925 |
if (!rdf || rdf.nodeName !== "rdf:rdf" || !rdf.hasChildNodes()) { |
| 34926 |
return; |
| 34927 |
} |
| 34928 |
for (const desc of rdf.childNodes) { |
| 34929 |
if (desc.nodeName !== "rdf:description") { |
| 34930 |
continue; |
| 34931 |
} |
| 34932 |
for (const entry of desc.childNodes) { |
| 34933 |
const name = entry.nodeName; |
| 34934 |
switch (name) { |
| 34935 |
case "#text": |
| 34936 |
continue; |
| 34937 |
case "dc:creator": |
| 34938 |
case "dc:subject": |
| 34939 |
this._parseArray(entry); |
| 34940 |
continue; |
| 34941 |
} |
| 34942 |
this._metadataMap.set(name, entry.textContent.trim()); |
| 34943 |
} |
| 34944 |
} |
| 34945 |
} |
| 34946 |
get serializable() { |
| 34947 |
return { |
| 34948 |
parsedData: this._metadataMap, |
| 34949 |
rawData: this._data |
| 34950 |
}; |
| 34951 |
} |
| 34952 |
} |
| 34953 |
|
| 34954 |
;// ./src/core/decrypt_stream.js |
| 34955 |
|
| 34956 |
const chunkSize = 512; |
| 34957 |
class DecryptStream extends DecodeStream { |
| 34958 |
constructor(str, maybeLength, decrypt) { |
| 34959 |
super(maybeLength); |
| 34960 |
this.str = str; |
| 34961 |
this.dict = str.dict; |
| 34962 |
this.decrypt = decrypt; |
| 34963 |
this.nextChunk = null; |
| 34964 |
this.initialized = false; |
| 34965 |
} |
| 34966 |
readBlock() { |
| 34967 |
let chunk; |
| 34968 |
if (this.initialized) { |
| 34969 |
chunk = this.nextChunk; |
| 34970 |
} else { |
| 34971 |
chunk = this.str.getBytes(chunkSize); |
| 34972 |
this.initialized = true; |
| 34973 |
} |
| 34974 |
if (!chunk || chunk.length === 0) { |
| 34975 |
this.eof = true; |
| 34976 |
return; |
| 34977 |
} |
| 34978 |
this.nextChunk = this.str.getBytes(chunkSize); |
| 34979 |
const hasMoreData = this.nextChunk?.length > 0; |
| 34980 |
const decrypt = this.decrypt; |
| 34981 |
chunk = decrypt(chunk, !hasMoreData); |
| 34982 |
const bufferLength = this.bufferLength, |
| 34983 |
newLength = bufferLength + chunk.length, |
| 34984 |
buffer = this.ensureBuffer(newLength); |
| 34985 |
buffer.set(chunk, bufferLength); |
| 34986 |
this.bufferLength = newLength; |
| 34987 |
} |
| 34988 |
} |
| 34989 |
|
| 34990 |
;// ./src/core/crypto.js |
| 34991 |
|
| 34992 |
|
| 34993 |
|
| 34994 |
class ARCFourCipher { |
| 34995 |
constructor(key) { |
| 34996 |
this.a = 0; |
| 34997 |
this.b = 0; |
| 34998 |
const s = new Uint8Array(256); |
| 34999 |
const keyLength = key.length; |
| 35000 |
for (let i = 0; i < 256; ++i) { |
| 35001 |
s[i] = i; |
| 35002 |
} |
| 35003 |
for (let i = 0, j = 0; i < 256; ++i) { |
| 35004 |
const tmp = s[i]; |
| 35005 |
j = j + tmp + key[i % keyLength] & 0xff; |
| 35006 |
s[i] = s[j]; |
| 35007 |
s[j] = tmp; |
| 35008 |
} |
| 35009 |
this.s = s; |
| 35010 |
} |
| 35011 |
encryptBlock(data) { |
| 35012 |
let a = this.a, |
| 35013 |
b = this.b; |
| 35014 |
const s = this.s; |
| 35015 |
const n = data.length; |
| 35016 |
const output = new Uint8Array(n); |
| 35017 |
for (let i = 0; i < n; ++i) { |
| 35018 |
a = a + 1 & 0xff; |
| 35019 |
const tmp = s[a]; |
| 35020 |
b = b + tmp & 0xff; |
| 35021 |
const tmp2 = s[b]; |
| 35022 |
s[a] = tmp2; |
| 35023 |
s[b] = tmp; |
| 35024 |
output[i] = data[i] ^ s[tmp + tmp2 & 0xff]; |
| 35025 |
} |
| 35026 |
this.a = a; |
| 35027 |
this.b = b; |
| 35028 |
return output; |
| 35029 |
} |
| 35030 |
decryptBlock(data) { |
| 35031 |
return this.encryptBlock(data); |
| 35032 |
} |
| 35033 |
encrypt(data) { |
| 35034 |
return this.encryptBlock(data); |
| 35035 |
} |
| 35036 |
} |
| 35037 |
const calculateMD5 = function calculateMD5Closure() { |
| 35038 |
const r = new Uint8Array([7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]); |
| 35039 |
const k = new Int32Array([-680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784, 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556, -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222, -722521979, 76029189, -640364487, -421815835, 530742520, -995338651, -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606, -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, -145523070, -1120210379, 718787259, -343485551]); |
| 35040 |
function hash(data, offset, length) { |
| 35041 |
let h0 = 1732584193, |
| 35042 |
h1 = -271733879, |
| 35043 |
h2 = -1732584194, |
| 35044 |
h3 = 271733878; |
| 35045 |
const paddedLength = length + 72 & ~63; |
| 35046 |
const padded = new Uint8Array(paddedLength); |
| 35047 |
let i, j; |
| 35048 |
for (i = 0; i < length; ++i) { |
| 35049 |
padded[i] = data[offset++]; |
| 35050 |
} |
| 35051 |
padded[i++] = 0x80; |
| 35052 |
const n = paddedLength - 8; |
| 35053 |
while (i < n) { |
| 35054 |
padded[i++] = 0; |
| 35055 |
} |
| 35056 |
padded[i++] = length << 3 & 0xff; |
| 35057 |
padded[i++] = length >> 5 & 0xff; |
| 35058 |
padded[i++] = length >> 13 & 0xff; |
| 35059 |
padded[i++] = length >> 21 & 0xff; |
| 35060 |
padded[i++] = length >>> 29 & 0xff; |
| 35061 |
padded[i++] = 0; |
| 35062 |
padded[i++] = 0; |
| 35063 |
padded[i++] = 0; |
| 35064 |
const w = new Int32Array(16); |
| 35065 |
for (i = 0; i < paddedLength;) { |
| 35066 |
for (j = 0; j < 16; ++j, i += 4) { |
| 35067 |
w[j] = padded[i] | padded[i + 1] << 8 | padded[i + 2] << 16 | padded[i + 3] << 24; |
| 35068 |
} |
| 35069 |
let a = h0, |
| 35070 |
b = h1, |
| 35071 |
c = h2, |
| 35072 |
d = h3, |
| 35073 |
f, |
| 35074 |
g; |
| 35075 |
for (j = 0; j < 64; ++j) { |
| 35076 |
if (j < 16) { |
| 35077 |
f = b & c | ~b & d; |
| 35078 |
g = j; |
| 35079 |
} else if (j < 32) { |
| 35080 |
f = d & b | ~d & c; |
| 35081 |
g = 5 * j + 1 & 15; |
| 35082 |
} else if (j < 48) { |
| 35083 |
f = b ^ c ^ d; |
| 35084 |
g = 3 * j + 5 & 15; |
| 35085 |
} else { |
| 35086 |
f = c ^ (b | ~d); |
| 35087 |
g = 7 * j & 15; |
| 35088 |
} |
| 35089 |
const tmp = d, |
| 35090 |
rotateArg = a + f + k[j] + w[g] | 0, |
| 35091 |
rotate = r[j]; |
| 35092 |
d = c; |
| 35093 |
c = b; |
| 35094 |
b = b + (rotateArg << rotate | rotateArg >>> 32 - rotate) | 0; |
| 35095 |
a = tmp; |
| 35096 |
} |
| 35097 |
h0 = h0 + a | 0; |
| 35098 |
h1 = h1 + b | 0; |
| 35099 |
h2 = h2 + c | 0; |
| 35100 |
h3 = h3 + d | 0; |
| 35101 |
} |
| 35102 |
return new Uint8Array([h0 & 0xFF, h0 >> 8 & 0xFF, h0 >> 16 & 0xFF, h0 >>> 24 & 0xFF, h1 & 0xFF, h1 >> 8 & 0xFF, h1 >> 16 & 0xFF, h1 >>> 24 & 0xFF, h2 & 0xFF, h2 >> 8 & 0xFF, h2 >> 16 & 0xFF, h2 >>> 24 & 0xFF, h3 & 0xFF, h3 >> 8 & 0xFF, h3 >> 16 & 0xFF, h3 >>> 24 & 0xFF]); |
| 35103 |
} |
| 35104 |
return hash; |
| 35105 |
}(); |
| 35106 |
class Word64 { |
| 35107 |
constructor(highInteger, lowInteger) { |
| 35108 |
this.high = highInteger | 0; |
| 35109 |
this.low = lowInteger | 0; |
| 35110 |
} |
| 35111 |
and(word) { |
| 35112 |
this.high &= word.high; |
| 35113 |
this.low &= word.low; |
| 35114 |
} |
| 35115 |
xor(word) { |
| 35116 |
this.high ^= word.high; |
| 35117 |
this.low ^= word.low; |
| 35118 |
} |
| 35119 |
or(word) { |
| 35120 |
this.high |= word.high; |
| 35121 |
this.low |= word.low; |
| 35122 |
} |
| 35123 |
shiftRight(places) { |
| 35124 |
if (places >= 32) { |
| 35125 |
this.low = this.high >>> places - 32 | 0; |
| 35126 |
this.high = 0; |
| 35127 |
} else { |
| 35128 |
this.low = this.low >>> places | this.high << 32 - places; |
| 35129 |
this.high = this.high >>> places | 0; |
| 35130 |
} |
| 35131 |
} |
| 35132 |
shiftLeft(places) { |
| 35133 |
if (places >= 32) { |
| 35134 |
this.high = this.low << places - 32; |
| 35135 |
this.low = 0; |
| 35136 |
} else { |
| 35137 |
this.high = this.high << places | this.low >>> 32 - places; |
| 35138 |
this.low <<= places; |
| 35139 |
} |
| 35140 |
} |
| 35141 |
rotateRight(places) { |
| 35142 |
let low, high; |
| 35143 |
if (places & 32) { |
| 35144 |
high = this.low; |
| 35145 |
low = this.high; |
| 35146 |
} else { |
| 35147 |
low = this.low; |
| 35148 |
high = this.high; |
| 35149 |
} |
| 35150 |
places &= 31; |
| 35151 |
this.low = low >>> places | high << 32 - places; |
| 35152 |
this.high = high >>> places | low << 32 - places; |
| 35153 |
} |
| 35154 |
not() { |
| 35155 |
this.high = ~this.high; |
| 35156 |
this.low = ~this.low; |
| 35157 |
} |
| 35158 |
add(word) { |
| 35159 |
const lowAdd = (this.low >>> 0) + (word.low >>> 0); |
| 35160 |
let highAdd = (this.high >>> 0) + (word.high >>> 0); |
| 35161 |
if (lowAdd > 0xffffffff) { |
| 35162 |
highAdd += 1; |
| 35163 |
} |
| 35164 |
this.low = lowAdd | 0; |
| 35165 |
this.high = highAdd | 0; |
| 35166 |
} |
| 35167 |
copyTo(bytes, offset) { |
| 35168 |
bytes[offset] = this.high >>> 24 & 0xff; |
| 35169 |
bytes[offset + 1] = this.high >> 16 & 0xff; |
| 35170 |
bytes[offset + 2] = this.high >> 8 & 0xff; |
| 35171 |
bytes[offset + 3] = this.high & 0xff; |
| 35172 |
bytes[offset + 4] = this.low >>> 24 & 0xff; |
| 35173 |
bytes[offset + 5] = this.low >> 16 & 0xff; |
| 35174 |
bytes[offset + 6] = this.low >> 8 & 0xff; |
| 35175 |
bytes[offset + 7] = this.low & 0xff; |
| 35176 |
} |
| 35177 |
assign(word) { |
| 35178 |
this.high = word.high; |
| 35179 |
this.low = word.low; |
| 35180 |
} |
| 35181 |
} |
| 35182 |
const calculateSHA256 = function calculateSHA256Closure() { |
| 35183 |
function rotr(x, n) { |
| 35184 |
return x >>> n | x << 32 - n; |
| 35185 |
} |
| 35186 |
function ch(x, y, z) { |
| 35187 |
return x & y ^ ~x & z; |
| 35188 |
} |
| 35189 |
function maj(x, y, z) { |
| 35190 |
return x & y ^ x & z ^ y & z; |
| 35191 |
} |
| 35192 |
function sigma(x) { |
| 35193 |
return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22); |
| 35194 |
} |
| 35195 |
function sigmaPrime(x) { |
| 35196 |
return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25); |
| 35197 |
} |
| 35198 |
function littleSigma(x) { |
| 35199 |
return rotr(x, 7) ^ rotr(x, 18) ^ x >>> 3; |
| 35200 |
} |
| 35201 |
function littleSigmaPrime(x) { |
| 35202 |
return rotr(x, 17) ^ rotr(x, 19) ^ x >>> 10; |
| 35203 |
} |
| 35204 |
const k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]; |
| 35205 |
function hash(data, offset, length) { |
| 35206 |
let h0 = 0x6a09e667, |
| 35207 |
h1 = 0xbb67ae85, |
| 35208 |
h2 = 0x3c6ef372, |
| 35209 |
h3 = 0xa54ff53a, |
| 35210 |
h4 = 0x510e527f, |
| 35211 |
h5 = 0x9b05688c, |
| 35212 |
h6 = 0x1f83d9ab, |
| 35213 |
h7 = 0x5be0cd19; |
| 35214 |
const paddedLength = Math.ceil((length + 9) / 64) * 64; |
| 35215 |
const padded = new Uint8Array(paddedLength); |
| 35216 |
let i, j; |
| 35217 |
for (i = 0; i < length; ++i) { |
| 35218 |
padded[i] = data[offset++]; |
| 35219 |
} |
| 35220 |
padded[i++] = 0x80; |
| 35221 |
const n = paddedLength - 8; |
| 35222 |
while (i < n) { |
| 35223 |
padded[i++] = 0; |
| 35224 |
} |
| 35225 |
padded[i++] = 0; |
| 35226 |
padded[i++] = 0; |
| 35227 |
padded[i++] = 0; |
| 35228 |
padded[i++] = length >>> 29 & 0xff; |
| 35229 |
padded[i++] = length >> 21 & 0xff; |
| 35230 |
padded[i++] = length >> 13 & 0xff; |
| 35231 |
padded[i++] = length >> 5 & 0xff; |
| 35232 |
padded[i++] = length << 3 & 0xff; |
| 35233 |
const w = new Uint32Array(64); |
| 35234 |
for (i = 0; i < paddedLength;) { |
| 35235 |
for (j = 0; j < 16; ++j) { |
| 35236 |
w[j] = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3]; |
| 35237 |
i += 4; |
| 35238 |
} |
| 35239 |
for (j = 16; j < 64; ++j) { |
| 35240 |
w[j] = littleSigmaPrime(w[j - 2]) + w[j - 7] + littleSigma(w[j - 15]) + w[j - 16] | 0; |
| 35241 |
} |
| 35242 |
let a = h0, |
| 35243 |
b = h1, |
| 35244 |
c = h2, |
| 35245 |
d = h3, |
| 35246 |
e = h4, |
| 35247 |
f = h5, |
| 35248 |
g = h6, |
| 35249 |
h = h7, |
| 35250 |
t1, |
| 35251 |
t2; |
| 35252 |
for (j = 0; j < 64; ++j) { |
| 35253 |
t1 = h + sigmaPrime(e) + ch(e, f, g) + k[j] + w[j]; |
| 35254 |
t2 = sigma(a) + maj(a, b, c); |
| 35255 |
h = g; |
| 35256 |
g = f; |
| 35257 |
f = e; |
| 35258 |
e = d + t1 | 0; |
| 35259 |
d = c; |
| 35260 |
c = b; |
| 35261 |
b = a; |
| 35262 |
a = t1 + t2 | 0; |
| 35263 |
} |
| 35264 |
h0 = h0 + a | 0; |
| 35265 |
h1 = h1 + b | 0; |
| 35266 |
h2 = h2 + c | 0; |
| 35267 |
h3 = h3 + d | 0; |
| 35268 |
h4 = h4 + e | 0; |
| 35269 |
h5 = h5 + f | 0; |
| 35270 |
h6 = h6 + g | 0; |
| 35271 |
h7 = h7 + h | 0; |
| 35272 |
} |
| 35273 |
return new Uint8Array([h0 >> 24 & 0xFF, h0 >> 16 & 0xFF, h0 >> 8 & 0xFF, h0 & 0xFF, h1 >> 24 & 0xFF, h1 >> 16 & 0xFF, h1 >> 8 & 0xFF, h1 & 0xFF, h2 >> 24 & 0xFF, h2 >> 16 & 0xFF, h2 >> 8 & 0xFF, h2 & 0xFF, h3 >> 24 & 0xFF, h3 >> 16 & 0xFF, h3 >> 8 & 0xFF, h3 & 0xFF, h4 >> 24 & 0xFF, h4 >> 16 & 0xFF, h4 >> 8 & 0xFF, h4 & 0xFF, h5 >> 24 & 0xFF, h5 >> 16 & 0xFF, h5 >> 8 & 0xFF, h5 & 0xFF, h6 >> 24 & 0xFF, h6 >> 16 & 0xFF, h6 >> 8 & 0xFF, h6 & 0xFF, h7 >> 24 & 0xFF, h7 >> 16 & 0xFF, h7 >> 8 & 0xFF, h7 & 0xFF]); |
| 35274 |
} |
| 35275 |
return hash; |
| 35276 |
}(); |
| 35277 |
const calculateSHA512 = function calculateSHA512Closure() { |
| 35278 |
function ch(result, x, y, z, tmp) { |
| 35279 |
result.assign(x); |
| 35280 |
result.and(y); |
| 35281 |
tmp.assign(x); |
| 35282 |
tmp.not(); |
| 35283 |
tmp.and(z); |
| 35284 |
result.xor(tmp); |
| 35285 |
} |
| 35286 |
function maj(result, x, y, z, tmp) { |
| 35287 |
result.assign(x); |
| 35288 |
result.and(y); |
| 35289 |
tmp.assign(x); |
| 35290 |
tmp.and(z); |
| 35291 |
result.xor(tmp); |
| 35292 |
tmp.assign(y); |
| 35293 |
tmp.and(z); |
| 35294 |
result.xor(tmp); |
| 35295 |
} |
| 35296 |
function sigma(result, x, tmp) { |
| 35297 |
result.assign(x); |
| 35298 |
result.rotateRight(28); |
| 35299 |
tmp.assign(x); |
| 35300 |
tmp.rotateRight(34); |
| 35301 |
result.xor(tmp); |
| 35302 |
tmp.assign(x); |
| 35303 |
tmp.rotateRight(39); |
| 35304 |
result.xor(tmp); |
| 35305 |
} |
| 35306 |
function sigmaPrime(result, x, tmp) { |
| 35307 |
result.assign(x); |
| 35308 |
result.rotateRight(14); |
| 35309 |
tmp.assign(x); |
| 35310 |
tmp.rotateRight(18); |
| 35311 |
result.xor(tmp); |
| 35312 |
tmp.assign(x); |
| 35313 |
tmp.rotateRight(41); |
| 35314 |
result.xor(tmp); |
| 35315 |
} |
| 35316 |
function littleSigma(result, x, tmp) { |
| 35317 |
result.assign(x); |
| 35318 |
result.rotateRight(1); |
| 35319 |
tmp.assign(x); |
| 35320 |
tmp.rotateRight(8); |
| 35321 |
result.xor(tmp); |
| 35322 |
tmp.assign(x); |
| 35323 |
tmp.shiftRight(7); |
| 35324 |
result.xor(tmp); |
| 35325 |
} |
| 35326 |
function littleSigmaPrime(result, x, tmp) { |
| 35327 |
result.assign(x); |
| 35328 |
result.rotateRight(19); |
| 35329 |
tmp.assign(x); |
| 35330 |
tmp.rotateRight(61); |
| 35331 |
result.xor(tmp); |
| 35332 |
tmp.assign(x); |
| 35333 |
tmp.shiftRight(6); |
| 35334 |
result.xor(tmp); |
| 35335 |
} |
| 35336 |
const k = [new Word64(0x428a2f98, 0xd728ae22), new Word64(0x71374491, 0x23ef65cd), new Word64(0xb5c0fbcf, 0xec4d3b2f), new Word64(0xe9b5dba5, 0x8189dbbc), new Word64(0x3956c25b, 0xf348b538), new Word64(0x59f111f1, 0xb605d019), new Word64(0x923f82a4, 0xaf194f9b), new Word64(0xab1c5ed5, 0xda6d8118), new Word64(0xd807aa98, 0xa3030242), new Word64(0x12835b01, 0x45706fbe), new Word64(0x243185be, 0x4ee4b28c), new Word64(0x550c7dc3, 0xd5ffb4e2), new Word64(0x72be5d74, 0xf27b896f), new Word64(0x80deb1fe, 0x3b1696b1), new Word64(0x9bdc06a7, 0x25c71235), new Word64(0xc19bf174, 0xcf692694), new Word64(0xe49b69c1, 0x9ef14ad2), new Word64(0xefbe4786, 0x384f25e3), new Word64(0x0fc19dc6, 0x8b8cd5b5), new Word64(0x240ca1cc, 0x77ac9c65), new Word64(0x2de92c6f, 0x592b0275), new Word64(0x4a7484aa, 0x6ea6e483), new Word64(0x5cb0a9dc, 0xbd41fbd4), new Word64(0x76f988da, 0x831153b5), new Word64(0x983e5152, 0xee66dfab), new Word64(0xa831c66d, 0x2db43210), new Word64(0xb00327c8, 0x98fb213f), new Word64(0xbf597fc7, 0xbeef0ee4), new Word64(0xc6e00bf3, 0x3da88fc2), new Word64(0xd5a79147, 0x930aa725), new Word64(0x06ca6351, 0xe003826f), new Word64(0x14292967, 0x0a0e6e70), new Word64(0x27b70a85, 0x46d22ffc), new Word64(0x2e1b2138, 0x5c26c926), new Word64(0x4d2c6dfc, 0x5ac42aed), new Word64(0x53380d13, 0x9d95b3df), new Word64(0x650a7354, 0x8baf63de), new Word64(0x766a0abb, 0x3c77b2a8), new Word64(0x81c2c92e, 0x47edaee6), new Word64(0x92722c85, 0x1482353b), new Word64(0xa2bfe8a1, 0x4cf10364), new Word64(0xa81a664b, 0xbc423001), new Word64(0xc24b8b70, 0xd0f89791), new Word64(0xc76c51a3, 0x0654be30), new Word64(0xd192e819, 0xd6ef5218), new Word64(0xd6990624, 0x5565a910), new Word64(0xf40e3585, 0x5771202a), new Word64(0x106aa070, 0x32bbd1b8), new Word64(0x19a4c116, 0xb8d2d0c8), new Word64(0x1e376c08, 0x5141ab53), new Word64(0x2748774c, 0xdf8eeb99), new Word64(0x34b0bcb5, 0xe19b48a8), new Word64(0x391c0cb3, 0xc5c95a63), new Word64(0x4ed8aa4a, 0xe3418acb), new Word64(0x5b9cca4f, 0x7763e373), new Word64(0x682e6ff3, 0xd6b2b8a3), new Word64(0x748f82ee, 0x5defb2fc), new Word64(0x78a5636f, 0x43172f60), new Word64(0x84c87814, 0xa1f0ab72), new Word64(0x8cc70208, 0x1a6439ec), new Word64(0x90befffa, 0x23631e28), new Word64(0xa4506ceb, 0xde82bde9), new Word64(0xbef9a3f7, 0xb2c67915), new Word64(0xc67178f2, 0xe372532b), new Word64(0xca273ece, 0xea26619c), new Word64(0xd186b8c7, 0x21c0c207), new Word64(0xeada7dd6, 0xcde0eb1e), new Word64(0xf57d4f7f, 0xee6ed178), new Word64(0x06f067aa, 0x72176fba), new Word64(0x0a637dc5, 0xa2c898a6), new Word64(0x113f9804, 0xbef90dae), new Word64(0x1b710b35, 0x131c471b), new Word64(0x28db77f5, 0x23047d84), new Word64(0x32caab7b, 0x40c72493), new Word64(0x3c9ebe0a, 0x15c9bebc), new Word64(0x431d67c4, 0x9c100d4c), new Word64(0x4cc5d4be, 0xcb3e42b6), new Word64(0x597f299c, 0xfc657e2a), new Word64(0x5fcb6fab, 0x3ad6faec), new Word64(0x6c44198c, 0x4a475817)]; |
| 35337 |
function hash(data, offset, length, mode384 = false) { |
| 35338 |
let h0, h1, h2, h3, h4, h5, h6, h7; |
| 35339 |
if (!mode384) { |
| 35340 |
h0 = new Word64(0x6a09e667, 0xf3bcc908); |
| 35341 |
h1 = new Word64(0xbb67ae85, 0x84caa73b); |
| 35342 |
h2 = new Word64(0x3c6ef372, 0xfe94f82b); |
| 35343 |
h3 = new Word64(0xa54ff53a, 0x5f1d36f1); |
| 35344 |
h4 = new Word64(0x510e527f, 0xade682d1); |
| 35345 |
h5 = new Word64(0x9b05688c, 0x2b3e6c1f); |
| 35346 |
h6 = new Word64(0x1f83d9ab, 0xfb41bd6b); |
| 35347 |
h7 = new Word64(0x5be0cd19, 0x137e2179); |
| 35348 |
} else { |
| 35349 |
h0 = new Word64(0xcbbb9d5d, 0xc1059ed8); |
| 35350 |
h1 = new Word64(0x629a292a, 0x367cd507); |
| 35351 |
h2 = new Word64(0x9159015a, 0x3070dd17); |
| 35352 |
h3 = new Word64(0x152fecd8, 0xf70e5939); |
| 35353 |
h4 = new Word64(0x67332667, 0xffc00b31); |
| 35354 |
h5 = new Word64(0x8eb44a87, 0x68581511); |
| 35355 |
h6 = new Word64(0xdb0c2e0d, 0x64f98fa7); |
| 35356 |
h7 = new Word64(0x47b5481d, 0xbefa4fa4); |
| 35357 |
} |
| 35358 |
const paddedLength = Math.ceil((length + 17) / 128) * 128; |
| 35359 |
const padded = new Uint8Array(paddedLength); |
| 35360 |
let i, j; |
| 35361 |
for (i = 0; i < length; ++i) { |
| 35362 |
padded[i] = data[offset++]; |
| 35363 |
} |
| 35364 |
padded[i++] = 0x80; |
| 35365 |
const n = paddedLength - 16; |
| 35366 |
while (i < n) { |
| 35367 |
padded[i++] = 0; |
| 35368 |
} |
| 35369 |
padded[i++] = 0; |
| 35370 |
padded[i++] = 0; |
| 35371 |
padded[i++] = 0; |
| 35372 |
padded[i++] = 0; |
| 35373 |
padded[i++] = 0; |
| 35374 |
padded[i++] = 0; |
| 35375 |
padded[i++] = 0; |
| 35376 |
padded[i++] = 0; |
| 35377 |
padded[i++] = 0; |
| 35378 |
padded[i++] = 0; |
| 35379 |
padded[i++] = 0; |
| 35380 |
padded[i++] = length >>> 29 & 0xff; |
| 35381 |
padded[i++] = length >> 21 & 0xff; |
| 35382 |
padded[i++] = length >> 13 & 0xff; |
| 35383 |
padded[i++] = length >> 5 & 0xff; |
| 35384 |
padded[i++] = length << 3 & 0xff; |
| 35385 |
const w = new Array(80); |
| 35386 |
for (i = 0; i < 80; i++) { |
| 35387 |
w[i] = new Word64(0, 0); |
| 35388 |
} |
| 35389 |
let a = new Word64(0, 0), |
| 35390 |
b = new Word64(0, 0), |
| 35391 |
c = new Word64(0, 0); |
| 35392 |
let d = new Word64(0, 0), |
| 35393 |
e = new Word64(0, 0), |
| 35394 |
f = new Word64(0, 0); |
| 35395 |
let g = new Word64(0, 0), |
| 35396 |
h = new Word64(0, 0); |
| 35397 |
const t1 = new Word64(0, 0), |
| 35398 |
t2 = new Word64(0, 0); |
| 35399 |
const tmp1 = new Word64(0, 0), |
| 35400 |
tmp2 = new Word64(0, 0); |
| 35401 |
let tmp3; |
| 35402 |
for (i = 0; i < paddedLength;) { |
| 35403 |
for (j = 0; j < 16; ++j) { |
| 35404 |
w[j].high = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3]; |
| 35405 |
w[j].low = padded[i + 4] << 24 | padded[i + 5] << 16 | padded[i + 6] << 8 | padded[i + 7]; |
| 35406 |
i += 8; |
| 35407 |
} |
| 35408 |
for (j = 16; j < 80; ++j) { |
| 35409 |
tmp3 = w[j]; |
| 35410 |
littleSigmaPrime(tmp3, w[j - 2], tmp2); |
| 35411 |
tmp3.add(w[j - 7]); |
| 35412 |
littleSigma(tmp1, w[j - 15], tmp2); |
| 35413 |
tmp3.add(tmp1); |
| 35414 |
tmp3.add(w[j - 16]); |
| 35415 |
} |
| 35416 |
a.assign(h0); |
| 35417 |
b.assign(h1); |
| 35418 |
c.assign(h2); |
| 35419 |
d.assign(h3); |
| 35420 |
e.assign(h4); |
| 35421 |
f.assign(h5); |
| 35422 |
g.assign(h6); |
| 35423 |
h.assign(h7); |
| 35424 |
for (j = 0; j < 80; ++j) { |
| 35425 |
t1.assign(h); |
| 35426 |
sigmaPrime(tmp1, e, tmp2); |
| 35427 |
t1.add(tmp1); |
| 35428 |
ch(tmp1, e, f, g, tmp2); |
| 35429 |
t1.add(tmp1); |
| 35430 |
t1.add(k[j]); |
| 35431 |
t1.add(w[j]); |
| 35432 |
sigma(t2, a, tmp2); |
| 35433 |
maj(tmp1, a, b, c, tmp2); |
| 35434 |
t2.add(tmp1); |
| 35435 |
tmp3 = h; |
| 35436 |
h = g; |
| 35437 |
g = f; |
| 35438 |
f = e; |
| 35439 |
d.add(t1); |
| 35440 |
e = d; |
| 35441 |
d = c; |
| 35442 |
c = b; |
| 35443 |
b = a; |
| 35444 |
tmp3.assign(t1); |
| 35445 |
tmp3.add(t2); |
| 35446 |
a = tmp3; |
| 35447 |
} |
| 35448 |
h0.add(a); |
| 35449 |
h1.add(b); |
| 35450 |
h2.add(c); |
| 35451 |
h3.add(d); |
| 35452 |
h4.add(e); |
| 35453 |
h5.add(f); |
| 35454 |
h6.add(g); |
| 35455 |
h7.add(h); |
| 35456 |
} |
| 35457 |
let result; |
| 35458 |
if (!mode384) { |
| 35459 |
result = new Uint8Array(64); |
| 35460 |
h0.copyTo(result, 0); |
| 35461 |
h1.copyTo(result, 8); |
| 35462 |
h2.copyTo(result, 16); |
| 35463 |
h3.copyTo(result, 24); |
| 35464 |
h4.copyTo(result, 32); |
| 35465 |
h5.copyTo(result, 40); |
| 35466 |
h6.copyTo(result, 48); |
| 35467 |
h7.copyTo(result, 56); |
| 35468 |
} else { |
| 35469 |
result = new Uint8Array(48); |
| 35470 |
h0.copyTo(result, 0); |
| 35471 |
h1.copyTo(result, 8); |
| 35472 |
h2.copyTo(result, 16); |
| 35473 |
h3.copyTo(result, 24); |
| 35474 |
h4.copyTo(result, 32); |
| 35475 |
h5.copyTo(result, 40); |
| 35476 |
} |
| 35477 |
return result; |
| 35478 |
} |
| 35479 |
return hash; |
| 35480 |
}(); |
| 35481 |
function calculateSHA384(data, offset, length) { |
| 35482 |
return calculateSHA512(data, offset, length, true); |
| 35483 |
} |
| 35484 |
class NullCipher { |
| 35485 |
decryptBlock(data) { |
| 35486 |
return data; |
| 35487 |
} |
| 35488 |
encrypt(data) { |
| 35489 |
return data; |
| 35490 |
} |
| 35491 |
} |
| 35492 |
class AESBaseCipher { |
| 35493 |
constructor() { |
| 35494 |
this._s = new Uint8Array([0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81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0c, 0x7d]); |
| 35496 |
this._mix = new Uint32Array([0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]); |
| 35497 |
this._mixCol = new Uint8Array(256); |
| 35498 |
for (let i = 0; i < 256; i++) { |
| 35499 |
this._mixCol[i] = i < 128 ? i << 1 : i << 1 ^ 0x1b; |
| 35500 |
} |
| 35501 |
this.buffer = new Uint8Array(16); |
| 35502 |
this.bufferPosition = 0; |
| 35503 |
} |
| 35504 |
_expandKey(cipherKey) { |
| 35505 |
unreachable("Cannot call `_expandKey` on the base class"); |
| 35506 |
} |
| 35507 |
_decrypt(input, key) { |
| 35508 |
let t, u, v; |
| 35509 |
const state = new Uint8Array(16); |
| 35510 |
state.set(input); |
| 35511 |
for (let j = 0, k = this._keySize; j < 16; ++j, ++k) { |
| 35512 |
state[j] ^= key[k]; |
| 35513 |
} |
| 35514 |
for (let i = this._cyclesOfRepetition - 1; i >= 1; --i) { |
| 35515 |
t = state[13]; |
| 35516 |
state[13] = state[9]; |
| 35517 |
state[9] = state[5]; |
| 35518 |
state[5] = state[1]; |
| 35519 |
state[1] = t; |
| 35520 |
t = state[14]; |
| 35521 |
u = state[10]; |
| 35522 |
state[14] = state[6]; |
| 35523 |
state[10] = state[2]; |
| 35524 |
state[6] = t; |
| 35525 |
state[2] = u; |
| 35526 |
t = state[15]; |
| 35527 |
u = state[11]; |
| 35528 |
v = state[7]; |
| 35529 |
state[15] = state[3]; |
| 35530 |
state[11] = t; |
| 35531 |
state[7] = u; |
| 35532 |
state[3] = v; |
| 35533 |
for (let j = 0; j < 16; ++j) { |
| 35534 |
state[j] = this._inv_s[state[j]]; |
| 35535 |
} |
| 35536 |
for (let j = 0, k = i * 16; j < 16; ++j, ++k) { |
| 35537 |
state[j] ^= key[k]; |
| 35538 |
} |
| 35539 |
for (let j = 0; j < 16; j += 4) { |
| 35540 |
const s0 = this._mix[state[j]]; |
| 35541 |
const s1 = this._mix[state[j + 1]]; |
| 35542 |
const s2 = this._mix[state[j + 2]]; |
| 35543 |
const s3 = this._mix[state[j + 3]]; |
| 35544 |
t = s0 ^ s1 >>> 8 ^ s1 << 24 ^ s2 >>> 16 ^ s2 << 16 ^ s3 >>> 24 ^ s3 << 8; |
| 35545 |
state[j] = t >>> 24 & 0xff; |
| 35546 |
state[j + 1] = t >> 16 & 0xff; |
| 35547 |
state[j + 2] = t >> 8 & 0xff; |
| 35548 |
state[j + 3] = t & 0xff; |
| 35549 |
} |
| 35550 |
} |
| 35551 |
t = state[13]; |
| 35552 |
state[13] = state[9]; |
| 35553 |
state[9] = state[5]; |
| 35554 |
state[5] = state[1]; |
| 35555 |
state[1] = t; |
| 35556 |
t = state[14]; |
| 35557 |
u = state[10]; |
| 35558 |
state[14] = state[6]; |
| 35559 |
state[10] = state[2]; |
| 35560 |
state[6] = t; |
| 35561 |
state[2] = u; |
| 35562 |
t = state[15]; |
| 35563 |
u = state[11]; |
| 35564 |
v = state[7]; |
| 35565 |
state[15] = state[3]; |
| 35566 |
state[11] = t; |
| 35567 |
state[7] = u; |
| 35568 |
state[3] = v; |
| 35569 |
for (let j = 0; j < 16; ++j) { |
| 35570 |
state[j] = this._inv_s[state[j]]; |
| 35571 |
state[j] ^= key[j]; |
| 35572 |
} |
| 35573 |
return state; |
| 35574 |
} |
| 35575 |
_encrypt(input, key) { |
| 35576 |
const s = this._s; |
| 35577 |
let t, u, v; |
| 35578 |
const state = new Uint8Array(16); |
| 35579 |
state.set(input); |
| 35580 |
for (let j = 0; j < 16; ++j) { |
| 35581 |
state[j] ^= key[j]; |
| 35582 |
} |
| 35583 |
for (let i = 1; i < this._cyclesOfRepetition; i++) { |
| 35584 |
for (let j = 0; j < 16; ++j) { |
| 35585 |
state[j] = s[state[j]]; |
| 35586 |
} |
| 35587 |
v = state[1]; |
| 35588 |
state[1] = state[5]; |
| 35589 |
state[5] = state[9]; |
| 35590 |
state[9] = state[13]; |
| 35591 |
state[13] = v; |
| 35592 |
v = state[2]; |
| 35593 |
u = state[6]; |
| 35594 |
state[2] = state[10]; |
| 35595 |
state[6] = state[14]; |
| 35596 |
state[10] = v; |
| 35597 |
state[14] = u; |
| 35598 |
v = state[3]; |
| 35599 |
u = state[7]; |
| 35600 |
t = state[11]; |
| 35601 |
state[3] = state[15]; |
| 35602 |
state[7] = v; |
| 35603 |
state[11] = u; |
| 35604 |
state[15] = t; |
| 35605 |
for (let j = 0; j < 16; j += 4) { |
| 35606 |
const s0 = state[j + 0]; |
| 35607 |
const s1 = state[j + 1]; |
| 35608 |
const s2 = state[j + 2]; |
| 35609 |
const s3 = state[j + 3]; |
| 35610 |
t = s0 ^ s1 ^ s2 ^ s3; |
| 35611 |
state[j + 0] ^= t ^ this._mixCol[s0 ^ s1]; |
| 35612 |
state[j + 1] ^= t ^ this._mixCol[s1 ^ s2]; |
| 35613 |
state[j + 2] ^= t ^ this._mixCol[s2 ^ s3]; |
| 35614 |
state[j + 3] ^= t ^ this._mixCol[s3 ^ s0]; |
| 35615 |
} |
| 35616 |
for (let j = 0, k = i * 16; j < 16; ++j, ++k) { |
| 35617 |
state[j] ^= key[k]; |
| 35618 |
} |
| 35619 |
} |
| 35620 |
for (let j = 0; j < 16; ++j) { |
| 35621 |
state[j] = s[state[j]]; |
| 35622 |
} |
| 35623 |
v = state[1]; |
| 35624 |
state[1] = state[5]; |
| 35625 |
state[5] = state[9]; |
| 35626 |
state[9] = state[13]; |
| 35627 |
state[13] = v; |
| 35628 |
v = state[2]; |
| 35629 |
u = state[6]; |
| 35630 |
state[2] = state[10]; |
| 35631 |
state[6] = state[14]; |
| 35632 |
state[10] = v; |
| 35633 |
state[14] = u; |
| 35634 |
v = state[3]; |
| 35635 |
u = state[7]; |
| 35636 |
t = state[11]; |
| 35637 |
state[3] = state[15]; |
| 35638 |
state[7] = v; |
| 35639 |
state[11] = u; |
| 35640 |
state[15] = t; |
| 35641 |
for (let j = 0, k = this._keySize; j < 16; ++j, ++k) { |
| 35642 |
state[j] ^= key[k]; |
| 35643 |
} |
| 35644 |
return state; |
| 35645 |
} |
| 35646 |
_decryptBlock2(data, finalize) { |
| 35647 |
const sourceLength = data.length; |
| 35648 |
let buffer = this.buffer, |
| 35649 |
bufferLength = this.bufferPosition; |
| 35650 |
const result = []; |
| 35651 |
let iv = this.iv; |
| 35652 |
for (let i = 0; i < sourceLength; ++i) { |
| 35653 |
buffer[bufferLength] = data[i]; |
| 35654 |
++bufferLength; |
| 35655 |
if (bufferLength < 16) { |
| 35656 |
continue; |
| 35657 |
} |
| 35658 |
const plain = this._decrypt(buffer, this._key); |
| 35659 |
for (let j = 0; j < 16; ++j) { |
| 35660 |
plain[j] ^= iv[j]; |
| 35661 |
} |
| 35662 |
iv = buffer; |
| 35663 |
result.push(plain); |
| 35664 |
buffer = new Uint8Array(16); |
| 35665 |
bufferLength = 0; |
| 35666 |
} |
| 35667 |
this.buffer = buffer; |
| 35668 |
this.bufferLength = bufferLength; |
| 35669 |
this.iv = iv; |
| 35670 |
if (result.length === 0) { |
| 35671 |
return new Uint8Array(0); |
| 35672 |
} |
| 35673 |
let outputLength = 16 * result.length; |
| 35674 |
if (finalize) { |
| 35675 |
const lastBlock = result.at(-1); |
| 35676 |
let psLen = lastBlock[15]; |
| 35677 |
if (psLen <= 16) { |
| 35678 |
for (let i = 15, ii = 16 - psLen; i >= ii; --i) { |
| 35679 |
if (lastBlock[i] !== psLen) { |
| 35680 |
psLen = 0; |
| 35681 |
break; |
| 35682 |
} |
| 35683 |
} |
| 35684 |
outputLength -= psLen; |
| 35685 |
result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); |
| 35686 |
} |
| 35687 |
} |
| 35688 |
const output = new Uint8Array(outputLength); |
| 35689 |
for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { |
| 35690 |
output.set(result[i], j); |
| 35691 |
} |
| 35692 |
return output; |
| 35693 |
} |
| 35694 |
decryptBlock(data, finalize, iv = null) { |
| 35695 |
const sourceLength = data.length; |
| 35696 |
const buffer = this.buffer; |
| 35697 |
let bufferLength = this.bufferPosition; |
| 35698 |
if (iv) { |
| 35699 |
this.iv = iv; |
| 35700 |
} else { |
| 35701 |
for (let i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) { |
| 35702 |
buffer[bufferLength] = data[i]; |
| 35703 |
} |
| 35704 |
if (bufferLength < 16) { |
| 35705 |
this.bufferLength = bufferLength; |
| 35706 |
return new Uint8Array(0); |
| 35707 |
} |
| 35708 |
this.iv = buffer; |
| 35709 |
data = data.subarray(16); |
| 35710 |
} |
| 35711 |
this.buffer = new Uint8Array(16); |
| 35712 |
this.bufferLength = 0; |
| 35713 |
this.decryptBlock = this._decryptBlock2; |
| 35714 |
return this.decryptBlock(data, finalize); |
| 35715 |
} |
| 35716 |
encrypt(data, iv) { |
| 35717 |
const sourceLength = data.length; |
| 35718 |
let buffer = this.buffer, |
| 35719 |
bufferLength = this.bufferPosition; |
| 35720 |
const result = []; |
| 35721 |
if (!iv) { |
| 35722 |
iv = new Uint8Array(16); |
| 35723 |
} |
| 35724 |
for (let i = 0; i < sourceLength; ++i) { |
| 35725 |
buffer[bufferLength] = data[i]; |
| 35726 |
++bufferLength; |
| 35727 |
if (bufferLength < 16) { |
| 35728 |
continue; |
| 35729 |
} |
| 35730 |
for (let j = 0; j < 16; ++j) { |
| 35731 |
buffer[j] ^= iv[j]; |
| 35732 |
} |
| 35733 |
const cipher = this._encrypt(buffer, this._key); |
| 35734 |
iv = cipher; |
| 35735 |
result.push(cipher); |
| 35736 |
buffer = new Uint8Array(16); |
| 35737 |
bufferLength = 0; |
| 35738 |
} |
| 35739 |
this.buffer = buffer; |
| 35740 |
this.bufferLength = bufferLength; |
| 35741 |
this.iv = iv; |
| 35742 |
if (result.length === 0) { |
| 35743 |
return new Uint8Array(0); |
| 35744 |
} |
| 35745 |
const outputLength = 16 * result.length; |
| 35746 |
const output = new Uint8Array(outputLength); |
| 35747 |
for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { |
| 35748 |
output.set(result[i], j); |
| 35749 |
} |
| 35750 |
return output; |
| 35751 |
} |
| 35752 |
} |
| 35753 |
class AES128Cipher extends AESBaseCipher { |
| 35754 |
constructor(key) { |
| 35755 |
super(); |
| 35756 |
this._cyclesOfRepetition = 10; |
| 35757 |
this._keySize = 160; |
| 35758 |
this._rcon = new Uint8Array([0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d]); |
| 35759 |
this._key = this._expandKey(key); |
| 35760 |
} |
| 35761 |
_expandKey(cipherKey) { |
| 35762 |
const b = 176; |
| 35763 |
const s = this._s; |
| 35764 |
const rcon = this._rcon; |
| 35765 |
const result = new Uint8Array(b); |
| 35766 |
result.set(cipherKey); |
| 35767 |
for (let j = 16, i = 1; j < b; ++i) { |
| 35768 |
let t1 = result[j - 3]; |
| 35769 |
let t2 = result[j - 2]; |
| 35770 |
let t3 = result[j - 1]; |
| 35771 |
let t4 = result[j - 4]; |
| 35772 |
t1 = s[t1]; |
| 35773 |
t2 = s[t2]; |
| 35774 |
t3 = s[t3]; |
| 35775 |
t4 = s[t4]; |
| 35776 |
t1 ^= rcon[i]; |
| 35777 |
for (let n = 0; n < 4; ++n) { |
| 35778 |
result[j] = t1 ^= result[j - 16]; |
| 35779 |
j++; |
| 35780 |
result[j] = t2 ^= result[j - 16]; |
| 35781 |
j++; |
| 35782 |
result[j] = t3 ^= result[j - 16]; |
| 35783 |
j++; |
| 35784 |
result[j] = t4 ^= result[j - 16]; |
| 35785 |
j++; |
| 35786 |
} |
| 35787 |
} |
| 35788 |
return result; |
| 35789 |
} |
| 35790 |
} |
| 35791 |
class AES256Cipher extends AESBaseCipher { |
| 35792 |
constructor(key) { |
| 35793 |
super(); |
| 35794 |
this._cyclesOfRepetition = 14; |
| 35795 |
this._keySize = 224; |
| 35796 |
this._key = this._expandKey(key); |
| 35797 |
} |
| 35798 |
_expandKey(cipherKey) { |
| 35799 |
const b = 240; |
| 35800 |
const s = this._s; |
| 35801 |
const result = new Uint8Array(b); |
| 35802 |
result.set(cipherKey); |
| 35803 |
let r = 1; |
| 35804 |
let t1, t2, t3, t4; |
| 35805 |
for (let j = 32, i = 1; j < b; ++i) { |
| 35806 |
if (j % 32 === 16) { |
| 35807 |
t1 = s[t1]; |
| 35808 |
t2 = s[t2]; |
| 35809 |
t3 = s[t3]; |
| 35810 |
t4 = s[t4]; |
| 35811 |
} else if (j % 32 === 0) { |
| 35812 |
t1 = result[j - 3]; |
| 35813 |
t2 = result[j - 2]; |
| 35814 |
t3 = result[j - 1]; |
| 35815 |
t4 = result[j - 4]; |
| 35816 |
t1 = s[t1]; |
| 35817 |
t2 = s[t2]; |
| 35818 |
t3 = s[t3]; |
| 35819 |
t4 = s[t4]; |
| 35820 |
t1 ^= r; |
| 35821 |
if ((r <<= 1) >= 256) { |
| 35822 |
r = (r ^ 0x1b) & 0xff; |
| 35823 |
} |
| 35824 |
} |
| 35825 |
for (let n = 0; n < 4; ++n) { |
| 35826 |
result[j] = t1 ^= result[j - 32]; |
| 35827 |
j++; |
| 35828 |
result[j] = t2 ^= result[j - 32]; |
| 35829 |
j++; |
| 35830 |
result[j] = t3 ^= result[j - 32]; |
| 35831 |
j++; |
| 35832 |
result[j] = t4 ^= result[j - 32]; |
| 35833 |
j++; |
| 35834 |
} |
| 35835 |
} |
| 35836 |
return result; |
| 35837 |
} |
| 35838 |
} |
| 35839 |
class PDF17 { |
| 35840 |
checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { |
| 35841 |
const hashData = new Uint8Array(password.length + 56); |
| 35842 |
hashData.set(password, 0); |
| 35843 |
hashData.set(ownerValidationSalt, password.length); |
| 35844 |
hashData.set(userBytes, password.length + ownerValidationSalt.length); |
| 35845 |
const result = calculateSHA256(hashData, 0, hashData.length); |
| 35846 |
return isArrayEqual(result, ownerPassword); |
| 35847 |
} |
| 35848 |
checkUserPassword(password, userValidationSalt, userPassword) { |
| 35849 |
const hashData = new Uint8Array(password.length + 8); |
| 35850 |
hashData.set(password, 0); |
| 35851 |
hashData.set(userValidationSalt, password.length); |
| 35852 |
const result = calculateSHA256(hashData, 0, hashData.length); |
| 35853 |
return isArrayEqual(result, userPassword); |
| 35854 |
} |
| 35855 |
getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { |
| 35856 |
const hashData = new Uint8Array(password.length + 56); |
| 35857 |
hashData.set(password, 0); |
| 35858 |
hashData.set(ownerKeySalt, password.length); |
| 35859 |
hashData.set(userBytes, password.length + ownerKeySalt.length); |
| 35860 |
const key = calculateSHA256(hashData, 0, hashData.length); |
| 35861 |
const cipher = new AES256Cipher(key); |
| 35862 |
return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); |
| 35863 |
} |
| 35864 |
getUserKey(password, userKeySalt, userEncryption) { |
| 35865 |
const hashData = new Uint8Array(password.length + 8); |
| 35866 |
hashData.set(password, 0); |
| 35867 |
hashData.set(userKeySalt, password.length); |
| 35868 |
const key = calculateSHA256(hashData, 0, hashData.length); |
| 35869 |
const cipher = new AES256Cipher(key); |
| 35870 |
return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); |
| 35871 |
} |
| 35872 |
} |
| 35873 |
class PDF20 { |
| 35874 |
_hash(password, input, userBytes) { |
| 35875 |
let k = calculateSHA256(input, 0, input.length).subarray(0, 32); |
| 35876 |
let e = [0]; |
| 35877 |
let i = 0; |
| 35878 |
while (i < 64 || e.at(-1) > i - 32) { |
| 35879 |
const combinedLength = password.length + k.length + userBytes.length, |
| 35880 |
combinedArray = new Uint8Array(combinedLength); |
| 35881 |
let writeOffset = 0; |
| 35882 |
combinedArray.set(password, writeOffset); |
| 35883 |
writeOffset += password.length; |
| 35884 |
combinedArray.set(k, writeOffset); |
| 35885 |
writeOffset += k.length; |
| 35886 |
combinedArray.set(userBytes, writeOffset); |
| 35887 |
const k1 = new Uint8Array(combinedLength * 64); |
| 35888 |
for (let j = 0, pos = 0; j < 64; j++, pos += combinedLength) { |
| 35889 |
k1.set(combinedArray, pos); |
| 35890 |
} |
| 35891 |
const cipher = new AES128Cipher(k.subarray(0, 16)); |
| 35892 |
e = cipher.encrypt(k1, k.subarray(16, 32)); |
| 35893 |
const remainder = e.slice(0, 16).reduce((a, b) => a + b, 0) % 3; |
| 35894 |
if (remainder === 0) { |
| 35895 |
k = calculateSHA256(e, 0, e.length); |
| 35896 |
} else if (remainder === 1) { |
| 35897 |
k = calculateSHA384(e, 0, e.length); |
| 35898 |
} else if (remainder === 2) { |
| 35899 |
k = calculateSHA512(e, 0, e.length); |
| 35900 |
} |
| 35901 |
i++; |
| 35902 |
} |
| 35903 |
return k.subarray(0, 32); |
| 35904 |
} |
| 35905 |
checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { |
| 35906 |
const hashData = new Uint8Array(password.length + 56); |
| 35907 |
hashData.set(password, 0); |
| 35908 |
hashData.set(ownerValidationSalt, password.length); |
| 35909 |
hashData.set(userBytes, password.length + ownerValidationSalt.length); |
| 35910 |
const result = this._hash(password, hashData, userBytes); |
| 35911 |
return isArrayEqual(result, ownerPassword); |
| 35912 |
} |
| 35913 |
checkUserPassword(password, userValidationSalt, userPassword) { |
| 35914 |
const hashData = new Uint8Array(password.length + 8); |
| 35915 |
hashData.set(password, 0); |
| 35916 |
hashData.set(userValidationSalt, password.length); |
| 35917 |
const result = this._hash(password, hashData, []); |
| 35918 |
return isArrayEqual(result, userPassword); |
| 35919 |
} |
| 35920 |
getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { |
| 35921 |
const hashData = new Uint8Array(password.length + 56); |
| 35922 |
hashData.set(password, 0); |
| 35923 |
hashData.set(ownerKeySalt, password.length); |
| 35924 |
hashData.set(userBytes, password.length + ownerKeySalt.length); |
| 35925 |
const key = this._hash(password, hashData, userBytes); |
| 35926 |
const cipher = new AES256Cipher(key); |
| 35927 |
return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); |
| 35928 |
} |
| 35929 |
getUserKey(password, userKeySalt, userEncryption) { |
| 35930 |
const hashData = new Uint8Array(password.length + 8); |
| 35931 |
hashData.set(password, 0); |
| 35932 |
hashData.set(userKeySalt, password.length); |
| 35933 |
const key = this._hash(password, hashData, []); |
| 35934 |
const cipher = new AES256Cipher(key); |
| 35935 |
return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); |
| 35936 |
} |
| 35937 |
} |
| 35938 |
class CipherTransform { |
| 35939 |
constructor(stringCipherConstructor, streamCipherConstructor) { |
| 35940 |
this.StringCipherConstructor = stringCipherConstructor; |
| 35941 |
this.StreamCipherConstructor = streamCipherConstructor; |
| 35942 |
} |
| 35943 |
createStream(stream, length) { |
| 35944 |
const cipher = new this.StreamCipherConstructor(); |
| 35945 |
return new DecryptStream(stream, length, function cipherTransformDecryptStream(data, finalize) { |
| 35946 |
return cipher.decryptBlock(data, finalize); |
| 35947 |
}); |
| 35948 |
} |
| 35949 |
decryptString(s) { |
| 35950 |
const cipher = new this.StringCipherConstructor(); |
| 35951 |
let data = stringToBytes(s); |
| 35952 |
data = cipher.decryptBlock(data, true); |
| 35953 |
return bytesToString(data); |
| 35954 |
} |
| 35955 |
encryptString(s) { |
| 35956 |
const cipher = new this.StringCipherConstructor(); |
| 35957 |
if (cipher instanceof AESBaseCipher) { |
| 35958 |
const strLen = s.length; |
| 35959 |
const pad = 16 - strLen % 16; |
| 35960 |
s += String.fromCharCode(pad).repeat(pad); |
| 35961 |
const iv = new Uint8Array(16); |
| 35962 |
if (typeof crypto !== "undefined") { |
| 35963 |
crypto.getRandomValues(iv); |
| 35964 |
} else { |
| 35965 |
for (let i = 0; i < 16; i++) { |
| 35966 |
iv[i] = Math.floor(256 * Math.random()); |
| 35967 |
} |
| 35968 |
} |
| 35969 |
let data = stringToBytes(s); |
| 35970 |
data = cipher.encrypt(data, iv); |
| 35971 |
const buf = new Uint8Array(16 + data.length); |
| 35972 |
buf.set(iv); |
| 35973 |
buf.set(data, 16); |
| 35974 |
return bytesToString(buf); |
| 35975 |
} |
| 35976 |
let data = stringToBytes(s); |
| 35977 |
data = cipher.encrypt(data); |
| 35978 |
return bytesToString(data); |
| 35979 |
} |
| 35980 |
} |
| 35981 |
class CipherTransformFactory { |
| 35982 |
static #defaultPasswordBytes = new Uint8Array([0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80, 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a]); |
| 35983 |
#createEncryptionKey20(revision, password, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms) { |
| 35984 |
if (password) { |
| 35985 |
const passwordLength = Math.min(127, password.length); |
| 35986 |
password = password.subarray(0, passwordLength); |
| 35987 |
} else { |
| 35988 |
password = []; |
| 35989 |
} |
| 35990 |
const pdfAlgorithm = revision === 6 ? new PDF20() : new PDF17(); |
| 35991 |
if (pdfAlgorithm.checkUserPassword(password, userValidationSalt, userPassword)) { |
| 35992 |
return pdfAlgorithm.getUserKey(password, userKeySalt, userEncryption); |
| 35993 |
} else if (password.length && pdfAlgorithm.checkOwnerPassword(password, ownerValidationSalt, uBytes, ownerPassword)) { |
| 35994 |
return pdfAlgorithm.getOwnerKey(password, ownerKeySalt, uBytes, ownerEncryption); |
| 35995 |
} |
| 35996 |
return null; |
| 35997 |
} |
| 35998 |
#prepareKeyData(fileId, password, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata) { |
| 35999 |
const hashDataSize = 40 + ownerPassword.length + fileId.length; |
| 36000 |
const hashData = new Uint8Array(hashDataSize); |
| 36001 |
let i = 0, |
| 36002 |
j, |
| 36003 |
n; |
| 36004 |
if (password) { |
| 36005 |
n = Math.min(32, password.length); |
| 36006 |
for (; i < n; ++i) { |
| 36007 |
hashData[i] = password[i]; |
| 36008 |
} |
| 36009 |
} |
| 36010 |
j = 0; |
| 36011 |
while (i < 32) { |
| 36012 |
hashData[i++] = CipherTransformFactory.#defaultPasswordBytes[j++]; |
| 36013 |
} |
| 36014 |
for (j = 0, n = ownerPassword.length; j < n; ++j) { |
| 36015 |
hashData[i++] = ownerPassword[j]; |
| 36016 |
} |
| 36017 |
hashData[i++] = flags & 0xff; |
| 36018 |
hashData[i++] = flags >> 8 & 0xff; |
| 36019 |
hashData[i++] = flags >> 16 & 0xff; |
| 36020 |
hashData[i++] = flags >>> 24 & 0xff; |
| 36021 |
for (j = 0, n = fileId.length; j < n; ++j) { |
| 36022 |
hashData[i++] = fileId[j]; |
| 36023 |
} |
| 36024 |
if (revision >= 4 && !encryptMetadata) { |
| 36025 |
hashData[i++] = 0xff; |
| 36026 |
hashData[i++] = 0xff; |
| 36027 |
hashData[i++] = 0xff; |
| 36028 |
hashData[i++] = 0xff; |
| 36029 |
} |
| 36030 |
let hash = calculateMD5(hashData, 0, i); |
| 36031 |
const keyLengthInBytes = keyLength >> 3; |
| 36032 |
if (revision >= 3) { |
| 36033 |
for (j = 0; j < 50; ++j) { |
| 36034 |
hash = calculateMD5(hash, 0, keyLengthInBytes); |
| 36035 |
} |
| 36036 |
} |
| 36037 |
const encryptionKey = hash.subarray(0, keyLengthInBytes); |
| 36038 |
let cipher, checkData; |
| 36039 |
if (revision >= 3) { |
| 36040 |
for (i = 0; i < 32; ++i) { |
| 36041 |
hashData[i] = CipherTransformFactory.#defaultPasswordBytes[i]; |
| 36042 |
} |
| 36043 |
for (j = 0, n = fileId.length; j < n; ++j) { |
| 36044 |
hashData[i++] = fileId[j]; |
| 36045 |
} |
| 36046 |
cipher = new ARCFourCipher(encryptionKey); |
| 36047 |
checkData = cipher.encryptBlock(calculateMD5(hashData, 0, i)); |
| 36048 |
n = encryptionKey.length; |
| 36049 |
const derivedKey = new Uint8Array(n); |
| 36050 |
for (j = 1; j <= 19; ++j) { |
| 36051 |
for (let k = 0; k < n; ++k) { |
| 36052 |
derivedKey[k] = encryptionKey[k] ^ j; |
| 36053 |
} |
| 36054 |
cipher = new ARCFourCipher(derivedKey); |
| 36055 |
checkData = cipher.encryptBlock(checkData); |
| 36056 |
} |
| 36057 |
for (j = 0, n = checkData.length; j < n; ++j) { |
| 36058 |
if (userPassword[j] !== checkData[j]) { |
| 36059 |
return null; |
| 36060 |
} |
| 36061 |
} |
| 36062 |
} else { |
| 36063 |
cipher = new ARCFourCipher(encryptionKey); |
| 36064 |
checkData = cipher.encryptBlock(CipherTransformFactory.#defaultPasswordBytes); |
| 36065 |
for (j = 0, n = checkData.length; j < n; ++j) { |
| 36066 |
if (userPassword[j] !== checkData[j]) { |
| 36067 |
return null; |
| 36068 |
} |
| 36069 |
} |
| 36070 |
} |
| 36071 |
return encryptionKey; |
| 36072 |
} |
| 36073 |
#decodeUserPassword(password, ownerPassword, revision, keyLength) { |
| 36074 |
const hashData = new Uint8Array(32); |
| 36075 |
let i = 0; |
| 36076 |
const n = Math.min(32, password.length); |
| 36077 |
for (; i < n; ++i) { |
| 36078 |
hashData[i] = password[i]; |
| 36079 |
} |
| 36080 |
let j = 0; |
| 36081 |
while (i < 32) { |
| 36082 |
hashData[i++] = CipherTransformFactory.#defaultPasswordBytes[j++]; |
| 36083 |
} |
| 36084 |
let hash = calculateMD5(hashData, 0, i); |
| 36085 |
const keyLengthInBytes = keyLength >> 3; |
| 36086 |
if (revision >= 3) { |
| 36087 |
for (j = 0; j < 50; ++j) { |
| 36088 |
hash = calculateMD5(hash, 0, hash.length); |
| 36089 |
} |
| 36090 |
} |
| 36091 |
let cipher, userPassword; |
| 36092 |
if (revision >= 3) { |
| 36093 |
userPassword = ownerPassword; |
| 36094 |
const derivedKey = new Uint8Array(keyLengthInBytes); |
| 36095 |
for (j = 19; j >= 0; j--) { |
| 36096 |
for (let k = 0; k < keyLengthInBytes; ++k) { |
| 36097 |
derivedKey[k] = hash[k] ^ j; |
| 36098 |
} |
| 36099 |
cipher = new ARCFourCipher(derivedKey); |
| 36100 |
userPassword = cipher.encryptBlock(userPassword); |
| 36101 |
} |
| 36102 |
} else { |
| 36103 |
cipher = new ARCFourCipher(hash.subarray(0, keyLengthInBytes)); |
| 36104 |
userPassword = cipher.encryptBlock(ownerPassword); |
| 36105 |
} |
| 36106 |
return userPassword; |
| 36107 |
} |
| 36108 |
#buildObjectKey(num, gen, encryptionKey, isAes = false) { |
| 36109 |
const key = new Uint8Array(encryptionKey.length + 9); |
| 36110 |
const n = encryptionKey.length; |
| 36111 |
let i; |
| 36112 |
for (i = 0; i < n; ++i) { |
| 36113 |
key[i] = encryptionKey[i]; |
| 36114 |
} |
| 36115 |
key[i++] = num & 0xff; |
| 36116 |
key[i++] = num >> 8 & 0xff; |
| 36117 |
key[i++] = num >> 16 & 0xff; |
| 36118 |
key[i++] = gen & 0xff; |
| 36119 |
key[i++] = gen >> 8 & 0xff; |
| 36120 |
if (isAes) { |
| 36121 |
key[i++] = 0x73; |
| 36122 |
key[i++] = 0x41; |
| 36123 |
key[i++] = 0x6c; |
| 36124 |
key[i++] = 0x54; |
| 36125 |
} |
| 36126 |
const hash = calculateMD5(key, 0, i); |
| 36127 |
return hash.subarray(0, Math.min(encryptionKey.length + 5, 16)); |
| 36128 |
} |
| 36129 |
#buildCipherConstructor(cf, name, num, gen, key) { |
| 36130 |
if (!(name instanceof Name)) { |
| 36131 |
throw new FormatError("Invalid crypt filter name."); |
| 36132 |
} |
| 36133 |
const self = this; |
| 36134 |
const cryptFilter = cf.get(name.name); |
| 36135 |
const cfm = cryptFilter?.get("CFM"); |
| 36136 |
if (!cfm || cfm.name === "None") { |
| 36137 |
return function () { |
| 36138 |
return new NullCipher(); |
| 36139 |
}; |
| 36140 |
} |
| 36141 |
if (cfm.name === "V2") { |
| 36142 |
return function () { |
| 36143 |
return new ARCFourCipher(self.#buildObjectKey(num, gen, key, false)); |
| 36144 |
}; |
| 36145 |
} |
| 36146 |
if (cfm.name === "AESV2") { |
| 36147 |
return function () { |
| 36148 |
return new AES128Cipher(self.#buildObjectKey(num, gen, key, true)); |
| 36149 |
}; |
| 36150 |
} |
| 36151 |
if (cfm.name === "AESV3") { |
| 36152 |
return function () { |
| 36153 |
return new AES256Cipher(key); |
| 36154 |
}; |
| 36155 |
} |
| 36156 |
throw new FormatError("Unknown crypto method"); |
| 36157 |
} |
| 36158 |
constructor(dict, fileId, password) { |
| 36159 |
const filter = dict.get("Filter"); |
| 36160 |
if (!isName(filter, "Standard")) { |
| 36161 |
throw new FormatError("unknown encryption method"); |
| 36162 |
} |
| 36163 |
this.filterName = filter.name; |
| 36164 |
this.dict = dict; |
| 36165 |
const algorithm = dict.get("V"); |
| 36166 |
if (!Number.isInteger(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) { |
| 36167 |
throw new FormatError("unsupported encryption algorithm"); |
| 36168 |
} |
| 36169 |
this.algorithm = algorithm; |
| 36170 |
let keyLength = dict.get("Length"); |
| 36171 |
if (!keyLength) { |
| 36172 |
if (algorithm <= 3) { |
| 36173 |
keyLength = 40; |
| 36174 |
} else { |
| 36175 |
const cfDict = dict.get("CF"); |
| 36176 |
const streamCryptoName = dict.get("StmF"); |
| 36177 |
if (cfDict instanceof Dict && streamCryptoName instanceof Name) { |
| 36178 |
cfDict.suppressEncryption = true; |
| 36179 |
const handlerDict = cfDict.get(streamCryptoName.name); |
| 36180 |
keyLength = handlerDict?.get("Length") || 128; |
| 36181 |
if (keyLength < 40) { |
| 36182 |
keyLength <<= 3; |
| 36183 |
} |
| 36184 |
} |
| 36185 |
} |
| 36186 |
} |
| 36187 |
if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) { |
| 36188 |
throw new FormatError("invalid key length"); |
| 36189 |
} |
| 36190 |
const ownerBytes = stringToBytes(dict.get("O")), |
| 36191 |
userBytes = stringToBytes(dict.get("U")); |
| 36192 |
const ownerPassword = ownerBytes.subarray(0, 32); |
| 36193 |
const userPassword = userBytes.subarray(0, 32); |
| 36194 |
const flags = dict.get("P"); |
| 36195 |
const revision = dict.get("R"); |
| 36196 |
const encryptMetadata = (algorithm === 4 || algorithm === 5) && dict.get("EncryptMetadata") !== false; |
| 36197 |
this.encryptMetadata = encryptMetadata; |
| 36198 |
const fileIdBytes = stringToBytes(fileId); |
| 36199 |
let passwordBytes; |
| 36200 |
if (password) { |
| 36201 |
if (revision === 6) { |
| 36202 |
try { |
| 36203 |
password = utf8StringToString(password); |
| 36204 |
} catch { |
| 36205 |
warn("CipherTransformFactory: Unable to convert UTF8 encoded password."); |
| 36206 |
} |
| 36207 |
} |
| 36208 |
passwordBytes = stringToBytes(password); |
| 36209 |
} |
| 36210 |
let encryptionKey; |
| 36211 |
if (algorithm !== 5) { |
| 36212 |
encryptionKey = this.#prepareKeyData(fileIdBytes, passwordBytes, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata); |
| 36213 |
} else { |
| 36214 |
const ownerValidationSalt = ownerBytes.subarray(32, 40); |
| 36215 |
const ownerKeySalt = ownerBytes.subarray(40, 48); |
| 36216 |
const uBytes = userBytes.subarray(0, 48); |
| 36217 |
const userValidationSalt = userBytes.subarray(32, 40); |
| 36218 |
const userKeySalt = userBytes.subarray(40, 48); |
| 36219 |
const ownerEncryption = stringToBytes(dict.get("OE")); |
| 36220 |
const userEncryption = stringToBytes(dict.get("UE")); |
| 36221 |
const perms = stringToBytes(dict.get("Perms")); |
| 36222 |
encryptionKey = this.#createEncryptionKey20(revision, passwordBytes, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms); |
| 36223 |
} |
| 36224 |
if (!encryptionKey && !password) { |
| 36225 |
throw new PasswordException("No password given", PasswordResponses.NEED_PASSWORD); |
| 36226 |
} else if (!encryptionKey && password) { |
| 36227 |
const decodedPassword = this.#decodeUserPassword(passwordBytes, ownerPassword, revision, keyLength); |
| 36228 |
encryptionKey = this.#prepareKeyData(fileIdBytes, decodedPassword, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata); |
| 36229 |
} |
| 36230 |
if (!encryptionKey) { |
| 36231 |
throw new PasswordException("Incorrect Password", PasswordResponses.INCORRECT_PASSWORD); |
| 36232 |
} |
| 36233 |
this.encryptionKey = encryptionKey; |
| 36234 |
if (algorithm >= 4) { |
| 36235 |
const cf = dict.get("CF"); |
| 36236 |
if (cf instanceof Dict) { |
| 36237 |
cf.suppressEncryption = true; |
| 36238 |
} |
| 36239 |
this.cf = cf; |
| 36240 |
this.stmf = dict.get("StmF") || Name.get("Identity"); |
| 36241 |
this.strf = dict.get("StrF") || Name.get("Identity"); |
| 36242 |
this.eff = dict.get("EFF") || this.stmf; |
| 36243 |
} |
| 36244 |
} |
| 36245 |
createCipherTransform(num, gen) { |
| 36246 |
if (this.algorithm === 4 || this.algorithm === 5) { |
| 36247 |
return new CipherTransform(this.#buildCipherConstructor(this.cf, this.strf, num, gen, this.encryptionKey), this.#buildCipherConstructor(this.cf, this.stmf, num, gen, this.encryptionKey)); |
| 36248 |
} |
| 36249 |
const key = this.#buildObjectKey(num, gen, this.encryptionKey, false); |
| 36250 |
const cipherConstructor = function () { |
| 36251 |
return new ARCFourCipher(key); |
| 36252 |
}; |
| 36253 |
return new CipherTransform(cipherConstructor, cipherConstructor); |
| 36254 |
} |
| 36255 |
} |
| 36256 |
|
| 36257 |
;// ./src/core/writer.js |
| 36258 |
|
| 36259 |
|
| 36260 |
|
| 36261 |
|
| 36262 |
|
| 36263 |
|
| 36264 |
|
| 36265 |
async function writeObject(ref, obj, buffer, { |
| 36266 |
encrypt = null |
| 36267 |
}) { |
| 36268 |
const transform = encrypt?.createCipherTransform(ref.num, ref.gen); |
| 36269 |
buffer.push(`${ref.num} ${ref.gen} obj\n`); |
| 36270 |
if (obj instanceof Dict) { |
| 36271 |
await writeDict(obj, buffer, transform); |
| 36272 |
} else if (obj instanceof BaseStream) { |
| 36273 |
await writeStream(obj, buffer, transform); |
| 36274 |
} else if (Array.isArray(obj) || ArrayBuffer.isView(obj)) { |
| 36275 |
await writeArray(obj, buffer, transform); |
| 36276 |
} |
| 36277 |
buffer.push("\nendobj\n"); |
| 36278 |
} |
| 36279 |
async function writeDict(dict, buffer, transform) { |
| 36280 |
buffer.push("<<"); |
| 36281 |
for (const key of dict.getKeys()) { |
| 36282 |
buffer.push(` /${escapePDFName(key)} `); |
| 36283 |
await writeValue(dict.getRaw(key), buffer, transform); |
| 36284 |
} |
| 36285 |
buffer.push(">>"); |
| 36286 |
} |
| 36287 |
async function writeStream(stream, buffer, transform) { |
| 36288 |
let bytes = stream.getBytes(); |
| 36289 |
const { |
| 36290 |
dict |
| 36291 |
} = stream; |
| 36292 |
const [filter, params] = await Promise.all([dict.getAsync("Filter"), dict.getAsync("DecodeParms")]); |
| 36293 |
const filterZero = Array.isArray(filter) ? await dict.xref.fetchIfRefAsync(filter[0]) : filter; |
| 36294 |
const isFilterZeroFlateDecode = isName(filterZero, "FlateDecode"); |
| 36295 |
const MIN_LENGTH_FOR_COMPRESSING = 256; |
| 36296 |
if (bytes.length >= MIN_LENGTH_FOR_COMPRESSING || isFilterZeroFlateDecode) { |
| 36297 |
try { |
| 36298 |
const cs = new CompressionStream("deflate"); |
| 36299 |
const writer = cs.writable.getWriter(); |
| 36300 |
writer.write(bytes); |
| 36301 |
writer.close(); |
| 36302 |
const buf = await new Response(cs.readable).arrayBuffer(); |
| 36303 |
bytes = new Uint8Array(buf); |
| 36304 |
let newFilter, newParams; |
| 36305 |
if (!filter) { |
| 36306 |
newFilter = Name.get("FlateDecode"); |
| 36307 |
} else if (!isFilterZeroFlateDecode) { |
| 36308 |
newFilter = Array.isArray(filter) ? [Name.get("FlateDecode"), ...filter] : [Name.get("FlateDecode"), filter]; |
| 36309 |
if (params) { |
| 36310 |
newParams = Array.isArray(params) ? [null, ...params] : [null, params]; |
| 36311 |
} |
| 36312 |
} |
| 36313 |
if (newFilter) { |
| 36314 |
dict.set("Filter", newFilter); |
| 36315 |
} |
| 36316 |
if (newParams) { |
| 36317 |
dict.set("DecodeParms", newParams); |
| 36318 |
} |
| 36319 |
} catch (ex) { |
| 36320 |
info(`writeStream - cannot compress data: "${ex}".`); |
| 36321 |
} |
| 36322 |
} |
| 36323 |
let string = bytesToString(bytes); |
| 36324 |
if (transform) { |
| 36325 |
string = transform.encryptString(string); |
| 36326 |
} |
| 36327 |
dict.set("Length", string.length); |
| 36328 |
await writeDict(dict, buffer, transform); |
| 36329 |
buffer.push(" stream\n", string, "\nendstream"); |
| 36330 |
} |
| 36331 |
async function writeArray(array, buffer, transform) { |
| 36332 |
buffer.push("["); |
| 36333 |
let first = true; |
| 36334 |
for (const val of array) { |
| 36335 |
if (!first) { |
| 36336 |
buffer.push(" "); |
| 36337 |
} else { |
| 36338 |
first = false; |
| 36339 |
} |
| 36340 |
await writeValue(val, buffer, transform); |
| 36341 |
} |
| 36342 |
buffer.push("]"); |
| 36343 |
} |
| 36344 |
async function writeValue(value, buffer, transform) { |
| 36345 |
if (value instanceof Name) { |
| 36346 |
buffer.push(`/${escapePDFName(value.name)}`); |
| 36347 |
} else if (value instanceof Ref) { |
| 36348 |
buffer.push(`${value.num} ${value.gen} R`); |
| 36349 |
} else if (Array.isArray(value) || ArrayBuffer.isView(value)) { |
| 36350 |
await writeArray(value, buffer, transform); |
| 36351 |
} else if (typeof value === "string") { |
| 36352 |
if (transform) { |
| 36353 |
value = transform.encryptString(value); |
| 36354 |
} |
| 36355 |
buffer.push(`(${escapeString(value)})`); |
| 36356 |
} else if (typeof value === "number") { |
| 36357 |
buffer.push(numberToString(value)); |
| 36358 |
} else if (typeof value === "boolean") { |
| 36359 |
buffer.push(value.toString()); |
| 36360 |
} else if (value instanceof Dict) { |
| 36361 |
await writeDict(value, buffer, transform); |
| 36362 |
} else if (value instanceof BaseStream) { |
| 36363 |
await writeStream(value, buffer, transform); |
| 36364 |
} else if (value === null) { |
| 36365 |
buffer.push("null"); |
| 36366 |
} else { |
| 36367 |
warn(`Unhandled value in writer: ${typeof value}, please file a bug.`); |
| 36368 |
} |
| 36369 |
} |
| 36370 |
function writeInt(number, size, offset, buffer) { |
| 36371 |
for (let i = size + offset - 1; i > offset - 1; i--) { |
| 36372 |
buffer[i] = number & 0xff; |
| 36373 |
number >>= 8; |
| 36374 |
} |
| 36375 |
return offset + size; |
| 36376 |
} |
| 36377 |
function writeString(string, offset, buffer) { |
| 36378 |
for (let i = 0, len = string.length; i < len; i++) { |
| 36379 |
buffer[offset + i] = string.charCodeAt(i) & 0xff; |
| 36380 |
} |
| 36381 |
} |
| 36382 |
function computeMD5(filesize, xrefInfo) { |
| 36383 |
const time = Math.floor(Date.now() / 1000); |
| 36384 |
const filename = xrefInfo.filename || ""; |
| 36385 |
const md5Buffer = [time.toString(), filename, filesize.toString()]; |
| 36386 |
let md5BufferLen = md5Buffer.reduce((a, str) => a + str.length, 0); |
| 36387 |
for (const value of Object.values(xrefInfo.info)) { |
| 36388 |
md5Buffer.push(value); |
| 36389 |
md5BufferLen += value.length; |
| 36390 |
} |
| 36391 |
const array = new Uint8Array(md5BufferLen); |
| 36392 |
let offset = 0; |
| 36393 |
for (const str of md5Buffer) { |
| 36394 |
writeString(str, offset, array); |
| 36395 |
offset += str.length; |
| 36396 |
} |
| 36397 |
return bytesToString(calculateMD5(array)); |
| 36398 |
} |
| 36399 |
function writeXFADataForAcroform(str, newRefs) { |
| 36400 |
const xml = new SimpleXMLParser({ |
| 36401 |
hasAttributes: true |
| 36402 |
}).parseFromString(str); |
| 36403 |
for (const { |
| 36404 |
xfa |
| 36405 |
} of newRefs) { |
| 36406 |
if (!xfa) { |
| 36407 |
continue; |
| 36408 |
} |
| 36409 |
const { |
| 36410 |
path, |
| 36411 |
value |
| 36412 |
} = xfa; |
| 36413 |
if (!path) { |
| 36414 |
continue; |
| 36415 |
} |
| 36416 |
const nodePath = parseXFAPath(path); |
| 36417 |
let node = xml.documentElement.searchNode(nodePath, 0); |
| 36418 |
if (!node && nodePath.length > 1) { |
| 36419 |
node = xml.documentElement.searchNode([nodePath.at(-1)], 0); |
| 36420 |
} |
| 36421 |
if (node) { |
| 36422 |
node.childNodes = Array.isArray(value) ? value.map(val => new SimpleDOMNode("value", val)) : [new SimpleDOMNode("#text", value)]; |
| 36423 |
} else { |
| 36424 |
warn(`Node not found for path: ${path}`); |
| 36425 |
} |
| 36426 |
} |
| 36427 |
const buffer = []; |
| 36428 |
xml.documentElement.dump(buffer); |
| 36429 |
return buffer.join(""); |
| 36430 |
} |
| 36431 |
async function updateAcroform({ |
| 36432 |
xref, |
| 36433 |
acroForm, |
| 36434 |
acroFormRef, |
| 36435 |
hasXfa, |
| 36436 |
hasXfaDatasetsEntry, |
| 36437 |
xfaDatasetsRef, |
| 36438 |
needAppearances, |
| 36439 |
newRefs |
| 36440 |
}) { |
| 36441 |
if (hasXfa && !hasXfaDatasetsEntry && !xfaDatasetsRef) { |
| 36442 |
warn("XFA - Cannot save it"); |
| 36443 |
} |
| 36444 |
if (!needAppearances && (!hasXfa || !xfaDatasetsRef || hasXfaDatasetsEntry)) { |
| 36445 |
return; |
| 36446 |
} |
| 36447 |
const dict = acroForm.clone(); |
| 36448 |
if (hasXfa && !hasXfaDatasetsEntry) { |
| 36449 |
const newXfa = acroForm.get("XFA").slice(); |
| 36450 |
newXfa.splice(2, 0, "datasets"); |
| 36451 |
newXfa.splice(3, 0, xfaDatasetsRef); |
| 36452 |
dict.set("XFA", newXfa); |
| 36453 |
} |
| 36454 |
if (needAppearances) { |
| 36455 |
dict.set("NeedAppearances", true); |
| 36456 |
} |
| 36457 |
const buffer = []; |
| 36458 |
await writeObject(acroFormRef, dict, buffer, xref); |
| 36459 |
newRefs.push({ |
| 36460 |
ref: acroFormRef, |
| 36461 |
data: buffer.join("") |
| 36462 |
}); |
| 36463 |
} |
| 36464 |
function updateXFA({ |
| 36465 |
xfaData, |
| 36466 |
xfaDatasetsRef, |
| 36467 |
newRefs, |
| 36468 |
xref |
| 36469 |
}) { |
| 36470 |
if (xfaData === null) { |
| 36471 |
const datasets = xref.fetchIfRef(xfaDatasetsRef); |
| 36472 |
xfaData = writeXFADataForAcroform(datasets.getString(), newRefs); |
| 36473 |
} |
| 36474 |
const encrypt = xref.encrypt; |
| 36475 |
if (encrypt) { |
| 36476 |
const transform = encrypt.createCipherTransform(xfaDatasetsRef.num, xfaDatasetsRef.gen); |
| 36477 |
xfaData = transform.encryptString(xfaData); |
| 36478 |
} |
| 36479 |
const data = `${xfaDatasetsRef.num} ${xfaDatasetsRef.gen} obj\n` + `<< /Type /EmbeddedFile /Length ${xfaData.length}>>\nstream\n` + xfaData + "\nendstream\nendobj\n"; |
| 36480 |
newRefs.push({ |
| 36481 |
ref: xfaDatasetsRef, |
| 36482 |
data |
| 36483 |
}); |
| 36484 |
} |
| 36485 |
async function getXRefTable(xrefInfo, baseOffset, newRefs, newXref, buffer) { |
| 36486 |
buffer.push("xref\n"); |
| 36487 |
const indexes = getIndexes(newRefs); |
| 36488 |
let indexesPosition = 0; |
| 36489 |
for (const { |
| 36490 |
ref, |
| 36491 |
data |
| 36492 |
} of newRefs) { |
| 36493 |
if (ref.num === indexes[indexesPosition]) { |
| 36494 |
buffer.push(`${indexes[indexesPosition]} ${indexes[indexesPosition + 1]}\n`); |
| 36495 |
indexesPosition += 2; |
| 36496 |
} |
| 36497 |
if (data !== null) { |
| 36498 |
buffer.push(`${baseOffset.toString().padStart(10, "0")} ${Math.min(ref.gen, 0xffff).toString().padStart(5, "0")} n\r\n`); |
| 36499 |
baseOffset += data.length; |
| 36500 |
} else { |
| 36501 |
buffer.push(`0000000000 ${Math.min(ref.gen + 1, 0xffff).toString().padStart(5, "0")} f\r\n`); |
| 36502 |
} |
| 36503 |
} |
| 36504 |
computeIDs(baseOffset, xrefInfo, newXref); |
| 36505 |
buffer.push("trailer\n"); |
| 36506 |
await writeDict(newXref, buffer); |
| 36507 |
buffer.push("\nstartxref\n", baseOffset.toString(), "\n%%EOF\n"); |
| 36508 |
} |
| 36509 |
function getIndexes(newRefs) { |
| 36510 |
const indexes = []; |
| 36511 |
for (const { |
| 36512 |
ref |
| 36513 |
} of newRefs) { |
| 36514 |
if (ref.num === indexes.at(-2) + indexes.at(-1)) { |
| 36515 |
indexes[indexes.length - 1] += 1; |
| 36516 |
} else { |
| 36517 |
indexes.push(ref.num, 1); |
| 36518 |
} |
| 36519 |
} |
| 36520 |
return indexes; |
| 36521 |
} |
| 36522 |
async function getXRefStreamTable(xrefInfo, baseOffset, newRefs, newXref, buffer) { |
| 36523 |
const xrefTableData = []; |
| 36524 |
let maxOffset = 0; |
| 36525 |
let maxGen = 0; |
| 36526 |
for (const { |
| 36527 |
ref, |
| 36528 |
data |
| 36529 |
} of newRefs) { |
| 36530 |
let gen; |
| 36531 |
maxOffset = Math.max(maxOffset, baseOffset); |
| 36532 |
if (data !== null) { |
| 36533 |
gen = Math.min(ref.gen, 0xffff); |
| 36534 |
xrefTableData.push([1, baseOffset, gen]); |
| 36535 |
baseOffset += data.length; |
| 36536 |
} else { |
| 36537 |
gen = Math.min(ref.gen + 1, 0xffff); |
| 36538 |
xrefTableData.push([0, 0, gen]); |
| 36539 |
} |
| 36540 |
maxGen = Math.max(maxGen, gen); |
| 36541 |
} |
| 36542 |
newXref.set("Index", getIndexes(newRefs)); |
| 36543 |
const offsetSize = getSizeInBytes(maxOffset); |
| 36544 |
const maxGenSize = getSizeInBytes(maxGen); |
| 36545 |
const sizes = [1, offsetSize, maxGenSize]; |
| 36546 |
newXref.set("W", sizes); |
| 36547 |
computeIDs(baseOffset, xrefInfo, newXref); |
| 36548 |
const structSize = sizes.reduce((a, x) => a + x, 0); |
| 36549 |
const data = new Uint8Array(structSize * xrefTableData.length); |
| 36550 |
const stream = new Stream(data); |
| 36551 |
stream.dict = newXref; |
| 36552 |
let offset = 0; |
| 36553 |
for (const [type, objOffset, gen] of xrefTableData) { |
| 36554 |
offset = writeInt(type, sizes[0], offset, data); |
| 36555 |
offset = writeInt(objOffset, sizes[1], offset, data); |
| 36556 |
offset = writeInt(gen, sizes[2], offset, data); |
| 36557 |
} |
| 36558 |
await writeObject(xrefInfo.newRef, stream, buffer, {}); |
| 36559 |
buffer.push("startxref\n", baseOffset.toString(), "\n%%EOF\n"); |
| 36560 |
} |
| 36561 |
function computeIDs(baseOffset, xrefInfo, newXref) { |
| 36562 |
if (Array.isArray(xrefInfo.fileIds) && xrefInfo.fileIds.length > 0) { |
| 36563 |
const md5 = computeMD5(baseOffset, xrefInfo); |
| 36564 |
newXref.set("ID", [xrefInfo.fileIds[0], md5]); |
| 36565 |
} |
| 36566 |
} |
| 36567 |
function getTrailerDict(xrefInfo, newRefs, useXrefStream) { |
| 36568 |
const newXref = new Dict(null); |
| 36569 |
newXref.set("Prev", xrefInfo.startXRef); |
| 36570 |
const refForXrefTable = xrefInfo.newRef; |
| 36571 |
if (useXrefStream) { |
| 36572 |
newRefs.push({ |
| 36573 |
ref: refForXrefTable, |
| 36574 |
data: "" |
| 36575 |
}); |
| 36576 |
newXref.set("Size", refForXrefTable.num + 1); |
| 36577 |
newXref.set("Type", Name.get("XRef")); |
| 36578 |
} else { |
| 36579 |
newXref.set("Size", refForXrefTable.num); |
| 36580 |
} |
| 36581 |
if (xrefInfo.rootRef !== null) { |
| 36582 |
newXref.set("Root", xrefInfo.rootRef); |
| 36583 |
} |
| 36584 |
if (xrefInfo.infoRef !== null) { |
| 36585 |
newXref.set("Info", xrefInfo.infoRef); |
| 36586 |
} |
| 36587 |
if (xrefInfo.encryptRef !== null) { |
| 36588 |
newXref.set("Encrypt", xrefInfo.encryptRef); |
| 36589 |
} |
| 36590 |
return newXref; |
| 36591 |
} |
| 36592 |
async function incrementalUpdate({ |
| 36593 |
originalData, |
| 36594 |
xrefInfo, |
| 36595 |
newRefs, |
| 36596 |
xref = null, |
| 36597 |
hasXfa = false, |
| 36598 |
xfaDatasetsRef = null, |
| 36599 |
hasXfaDatasetsEntry = false, |
| 36600 |
needAppearances, |
| 36601 |
acroFormRef = null, |
| 36602 |
acroForm = null, |
| 36603 |
xfaData = null, |
| 36604 |
useXrefStream = false |
| 36605 |
}) { |
| 36606 |
await updateAcroform({ |
| 36607 |
xref, |
| 36608 |
acroForm, |
| 36609 |
acroFormRef, |
| 36610 |
hasXfa, |
| 36611 |
hasXfaDatasetsEntry, |
| 36612 |
xfaDatasetsRef, |
| 36613 |
needAppearances, |
| 36614 |
newRefs |
| 36615 |
}); |
| 36616 |
if (hasXfa) { |
| 36617 |
updateXFA({ |
| 36618 |
xfaData, |
| 36619 |
xfaDatasetsRef, |
| 36620 |
newRefs, |
| 36621 |
xref |
| 36622 |
}); |
| 36623 |
} |
| 36624 |
const buffer = []; |
| 36625 |
let baseOffset = originalData.length; |
| 36626 |
const lastByte = originalData.at(-1); |
| 36627 |
if (lastByte !== 0x0a && lastByte !== 0x0d) { |
| 36628 |
buffer.push("\n"); |
| 36629 |
baseOffset += 1; |
| 36630 |
} |
| 36631 |
const newXref = getTrailerDict(xrefInfo, newRefs, useXrefStream); |
| 36632 |
newRefs = newRefs.sort((a, b) => a.ref.num - b.ref.num); |
| 36633 |
for (const { |
| 36634 |
data |
| 36635 |
} of newRefs) { |
| 36636 |
if (data !== null) { |
| 36637 |
buffer.push(data); |
| 36638 |
} |
| 36639 |
} |
| 36640 |
await (useXrefStream ? getXRefStreamTable(xrefInfo, baseOffset, newRefs, newXref, buffer) : getXRefTable(xrefInfo, baseOffset, newRefs, newXref, buffer)); |
| 36641 |
const totalLength = buffer.reduce((a, str) => a + str.length, originalData.length); |
| 36642 |
const array = new Uint8Array(totalLength); |
| 36643 |
array.set(originalData); |
| 36644 |
let offset = originalData.length; |
| 36645 |
for (const str of buffer) { |
| 36646 |
writeString(str, offset, array); |
| 36647 |
offset += str.length; |
| 36648 |
} |
| 36649 |
return array; |
| 36650 |
} |
| 36651 |
|
| 36652 |
;// ./src/core/struct_tree.js |
| 36653 |
|
| 36654 |
|
| 36655 |
|
| 36656 |
|
| 36657 |
|
| 36658 |
const MAX_DEPTH = 40; |
| 36659 |
const StructElementType = { |
| 36660 |
PAGE_CONTENT: 1, |
| 36661 |
STREAM_CONTENT: 2, |
| 36662 |
OBJECT: 3, |
| 36663 |
ANNOTATION: 4, |
| 36664 |
ELEMENT: 5 |
| 36665 |
}; |
| 36666 |
class StructTreeRoot { |
| 36667 |
constructor(rootDict, rootRef) { |
| 36668 |
this.dict = rootDict; |
| 36669 |
this.ref = rootRef instanceof Ref ? rootRef : null; |
| 36670 |
this.roleMap = new Map(); |
| 36671 |
this.structParentIds = null; |
| 36672 |
} |
| 36673 |
init() { |
| 36674 |
this.readRoleMap(); |
| 36675 |
} |
| 36676 |
#addIdToPage(pageRef, id, type) { |
| 36677 |
if (!(pageRef instanceof Ref) || id < 0) { |
| 36678 |
return; |
| 36679 |
} |
| 36680 |
this.structParentIds ||= new RefSetCache(); |
| 36681 |
let ids = this.structParentIds.get(pageRef); |
| 36682 |
if (!ids) { |
| 36683 |
ids = []; |
| 36684 |
this.structParentIds.put(pageRef, ids); |
| 36685 |
} |
| 36686 |
ids.push([id, type]); |
| 36687 |
} |
| 36688 |
addAnnotationIdToPage(pageRef, id) { |
| 36689 |
this.#addIdToPage(pageRef, id, StructElementType.ANNOTATION); |
| 36690 |
} |
| 36691 |
readRoleMap() { |
| 36692 |
const roleMapDict = this.dict.get("RoleMap"); |
| 36693 |
if (!(roleMapDict instanceof Dict)) { |
| 36694 |
return; |
| 36695 |
} |
| 36696 |
roleMapDict.forEach((key, value) => { |
| 36697 |
if (!(value instanceof Name)) { |
| 36698 |
return; |
| 36699 |
} |
| 36700 |
this.roleMap.set(key, value.name); |
| 36701 |
}); |
| 36702 |
} |
| 36703 |
static async canCreateStructureTree({ |
| 36704 |
catalogRef, |
| 36705 |
pdfManager, |
| 36706 |
newAnnotationsByPage |
| 36707 |
}) { |
| 36708 |
if (!(catalogRef instanceof Ref)) { |
| 36709 |
warn("Cannot save the struct tree: no catalog reference."); |
| 36710 |
return false; |
| 36711 |
} |
| 36712 |
let nextKey = 0; |
| 36713 |
let hasNothingToUpdate = true; |
| 36714 |
for (const [pageIndex, elements] of newAnnotationsByPage) { |
| 36715 |
const { |
| 36716 |
ref: pageRef |
| 36717 |
} = await pdfManager.getPage(pageIndex); |
| 36718 |
if (!(pageRef instanceof Ref)) { |
| 36719 |
warn(`Cannot save the struct tree: page ${pageIndex} has no ref.`); |
| 36720 |
hasNothingToUpdate = true; |
| 36721 |
break; |
| 36722 |
} |
| 36723 |
for (const element of elements) { |
| 36724 |
if (element.accessibilityData?.type) { |
| 36725 |
element.parentTreeId = nextKey++; |
| 36726 |
hasNothingToUpdate = false; |
| 36727 |
} |
| 36728 |
} |
| 36729 |
} |
| 36730 |
if (hasNothingToUpdate) { |
| 36731 |
for (const elements of newAnnotationsByPage.values()) { |
| 36732 |
for (const element of elements) { |
| 36733 |
delete element.parentTreeId; |
| 36734 |
} |
| 36735 |
} |
| 36736 |
return false; |
| 36737 |
} |
| 36738 |
return true; |
| 36739 |
} |
| 36740 |
static async createStructureTree({ |
| 36741 |
newAnnotationsByPage, |
| 36742 |
xref, |
| 36743 |
catalogRef, |
| 36744 |
pdfManager, |
| 36745 |
newRefs |
| 36746 |
}) { |
| 36747 |
const root = pdfManager.catalog.cloneDict(); |
| 36748 |
const cache = new RefSetCache(); |
| 36749 |
cache.put(catalogRef, root); |
| 36750 |
const structTreeRootRef = xref.getNewTemporaryRef(); |
| 36751 |
root.set("StructTreeRoot", structTreeRootRef); |
| 36752 |
const structTreeRoot = new Dict(xref); |
| 36753 |
structTreeRoot.set("Type", Name.get("StructTreeRoot")); |
| 36754 |
const parentTreeRef = xref.getNewTemporaryRef(); |
| 36755 |
structTreeRoot.set("ParentTree", parentTreeRef); |
| 36756 |
const kids = []; |
| 36757 |
structTreeRoot.set("K", kids); |
| 36758 |
cache.put(structTreeRootRef, structTreeRoot); |
| 36759 |
const parentTree = new Dict(xref); |
| 36760 |
const nums = []; |
| 36761 |
parentTree.set("Nums", nums); |
| 36762 |
const nextKey = await this.#writeKids({ |
| 36763 |
newAnnotationsByPage, |
| 36764 |
structTreeRootRef, |
| 36765 |
structTreeRoot: null, |
| 36766 |
kids, |
| 36767 |
nums, |
| 36768 |
xref, |
| 36769 |
pdfManager, |
| 36770 |
newRefs, |
| 36771 |
cache |
| 36772 |
}); |
| 36773 |
structTreeRoot.set("ParentTreeNextKey", nextKey); |
| 36774 |
cache.put(parentTreeRef, parentTree); |
| 36775 |
const buffer = []; |
| 36776 |
for (const [ref, obj] of cache.items()) { |
| 36777 |
buffer.length = 0; |
| 36778 |
await writeObject(ref, obj, buffer, xref); |
| 36779 |
newRefs.push({ |
| 36780 |
ref, |
| 36781 |
data: buffer.join("") |
| 36782 |
}); |
| 36783 |
} |
| 36784 |
} |
| 36785 |
async canUpdateStructTree({ |
| 36786 |
pdfManager, |
| 36787 |
xref, |
| 36788 |
newAnnotationsByPage |
| 36789 |
}) { |
| 36790 |
if (!this.ref) { |
| 36791 |
warn("Cannot update the struct tree: no root reference."); |
| 36792 |
return false; |
| 36793 |
} |
| 36794 |
let nextKey = this.dict.get("ParentTreeNextKey"); |
| 36795 |
if (!Number.isInteger(nextKey) || nextKey < 0) { |
| 36796 |
warn("Cannot update the struct tree: invalid next key."); |
| 36797 |
return false; |
| 36798 |
} |
| 36799 |
const parentTree = this.dict.get("ParentTree"); |
| 36800 |
if (!(parentTree instanceof Dict)) { |
| 36801 |
warn("Cannot update the struct tree: ParentTree isn't a dict."); |
| 36802 |
return false; |
| 36803 |
} |
| 36804 |
const nums = parentTree.get("Nums"); |
| 36805 |
if (!Array.isArray(nums)) { |
| 36806 |
warn("Cannot update the struct tree: nums isn't an array."); |
| 36807 |
return false; |
| 36808 |
} |
| 36809 |
const numberTree = new NumberTree(parentTree, xref); |
| 36810 |
for (const pageIndex of newAnnotationsByPage.keys()) { |
| 36811 |
const { |
| 36812 |
pageDict |
| 36813 |
} = await pdfManager.getPage(pageIndex); |
| 36814 |
if (!pageDict.has("StructParents")) { |
| 36815 |
continue; |
| 36816 |
} |
| 36817 |
const id = pageDict.get("StructParents"); |
| 36818 |
if (!Number.isInteger(id) || !Array.isArray(numberTree.get(id))) { |
| 36819 |
warn(`Cannot save the struct tree: page ${pageIndex} has a wrong id.`); |
| 36820 |
return false; |
| 36821 |
} |
| 36822 |
} |
| 36823 |
let hasNothingToUpdate = true; |
| 36824 |
for (const [pageIndex, elements] of newAnnotationsByPage) { |
| 36825 |
const { |
| 36826 |
pageDict |
| 36827 |
} = await pdfManager.getPage(pageIndex); |
| 36828 |
StructTreeRoot.#collectParents({ |
| 36829 |
elements, |
| 36830 |
xref: this.dict.xref, |
| 36831 |
pageDict, |
| 36832 |
numberTree |
| 36833 |
}); |
| 36834 |
for (const element of elements) { |
| 36835 |
if (element.accessibilityData?.type) { |
| 36836 |
if (!(element.accessibilityData.structParent >= 0)) { |
| 36837 |
element.parentTreeId = nextKey++; |
| 36838 |
} |
| 36839 |
hasNothingToUpdate = false; |
| 36840 |
} |
| 36841 |
} |
| 36842 |
} |
| 36843 |
if (hasNothingToUpdate) { |
| 36844 |
for (const elements of newAnnotationsByPage.values()) { |
| 36845 |
for (const element of elements) { |
| 36846 |
delete element.parentTreeId; |
| 36847 |
delete element.structTreeParent; |
| 36848 |
} |
| 36849 |
} |
| 36850 |
return false; |
| 36851 |
} |
| 36852 |
return true; |
| 36853 |
} |
| 36854 |
async updateStructureTree({ |
| 36855 |
newAnnotationsByPage, |
| 36856 |
pdfManager, |
| 36857 |
newRefs |
| 36858 |
}) { |
| 36859 |
const xref = this.dict.xref; |
| 36860 |
const structTreeRoot = this.dict.clone(); |
| 36861 |
const structTreeRootRef = this.ref; |
| 36862 |
const cache = new RefSetCache(); |
| 36863 |
cache.put(structTreeRootRef, structTreeRoot); |
| 36864 |
let parentTreeRef = structTreeRoot.getRaw("ParentTree"); |
| 36865 |
let parentTree; |
| 36866 |
if (parentTreeRef instanceof Ref) { |
| 36867 |
parentTree = xref.fetch(parentTreeRef); |
| 36868 |
} else { |
| 36869 |
parentTree = parentTreeRef; |
| 36870 |
parentTreeRef = xref.getNewTemporaryRef(); |
| 36871 |
structTreeRoot.set("ParentTree", parentTreeRef); |
| 36872 |
} |
| 36873 |
parentTree = parentTree.clone(); |
| 36874 |
cache.put(parentTreeRef, parentTree); |
| 36875 |
let nums = parentTree.getRaw("Nums"); |
| 36876 |
let numsRef = null; |
| 36877 |
if (nums instanceof Ref) { |
| 36878 |
numsRef = nums; |
| 36879 |
nums = xref.fetch(numsRef); |
| 36880 |
} |
| 36881 |
nums = nums.slice(); |
| 36882 |
if (!numsRef) { |
| 36883 |
parentTree.set("Nums", nums); |
| 36884 |
} |
| 36885 |
const newNextKey = await StructTreeRoot.#writeKids({ |
| 36886 |
newAnnotationsByPage, |
| 36887 |
structTreeRootRef, |
| 36888 |
structTreeRoot: this, |
| 36889 |
kids: null, |
| 36890 |
nums, |
| 36891 |
xref, |
| 36892 |
pdfManager, |
| 36893 |
newRefs, |
| 36894 |
cache |
| 36895 |
}); |
| 36896 |
if (newNextKey === -1) { |
| 36897 |
return; |
| 36898 |
} |
| 36899 |
structTreeRoot.set("ParentTreeNextKey", newNextKey); |
| 36900 |
if (numsRef) { |
| 36901 |
cache.put(numsRef, nums); |
| 36902 |
} |
| 36903 |
const buffer = []; |
| 36904 |
for (const [ref, obj] of cache.items()) { |
| 36905 |
buffer.length = 0; |
| 36906 |
await writeObject(ref, obj, buffer, xref); |
| 36907 |
newRefs.push({ |
| 36908 |
ref, |
| 36909 |
data: buffer.join("") |
| 36910 |
}); |
| 36911 |
} |
| 36912 |
} |
| 36913 |
static async #writeKids({ |
| 36914 |
newAnnotationsByPage, |
| 36915 |
structTreeRootRef, |
| 36916 |
structTreeRoot, |
| 36917 |
kids, |
| 36918 |
nums, |
| 36919 |
xref, |
| 36920 |
pdfManager, |
| 36921 |
newRefs, |
| 36922 |
cache |
| 36923 |
}) { |
| 36924 |
const objr = Name.get("OBJR"); |
| 36925 |
let nextKey = -1; |
| 36926 |
let structTreePageObjs; |
| 36927 |
const buffer = []; |
| 36928 |
for (const [pageIndex, elements] of newAnnotationsByPage) { |
| 36929 |
const page = await pdfManager.getPage(pageIndex); |
| 36930 |
const { |
| 36931 |
ref: pageRef |
| 36932 |
} = page; |
| 36933 |
const isPageRef = pageRef instanceof Ref; |
| 36934 |
for (const { |
| 36935 |
accessibilityData, |
| 36936 |
ref, |
| 36937 |
parentTreeId, |
| 36938 |
structTreeParent |
| 36939 |
} of elements) { |
| 36940 |
if (!accessibilityData?.type) { |
| 36941 |
continue; |
| 36942 |
} |
| 36943 |
const { |
| 36944 |
structParent |
| 36945 |
} = accessibilityData; |
| 36946 |
if (structTreeRoot && Number.isInteger(structParent) && structParent >= 0) { |
| 36947 |
let objs = (structTreePageObjs ||= new Map()).get(pageIndex); |
| 36948 |
if (objs === undefined) { |
| 36949 |
const structTreePage = new StructTreePage(structTreeRoot, page.pageDict); |
| 36950 |
objs = structTreePage.collectObjects(pageRef); |
| 36951 |
structTreePageObjs.set(pageIndex, objs); |
| 36952 |
} |
| 36953 |
const objRef = objs?.get(structParent); |
| 36954 |
if (objRef) { |
| 36955 |
const tagDict = xref.fetch(objRef).clone(); |
| 36956 |
StructTreeRoot.#writeProperties(tagDict, accessibilityData); |
| 36957 |
buffer.length = 0; |
| 36958 |
await writeObject(objRef, tagDict, buffer, xref); |
| 36959 |
newRefs.push({ |
| 36960 |
ref: objRef, |
| 36961 |
data: buffer.join("") |
| 36962 |
}); |
| 36963 |
continue; |
| 36964 |
} |
| 36965 |
} |
| 36966 |
nextKey = Math.max(nextKey, parentTreeId); |
| 36967 |
const tagRef = xref.getNewTemporaryRef(); |
| 36968 |
const tagDict = new Dict(xref); |
| 36969 |
StructTreeRoot.#writeProperties(tagDict, accessibilityData); |
| 36970 |
await this.#updateParentTag({ |
| 36971 |
structTreeParent, |
| 36972 |
tagDict, |
| 36973 |
newTagRef: tagRef, |
| 36974 |
structTreeRootRef, |
| 36975 |
fallbackKids: kids, |
| 36976 |
xref, |
| 36977 |
cache |
| 36978 |
}); |
| 36979 |
const objDict = new Dict(xref); |
| 36980 |
tagDict.set("K", objDict); |
| 36981 |
objDict.set("Type", objr); |
| 36982 |
if (isPageRef) { |
| 36983 |
objDict.set("Pg", pageRef); |
| 36984 |
} |
| 36985 |
objDict.set("Obj", ref); |
| 36986 |
cache.put(tagRef, tagDict); |
| 36987 |
nums.push(parentTreeId, tagRef); |
| 36988 |
} |
| 36989 |
} |
| 36990 |
return nextKey + 1; |
| 36991 |
} |
| 36992 |
static #writeProperties(tagDict, { |
| 36993 |
type, |
| 36994 |
title, |
| 36995 |
lang, |
| 36996 |
alt, |
| 36997 |
expanded, |
| 36998 |
actualText |
| 36999 |
}) { |
| 37000 |
tagDict.set("S", Name.get(type)); |
| 37001 |
if (title) { |
| 37002 |
tagDict.set("T", stringToAsciiOrUTF16BE(title)); |
| 37003 |
} |
| 37004 |
if (lang) { |
| 37005 |
tagDict.set("Lang", stringToAsciiOrUTF16BE(lang)); |
| 37006 |
} |
| 37007 |
if (alt) { |
| 37008 |
tagDict.set("Alt", stringToAsciiOrUTF16BE(alt)); |
| 37009 |
} |
| 37010 |
if (expanded) { |
| 37011 |
tagDict.set("E", stringToAsciiOrUTF16BE(expanded)); |
| 37012 |
} |
| 37013 |
if (actualText) { |
| 37014 |
tagDict.set("ActualText", stringToAsciiOrUTF16BE(actualText)); |
| 37015 |
} |
| 37016 |
} |
| 37017 |
static #collectParents({ |
| 37018 |
elements, |
| 37019 |
xref, |
| 37020 |
pageDict, |
| 37021 |
numberTree |
| 37022 |
}) { |
| 37023 |
const idToElements = new Map(); |
| 37024 |
for (const element of elements) { |
| 37025 |
if (element.structTreeParentId) { |
| 37026 |
const id = parseInt(element.structTreeParentId.split("_mc")[1], 10); |
| 37027 |
let elems = idToElements.get(id); |
| 37028 |
if (!elems) { |
| 37029 |
elems = []; |
| 37030 |
idToElements.set(id, elems); |
| 37031 |
} |
| 37032 |
elems.push(element); |
| 37033 |
} |
| 37034 |
} |
| 37035 |
const id = pageDict.get("StructParents"); |
| 37036 |
if (!Number.isInteger(id)) { |
| 37037 |
return; |
| 37038 |
} |
| 37039 |
const parentArray = numberTree.get(id); |
| 37040 |
const updateElement = (kid, pageKid, kidRef) => { |
| 37041 |
const elems = idToElements.get(kid); |
| 37042 |
if (elems) { |
| 37043 |
const parentRef = pageKid.getRaw("P"); |
| 37044 |
const parentDict = xref.fetchIfRef(parentRef); |
| 37045 |
if (parentRef instanceof Ref && parentDict instanceof Dict) { |
| 37046 |
const params = { |
| 37047 |
ref: kidRef, |
| 37048 |
dict: pageKid |
| 37049 |
}; |
| 37050 |
for (const element of elems) { |
| 37051 |
element.structTreeParent = params; |
| 37052 |
} |
| 37053 |
} |
| 37054 |
return true; |
| 37055 |
} |
| 37056 |
return false; |
| 37057 |
}; |
| 37058 |
for (const kidRef of parentArray) { |
| 37059 |
if (!(kidRef instanceof Ref)) { |
| 37060 |
continue; |
| 37061 |
} |
| 37062 |
const pageKid = xref.fetch(kidRef); |
| 37063 |
const k = pageKid.get("K"); |
| 37064 |
if (Number.isInteger(k)) { |
| 37065 |
updateElement(k, pageKid, kidRef); |
| 37066 |
continue; |
| 37067 |
} |
| 37068 |
if (!Array.isArray(k)) { |
| 37069 |
continue; |
| 37070 |
} |
| 37071 |
for (let kid of k) { |
| 37072 |
kid = xref.fetchIfRef(kid); |
| 37073 |
if (Number.isInteger(kid) && updateElement(kid, pageKid, kidRef)) { |
| 37074 |
break; |
| 37075 |
} |
| 37076 |
if (!(kid instanceof Dict)) { |
| 37077 |
continue; |
| 37078 |
} |
| 37079 |
if (!isName(kid.get("Type"), "MCR")) { |
| 37080 |
break; |
| 37081 |
} |
| 37082 |
const mcid = kid.get("MCID"); |
| 37083 |
if (Number.isInteger(mcid) && updateElement(mcid, pageKid, kidRef)) { |
| 37084 |
break; |
| 37085 |
} |
| 37086 |
} |
| 37087 |
} |
| 37088 |
} |
| 37089 |
static async #updateParentTag({ |
| 37090 |
structTreeParent, |
| 37091 |
tagDict, |
| 37092 |
newTagRef, |
| 37093 |
structTreeRootRef, |
| 37094 |
fallbackKids, |
| 37095 |
xref, |
| 37096 |
cache |
| 37097 |
}) { |
| 37098 |
let ref = null; |
| 37099 |
let parentRef; |
| 37100 |
if (structTreeParent) { |
| 37101 |
({ |
| 37102 |
ref |
| 37103 |
} = structTreeParent); |
| 37104 |
parentRef = structTreeParent.dict.getRaw("P") || structTreeRootRef; |
| 37105 |
} else { |
| 37106 |
parentRef = structTreeRootRef; |
| 37107 |
} |
| 37108 |
tagDict.set("P", parentRef); |
| 37109 |
const parentDict = xref.fetchIfRef(parentRef); |
| 37110 |
if (!parentDict) { |
| 37111 |
fallbackKids.push(newTagRef); |
| 37112 |
return; |
| 37113 |
} |
| 37114 |
let cachedParentDict = cache.get(parentRef); |
| 37115 |
if (!cachedParentDict) { |
| 37116 |
cachedParentDict = parentDict.clone(); |
| 37117 |
cache.put(parentRef, cachedParentDict); |
| 37118 |
} |
| 37119 |
const parentKidsRaw = cachedParentDict.getRaw("K"); |
| 37120 |
let cachedParentKids = parentKidsRaw instanceof Ref ? cache.get(parentKidsRaw) : null; |
| 37121 |
if (!cachedParentKids) { |
| 37122 |
cachedParentKids = xref.fetchIfRef(parentKidsRaw); |
| 37123 |
cachedParentKids = Array.isArray(cachedParentKids) ? cachedParentKids.slice() : [parentKidsRaw]; |
| 37124 |
const parentKidsRef = xref.getNewTemporaryRef(); |
| 37125 |
cachedParentDict.set("K", parentKidsRef); |
| 37126 |
cache.put(parentKidsRef, cachedParentKids); |
| 37127 |
} |
| 37128 |
const index = cachedParentKids.indexOf(ref); |
| 37129 |
cachedParentKids.splice(index >= 0 ? index + 1 : cachedParentKids.length, 0, newTagRef); |
| 37130 |
} |
| 37131 |
} |
| 37132 |
class StructElementNode { |
| 37133 |
constructor(tree, dict) { |
| 37134 |
this.tree = tree; |
| 37135 |
this.dict = dict; |
| 37136 |
this.kids = []; |
| 37137 |
this.parseKids(); |
| 37138 |
} |
| 37139 |
get role() { |
| 37140 |
const nameObj = this.dict.get("S"); |
| 37141 |
const name = nameObj instanceof Name ? nameObj.name : ""; |
| 37142 |
const { |
| 37143 |
root |
| 37144 |
} = this.tree; |
| 37145 |
if (root.roleMap.has(name)) { |
| 37146 |
return root.roleMap.get(name); |
| 37147 |
} |
| 37148 |
return name; |
| 37149 |
} |
| 37150 |
parseKids() { |
| 37151 |
let pageObjId = null; |
| 37152 |
const objRef = this.dict.getRaw("Pg"); |
| 37153 |
if (objRef instanceof Ref) { |
| 37154 |
pageObjId = objRef.toString(); |
| 37155 |
} |
| 37156 |
const kids = this.dict.get("K"); |
| 37157 |
if (Array.isArray(kids)) { |
| 37158 |
for (const kid of kids) { |
| 37159 |
const element = this.parseKid(pageObjId, kid); |
| 37160 |
if (element) { |
| 37161 |
this.kids.push(element); |
| 37162 |
} |
| 37163 |
} |
| 37164 |
} else { |
| 37165 |
const element = this.parseKid(pageObjId, kids); |
| 37166 |
if (element) { |
| 37167 |
this.kids.push(element); |
| 37168 |
} |
| 37169 |
} |
| 37170 |
} |
| 37171 |
parseKid(pageObjId, kid) { |
| 37172 |
if (Number.isInteger(kid)) { |
| 37173 |
if (this.tree.pageDict.objId !== pageObjId) { |
| 37174 |
return null; |
| 37175 |
} |
| 37176 |
return new StructElement({ |
| 37177 |
type: StructElementType.PAGE_CONTENT, |
| 37178 |
mcid: kid, |
| 37179 |
pageObjId |
| 37180 |
}); |
| 37181 |
} |
| 37182 |
let kidDict = null; |
| 37183 |
if (kid instanceof Ref) { |
| 37184 |
kidDict = this.dict.xref.fetch(kid); |
| 37185 |
} else if (kid instanceof Dict) { |
| 37186 |
kidDict = kid; |
| 37187 |
} |
| 37188 |
if (!kidDict) { |
| 37189 |
return null; |
| 37190 |
} |
| 37191 |
const pageRef = kidDict.getRaw("Pg"); |
| 37192 |
if (pageRef instanceof Ref) { |
| 37193 |
pageObjId = pageRef.toString(); |
| 37194 |
} |
| 37195 |
const type = kidDict.get("Type") instanceof Name ? kidDict.get("Type").name : null; |
| 37196 |
if (type === "MCR") { |
| 37197 |
if (this.tree.pageDict.objId !== pageObjId) { |
| 37198 |
return null; |
| 37199 |
} |
| 37200 |
const kidRef = kidDict.getRaw("Stm"); |
| 37201 |
return new StructElement({ |
| 37202 |
type: StructElementType.STREAM_CONTENT, |
| 37203 |
refObjId: kidRef instanceof Ref ? kidRef.toString() : null, |
| 37204 |
pageObjId, |
| 37205 |
mcid: kidDict.get("MCID") |
| 37206 |
}); |
| 37207 |
} |
| 37208 |
if (type === "OBJR") { |
| 37209 |
if (this.tree.pageDict.objId !== pageObjId) { |
| 37210 |
return null; |
| 37211 |
} |
| 37212 |
const kidRef = kidDict.getRaw("Obj"); |
| 37213 |
return new StructElement({ |
| 37214 |
type: StructElementType.OBJECT, |
| 37215 |
refObjId: kidRef instanceof Ref ? kidRef.toString() : null, |
| 37216 |
pageObjId |
| 37217 |
}); |
| 37218 |
} |
| 37219 |
return new StructElement({ |
| 37220 |
type: StructElementType.ELEMENT, |
| 37221 |
dict: kidDict |
| 37222 |
}); |
| 37223 |
} |
| 37224 |
} |
| 37225 |
class StructElement { |
| 37226 |
constructor({ |
| 37227 |
type, |
| 37228 |
dict = null, |
| 37229 |
mcid = null, |
| 37230 |
pageObjId = null, |
| 37231 |
refObjId = null |
| 37232 |
}) { |
| 37233 |
this.type = type; |
| 37234 |
this.dict = dict; |
| 37235 |
this.mcid = mcid; |
| 37236 |
this.pageObjId = pageObjId; |
| 37237 |
this.refObjId = refObjId; |
| 37238 |
this.parentNode = null; |
| 37239 |
} |
| 37240 |
} |
| 37241 |
class StructTreePage { |
| 37242 |
constructor(structTreeRoot, pageDict) { |
| 37243 |
this.root = structTreeRoot; |
| 37244 |
this.rootDict = structTreeRoot ? structTreeRoot.dict : null; |
| 37245 |
this.pageDict = pageDict; |
| 37246 |
this.nodes = []; |
| 37247 |
} |
| 37248 |
collectObjects(pageRef) { |
| 37249 |
if (!this.root || !this.rootDict || !(pageRef instanceof Ref)) { |
| 37250 |
return null; |
| 37251 |
} |
| 37252 |
const parentTree = this.rootDict.get("ParentTree"); |
| 37253 |
if (!parentTree) { |
| 37254 |
return null; |
| 37255 |
} |
| 37256 |
const ids = this.root.structParentIds?.get(pageRef); |
| 37257 |
if (!ids) { |
| 37258 |
return null; |
| 37259 |
} |
| 37260 |
const map = new Map(); |
| 37261 |
const numberTree = new NumberTree(parentTree, this.rootDict.xref); |
| 37262 |
for (const [elemId] of ids) { |
| 37263 |
const obj = numberTree.getRaw(elemId); |
| 37264 |
if (obj instanceof Ref) { |
| 37265 |
map.set(elemId, obj); |
| 37266 |
} |
| 37267 |
} |
| 37268 |
return map; |
| 37269 |
} |
| 37270 |
parse(pageRef) { |
| 37271 |
if (!this.root || !this.rootDict || !(pageRef instanceof Ref)) { |
| 37272 |
return; |
| 37273 |
} |
| 37274 |
const parentTree = this.rootDict.get("ParentTree"); |
| 37275 |
if (!parentTree) { |
| 37276 |
return; |
| 37277 |
} |
| 37278 |
const id = this.pageDict.get("StructParents"); |
| 37279 |
const ids = this.root.structParentIds?.get(pageRef); |
| 37280 |
if (!Number.isInteger(id) && !ids) { |
| 37281 |
return; |
| 37282 |
} |
| 37283 |
const map = new Map(); |
| 37284 |
const numberTree = new NumberTree(parentTree, this.rootDict.xref); |
| 37285 |
if (Number.isInteger(id)) { |
| 37286 |
const parentArray = numberTree.get(id); |
| 37287 |
if (Array.isArray(parentArray)) { |
| 37288 |
for (const ref of parentArray) { |
| 37289 |
if (ref instanceof Ref) { |
| 37290 |
this.addNode(this.rootDict.xref.fetch(ref), map); |
| 37291 |
} |
| 37292 |
} |
| 37293 |
} |
| 37294 |
} |
| 37295 |
if (!ids) { |
| 37296 |
return; |
| 37297 |
} |
| 37298 |
for (const [elemId, type] of ids) { |
| 37299 |
const obj = numberTree.get(elemId); |
| 37300 |
if (obj) { |
| 37301 |
const elem = this.addNode(this.rootDict.xref.fetchIfRef(obj), map); |
| 37302 |
if (elem?.kids?.length === 1 && elem.kids[0].type === StructElementType.OBJECT) { |
| 37303 |
elem.kids[0].type = type; |
| 37304 |
} |
| 37305 |
} |
| 37306 |
} |
| 37307 |
} |
| 37308 |
addNode(dict, map, level = 0) { |
| 37309 |
if (level > MAX_DEPTH) { |
| 37310 |
warn("StructTree MAX_DEPTH reached."); |
| 37311 |
return null; |
| 37312 |
} |
| 37313 |
if (!(dict instanceof Dict)) { |
| 37314 |
return null; |
| 37315 |
} |
| 37316 |
if (map.has(dict)) { |
| 37317 |
return map.get(dict); |
| 37318 |
} |
| 37319 |
const element = new StructElementNode(this, dict); |
| 37320 |
map.set(dict, element); |
| 37321 |
const parent = dict.get("P"); |
| 37322 |
if (!parent || isName(parent.get("Type"), "StructTreeRoot")) { |
| 37323 |
if (!this.addTopLevelNode(dict, element)) { |
| 37324 |
map.delete(dict); |
| 37325 |
} |
| 37326 |
return element; |
| 37327 |
} |
| 37328 |
const parentNode = this.addNode(parent, map, level + 1); |
| 37329 |
if (!parentNode) { |
| 37330 |
return element; |
| 37331 |
} |
| 37332 |
let save = false; |
| 37333 |
for (const kid of parentNode.kids) { |
| 37334 |
if (kid.type === StructElementType.ELEMENT && kid.dict === dict) { |
| 37335 |
kid.parentNode = element; |
| 37336 |
save = true; |
| 37337 |
} |
| 37338 |
} |
| 37339 |
if (!save) { |
| 37340 |
map.delete(dict); |
| 37341 |
} |
| 37342 |
return element; |
| 37343 |
} |
| 37344 |
addTopLevelNode(dict, element) { |
| 37345 |
const obj = this.rootDict.get("K"); |
| 37346 |
if (!obj) { |
| 37347 |
return false; |
| 37348 |
} |
| 37349 |
if (obj instanceof Dict) { |
| 37350 |
if (obj.objId !== dict.objId) { |
| 37351 |
return false; |
| 37352 |
} |
| 37353 |
this.nodes[0] = element; |
| 37354 |
return true; |
| 37355 |
} |
| 37356 |
if (!Array.isArray(obj)) { |
| 37357 |
return true; |
| 37358 |
} |
| 37359 |
let save = false; |
| 37360 |
for (let i = 0; i < obj.length; i++) { |
| 37361 |
const kidRef = obj[i]; |
| 37362 |
if (kidRef?.toString() === dict.objId) { |
| 37363 |
this.nodes[i] = element; |
| 37364 |
save = true; |
| 37365 |
} |
| 37366 |
} |
| 37367 |
return save; |
| 37368 |
} |
| 37369 |
get serializable() { |
| 37370 |
function nodeToSerializable(node, parent, level = 0) { |
| 37371 |
if (level > MAX_DEPTH) { |
| 37372 |
warn("StructTree too deep to be fully serialized."); |
| 37373 |
return; |
| 37374 |
} |
| 37375 |
const obj = Object.create(null); |
| 37376 |
obj.role = node.role; |
| 37377 |
obj.children = []; |
| 37378 |
parent.children.push(obj); |
| 37379 |
let alt = node.dict.get("Alt"); |
| 37380 |
if (typeof alt !== "string") { |
| 37381 |
alt = node.dict.get("ActualText"); |
| 37382 |
} |
| 37383 |
if (typeof alt === "string") { |
| 37384 |
obj.alt = stringToPDFString(alt); |
| 37385 |
} |
| 37386 |
const a = node.dict.get("A"); |
| 37387 |
if (a instanceof Dict) { |
| 37388 |
const bbox = lookupNormalRect(a.getArray("BBox"), null); |
| 37389 |
if (bbox) { |
| 37390 |
obj.bbox = bbox; |
| 37391 |
} else { |
| 37392 |
const width = a.get("Width"); |
| 37393 |
const height = a.get("Height"); |
| 37394 |
if (typeof width === "number" && width > 0 && typeof height === "number" && height > 0) { |
| 37395 |
obj.bbox = [0, 0, width, height]; |
| 37396 |
} |
| 37397 |
} |
| 37398 |
} |
| 37399 |
const lang = node.dict.get("Lang"); |
| 37400 |
if (typeof lang === "string") { |
| 37401 |
obj.lang = stringToPDFString(lang); |
| 37402 |
} |
| 37403 |
for (const kid of node.kids) { |
| 37404 |
const kidElement = kid.type === StructElementType.ELEMENT ? kid.parentNode : null; |
| 37405 |
if (kidElement) { |
| 37406 |
nodeToSerializable(kidElement, obj, level + 1); |
| 37407 |
continue; |
| 37408 |
} else if (kid.type === StructElementType.PAGE_CONTENT || kid.type === StructElementType.STREAM_CONTENT) { |
| 37409 |
obj.children.push({ |
| 37410 |
type: "content", |
| 37411 |
id: `p${kid.pageObjId}_mc${kid.mcid}` |
| 37412 |
}); |
| 37413 |
} else if (kid.type === StructElementType.OBJECT) { |
| 37414 |
obj.children.push({ |
| 37415 |
type: "object", |
| 37416 |
id: kid.refObjId |
| 37417 |
}); |
| 37418 |
} else if (kid.type === StructElementType.ANNOTATION) { |
| 37419 |
obj.children.push({ |
| 37420 |
type: "annotation", |
| 37421 |
id: `${AnnotationPrefix}${kid.refObjId}` |
| 37422 |
}); |
| 37423 |
} |
| 37424 |
} |
| 37425 |
} |
| 37426 |
const root = Object.create(null); |
| 37427 |
root.children = []; |
| 37428 |
root.role = "Root"; |
| 37429 |
for (const child of this.nodes) { |
| 37430 |
if (!child) { |
| 37431 |
continue; |
| 37432 |
} |
| 37433 |
nodeToSerializable(child, root); |
| 37434 |
} |
| 37435 |
return root; |
| 37436 |
} |
| 37437 |
} |
| 37438 |
|
| 37439 |
;// ./src/core/catalog.js |
| 37440 |
|
| 37441 |
|
| 37442 |
|
| 37443 |
|
| 37444 |
|
| 37445 |
|
| 37446 |
|
| 37447 |
|
| 37448 |
|
| 37449 |
|
| 37450 |
|
| 37451 |
function isValidExplicitDest(dest) { |
| 37452 |
if (!Array.isArray(dest) || dest.length < 2) { |
| 37453 |
return false; |
| 37454 |
} |
| 37455 |
const [page, zoom, ...args] = dest; |
| 37456 |
if (!(page instanceof Ref) && !Number.isInteger(page)) { |
| 37457 |
return false; |
| 37458 |
} |
| 37459 |
if (!(zoom instanceof Name)) { |
| 37460 |
return false; |
| 37461 |
} |
| 37462 |
const argsLen = args.length; |
| 37463 |
let allowNull = true; |
| 37464 |
switch (zoom.name) { |
| 37465 |
case "XYZ": |
| 37466 |
if (argsLen < 2 || argsLen > 3) { |
| 37467 |
return false; |
| 37468 |
} |
| 37469 |
break; |
| 37470 |
case "Fit": |
| 37471 |
case "FitB": |
| 37472 |
return argsLen === 0; |
| 37473 |
case "FitH": |
| 37474 |
case "FitBH": |
| 37475 |
case "FitV": |
| 37476 |
case "FitBV": |
| 37477 |
if (argsLen > 1) { |
| 37478 |
return false; |
| 37479 |
} |
| 37480 |
break; |
| 37481 |
case "FitR": |
| 37482 |
if (argsLen !== 4) { |
| 37483 |
return false; |
| 37484 |
} |
| 37485 |
allowNull = false; |
| 37486 |
break; |
| 37487 |
default: |
| 37488 |
return false; |
| 37489 |
} |
| 37490 |
for (const arg of args) { |
| 37491 |
if (!(typeof arg === "number" || allowNull && arg === null)) { |
| 37492 |
return false; |
| 37493 |
} |
| 37494 |
} |
| 37495 |
return true; |
| 37496 |
} |
| 37497 |
function fetchDest(dest) { |
| 37498 |
if (dest instanceof Dict) { |
| 37499 |
dest = dest.get("D"); |
| 37500 |
} |
| 37501 |
return isValidExplicitDest(dest) ? dest : null; |
| 37502 |
} |
| 37503 |
function fetchRemoteDest(action) { |
| 37504 |
let dest = action.get("D"); |
| 37505 |
if (dest) { |
| 37506 |
if (dest instanceof Name) { |
| 37507 |
dest = dest.name; |
| 37508 |
} |
| 37509 |
if (typeof dest === "string") { |
| 37510 |
return stringToPDFString(dest); |
| 37511 |
} else if (isValidExplicitDest(dest)) { |
| 37512 |
return JSON.stringify(dest); |
| 37513 |
} |
| 37514 |
} |
| 37515 |
return null; |
| 37516 |
} |
| 37517 |
class Catalog { |
| 37518 |
constructor(pdfManager, xref) { |
| 37519 |
this.pdfManager = pdfManager; |
| 37520 |
this.xref = xref; |
| 37521 |
this._catDict = xref.getCatalogObj(); |
| 37522 |
if (!(this._catDict instanceof Dict)) { |
| 37523 |
throw new FormatError("Catalog object is not a dictionary."); |
| 37524 |
} |
| 37525 |
this.toplevelPagesDict; |
| 37526 |
this._actualNumPages = null; |
| 37527 |
this.fontCache = new RefSetCache(); |
| 37528 |
this.builtInCMapCache = new Map(); |
| 37529 |
this.standardFontDataCache = new Map(); |
| 37530 |
this.globalImageCache = new GlobalImageCache(); |
| 37531 |
this.pageKidsCountCache = new RefSetCache(); |
| 37532 |
this.pageIndexCache = new RefSetCache(); |
| 37533 |
this.pageDictCache = new RefSetCache(); |
| 37534 |
this.nonBlendModesSet = new RefSet(); |
| 37535 |
this.systemFontCache = new Map(); |
| 37536 |
} |
| 37537 |
cloneDict() { |
| 37538 |
return this._catDict.clone(); |
| 37539 |
} |
| 37540 |
get version() { |
| 37541 |
const version = this._catDict.get("Version"); |
| 37542 |
if (version instanceof Name) { |
| 37543 |
if (PDF_VERSION_REGEXP.test(version.name)) { |
| 37544 |
return shadow(this, "version", version.name); |
| 37545 |
} |
| 37546 |
warn(`Invalid PDF catalog version: ${version.name}`); |
| 37547 |
} |
| 37548 |
return shadow(this, "version", null); |
| 37549 |
} |
| 37550 |
get lang() { |
| 37551 |
const lang = this._catDict.get("Lang"); |
| 37552 |
return shadow(this, "lang", lang && typeof lang === "string" ? stringToPDFString(lang) : null); |
| 37553 |
} |
| 37554 |
get needsRendering() { |
| 37555 |
const needsRendering = this._catDict.get("NeedsRendering"); |
| 37556 |
return shadow(this, "needsRendering", typeof needsRendering === "boolean" ? needsRendering : false); |
| 37557 |
} |
| 37558 |
get collection() { |
| 37559 |
let collection = null; |
| 37560 |
try { |
| 37561 |
const obj = this._catDict.get("Collection"); |
| 37562 |
if (obj instanceof Dict && obj.size > 0) { |
| 37563 |
collection = obj; |
| 37564 |
} |
| 37565 |
} catch (ex) { |
| 37566 |
if (ex instanceof MissingDataException) { |
| 37567 |
throw ex; |
| 37568 |
} |
| 37569 |
info("Cannot fetch Collection entry; assuming no collection is present."); |
| 37570 |
} |
| 37571 |
return shadow(this, "collection", collection); |
| 37572 |
} |
| 37573 |
get acroForm() { |
| 37574 |
let acroForm = null; |
| 37575 |
try { |
| 37576 |
const obj = this._catDict.get("AcroForm"); |
| 37577 |
if (obj instanceof Dict && obj.size > 0) { |
| 37578 |
acroForm = obj; |
| 37579 |
} |
| 37580 |
} catch (ex) { |
| 37581 |
if (ex instanceof MissingDataException) { |
| 37582 |
throw ex; |
| 37583 |
} |
| 37584 |
info("Cannot fetch AcroForm entry; assuming no forms are present."); |
| 37585 |
} |
| 37586 |
return shadow(this, "acroForm", acroForm); |
| 37587 |
} |
| 37588 |
get acroFormRef() { |
| 37589 |
const value = this._catDict.getRaw("AcroForm"); |
| 37590 |
return shadow(this, "acroFormRef", value instanceof Ref ? value : null); |
| 37591 |
} |
| 37592 |
get metadata() { |
| 37593 |
const streamRef = this._catDict.getRaw("Metadata"); |
| 37594 |
if (!(streamRef instanceof Ref)) { |
| 37595 |
return shadow(this, "metadata", null); |
| 37596 |
} |
| 37597 |
let metadata = null; |
| 37598 |
try { |
| 37599 |
const stream = this.xref.fetch(streamRef, !this.xref.encrypt?.encryptMetadata); |
| 37600 |
if (stream instanceof BaseStream && stream.dict instanceof Dict) { |
| 37601 |
const type = stream.dict.get("Type"); |
| 37602 |
const subtype = stream.dict.get("Subtype"); |
| 37603 |
if (isName(type, "Metadata") && isName(subtype, "XML")) { |
| 37604 |
const data = stringToUTF8String(stream.getString()); |
| 37605 |
if (data) { |
| 37606 |
metadata = new MetadataParser(data).serializable; |
| 37607 |
} |
| 37608 |
} |
| 37609 |
} |
| 37610 |
} catch (ex) { |
| 37611 |
if (ex instanceof MissingDataException) { |
| 37612 |
throw ex; |
| 37613 |
} |
| 37614 |
info(`Skipping invalid Metadata: "${ex}".`); |
| 37615 |
} |
| 37616 |
return shadow(this, "metadata", metadata); |
| 37617 |
} |
| 37618 |
get markInfo() { |
| 37619 |
let markInfo = null; |
| 37620 |
try { |
| 37621 |
markInfo = this._readMarkInfo(); |
| 37622 |
} catch (ex) { |
| 37623 |
if (ex instanceof MissingDataException) { |
| 37624 |
throw ex; |
| 37625 |
} |
| 37626 |
warn("Unable to read mark info."); |
| 37627 |
} |
| 37628 |
return shadow(this, "markInfo", markInfo); |
| 37629 |
} |
| 37630 |
_readMarkInfo() { |
| 37631 |
const obj = this._catDict.get("MarkInfo"); |
| 37632 |
if (!(obj instanceof Dict)) { |
| 37633 |
return null; |
| 37634 |
} |
| 37635 |
const markInfo = { |
| 37636 |
Marked: false, |
| 37637 |
UserProperties: false, |
| 37638 |
Suspects: false |
| 37639 |
}; |
| 37640 |
for (const key in markInfo) { |
| 37641 |
const value = obj.get(key); |
| 37642 |
if (typeof value === "boolean") { |
| 37643 |
markInfo[key] = value; |
| 37644 |
} |
| 37645 |
} |
| 37646 |
return markInfo; |
| 37647 |
} |
| 37648 |
get structTreeRoot() { |
| 37649 |
let structTree = null; |
| 37650 |
try { |
| 37651 |
structTree = this._readStructTreeRoot(); |
| 37652 |
} catch (ex) { |
| 37653 |
if (ex instanceof MissingDataException) { |
| 37654 |
throw ex; |
| 37655 |
} |
| 37656 |
warn("Unable read to structTreeRoot info."); |
| 37657 |
} |
| 37658 |
return shadow(this, "structTreeRoot", structTree); |
| 37659 |
} |
| 37660 |
_readStructTreeRoot() { |
| 37661 |
const rawObj = this._catDict.getRaw("StructTreeRoot"); |
| 37662 |
const obj = this.xref.fetchIfRef(rawObj); |
| 37663 |
if (!(obj instanceof Dict)) { |
| 37664 |
return null; |
| 37665 |
} |
| 37666 |
const root = new StructTreeRoot(obj, rawObj); |
| 37667 |
root.init(); |
| 37668 |
return root; |
| 37669 |
} |
| 37670 |
get toplevelPagesDict() { |
| 37671 |
const pagesObj = this._catDict.get("Pages"); |
| 37672 |
if (!(pagesObj instanceof Dict)) { |
| 37673 |
throw new FormatError("Invalid top-level pages dictionary."); |
| 37674 |
} |
| 37675 |
return shadow(this, "toplevelPagesDict", pagesObj); |
| 37676 |
} |
| 37677 |
get documentOutline() { |
| 37678 |
let obj = null; |
| 37679 |
try { |
| 37680 |
obj = this._readDocumentOutline(); |
| 37681 |
} catch (ex) { |
| 37682 |
if (ex instanceof MissingDataException) { |
| 37683 |
throw ex; |
| 37684 |
} |
| 37685 |
warn("Unable to read document outline."); |
| 37686 |
} |
| 37687 |
return shadow(this, "documentOutline", obj); |
| 37688 |
} |
| 37689 |
_readDocumentOutline() { |
| 37690 |
let obj = this._catDict.get("Outlines"); |
| 37691 |
if (!(obj instanceof Dict)) { |
| 37692 |
return null; |
| 37693 |
} |
| 37694 |
obj = obj.getRaw("First"); |
| 37695 |
if (!(obj instanceof Ref)) { |
| 37696 |
return null; |
| 37697 |
} |
| 37698 |
const root = { |
| 37699 |
items: [] |
| 37700 |
}; |
| 37701 |
const queue = [{ |
| 37702 |
obj, |
| 37703 |
parent: root |
| 37704 |
}]; |
| 37705 |
const processed = new RefSet(); |
| 37706 |
processed.put(obj); |
| 37707 |
const xref = this.xref, |
| 37708 |
blackColor = new Uint8ClampedArray(3); |
| 37709 |
while (queue.length > 0) { |
| 37710 |
const i = queue.shift(); |
| 37711 |
const outlineDict = xref.fetchIfRef(i.obj); |
| 37712 |
if (outlineDict === null) { |
| 37713 |
continue; |
| 37714 |
} |
| 37715 |
if (!outlineDict.has("Title")) { |
| 37716 |
warn("Invalid outline item encountered."); |
| 37717 |
} |
| 37718 |
const data = { |
| 37719 |
url: null, |
| 37720 |
dest: null, |
| 37721 |
action: null |
| 37722 |
}; |
| 37723 |
Catalog.parseDestDictionary({ |
| 37724 |
destDict: outlineDict, |
| 37725 |
resultObj: data, |
| 37726 |
docBaseUrl: this.baseUrl, |
| 37727 |
docAttachments: this.attachments |
| 37728 |
}); |
| 37729 |
const title = outlineDict.get("Title"); |
| 37730 |
const flags = outlineDict.get("F") || 0; |
| 37731 |
const color = outlineDict.getArray("C"); |
| 37732 |
const count = outlineDict.get("Count"); |
| 37733 |
let rgbColor = blackColor; |
| 37734 |
if (isNumberArray(color, 3) && (color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) { |
| 37735 |
rgbColor = ColorSpace.singletons.rgb.getRgb(color, 0); |
| 37736 |
} |
| 37737 |
const outlineItem = { |
| 37738 |
action: data.action, |
| 37739 |
attachment: data.attachment, |
| 37740 |
dest: data.dest, |
| 37741 |
url: data.url, |
| 37742 |
unsafeUrl: data.unsafeUrl, |
| 37743 |
newWindow: data.newWindow, |
| 37744 |
setOCGState: data.setOCGState, |
| 37745 |
title: typeof title === "string" ? stringToPDFString(title) : "", |
| 37746 |
color: rgbColor, |
| 37747 |
count: Number.isInteger(count) ? count : undefined, |
| 37748 |
bold: !!(flags & 2), |
| 37749 |
italic: !!(flags & 1), |
| 37750 |
items: [] |
| 37751 |
}; |
| 37752 |
i.parent.items.push(outlineItem); |
| 37753 |
obj = outlineDict.getRaw("First"); |
| 37754 |
if (obj instanceof Ref && !processed.has(obj)) { |
| 37755 |
queue.push({ |
| 37756 |
obj, |
| 37757 |
parent: outlineItem |
| 37758 |
}); |
| 37759 |
processed.put(obj); |
| 37760 |
} |
| 37761 |
obj = outlineDict.getRaw("Next"); |
| 37762 |
if (obj instanceof Ref && !processed.has(obj)) { |
| 37763 |
queue.push({ |
| 37764 |
obj, |
| 37765 |
parent: i.parent |
| 37766 |
}); |
| 37767 |
processed.put(obj); |
| 37768 |
} |
| 37769 |
} |
| 37770 |
return root.items.length > 0 ? root.items : null; |
| 37771 |
} |
| 37772 |
get permissions() { |
| 37773 |
let permissions = null; |
| 37774 |
try { |
| 37775 |
permissions = this._readPermissions(); |
| 37776 |
} catch (ex) { |
| 37777 |
if (ex instanceof MissingDataException) { |
| 37778 |
throw ex; |
| 37779 |
} |
| 37780 |
warn("Unable to read permissions."); |
| 37781 |
} |
| 37782 |
return shadow(this, "permissions", permissions); |
| 37783 |
} |
| 37784 |
_readPermissions() { |
| 37785 |
const encrypt = this.xref.trailer.get("Encrypt"); |
| 37786 |
if (!(encrypt instanceof Dict)) { |
| 37787 |
return null; |
| 37788 |
} |
| 37789 |
let flags = encrypt.get("P"); |
| 37790 |
if (typeof flags !== "number") { |
| 37791 |
return null; |
| 37792 |
} |
| 37793 |
flags += 2 ** 32; |
| 37794 |
const permissions = []; |
| 37795 |
for (const key in PermissionFlag) { |
| 37796 |
const value = PermissionFlag[key]; |
| 37797 |
if (flags & value) { |
| 37798 |
permissions.push(value); |
| 37799 |
} |
| 37800 |
} |
| 37801 |
return permissions; |
| 37802 |
} |
| 37803 |
get optionalContentConfig() { |
| 37804 |
let config = null; |
| 37805 |
try { |
| 37806 |
const properties = this._catDict.get("OCProperties"); |
| 37807 |
if (!properties) { |
| 37808 |
return shadow(this, "optionalContentConfig", null); |
| 37809 |
} |
| 37810 |
const defaultConfig = properties.get("D"); |
| 37811 |
if (!defaultConfig) { |
| 37812 |
return shadow(this, "optionalContentConfig", null); |
| 37813 |
} |
| 37814 |
const groupsData = properties.get("OCGs"); |
| 37815 |
if (!Array.isArray(groupsData)) { |
| 37816 |
return shadow(this, "optionalContentConfig", null); |
| 37817 |
} |
| 37818 |
const groups = []; |
| 37819 |
const groupRefs = new RefSet(); |
| 37820 |
for (const groupRef of groupsData) { |
| 37821 |
if (!(groupRef instanceof Ref) || groupRefs.has(groupRef)) { |
| 37822 |
continue; |
| 37823 |
} |
| 37824 |
groupRefs.put(groupRef); |
| 37825 |
groups.push(this.#readOptionalContentGroup(groupRef)); |
| 37826 |
} |
| 37827 |
config = this.#readOptionalContentConfig(defaultConfig, groupRefs); |
| 37828 |
config.groups = groups; |
| 37829 |
} catch (ex) { |
| 37830 |
if (ex instanceof MissingDataException) { |
| 37831 |
throw ex; |
| 37832 |
} |
| 37833 |
warn(`Unable to read optional content config: ${ex}`); |
| 37834 |
} |
| 37835 |
return shadow(this, "optionalContentConfig", config); |
| 37836 |
} |
| 37837 |
#readOptionalContentGroup(groupRef) { |
| 37838 |
const group = this.xref.fetch(groupRef); |
| 37839 |
const obj = { |
| 37840 |
id: groupRef.toString(), |
| 37841 |
name: null, |
| 37842 |
intent: null, |
| 37843 |
usage: { |
| 37844 |
print: null, |
| 37845 |
view: null |
| 37846 |
} |
| 37847 |
}; |
| 37848 |
const name = group.get("Name"); |
| 37849 |
if (typeof name === "string") { |
| 37850 |
obj.name = stringToPDFString(name); |
| 37851 |
} |
| 37852 |
let intent = group.getArray("Intent"); |
| 37853 |
if (!Array.isArray(intent)) { |
| 37854 |
intent = [intent]; |
| 37855 |
} |
| 37856 |
if (intent.every(i => i instanceof Name)) { |
| 37857 |
obj.intent = intent.map(i => i.name); |
| 37858 |
} |
| 37859 |
const usage = group.get("Usage"); |
| 37860 |
if (!(usage instanceof Dict)) { |
| 37861 |
return obj; |
| 37862 |
} |
| 37863 |
const usageObj = obj.usage; |
| 37864 |
const print = usage.get("Print"); |
| 37865 |
if (print instanceof Dict) { |
| 37866 |
const printState = print.get("PrintState"); |
| 37867 |
if (printState instanceof Name) { |
| 37868 |
switch (printState.name) { |
| 37869 |
case "ON": |
| 37870 |
case "OFF": |
| 37871 |
usageObj.print = { |
| 37872 |
printState: printState.name |
| 37873 |
}; |
| 37874 |
} |
| 37875 |
} |
| 37876 |
} |
| 37877 |
const view = usage.get("View"); |
| 37878 |
if (view instanceof Dict) { |
| 37879 |
const viewState = view.get("ViewState"); |
| 37880 |
if (viewState instanceof Name) { |
| 37881 |
switch (viewState.name) { |
| 37882 |
case "ON": |
| 37883 |
case "OFF": |
| 37884 |
usageObj.view = { |
| 37885 |
viewState: viewState.name |
| 37886 |
}; |
| 37887 |
} |
| 37888 |
} |
| 37889 |
} |
| 37890 |
return obj; |
| 37891 |
} |
| 37892 |
#readOptionalContentConfig(config, contentGroupRefs) { |
| 37893 |
function parseOnOff(refs) { |
| 37894 |
const onParsed = []; |
| 37895 |
if (Array.isArray(refs)) { |
| 37896 |
for (const value of refs) { |
| 37897 |
if (!(value instanceof Ref)) { |
| 37898 |
continue; |
| 37899 |
} |
| 37900 |
if (contentGroupRefs.has(value)) { |
| 37901 |
onParsed.push(value.toString()); |
| 37902 |
} |
| 37903 |
} |
| 37904 |
} |
| 37905 |
return onParsed; |
| 37906 |
} |
| 37907 |
function parseOrder(refs, nestedLevels = 0) { |
| 37908 |
if (!Array.isArray(refs)) { |
| 37909 |
return null; |
| 37910 |
} |
| 37911 |
const order = []; |
| 37912 |
for (const value of refs) { |
| 37913 |
if (value instanceof Ref && contentGroupRefs.has(value)) { |
| 37914 |
parsedOrderRefs.put(value); |
| 37915 |
order.push(value.toString()); |
| 37916 |
continue; |
| 37917 |
} |
| 37918 |
const nestedOrder = parseNestedOrder(value, nestedLevels); |
| 37919 |
if (nestedOrder) { |
| 37920 |
order.push(nestedOrder); |
| 37921 |
} |
| 37922 |
} |
| 37923 |
if (nestedLevels > 0) { |
| 37924 |
return order; |
| 37925 |
} |
| 37926 |
const hiddenGroups = []; |
| 37927 |
for (const groupRef of contentGroupRefs) { |
| 37928 |
if (parsedOrderRefs.has(groupRef)) { |
| 37929 |
continue; |
| 37930 |
} |
| 37931 |
hiddenGroups.push(groupRef.toString()); |
| 37932 |
} |
| 37933 |
if (hiddenGroups.length) { |
| 37934 |
order.push({ |
| 37935 |
name: null, |
| 37936 |
order: hiddenGroups |
| 37937 |
}); |
| 37938 |
} |
| 37939 |
return order; |
| 37940 |
} |
| 37941 |
function parseNestedOrder(ref, nestedLevels) { |
| 37942 |
if (++nestedLevels > MAX_NESTED_LEVELS) { |
| 37943 |
warn("parseNestedOrder - reached MAX_NESTED_LEVELS."); |
| 37944 |
return null; |
| 37945 |
} |
| 37946 |
const value = xref.fetchIfRef(ref); |
| 37947 |
if (!Array.isArray(value)) { |
| 37948 |
return null; |
| 37949 |
} |
| 37950 |
const nestedName = xref.fetchIfRef(value[0]); |
| 37951 |
if (typeof nestedName !== "string") { |
| 37952 |
return null; |
| 37953 |
} |
| 37954 |
const nestedOrder = parseOrder(value.slice(1), nestedLevels); |
| 37955 |
if (!nestedOrder || !nestedOrder.length) { |
| 37956 |
return null; |
| 37957 |
} |
| 37958 |
return { |
| 37959 |
name: stringToPDFString(nestedName), |
| 37960 |
order: nestedOrder |
| 37961 |
}; |
| 37962 |
} |
| 37963 |
const xref = this.xref, |
| 37964 |
parsedOrderRefs = new RefSet(), |
| 37965 |
MAX_NESTED_LEVELS = 10; |
| 37966 |
return { |
| 37967 |
name: typeof config.get("Name") === "string" ? stringToPDFString(config.get("Name")) : null, |
| 37968 |
creator: typeof config.get("Creator") === "string" ? stringToPDFString(config.get("Creator")) : null, |
| 37969 |
baseState: config.get("BaseState") instanceof Name ? config.get("BaseState").name : null, |
| 37970 |
on: parseOnOff(config.get("ON")), |
| 37971 |
off: parseOnOff(config.get("OFF")), |
| 37972 |
order: parseOrder(config.get("Order")), |
| 37973 |
groups: null |
| 37974 |
}; |
| 37975 |
} |
| 37976 |
setActualNumPages(num = null) { |
| 37977 |
this._actualNumPages = num; |
| 37978 |
} |
| 37979 |
get hasActualNumPages() { |
| 37980 |
return this._actualNumPages !== null; |
| 37981 |
} |
| 37982 |
get _pagesCount() { |
| 37983 |
const obj = this.toplevelPagesDict.get("Count"); |
| 37984 |
if (!Number.isInteger(obj)) { |
| 37985 |
throw new FormatError("Page count in top-level pages dictionary is not an integer."); |
| 37986 |
} |
| 37987 |
return shadow(this, "_pagesCount", obj); |
| 37988 |
} |
| 37989 |
get numPages() { |
| 37990 |
return this.hasActualNumPages ? this._actualNumPages : this._pagesCount; |
| 37991 |
} |
| 37992 |
get destinations() { |
| 37993 |
const obj = this._readDests(), |
| 37994 |
dests = Object.create(null); |
| 37995 |
if (obj instanceof NameTree) { |
| 37996 |
for (const [key, value] of obj.getAll()) { |
| 37997 |
const dest = fetchDest(value); |
| 37998 |
if (dest) { |
| 37999 |
dests[stringToPDFString(key)] = dest; |
| 38000 |
} |
| 38001 |
} |
| 38002 |
} else if (obj instanceof Dict) { |
| 38003 |
obj.forEach(function (key, value) { |
| 38004 |
const dest = fetchDest(value); |
| 38005 |
if (dest) { |
| 38006 |
dests[key] = dest; |
| 38007 |
} |
| 38008 |
}); |
| 38009 |
} |
| 38010 |
return shadow(this, "destinations", dests); |
| 38011 |
} |
| 38012 |
getDestination(id) { |
| 38013 |
const obj = this._readDests(); |
| 38014 |
if (obj instanceof NameTree) { |
| 38015 |
const dest = fetchDest(obj.get(id)); |
| 38016 |
if (dest) { |
| 38017 |
return dest; |
| 38018 |
} |
| 38019 |
const allDest = this.destinations[id]; |
| 38020 |
if (allDest) { |
| 38021 |
warn(`Found "${id}" at an incorrect position in the NameTree.`); |
| 38022 |
return allDest; |
| 38023 |
} |
| 38024 |
} else if (obj instanceof Dict) { |
| 38025 |
const dest = fetchDest(obj.get(id)); |
| 38026 |
if (dest) { |
| 38027 |
return dest; |
| 38028 |
} |
| 38029 |
} |
| 38030 |
return null; |
| 38031 |
} |
| 38032 |
_readDests() { |
| 38033 |
const obj = this._catDict.get("Names"); |
| 38034 |
if (obj?.has("Dests")) { |
| 38035 |
return new NameTree(obj.getRaw("Dests"), this.xref); |
| 38036 |
} else if (this._catDict.has("Dests")) { |
| 38037 |
return this._catDict.get("Dests"); |
| 38038 |
} |
| 38039 |
return undefined; |
| 38040 |
} |
| 38041 |
get pageLabels() { |
| 38042 |
let obj = null; |
| 38043 |
try { |
| 38044 |
obj = this._readPageLabels(); |
| 38045 |
} catch (ex) { |
| 38046 |
if (ex instanceof MissingDataException) { |
| 38047 |
throw ex; |
| 38048 |
} |
| 38049 |
warn("Unable to read page labels."); |
| 38050 |
} |
| 38051 |
return shadow(this, "pageLabels", obj); |
| 38052 |
} |
| 38053 |
_readPageLabels() { |
| 38054 |
const obj = this._catDict.getRaw("PageLabels"); |
| 38055 |
if (!obj) { |
| 38056 |
return null; |
| 38057 |
} |
| 38058 |
const pageLabels = new Array(this.numPages); |
| 38059 |
let style = null, |
| 38060 |
prefix = ""; |
| 38061 |
const numberTree = new NumberTree(obj, this.xref); |
| 38062 |
const nums = numberTree.getAll(); |
| 38063 |
let currentLabel = "", |
| 38064 |
currentIndex = 1; |
| 38065 |
for (let i = 0, ii = this.numPages; i < ii; i++) { |
| 38066 |
const labelDict = nums.get(i); |
| 38067 |
if (labelDict !== undefined) { |
| 38068 |
if (!(labelDict instanceof Dict)) { |
| 38069 |
throw new FormatError("PageLabel is not a dictionary."); |
| 38070 |
} |
| 38071 |
if (labelDict.has("Type") && !isName(labelDict.get("Type"), "PageLabel")) { |
| 38072 |
throw new FormatError("Invalid type in PageLabel dictionary."); |
| 38073 |
} |
| 38074 |
if (labelDict.has("S")) { |
| 38075 |
const s = labelDict.get("S"); |
| 38076 |
if (!(s instanceof Name)) { |
| 38077 |
throw new FormatError("Invalid style in PageLabel dictionary."); |
| 38078 |
} |
| 38079 |
style = s.name; |
| 38080 |
} else { |
| 38081 |
style = null; |
| 38082 |
} |
| 38083 |
if (labelDict.has("P")) { |
| 38084 |
const p = labelDict.get("P"); |
| 38085 |
if (typeof p !== "string") { |
| 38086 |
throw new FormatError("Invalid prefix in PageLabel dictionary."); |
| 38087 |
} |
| 38088 |
prefix = stringToPDFString(p); |
| 38089 |
} else { |
| 38090 |
prefix = ""; |
| 38091 |
} |
| 38092 |
if (labelDict.has("St")) { |
| 38093 |
const st = labelDict.get("St"); |
| 38094 |
if (!(Number.isInteger(st) && st >= 1)) { |
| 38095 |
throw new FormatError("Invalid start in PageLabel dictionary."); |
| 38096 |
} |
| 38097 |
currentIndex = st; |
| 38098 |
} else { |
| 38099 |
currentIndex = 1; |
| 38100 |
} |
| 38101 |
} |
| 38102 |
switch (style) { |
| 38103 |
case "D": |
| 38104 |
currentLabel = currentIndex; |
| 38105 |
break; |
| 38106 |
case "R": |
| 38107 |
case "r": |
| 38108 |
currentLabel = toRomanNumerals(currentIndex, style === "r"); |
| 38109 |
break; |
| 38110 |
case "A": |
| 38111 |
case "a": |
| 38112 |
const LIMIT = 26; |
| 38113 |
const A_UPPER_CASE = 0x41, |
| 38114 |
A_LOWER_CASE = 0x61; |
| 38115 |
const baseCharCode = style === "a" ? A_LOWER_CASE : A_UPPER_CASE; |
| 38116 |
const letterIndex = currentIndex - 1; |
| 38117 |
const character = String.fromCharCode(baseCharCode + letterIndex % LIMIT); |
| 38118 |
currentLabel = character.repeat(Math.floor(letterIndex / LIMIT) + 1); |
| 38119 |
break; |
| 38120 |
default: |
| 38121 |
if (style) { |
| 38122 |
throw new FormatError(`Invalid style "${style}" in PageLabel dictionary.`); |
| 38123 |
} |
| 38124 |
currentLabel = ""; |
| 38125 |
} |
| 38126 |
pageLabels[i] = prefix + currentLabel; |
| 38127 |
currentIndex++; |
| 38128 |
} |
| 38129 |
return pageLabels; |
| 38130 |
} |
| 38131 |
get pageLayout() { |
| 38132 |
const obj = this._catDict.get("PageLayout"); |
| 38133 |
let pageLayout = ""; |
| 38134 |
if (obj instanceof Name) { |
| 38135 |
switch (obj.name) { |
| 38136 |
case "SinglePage": |
| 38137 |
case "OneColumn": |
| 38138 |
case "TwoColumnLeft": |
| 38139 |
case "TwoColumnRight": |
| 38140 |
case "TwoPageLeft": |
| 38141 |
case "TwoPageRight": |
| 38142 |
pageLayout = obj.name; |
| 38143 |
} |
| 38144 |
} |
| 38145 |
return shadow(this, "pageLayout", pageLayout); |
| 38146 |
} |
| 38147 |
get pageMode() { |
| 38148 |
const obj = this._catDict.get("PageMode"); |
| 38149 |
let pageMode = "UseNone"; |
| 38150 |
if (obj instanceof Name) { |
| 38151 |
switch (obj.name) { |
| 38152 |
case "UseNone": |
| 38153 |
case "UseOutlines": |
| 38154 |
case "UseThumbs": |
| 38155 |
case "FullScreen": |
| 38156 |
case "UseOC": |
| 38157 |
case "UseAttachments": |
| 38158 |
pageMode = obj.name; |
| 38159 |
} |
| 38160 |
} |
| 38161 |
return shadow(this, "pageMode", pageMode); |
| 38162 |
} |
| 38163 |
get viewerPreferences() { |
| 38164 |
const obj = this._catDict.get("ViewerPreferences"); |
| 38165 |
if (!(obj instanceof Dict)) { |
| 38166 |
return shadow(this, "viewerPreferences", null); |
| 38167 |
} |
| 38168 |
let prefs = null; |
| 38169 |
for (const key of obj.getKeys()) { |
| 38170 |
const value = obj.get(key); |
| 38171 |
let prefValue; |
| 38172 |
switch (key) { |
| 38173 |
case "HideToolbar": |
| 38174 |
case "HideMenubar": |
| 38175 |
case "HideWindowUI": |
| 38176 |
case "FitWindow": |
| 38177 |
case "CenterWindow": |
| 38178 |
case "DisplayDocTitle": |
| 38179 |
case "PickTrayByPDFSize": |
| 38180 |
if (typeof value === "boolean") { |
| 38181 |
prefValue = value; |
| 38182 |
} |
| 38183 |
break; |
| 38184 |
case "NonFullScreenPageMode": |
| 38185 |
if (value instanceof Name) { |
| 38186 |
switch (value.name) { |
| 38187 |
case "UseNone": |
| 38188 |
case "UseOutlines": |
| 38189 |
case "UseThumbs": |
| 38190 |
case "UseOC": |
| 38191 |
prefValue = value.name; |
| 38192 |
break; |
| 38193 |
default: |
| 38194 |
prefValue = "UseNone"; |
| 38195 |
} |
| 38196 |
} |
| 38197 |
break; |
| 38198 |
case "Direction": |
| 38199 |
if (value instanceof Name) { |
| 38200 |
switch (value.name) { |
| 38201 |
case "L2R": |
| 38202 |
case "R2L": |
| 38203 |
prefValue = value.name; |
| 38204 |
break; |
| 38205 |
default: |
| 38206 |
prefValue = "L2R"; |
| 38207 |
} |
| 38208 |
} |
| 38209 |
break; |
| 38210 |
case "ViewArea": |
| 38211 |
case "ViewClip": |
| 38212 |
case "PrintArea": |
| 38213 |
case "PrintClip": |
| 38214 |
if (value instanceof Name) { |
| 38215 |
switch (value.name) { |
| 38216 |
case "MediaBox": |
| 38217 |
case "CropBox": |
| 38218 |
case "BleedBox": |
| 38219 |
case "TrimBox": |
| 38220 |
case "ArtBox": |
| 38221 |
prefValue = value.name; |
| 38222 |
break; |
| 38223 |
default: |
| 38224 |
prefValue = "CropBox"; |
| 38225 |
} |
| 38226 |
} |
| 38227 |
break; |
| 38228 |
case "PrintScaling": |
| 38229 |
if (value instanceof Name) { |
| 38230 |
switch (value.name) { |
| 38231 |
case "None": |
| 38232 |
case "AppDefault": |
| 38233 |
prefValue = value.name; |
| 38234 |
break; |
| 38235 |
default: |
| 38236 |
prefValue = "AppDefault"; |
| 38237 |
} |
| 38238 |
} |
| 38239 |
break; |
| 38240 |
case "Duplex": |
| 38241 |
if (value instanceof Name) { |
| 38242 |
switch (value.name) { |
| 38243 |
case "Simplex": |
| 38244 |
case "DuplexFlipShortEdge": |
| 38245 |
case "DuplexFlipLongEdge": |
| 38246 |
prefValue = value.name; |
| 38247 |
break; |
| 38248 |
default: |
| 38249 |
prefValue = "None"; |
| 38250 |
} |
| 38251 |
} |
| 38252 |
break; |
| 38253 |
case "PrintPageRange": |
| 38254 |
if (Array.isArray(value) && value.length % 2 === 0) { |
| 38255 |
const isValid = value.every((page, i, arr) => Number.isInteger(page) && page > 0 && (i === 0 || page >= arr[i - 1]) && page <= this.numPages); |
| 38256 |
if (isValid) { |
| 38257 |
prefValue = value; |
| 38258 |
} |
| 38259 |
} |
| 38260 |
break; |
| 38261 |
case "NumCopies": |
| 38262 |
if (Number.isInteger(value) && value > 0) { |
| 38263 |
prefValue = value; |
| 38264 |
} |
| 38265 |
break; |
| 38266 |
default: |
| 38267 |
warn(`Ignoring non-standard key in ViewerPreferences: ${key}.`); |
| 38268 |
continue; |
| 38269 |
} |
| 38270 |
if (prefValue === undefined) { |
| 38271 |
warn(`Bad value, for key "${key}", in ViewerPreferences: ${value}.`); |
| 38272 |
continue; |
| 38273 |
} |
| 38274 |
if (!prefs) { |
| 38275 |
prefs = Object.create(null); |
| 38276 |
} |
| 38277 |
prefs[key] = prefValue; |
| 38278 |
} |
| 38279 |
return shadow(this, "viewerPreferences", prefs); |
| 38280 |
} |
| 38281 |
get openAction() { |
| 38282 |
const obj = this._catDict.get("OpenAction"); |
| 38283 |
const openAction = Object.create(null); |
| 38284 |
if (obj instanceof Dict) { |
| 38285 |
const destDict = new Dict(this.xref); |
| 38286 |
destDict.set("A", obj); |
| 38287 |
const resultObj = { |
| 38288 |
url: null, |
| 38289 |
dest: null, |
| 38290 |
action: null |
| 38291 |
}; |
| 38292 |
Catalog.parseDestDictionary({ |
| 38293 |
destDict, |
| 38294 |
resultObj |
| 38295 |
}); |
| 38296 |
if (Array.isArray(resultObj.dest)) { |
| 38297 |
openAction.dest = resultObj.dest; |
| 38298 |
} else if (resultObj.action) { |
| 38299 |
openAction.action = resultObj.action; |
| 38300 |
} |
| 38301 |
} else if (Array.isArray(obj)) { |
| 38302 |
openAction.dest = obj; |
| 38303 |
} |
| 38304 |
return shadow(this, "openAction", objectSize(openAction) > 0 ? openAction : null); |
| 38305 |
} |
| 38306 |
get attachments() { |
| 38307 |
const obj = this._catDict.get("Names"); |
| 38308 |
let attachments = null; |
| 38309 |
if (obj instanceof Dict && obj.has("EmbeddedFiles")) { |
| 38310 |
const nameTree = new NameTree(obj.getRaw("EmbeddedFiles"), this.xref); |
| 38311 |
for (const [key, value] of nameTree.getAll()) { |
| 38312 |
const fs = new FileSpec(value, this.xref); |
| 38313 |
if (!attachments) { |
| 38314 |
attachments = Object.create(null); |
| 38315 |
} |
| 38316 |
attachments[stringToPDFString(key)] = fs.serializable; |
| 38317 |
} |
| 38318 |
} |
| 38319 |
return shadow(this, "attachments", attachments); |
| 38320 |
} |
| 38321 |
get xfaImages() { |
| 38322 |
const obj = this._catDict.get("Names"); |
| 38323 |
let xfaImages = null; |
| 38324 |
if (obj instanceof Dict && obj.has("XFAImages")) { |
| 38325 |
const nameTree = new NameTree(obj.getRaw("XFAImages"), this.xref); |
| 38326 |
for (const [key, value] of nameTree.getAll()) { |
| 38327 |
if (!xfaImages) { |
| 38328 |
xfaImages = new Dict(this.xref); |
| 38329 |
} |
| 38330 |
xfaImages.set(stringToPDFString(key), value); |
| 38331 |
} |
| 38332 |
} |
| 38333 |
return shadow(this, "xfaImages", xfaImages); |
| 38334 |
} |
| 38335 |
_collectJavaScript() { |
| 38336 |
const obj = this._catDict.get("Names"); |
| 38337 |
let javaScript = null; |
| 38338 |
function appendIfJavaScriptDict(name, jsDict) { |
| 38339 |
if (!(jsDict instanceof Dict)) { |
| 38340 |
return; |
| 38341 |
} |
| 38342 |
if (!isName(jsDict.get("S"), "JavaScript")) { |
| 38343 |
return; |
| 38344 |
} |
| 38345 |
let js = jsDict.get("JS"); |
| 38346 |
if (js instanceof BaseStream) { |
| 38347 |
js = js.getString(); |
| 38348 |
} else if (typeof js !== "string") { |
| 38349 |
return; |
| 38350 |
} |
| 38351 |
js = stringToPDFString(js).replaceAll("\x00", ""); |
| 38352 |
if (js) { |
| 38353 |
(javaScript ||= new Map()).set(name, js); |
| 38354 |
} |
| 38355 |
} |
| 38356 |
if (obj instanceof Dict && obj.has("JavaScript")) { |
| 38357 |
const nameTree = new NameTree(obj.getRaw("JavaScript"), this.xref); |
| 38358 |
for (const [key, value] of nameTree.getAll()) { |
| 38359 |
appendIfJavaScriptDict(stringToPDFString(key), value); |
| 38360 |
} |
| 38361 |
} |
| 38362 |
const openAction = this._catDict.get("OpenAction"); |
| 38363 |
if (openAction) { |
| 38364 |
appendIfJavaScriptDict("OpenAction", openAction); |
| 38365 |
} |
| 38366 |
return javaScript; |
| 38367 |
} |
| 38368 |
get jsActions() { |
| 38369 |
const javaScript = this._collectJavaScript(); |
| 38370 |
let actions = collectActions(this.xref, this._catDict, DocumentActionEventType); |
| 38371 |
if (javaScript) { |
| 38372 |
actions ||= Object.create(null); |
| 38373 |
for (const [key, val] of javaScript) { |
| 38374 |
if (key in actions) { |
| 38375 |
actions[key].push(val); |
| 38376 |
} else { |
| 38377 |
actions[key] = [val]; |
| 38378 |
} |
| 38379 |
} |
| 38380 |
} |
| 38381 |
return shadow(this, "jsActions", actions); |
| 38382 |
} |
| 38383 |
async fontFallback(id, handler) { |
| 38384 |
const translatedFonts = await Promise.all(this.fontCache); |
| 38385 |
for (const translatedFont of translatedFonts) { |
| 38386 |
if (translatedFont.loadedName === id) { |
| 38387 |
translatedFont.fallback(handler); |
| 38388 |
return; |
| 38389 |
} |
| 38390 |
} |
| 38391 |
} |
| 38392 |
async cleanup(manuallyTriggered = false) { |
| 38393 |
clearGlobalCaches(); |
| 38394 |
this.globalImageCache.clear(manuallyTriggered); |
| 38395 |
this.pageKidsCountCache.clear(); |
| 38396 |
this.pageIndexCache.clear(); |
| 38397 |
this.pageDictCache.clear(); |
| 38398 |
this.nonBlendModesSet.clear(); |
| 38399 |
const translatedFonts = await Promise.all(this.fontCache); |
| 38400 |
for (const { |
| 38401 |
dict |
| 38402 |
} of translatedFonts) { |
| 38403 |
delete dict.cacheKey; |
| 38404 |
} |
| 38405 |
this.fontCache.clear(); |
| 38406 |
this.builtInCMapCache.clear(); |
| 38407 |
this.standardFontDataCache.clear(); |
| 38408 |
this.systemFontCache.clear(); |
| 38409 |
} |
| 38410 |
async getPageDict(pageIndex) { |
| 38411 |
const nodesToVisit = [this.toplevelPagesDict]; |
| 38412 |
const visitedNodes = new RefSet(); |
| 38413 |
const pagesRef = this._catDict.getRaw("Pages"); |
| 38414 |
if (pagesRef instanceof Ref) { |
| 38415 |
visitedNodes.put(pagesRef); |
| 38416 |
} |
| 38417 |
const xref = this.xref, |
| 38418 |
pageKidsCountCache = this.pageKidsCountCache, |
| 38419 |
pageIndexCache = this.pageIndexCache, |
| 38420 |
pageDictCache = this.pageDictCache; |
| 38421 |
let currentPageIndex = 0; |
| 38422 |
while (nodesToVisit.length) { |
| 38423 |
const currentNode = nodesToVisit.pop(); |
| 38424 |
if (currentNode instanceof Ref) { |
| 38425 |
const count = pageKidsCountCache.get(currentNode); |
| 38426 |
if (count >= 0 && currentPageIndex + count <= pageIndex) { |
| 38427 |
currentPageIndex += count; |
| 38428 |
continue; |
| 38429 |
} |
| 38430 |
if (visitedNodes.has(currentNode)) { |
| 38431 |
throw new FormatError("Pages tree contains circular reference."); |
| 38432 |
} |
| 38433 |
visitedNodes.put(currentNode); |
| 38434 |
const obj = await (pageDictCache.get(currentNode) || xref.fetchAsync(currentNode)); |
| 38435 |
if (obj instanceof Dict) { |
| 38436 |
let type = obj.getRaw("Type"); |
| 38437 |
if (type instanceof Ref) { |
| 38438 |
type = await xref.fetchAsync(type); |
| 38439 |
} |
| 38440 |
if (isName(type, "Page") || !obj.has("Kids")) { |
| 38441 |
if (!pageKidsCountCache.has(currentNode)) { |
| 38442 |
pageKidsCountCache.put(currentNode, 1); |
| 38443 |
} |
| 38444 |
if (!pageIndexCache.has(currentNode)) { |
| 38445 |
pageIndexCache.put(currentNode, currentPageIndex); |
| 38446 |
} |
| 38447 |
if (currentPageIndex === pageIndex) { |
| 38448 |
return [obj, currentNode]; |
| 38449 |
} |
| 38450 |
currentPageIndex++; |
| 38451 |
continue; |
| 38452 |
} |
| 38453 |
} |
| 38454 |
nodesToVisit.push(obj); |
| 38455 |
continue; |
| 38456 |
} |
| 38457 |
if (!(currentNode instanceof Dict)) { |
| 38458 |
throw new FormatError("Page dictionary kid reference points to wrong type of object."); |
| 38459 |
} |
| 38460 |
const { |
| 38461 |
objId |
| 38462 |
} = currentNode; |
| 38463 |
let count = currentNode.getRaw("Count"); |
| 38464 |
if (count instanceof Ref) { |
| 38465 |
count = await xref.fetchAsync(count); |
| 38466 |
} |
| 38467 |
if (Number.isInteger(count) && count >= 0) { |
| 38468 |
if (objId && !pageKidsCountCache.has(objId)) { |
| 38469 |
pageKidsCountCache.put(objId, count); |
| 38470 |
} |
| 38471 |
if (currentPageIndex + count <= pageIndex) { |
| 38472 |
currentPageIndex += count; |
| 38473 |
continue; |
| 38474 |
} |
| 38475 |
} |
| 38476 |
let kids = currentNode.getRaw("Kids"); |
| 38477 |
if (kids instanceof Ref) { |
| 38478 |
kids = await xref.fetchAsync(kids); |
| 38479 |
} |
| 38480 |
if (!Array.isArray(kids)) { |
| 38481 |
let type = currentNode.getRaw("Type"); |
| 38482 |
if (type instanceof Ref) { |
| 38483 |
type = await xref.fetchAsync(type); |
| 38484 |
} |
| 38485 |
if (isName(type, "Page") || !currentNode.has("Kids")) { |
| 38486 |
if (currentPageIndex === pageIndex) { |
| 38487 |
return [currentNode, null]; |
| 38488 |
} |
| 38489 |
currentPageIndex++; |
| 38490 |
continue; |
| 38491 |
} |
| 38492 |
throw new FormatError("Page dictionary kids object is not an array."); |
| 38493 |
} |
| 38494 |
for (let last = kids.length - 1; last >= 0; last--) { |
| 38495 |
const lastKid = kids[last]; |
| 38496 |
nodesToVisit.push(lastKid); |
| 38497 |
if (currentNode === this.toplevelPagesDict && lastKid instanceof Ref && !pageDictCache.has(lastKid)) { |
| 38498 |
pageDictCache.put(lastKid, xref.fetchAsync(lastKid)); |
| 38499 |
} |
| 38500 |
} |
| 38501 |
} |
| 38502 |
throw new Error(`Page index ${pageIndex} not found.`); |
| 38503 |
} |
| 38504 |
async getAllPageDicts(recoveryMode = false) { |
| 38505 |
const { |
| 38506 |
ignoreErrors |
| 38507 |
} = this.pdfManager.evaluatorOptions; |
| 38508 |
const queue = [{ |
| 38509 |
currentNode: this.toplevelPagesDict, |
| 38510 |
posInKids: 0 |
| 38511 |
}]; |
| 38512 |
const visitedNodes = new RefSet(); |
| 38513 |
const pagesRef = this._catDict.getRaw("Pages"); |
| 38514 |
if (pagesRef instanceof Ref) { |
| 38515 |
visitedNodes.put(pagesRef); |
| 38516 |
} |
| 38517 |
const map = new Map(), |
| 38518 |
xref = this.xref, |
| 38519 |
pageIndexCache = this.pageIndexCache; |
| 38520 |
let pageIndex = 0; |
| 38521 |
function addPageDict(pageDict, pageRef) { |
| 38522 |
if (pageRef && !pageIndexCache.has(pageRef)) { |
| 38523 |
pageIndexCache.put(pageRef, pageIndex); |
| 38524 |
} |
| 38525 |
map.set(pageIndex++, [pageDict, pageRef]); |
| 38526 |
} |
| 38527 |
function addPageError(error) { |
| 38528 |
if (error instanceof XRefEntryException && !recoveryMode) { |
| 38529 |
throw error; |
| 38530 |
} |
| 38531 |
if (recoveryMode && ignoreErrors && pageIndex === 0) { |
| 38532 |
warn(`getAllPageDicts - Skipping invalid first page: "${error}".`); |
| 38533 |
error = Dict.empty; |
| 38534 |
} |
| 38535 |
map.set(pageIndex++, [error, null]); |
| 38536 |
} |
| 38537 |
while (queue.length > 0) { |
| 38538 |
const queueItem = queue.at(-1); |
| 38539 |
const { |
| 38540 |
currentNode, |
| 38541 |
posInKids |
| 38542 |
} = queueItem; |
| 38543 |
let kids = currentNode.getRaw("Kids"); |
| 38544 |
if (kids instanceof Ref) { |
| 38545 |
try { |
| 38546 |
kids = await xref.fetchAsync(kids); |
| 38547 |
} catch (ex) { |
| 38548 |
addPageError(ex); |
| 38549 |
break; |
| 38550 |
} |
| 38551 |
} |
| 38552 |
if (!Array.isArray(kids)) { |
| 38553 |
addPageError(new FormatError("Page dictionary kids object is not an array.")); |
| 38554 |
break; |
| 38555 |
} |
| 38556 |
if (posInKids >= kids.length) { |
| 38557 |
queue.pop(); |
| 38558 |
continue; |
| 38559 |
} |
| 38560 |
const kidObj = kids[posInKids]; |
| 38561 |
let obj; |
| 38562 |
if (kidObj instanceof Ref) { |
| 38563 |
if (visitedNodes.has(kidObj)) { |
| 38564 |
addPageError(new FormatError("Pages tree contains circular reference.")); |
| 38565 |
break; |
| 38566 |
} |
| 38567 |
visitedNodes.put(kidObj); |
| 38568 |
try { |
| 38569 |
obj = await xref.fetchAsync(kidObj); |
| 38570 |
} catch (ex) { |
| 38571 |
addPageError(ex); |
| 38572 |
break; |
| 38573 |
} |
| 38574 |
} else { |
| 38575 |
obj = kidObj; |
| 38576 |
} |
| 38577 |
if (!(obj instanceof Dict)) { |
| 38578 |
addPageError(new FormatError("Page dictionary kid reference points to wrong type of object.")); |
| 38579 |
break; |
| 38580 |
} |
| 38581 |
let type = obj.getRaw("Type"); |
| 38582 |
if (type instanceof Ref) { |
| 38583 |
try { |
| 38584 |
type = await xref.fetchAsync(type); |
| 38585 |
} catch (ex) { |
| 38586 |
addPageError(ex); |
| 38587 |
break; |
| 38588 |
} |
| 38589 |
} |
| 38590 |
if (isName(type, "Page") || !obj.has("Kids")) { |
| 38591 |
addPageDict(obj, kidObj instanceof Ref ? kidObj : null); |
| 38592 |
} else { |
| 38593 |
queue.push({ |
| 38594 |
currentNode: obj, |
| 38595 |
posInKids: 0 |
| 38596 |
}); |
| 38597 |
} |
| 38598 |
queueItem.posInKids++; |
| 38599 |
} |
| 38600 |
return map; |
| 38601 |
} |
| 38602 |
getPageIndex(pageRef) { |
| 38603 |
const cachedPageIndex = this.pageIndexCache.get(pageRef); |
| 38604 |
if (cachedPageIndex !== undefined) { |
| 38605 |
return Promise.resolve(cachedPageIndex); |
| 38606 |
} |
| 38607 |
const xref = this.xref; |
| 38608 |
function pagesBeforeRef(kidRef) { |
| 38609 |
let total = 0, |
| 38610 |
parentRef; |
| 38611 |
return xref.fetchAsync(kidRef).then(function (node) { |
| 38612 |
if (isRefsEqual(kidRef, pageRef) && !isDict(node, "Page") && !(node instanceof Dict && !node.has("Type") && node.has("Contents"))) { |
| 38613 |
throw new FormatError("The reference does not point to a /Page dictionary."); |
| 38614 |
} |
| 38615 |
if (!node) { |
| 38616 |
return null; |
| 38617 |
} |
| 38618 |
if (!(node instanceof Dict)) { |
| 38619 |
throw new FormatError("Node must be a dictionary."); |
| 38620 |
} |
| 38621 |
parentRef = node.getRaw("Parent"); |
| 38622 |
return node.getAsync("Parent"); |
| 38623 |
}).then(function (parent) { |
| 38624 |
if (!parent) { |
| 38625 |
return null; |
| 38626 |
} |
| 38627 |
if (!(parent instanceof Dict)) { |
| 38628 |
throw new FormatError("Parent must be a dictionary."); |
| 38629 |
} |
| 38630 |
return parent.getAsync("Kids"); |
| 38631 |
}).then(function (kids) { |
| 38632 |
if (!kids) { |
| 38633 |
return null; |
| 38634 |
} |
| 38635 |
const kidPromises = []; |
| 38636 |
let found = false; |
| 38637 |
for (const kid of kids) { |
| 38638 |
if (!(kid instanceof Ref)) { |
| 38639 |
throw new FormatError("Kid must be a reference."); |
| 38640 |
} |
| 38641 |
if (isRefsEqual(kid, kidRef)) { |
| 38642 |
found = true; |
| 38643 |
break; |
| 38644 |
} |
| 38645 |
kidPromises.push(xref.fetchAsync(kid).then(function (obj) { |
| 38646 |
if (!(obj instanceof Dict)) { |
| 38647 |
throw new FormatError("Kid node must be a dictionary."); |
| 38648 |
} |
| 38649 |
if (obj.has("Count")) { |
| 38650 |
total += obj.get("Count"); |
| 38651 |
} else { |
| 38652 |
total++; |
| 38653 |
} |
| 38654 |
})); |
| 38655 |
} |
| 38656 |
if (!found) { |
| 38657 |
throw new FormatError("Kid reference not found in parent's kids."); |
| 38658 |
} |
| 38659 |
return Promise.all(kidPromises).then(function () { |
| 38660 |
return [total, parentRef]; |
| 38661 |
}); |
| 38662 |
}); |
| 38663 |
} |
| 38664 |
let total = 0; |
| 38665 |
const next = ref => pagesBeforeRef(ref).then(args => { |
| 38666 |
if (!args) { |
| 38667 |
this.pageIndexCache.put(pageRef, total); |
| 38668 |
return total; |
| 38669 |
} |
| 38670 |
const [count, parentRef] = args; |
| 38671 |
total += count; |
| 38672 |
return next(parentRef); |
| 38673 |
}); |
| 38674 |
return next(pageRef); |
| 38675 |
} |
| 38676 |
get baseUrl() { |
| 38677 |
const uri = this._catDict.get("URI"); |
| 38678 |
if (uri instanceof Dict) { |
| 38679 |
const base = uri.get("Base"); |
| 38680 |
if (typeof base === "string") { |
| 38681 |
const absoluteUrl = createValidAbsoluteUrl(base, null, { |
| 38682 |
tryConvertEncoding: true |
| 38683 |
}); |
| 38684 |
if (absoluteUrl) { |
| 38685 |
return shadow(this, "baseUrl", absoluteUrl.href); |
| 38686 |
} |
| 38687 |
} |
| 38688 |
} |
| 38689 |
return shadow(this, "baseUrl", this.pdfManager.docBaseUrl); |
| 38690 |
} |
| 38691 |
static parseDestDictionary({ |
| 38692 |
destDict, |
| 38693 |
resultObj, |
| 38694 |
docBaseUrl = null, |
| 38695 |
docAttachments = null |
| 38696 |
}) { |
| 38697 |
if (!(destDict instanceof Dict)) { |
| 38698 |
warn("parseDestDictionary: `destDict` must be a dictionary."); |
| 38699 |
return; |
| 38700 |
} |
| 38701 |
let action = destDict.get("A"), |
| 38702 |
url, |
| 38703 |
dest; |
| 38704 |
if (!(action instanceof Dict)) { |
| 38705 |
if (destDict.has("Dest")) { |
| 38706 |
action = destDict.get("Dest"); |
| 38707 |
} else { |
| 38708 |
action = destDict.get("AA"); |
| 38709 |
if (action instanceof Dict) { |
| 38710 |
if (action.has("D")) { |
| 38711 |
action = action.get("D"); |
| 38712 |
} else if (action.has("U")) { |
| 38713 |
action = action.get("U"); |
| 38714 |
} |
| 38715 |
} |
| 38716 |
} |
| 38717 |
} |
| 38718 |
if (action instanceof Dict) { |
| 38719 |
const actionType = action.get("S"); |
| 38720 |
if (!(actionType instanceof Name)) { |
| 38721 |
warn("parseDestDictionary: Invalid type in Action dictionary."); |
| 38722 |
return; |
| 38723 |
} |
| 38724 |
const actionName = actionType.name; |
| 38725 |
switch (actionName) { |
| 38726 |
case "ResetForm": |
| 38727 |
const flags = action.get("Flags"); |
| 38728 |
const include = ((typeof flags === "number" ? flags : 0) & 1) === 0; |
| 38729 |
const fields = []; |
| 38730 |
const refs = []; |
| 38731 |
for (const obj of action.get("Fields") || []) { |
| 38732 |
if (obj instanceof Ref) { |
| 38733 |
refs.push(obj.toString()); |
| 38734 |
} else if (typeof obj === "string") { |
| 38735 |
fields.push(stringToPDFString(obj)); |
| 38736 |
} |
| 38737 |
} |
| 38738 |
resultObj.resetForm = { |
| 38739 |
fields, |
| 38740 |
refs, |
| 38741 |
include |
| 38742 |
}; |
| 38743 |
break; |
| 38744 |
case "URI": |
| 38745 |
url = action.get("URI"); |
| 38746 |
if (url instanceof Name) { |
| 38747 |
url = "/" + url.name; |
| 38748 |
} |
| 38749 |
break; |
| 38750 |
case "GoTo": |
| 38751 |
dest = action.get("D"); |
| 38752 |
break; |
| 38753 |
case "Launch": |
| 38754 |
case "GoToR": |
| 38755 |
const urlDict = action.get("F"); |
| 38756 |
if (urlDict instanceof Dict) { |
| 38757 |
const fs = new FileSpec(urlDict, null, true); |
| 38758 |
const { |
| 38759 |
rawFilename |
| 38760 |
} = fs.serializable; |
| 38761 |
url = rawFilename; |
| 38762 |
} else if (typeof urlDict === "string") { |
| 38763 |
url = urlDict; |
| 38764 |
} |
| 38765 |
const remoteDest = fetchRemoteDest(action); |
| 38766 |
if (remoteDest && typeof url === "string") { |
| 38767 |
url = url.split("#", 1)[0] + "#" + remoteDest; |
| 38768 |
} |
| 38769 |
const newWindow = action.get("NewWindow"); |
| 38770 |
if (typeof newWindow === "boolean") { |
| 38771 |
resultObj.newWindow = newWindow; |
| 38772 |
} |
| 38773 |
break; |
| 38774 |
case "GoToE": |
| 38775 |
const target = action.get("T"); |
| 38776 |
let attachment; |
| 38777 |
if (docAttachments && target instanceof Dict) { |
| 38778 |
const relationship = target.get("R"); |
| 38779 |
const name = target.get("N"); |
| 38780 |
if (isName(relationship, "C") && typeof name === "string") { |
| 38781 |
attachment = docAttachments[stringToPDFString(name)]; |
| 38782 |
} |
| 38783 |
} |
| 38784 |
if (attachment) { |
| 38785 |
resultObj.attachment = attachment; |
| 38786 |
const attachmentDest = fetchRemoteDest(action); |
| 38787 |
if (attachmentDest) { |
| 38788 |
resultObj.attachmentDest = attachmentDest; |
| 38789 |
} |
| 38790 |
} else { |
| 38791 |
warn(`parseDestDictionary - unimplemented "GoToE" action.`); |
| 38792 |
} |
| 38793 |
break; |
| 38794 |
case "Named": |
| 38795 |
const namedAction = action.get("N"); |
| 38796 |
if (namedAction instanceof Name) { |
| 38797 |
resultObj.action = namedAction.name; |
| 38798 |
} |
| 38799 |
break; |
| 38800 |
case "SetOCGState": |
| 38801 |
const state = action.get("State"); |
| 38802 |
const preserveRB = action.get("PreserveRB"); |
| 38803 |
if (!Array.isArray(state) || state.length === 0) { |
| 38804 |
break; |
| 38805 |
} |
| 38806 |
const stateArr = []; |
| 38807 |
for (const elem of state) { |
| 38808 |
if (elem instanceof Name) { |
| 38809 |
switch (elem.name) { |
| 38810 |
case "ON": |
| 38811 |
case "OFF": |
| 38812 |
case "Toggle": |
| 38813 |
stateArr.push(elem.name); |
| 38814 |
break; |
| 38815 |
} |
| 38816 |
} else if (elem instanceof Ref) { |
| 38817 |
stateArr.push(elem.toString()); |
| 38818 |
} |
| 38819 |
} |
| 38820 |
if (stateArr.length !== state.length) { |
| 38821 |
break; |
| 38822 |
} |
| 38823 |
resultObj.setOCGState = { |
| 38824 |
state: stateArr, |
| 38825 |
preserveRB: typeof preserveRB === "boolean" ? preserveRB : true |
| 38826 |
}; |
| 38827 |
break; |
| 38828 |
case "JavaScript": |
| 38829 |
const jsAction = action.get("JS"); |
| 38830 |
let js; |
| 38831 |
if (jsAction instanceof BaseStream) { |
| 38832 |
js = jsAction.getString(); |
| 38833 |
} else if (typeof jsAction === "string") { |
| 38834 |
js = jsAction; |
| 38835 |
} |
| 38836 |
const jsURL = js && recoverJsURL(stringToPDFString(js)); |
| 38837 |
if (jsURL) { |
| 38838 |
url = jsURL.url; |
| 38839 |
resultObj.newWindow = jsURL.newWindow; |
| 38840 |
break; |
| 38841 |
} |
| 38842 |
default: |
| 38843 |
if (actionName === "JavaScript" || actionName === "SubmitForm") { |
| 38844 |
break; |
| 38845 |
} |
| 38846 |
warn(`parseDestDictionary - unsupported action: "${actionName}".`); |
| 38847 |
break; |
| 38848 |
} |
| 38849 |
} else if (destDict.has("Dest")) { |
| 38850 |
dest = destDict.get("Dest"); |
| 38851 |
} |
| 38852 |
if (typeof url === "string") { |
| 38853 |
const absoluteUrl = createValidAbsoluteUrl(url, docBaseUrl, { |
| 38854 |
addDefaultProtocol: true, |
| 38855 |
tryConvertEncoding: true |
| 38856 |
}); |
| 38857 |
if (absoluteUrl) { |
| 38858 |
resultObj.url = absoluteUrl.href; |
| 38859 |
} |
| 38860 |
resultObj.unsafeUrl = url; |
| 38861 |
} |
| 38862 |
if (dest) { |
| 38863 |
if (dest instanceof Name) { |
| 38864 |
dest = dest.name; |
| 38865 |
} |
| 38866 |
if (typeof dest === "string") { |
| 38867 |
resultObj.dest = stringToPDFString(dest); |
| 38868 |
} else if (isValidExplicitDest(dest)) { |
| 38869 |
resultObj.dest = dest; |
| 38870 |
} |
| 38871 |
} |
| 38872 |
} |
| 38873 |
} |
| 38874 |
|
| 38875 |
;// ./src/core/object_loader.js |
| 38876 |
|
| 38877 |
|
| 38878 |
|
| 38879 |
|
| 38880 |
function mayHaveChildren(value) { |
| 38881 |
return value instanceof Ref || value instanceof Dict || value instanceof BaseStream || Array.isArray(value); |
| 38882 |
} |
| 38883 |
function addChildren(node, nodesToVisit) { |
| 38884 |
if (node instanceof Dict) { |
| 38885 |
node = node.getRawValues(); |
| 38886 |
} else if (node instanceof BaseStream) { |
| 38887 |
node = node.dict.getRawValues(); |
| 38888 |
} else if (!Array.isArray(node)) { |
| 38889 |
return; |
| 38890 |
} |
| 38891 |
for (const rawValue of node) { |
| 38892 |
if (mayHaveChildren(rawValue)) { |
| 38893 |
nodesToVisit.push(rawValue); |
| 38894 |
} |
| 38895 |
} |
| 38896 |
} |
| 38897 |
class ObjectLoader { |
| 38898 |
constructor(dict, keys, xref) { |
| 38899 |
this.dict = dict; |
| 38900 |
this.keys = keys; |
| 38901 |
this.xref = xref; |
| 38902 |
this.refSet = null; |
| 38903 |
} |
| 38904 |
async load() { |
| 38905 |
if (this.xref.stream.isDataLoaded) { |
| 38906 |
return undefined; |
| 38907 |
} |
| 38908 |
const { |
| 38909 |
keys, |
| 38910 |
dict |
| 38911 |
} = this; |
| 38912 |
this.refSet = new RefSet(); |
| 38913 |
const nodesToVisit = []; |
| 38914 |
for (const key of keys) { |
| 38915 |
const rawValue = dict.getRaw(key); |
| 38916 |
if (rawValue !== undefined) { |
| 38917 |
nodesToVisit.push(rawValue); |
| 38918 |
} |
| 38919 |
} |
| 38920 |
return this._walk(nodesToVisit); |
| 38921 |
} |
| 38922 |
async _walk(nodesToVisit) { |
| 38923 |
const nodesToRevisit = []; |
| 38924 |
const pendingRequests = []; |
| 38925 |
while (nodesToVisit.length) { |
| 38926 |
let currentNode = nodesToVisit.pop(); |
| 38927 |
if (currentNode instanceof Ref) { |
| 38928 |
if (this.refSet.has(currentNode)) { |
| 38929 |
continue; |
| 38930 |
} |
| 38931 |
try { |
| 38932 |
this.refSet.put(currentNode); |
| 38933 |
currentNode = this.xref.fetch(currentNode); |
| 38934 |
} catch (ex) { |
| 38935 |
if (!(ex instanceof MissingDataException)) { |
| 38936 |
warn(`ObjectLoader._walk - requesting all data: "${ex}".`); |
| 38937 |
this.refSet = null; |
| 38938 |
const { |
| 38939 |
manager |
| 38940 |
} = this.xref.stream; |
| 38941 |
return manager.requestAllChunks(); |
| 38942 |
} |
| 38943 |
nodesToRevisit.push(currentNode); |
| 38944 |
pendingRequests.push({ |
| 38945 |
begin: ex.begin, |
| 38946 |
end: ex.end |
| 38947 |
}); |
| 38948 |
} |
| 38949 |
} |
| 38950 |
if (currentNode instanceof BaseStream) { |
| 38951 |
const baseStreams = currentNode.getBaseStreams(); |
| 38952 |
if (baseStreams) { |
| 38953 |
let foundMissingData = false; |
| 38954 |
for (const stream of baseStreams) { |
| 38955 |
if (stream.isDataLoaded) { |
| 38956 |
continue; |
| 38957 |
} |
| 38958 |
foundMissingData = true; |
| 38959 |
pendingRequests.push({ |
| 38960 |
begin: stream.start, |
| 38961 |
end: stream.end |
| 38962 |
}); |
| 38963 |
} |
| 38964 |
if (foundMissingData) { |
| 38965 |
nodesToRevisit.push(currentNode); |
| 38966 |
} |
| 38967 |
} |
| 38968 |
} |
| 38969 |
addChildren(currentNode, nodesToVisit); |
| 38970 |
} |
| 38971 |
if (pendingRequests.length) { |
| 38972 |
await this.xref.stream.manager.requestRanges(pendingRequests); |
| 38973 |
for (const node of nodesToRevisit) { |
| 38974 |
if (node instanceof Ref) { |
| 38975 |
this.refSet.remove(node); |
| 38976 |
} |
| 38977 |
} |
| 38978 |
return this._walk(nodesToRevisit); |
| 38979 |
} |
| 38980 |
this.refSet = null; |
| 38981 |
return undefined; |
| 38982 |
} |
| 38983 |
} |
| 38984 |
|
| 38985 |
;// ./src/core/xfa/symbol_utils.js |
| 38986 |
const $acceptWhitespace = Symbol(); |
| 38987 |
const $addHTML = Symbol(); |
| 38988 |
const $appendChild = Symbol(); |
| 38989 |
const $childrenToHTML = Symbol(); |
| 38990 |
const $clean = Symbol(); |
| 38991 |
const $cleanPage = Symbol(); |
| 38992 |
const $cleanup = Symbol(); |
| 38993 |
const $clone = Symbol(); |
| 38994 |
const $consumed = Symbol(); |
| 38995 |
const $content = Symbol("content"); |
| 38996 |
const $data = Symbol("data"); |
| 38997 |
const $dump = Symbol(); |
| 38998 |
const $extra = Symbol("extra"); |
| 38999 |
const $finalize = Symbol(); |
| 39000 |
const $flushHTML = Symbol(); |
| 39001 |
const $getAttributeIt = Symbol(); |
| 39002 |
const $getAttributes = Symbol(); |
| 39003 |
const $getAvailableSpace = Symbol(); |
| 39004 |
const $getChildrenByClass = Symbol(); |
| 39005 |
const $getChildrenByName = Symbol(); |
| 39006 |
const $getChildrenByNameIt = Symbol(); |
| 39007 |
const $getDataValue = Symbol(); |
| 39008 |
const $getExtra = Symbol(); |
| 39009 |
const $getRealChildrenByNameIt = Symbol(); |
| 39010 |
const $getChildren = Symbol(); |
| 39011 |
const $getContainedChildren = Symbol(); |
| 39012 |
const $getNextPage = Symbol(); |
| 39013 |
const $getSubformParent = Symbol(); |
| 39014 |
const $getParent = Symbol(); |
| 39015 |
const $getTemplateRoot = Symbol(); |
| 39016 |
const $globalData = Symbol(); |
| 39017 |
const $hasSettableValue = Symbol(); |
| 39018 |
const $ids = Symbol(); |
| 39019 |
const $indexOf = Symbol(); |
| 39020 |
const $insertAt = Symbol(); |
| 39021 |
const $isCDATAXml = Symbol(); |
| 39022 |
const $isBindable = Symbol(); |
| 39023 |
const $isDataValue = Symbol(); |
| 39024 |
const $isDescendent = Symbol(); |
| 39025 |
const $isNsAgnostic = Symbol(); |
| 39026 |
const $isSplittable = Symbol(); |
| 39027 |
const $isThereMoreWidth = Symbol(); |
| 39028 |
const $isTransparent = Symbol(); |
| 39029 |
const $isUsable = Symbol(); |
| 39030 |
const $lastAttribute = Symbol(); |
| 39031 |
const $namespaceId = Symbol("namespaceId"); |
| 39032 |
const $nodeName = Symbol("nodeName"); |
| 39033 |
const $nsAttributes = Symbol(); |
| 39034 |
const $onChild = Symbol(); |
| 39035 |
const $onChildCheck = Symbol(); |
| 39036 |
const $onText = Symbol(); |
| 39037 |
const $pushGlyphs = Symbol(); |
| 39038 |
const $popPara = Symbol(); |
| 39039 |
const $pushPara = Symbol(); |
| 39040 |
const $removeChild = Symbol(); |
| 39041 |
const $root = Symbol("root"); |
| 39042 |
const $resolvePrototypes = Symbol(); |
| 39043 |
const $searchNode = Symbol(); |
| 39044 |
const $setId = Symbol(); |
| 39045 |
const $setSetAttributes = Symbol(); |
| 39046 |
const $setValue = Symbol(); |
| 39047 |
const $tabIndex = Symbol(); |
| 39048 |
const $text = Symbol(); |
| 39049 |
const $toPages = Symbol(); |
| 39050 |
const $toHTML = Symbol(); |
| 39051 |
const $toString = Symbol(); |
| 39052 |
const $toStyle = Symbol(); |
| 39053 |
const $uid = Symbol("uid"); |
| 39054 |
|
| 39055 |
;// ./src/core/xfa/namespaces.js |
| 39056 |
const $buildXFAObject = Symbol(); |
| 39057 |
const NamespaceIds = { |
| 39058 |
config: { |
| 39059 |
id: 0, |
| 39060 |
check: ns => ns.startsWith("http://www.xfa.org/schema/xci/") |
| 39061 |
}, |
| 39062 |
connectionSet: { |
| 39063 |
id: 1, |
| 39064 |
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-connection-set/") |
| 39065 |
}, |
| 39066 |
datasets: { |
| 39067 |
id: 2, |
| 39068 |
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-data/") |
| 39069 |
}, |
| 39070 |
form: { |
| 39071 |
id: 3, |
| 39072 |
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-form/") |
| 39073 |
}, |
| 39074 |
localeSet: { |
| 39075 |
id: 4, |
| 39076 |
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-locale-set/") |
| 39077 |
}, |
| 39078 |
pdf: { |
| 39079 |
id: 5, |
| 39080 |
check: ns => ns === "http://ns.adobe.com/xdp/pdf/" |
| 39081 |
}, |
| 39082 |
signature: { |
| 39083 |
id: 6, |
| 39084 |
check: ns => ns === "http://www.w3.org/2000/09/xmldsig#" |
| 39085 |
}, |
| 39086 |
sourceSet: { |
| 39087 |
id: 7, |
| 39088 |
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-source-set/") |
| 39089 |
}, |
| 39090 |
stylesheet: { |
| 39091 |
id: 8, |
| 39092 |
check: ns => ns === "http://www.w3.org/1999/XSL/Transform" |
| 39093 |
}, |
| 39094 |
template: { |
| 39095 |
id: 9, |
| 39096 |
check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-template/") |
| 39097 |
}, |
| 39098 |
xdc: { |
| 39099 |
id: 10, |
| 39100 |
check: ns => ns.startsWith("http://www.xfa.org/schema/xdc/") |
| 39101 |
}, |
| 39102 |
xdp: { |
| 39103 |
id: 11, |
| 39104 |
check: ns => ns === "http://ns.adobe.com/xdp/" |
| 39105 |
}, |
| 39106 |
xfdf: { |
| 39107 |
id: 12, |
| 39108 |
check: ns => ns === "http://ns.adobe.com/xfdf/" |
| 39109 |
}, |
| 39110 |
xhtml: { |
| 39111 |
id: 13, |
| 39112 |
check: ns => ns === "http://www.w3.org/1999/xhtml" |
| 39113 |
}, |
| 39114 |
xmpmeta: { |
| 39115 |
id: 14, |
| 39116 |
check: ns => ns === "http://ns.adobe.com/xmpmeta/" |
| 39117 |
} |
| 39118 |
}; |
| 39119 |
|
| 39120 |
;// ./src/core/xfa/utils.js |
| 39121 |
|
| 39122 |
const dimConverters = { |
| 39123 |
pt: x => x, |
| 39124 |
cm: x => x / 2.54 * 72, |
| 39125 |
mm: x => x / (10 * 2.54) * 72, |
| 39126 |
in: x => x * 72, |
| 39127 |
px: x => x |
| 39128 |
}; |
| 39129 |
const measurementPattern = /([+-]?\d+\.?\d*)(.*)/; |
| 39130 |
function stripQuotes(str) { |
| 39131 |
if (str.startsWith("'") || str.startsWith('"')) { |
| 39132 |
return str.slice(1, -1); |
| 39133 |
} |
| 39134 |
return str; |
| 39135 |
} |
| 39136 |
function getInteger({ |
| 39137 |
data, |
| 39138 |
defaultValue, |
| 39139 |
validate |
| 39140 |
}) { |
| 39141 |
if (!data) { |
| 39142 |
return defaultValue; |
| 39143 |
} |
| 39144 |
data = data.trim(); |
| 39145 |
const n = parseInt(data, 10); |
| 39146 |
if (!isNaN(n) && validate(n)) { |
| 39147 |
return n; |
| 39148 |
} |
| 39149 |
return defaultValue; |
| 39150 |
} |
| 39151 |
function getFloat({ |
| 39152 |
data, |
| 39153 |
defaultValue, |
| 39154 |
validate |
| 39155 |
}) { |
| 39156 |
if (!data) { |
| 39157 |
return defaultValue; |
| 39158 |
} |
| 39159 |
data = data.trim(); |
| 39160 |
const n = parseFloat(data); |
| 39161 |
if (!isNaN(n) && validate(n)) { |
| 39162 |
return n; |
| 39163 |
} |
| 39164 |
return defaultValue; |
| 39165 |
} |
| 39166 |
function getKeyword({ |
| 39167 |
data, |
| 39168 |
defaultValue, |
| 39169 |
validate |
| 39170 |
}) { |
| 39171 |
if (!data) { |
| 39172 |
return defaultValue; |
| 39173 |
} |
| 39174 |
data = data.trim(); |
| 39175 |
if (validate(data)) { |
| 39176 |
return data; |
| 39177 |
} |
| 39178 |
return defaultValue; |
| 39179 |
} |
| 39180 |
function getStringOption(data, options) { |
| 39181 |
return getKeyword({ |
| 39182 |
data, |
| 39183 |
defaultValue: options[0], |
| 39184 |
validate: k => options.includes(k) |
| 39185 |
}); |
| 39186 |
} |
| 39187 |
function getMeasurement(str, def = "0") { |
| 39188 |
def ||= "0"; |
| 39189 |
if (!str) { |
| 39190 |
return getMeasurement(def); |
| 39191 |
} |
| 39192 |
const match = str.trim().match(measurementPattern); |
| 39193 |
if (!match) { |
| 39194 |
return getMeasurement(def); |
| 39195 |
} |
| 39196 |
const [, valueStr, unit] = match; |
| 39197 |
const value = parseFloat(valueStr); |
| 39198 |
if (isNaN(value)) { |
| 39199 |
return getMeasurement(def); |
| 39200 |
} |
| 39201 |
if (value === 0) { |
| 39202 |
return 0; |
| 39203 |
} |
| 39204 |
const conv = dimConverters[unit]; |
| 39205 |
if (conv) { |
| 39206 |
return conv(value); |
| 39207 |
} |
| 39208 |
return value; |
| 39209 |
} |
| 39210 |
function getRatio(data) { |
| 39211 |
if (!data) { |
| 39212 |
return { |
| 39213 |
num: 1, |
| 39214 |
den: 1 |
| 39215 |
}; |
| 39216 |
} |
| 39217 |
const ratio = data.trim().split(/\s*:\s*/).map(x => parseFloat(x)).filter(x => !isNaN(x)); |
| 39218 |
if (ratio.length === 1) { |
| 39219 |
ratio.push(1); |
| 39220 |
} |
| 39221 |
if (ratio.length === 0) { |
| 39222 |
return { |
| 39223 |
num: 1, |
| 39224 |
den: 1 |
| 39225 |
}; |
| 39226 |
} |
| 39227 |
const [num, den] = ratio; |
| 39228 |
return { |
| 39229 |
num, |
| 39230 |
den |
| 39231 |
}; |
| 39232 |
} |
| 39233 |
function getRelevant(data) { |
| 39234 |
if (!data) { |
| 39235 |
return []; |
| 39236 |
} |
| 39237 |
return data.trim().split(/\s+/).map(e => ({ |
| 39238 |
excluded: e[0] === "-", |
| 39239 |
viewname: e.substring(1) |
| 39240 |
})); |
| 39241 |
} |
| 39242 |
function getColor(data, def = [0, 0, 0]) { |
| 39243 |
let [r, g, b] = def; |
| 39244 |
if (!data) { |
| 39245 |
return { |
| 39246 |
r, |
| 39247 |
g, |
| 39248 |
b |
| 39249 |
}; |
| 39250 |
} |
| 39251 |
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); |
| 39252 |
if (color.length < 3) { |
| 39253 |
return { |
| 39254 |
r, |
| 39255 |
g, |
| 39256 |
b |
| 39257 |
}; |
| 39258 |
} |
| 39259 |
[r, g, b] = color; |
| 39260 |
return { |
| 39261 |
r, |
| 39262 |
g, |
| 39263 |
b |
| 39264 |
}; |
| 39265 |
} |
| 39266 |
function getBBox(data) { |
| 39267 |
const def = -1; |
| 39268 |
if (!data) { |
| 39269 |
return { |
| 39270 |
x: def, |
| 39271 |
y: def, |
| 39272 |
width: def, |
| 39273 |
height: def |
| 39274 |
}; |
| 39275 |
} |
| 39276 |
const bbox = data.trim().split(/\s*,\s*/).map(m => getMeasurement(m, "-1")); |
| 39277 |
if (bbox.length < 4 || bbox[2] < 0 || bbox[3] < 0) { |
| 39278 |
return { |
| 39279 |
x: def, |
| 39280 |
y: def, |
| 39281 |
width: def, |
| 39282 |
height: def |
| 39283 |
}; |
| 39284 |
} |
| 39285 |
const [x, y, width, height] = bbox; |
| 39286 |
return { |
| 39287 |
x, |
| 39288 |
y, |
| 39289 |
width, |
| 39290 |
height |
| 39291 |
}; |
| 39292 |
} |
| 39293 |
class HTMLResult { |
| 39294 |
static get FAILURE() { |
| 39295 |
return shadow(this, "FAILURE", new HTMLResult(false, null, null, null)); |
| 39296 |
} |
| 39297 |
static get EMPTY() { |
| 39298 |
return shadow(this, "EMPTY", new HTMLResult(true, null, null, null)); |
| 39299 |
} |
| 39300 |
constructor(success, html, bbox, breakNode) { |
| 39301 |
this.success = success; |
| 39302 |
this.html = html; |
| 39303 |
this.bbox = bbox; |
| 39304 |
this.breakNode = breakNode; |
| 39305 |
} |
| 39306 |
isBreak() { |
| 39307 |
return !!this.breakNode; |
| 39308 |
} |
| 39309 |
static breakNode(node) { |
| 39310 |
return new HTMLResult(false, null, null, node); |
| 39311 |
} |
| 39312 |
static success(html, bbox = null) { |
| 39313 |
return new HTMLResult(true, html, bbox, null); |
| 39314 |
} |
| 39315 |
} |
| 39316 |
|
| 39317 |
;// ./src/core/xfa/fonts.js |
| 39318 |
|
| 39319 |
|
| 39320 |
|
| 39321 |
class FontFinder { |
| 39322 |
constructor(pdfFonts) { |
| 39323 |
this.fonts = new Map(); |
| 39324 |
this.cache = new Map(); |
| 39325 |
this.warned = new Set(); |
| 39326 |
this.defaultFont = null; |
| 39327 |
this.add(pdfFonts); |
| 39328 |
} |
| 39329 |
add(pdfFonts, reallyMissingFonts = null) { |
| 39330 |
for (const pdfFont of pdfFonts) { |
| 39331 |
this.addPdfFont(pdfFont); |
| 39332 |
} |
| 39333 |
for (const pdfFont of this.fonts.values()) { |
| 39334 |
if (!pdfFont.regular) { |
| 39335 |
pdfFont.regular = pdfFont.italic || pdfFont.bold || pdfFont.bolditalic; |
| 39336 |
} |
| 39337 |
} |
| 39338 |
if (!reallyMissingFonts || reallyMissingFonts.size === 0) { |
| 39339 |
return; |
| 39340 |
} |
| 39341 |
const myriad = this.fonts.get("PdfJS-Fallback-PdfJS-XFA"); |
| 39342 |
for (const missing of reallyMissingFonts) { |
| 39343 |
this.fonts.set(missing, myriad); |
| 39344 |
} |
| 39345 |
} |
| 39346 |
addPdfFont(pdfFont) { |
| 39347 |
const cssFontInfo = pdfFont.cssFontInfo; |
| 39348 |
const name = cssFontInfo.fontFamily; |
| 39349 |
let font = this.fonts.get(name); |
| 39350 |
if (!font) { |
| 39351 |
font = Object.create(null); |
| 39352 |
this.fonts.set(name, font); |
| 39353 |
if (!this.defaultFont) { |
| 39354 |
this.defaultFont = font; |
| 39355 |
} |
| 39356 |
} |
| 39357 |
let property = ""; |
| 39358 |
const fontWeight = parseFloat(cssFontInfo.fontWeight); |
| 39359 |
if (parseFloat(cssFontInfo.italicAngle) !== 0) { |
| 39360 |
property = fontWeight >= 700 ? "bolditalic" : "italic"; |
| 39361 |
} else if (fontWeight >= 700) { |
| 39362 |
property = "bold"; |
| 39363 |
} |
| 39364 |
if (!property) { |
| 39365 |
if (pdfFont.name.includes("Bold") || pdfFont.psName?.includes("Bold")) { |
| 39366 |
property = "bold"; |
| 39367 |
} |
| 39368 |
if (pdfFont.name.includes("Italic") || pdfFont.name.endsWith("It") || pdfFont.psName?.includes("Italic") || pdfFont.psName?.endsWith("It")) { |
| 39369 |
property += "italic"; |
| 39370 |
} |
| 39371 |
} |
| 39372 |
if (!property) { |
| 39373 |
property = "regular"; |
| 39374 |
} |
| 39375 |
font[property] = pdfFont; |
| 39376 |
} |
| 39377 |
getDefault() { |
| 39378 |
return this.defaultFont; |
| 39379 |
} |
| 39380 |
find(fontName, mustWarn = true) { |
| 39381 |
let font = this.fonts.get(fontName) || this.cache.get(fontName); |
| 39382 |
if (font) { |
| 39383 |
return font; |
| 39384 |
} |
| 39385 |
const pattern = /,|-|_| |bolditalic|bold|italic|regular|it/gi; |
| 39386 |
let name = fontName.replaceAll(pattern, ""); |
| 39387 |
font = this.fonts.get(name); |
| 39388 |
if (font) { |
| 39389 |
this.cache.set(fontName, font); |
| 39390 |
return font; |
| 39391 |
} |
| 39392 |
name = name.toLowerCase(); |
| 39393 |
const maybe = []; |
| 39394 |
for (const [family, pdfFont] of this.fonts.entries()) { |
| 39395 |
if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) { |
| 39396 |
maybe.push(pdfFont); |
| 39397 |
} |
| 39398 |
} |
| 39399 |
if (maybe.length === 0) { |
| 39400 |
for (const [, pdfFont] of this.fonts.entries()) { |
| 39401 |
if (pdfFont.regular.name?.replaceAll(pattern, "").toLowerCase().startsWith(name)) { |
| 39402 |
maybe.push(pdfFont); |
| 39403 |
} |
| 39404 |
} |
| 39405 |
} |
| 39406 |
if (maybe.length === 0) { |
| 39407 |
name = name.replaceAll(/psmt|mt/gi, ""); |
| 39408 |
for (const [family, pdfFont] of this.fonts.entries()) { |
| 39409 |
if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) { |
| 39410 |
maybe.push(pdfFont); |
| 39411 |
} |
| 39412 |
} |
| 39413 |
} |
| 39414 |
if (maybe.length === 0) { |
| 39415 |
for (const pdfFont of this.fonts.values()) { |
| 39416 |
if (pdfFont.regular.name?.replaceAll(pattern, "").toLowerCase().startsWith(name)) { |
| 39417 |
maybe.push(pdfFont); |
| 39418 |
} |
| 39419 |
} |
| 39420 |
} |
| 39421 |
if (maybe.length >= 1) { |
| 39422 |
if (maybe.length !== 1 && mustWarn) { |
| 39423 |
warn(`XFA - Too many choices to guess the correct font: ${fontName}`); |
| 39424 |
} |
| 39425 |
this.cache.set(fontName, maybe[0]); |
| 39426 |
return maybe[0]; |
| 39427 |
} |
| 39428 |
if (mustWarn && !this.warned.has(fontName)) { |
| 39429 |
this.warned.add(fontName); |
| 39430 |
warn(`XFA - Cannot find the font: ${fontName}`); |
| 39431 |
} |
| 39432 |
return null; |
| 39433 |
} |
| 39434 |
} |
| 39435 |
function selectFont(xfaFont, typeface) { |
| 39436 |
if (xfaFont.posture === "italic") { |
| 39437 |
if (xfaFont.weight === "bold") { |
| 39438 |
return typeface.bolditalic; |
| 39439 |
} |
| 39440 |
return typeface.italic; |
| 39441 |
} else if (xfaFont.weight === "bold") { |
| 39442 |
return typeface.bold; |
| 39443 |
} |
| 39444 |
return typeface.regular; |
| 39445 |
} |
| 39446 |
function fonts_getMetrics(xfaFont, real = false) { |
| 39447 |
let pdfFont = null; |
| 39448 |
if (xfaFont) { |
| 39449 |
const name = stripQuotes(xfaFont.typeface); |
| 39450 |
const typeface = xfaFont[$globalData].fontFinder.find(name); |
| 39451 |
pdfFont = selectFont(xfaFont, typeface); |
| 39452 |
} |
| 39453 |
if (!pdfFont) { |
| 39454 |
return { |
| 39455 |
lineHeight: 12, |
| 39456 |
lineGap: 2, |
| 39457 |
lineNoGap: 10 |
| 39458 |
}; |
| 39459 |
} |
| 39460 |
const size = xfaFont.size || 10; |
| 39461 |
const lineHeight = pdfFont.lineHeight ? Math.max(real ? 0 : 1.2, pdfFont.lineHeight) : 1.2; |
| 39462 |
const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap; |
| 39463 |
return { |
| 39464 |
lineHeight: lineHeight * size, |
| 39465 |
lineGap: lineGap * size, |
| 39466 |
lineNoGap: Math.max(1, lineHeight - lineGap) * size |
| 39467 |
}; |
| 39468 |
} |
| 39469 |
|
| 39470 |
;// ./src/core/xfa/text.js |
| 39471 |
|
| 39472 |
const WIDTH_FACTOR = 1.02; |
| 39473 |
class FontInfo { |
| 39474 |
constructor(xfaFont, margin, lineHeight, fontFinder) { |
| 39475 |
this.lineHeight = lineHeight; |
| 39476 |
this.paraMargin = margin || { |
| 39477 |
top: 0, |
| 39478 |
bottom: 0, |
| 39479 |
left: 0, |
| 39480 |
right: 0 |
| 39481 |
}; |
| 39482 |
if (!xfaFont) { |
| 39483 |
[this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder); |
| 39484 |
return; |
| 39485 |
} |
| 39486 |
this.xfaFont = { |
| 39487 |
typeface: xfaFont.typeface, |
| 39488 |
posture: xfaFont.posture, |
| 39489 |
weight: xfaFont.weight, |
| 39490 |
size: xfaFont.size, |
| 39491 |
letterSpacing: xfaFont.letterSpacing |
| 39492 |
}; |
| 39493 |
const typeface = fontFinder.find(xfaFont.typeface); |
| 39494 |
if (!typeface) { |
| 39495 |
[this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder); |
| 39496 |
return; |
| 39497 |
} |
| 39498 |
this.pdfFont = selectFont(xfaFont, typeface); |
| 39499 |
if (!this.pdfFont) { |
| 39500 |
[this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder); |
| 39501 |
} |
| 39502 |
} |
| 39503 |
defaultFont(fontFinder) { |
| 39504 |
const font = fontFinder.find("Helvetica", false) || fontFinder.find("Myriad Pro", false) || fontFinder.find("Arial", false) || fontFinder.getDefault(); |
| 39505 |
if (font?.regular) { |
| 39506 |
const pdfFont = font.regular; |
| 39507 |
const info = pdfFont.cssFontInfo; |
| 39508 |
const xfaFont = { |
| 39509 |
typeface: info.fontFamily, |
| 39510 |
posture: "normal", |
| 39511 |
weight: "normal", |
| 39512 |
size: 10, |
| 39513 |
letterSpacing: 0 |
| 39514 |
}; |
| 39515 |
return [pdfFont, xfaFont]; |
| 39516 |
} |
| 39517 |
const xfaFont = { |
| 39518 |
typeface: "Courier", |
| 39519 |
posture: "normal", |
| 39520 |
weight: "normal", |
| 39521 |
size: 10, |
| 39522 |
letterSpacing: 0 |
| 39523 |
}; |
| 39524 |
return [null, xfaFont]; |
| 39525 |
} |
| 39526 |
} |
| 39527 |
class FontSelector { |
| 39528 |
constructor(defaultXfaFont, defaultParaMargin, defaultLineHeight, fontFinder) { |
| 39529 |
this.fontFinder = fontFinder; |
| 39530 |
this.stack = [new FontInfo(defaultXfaFont, defaultParaMargin, defaultLineHeight, fontFinder)]; |
| 39531 |
} |
| 39532 |
pushData(xfaFont, margin, lineHeight) { |
| 39533 |
const lastFont = this.stack.at(-1); |
| 39534 |
for (const name of ["typeface", "posture", "weight", "size", "letterSpacing"]) { |
| 39535 |
if (!xfaFont[name]) { |
| 39536 |
xfaFont[name] = lastFont.xfaFont[name]; |
| 39537 |
} |
| 39538 |
} |
| 39539 |
for (const name of ["top", "bottom", "left", "right"]) { |
| 39540 |
if (isNaN(margin[name])) { |
| 39541 |
margin[name] = lastFont.paraMargin[name]; |
| 39542 |
} |
| 39543 |
} |
| 39544 |
const fontInfo = new FontInfo(xfaFont, margin, lineHeight || lastFont.lineHeight, this.fontFinder); |
| 39545 |
if (!fontInfo.pdfFont) { |
| 39546 |
fontInfo.pdfFont = lastFont.pdfFont; |
| 39547 |
} |
| 39548 |
this.stack.push(fontInfo); |
| 39549 |
} |
| 39550 |
popFont() { |
| 39551 |
this.stack.pop(); |
| 39552 |
} |
| 39553 |
topFont() { |
| 39554 |
return this.stack.at(-1); |
| 39555 |
} |
| 39556 |
} |
| 39557 |
class TextMeasure { |
| 39558 |
constructor(defaultXfaFont, defaultParaMargin, defaultLineHeight, fonts) { |
| 39559 |
this.glyphs = []; |
| 39560 |
this.fontSelector = new FontSelector(defaultXfaFont, defaultParaMargin, defaultLineHeight, fonts); |
| 39561 |
this.extraHeight = 0; |
| 39562 |
} |
| 39563 |
pushData(xfaFont, margin, lineHeight) { |
| 39564 |
this.fontSelector.pushData(xfaFont, margin, lineHeight); |
| 39565 |
} |
| 39566 |
popFont(xfaFont) { |
| 39567 |
return this.fontSelector.popFont(); |
| 39568 |
} |
| 39569 |
addPara() { |
| 39570 |
const lastFont = this.fontSelector.topFont(); |
| 39571 |
this.extraHeight += lastFont.paraMargin.top + lastFont.paraMargin.bottom; |
| 39572 |
} |
| 39573 |
addString(str) { |
| 39574 |
if (!str) { |
| 39575 |
return; |
| 39576 |
} |
| 39577 |
const lastFont = this.fontSelector.topFont(); |
| 39578 |
const fontSize = lastFont.xfaFont.size; |
| 39579 |
if (lastFont.pdfFont) { |
| 39580 |
const letterSpacing = lastFont.xfaFont.letterSpacing; |
| 39581 |
const pdfFont = lastFont.pdfFont; |
| 39582 |
const fontLineHeight = pdfFont.lineHeight || 1.2; |
| 39583 |
const lineHeight = lastFont.lineHeight || Math.max(1.2, fontLineHeight) * fontSize; |
| 39584 |
const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap; |
| 39585 |
const noGap = fontLineHeight - lineGap; |
| 39586 |
const firstLineHeight = Math.max(1, noGap) * fontSize; |
| 39587 |
const scale = fontSize / 1000; |
| 39588 |
const fallbackWidth = pdfFont.defaultWidth || pdfFont.charsToGlyphs(" ")[0].width; |
| 39589 |
for (const line of str.split(/[\u2029\n]/)) { |
| 39590 |
const encodedLine = pdfFont.encodeString(line).join(""); |
| 39591 |
const glyphs = pdfFont.charsToGlyphs(encodedLine); |
| 39592 |
for (const glyph of glyphs) { |
| 39593 |
const width = glyph.width || fallbackWidth; |
| 39594 |
this.glyphs.push([width * scale + letterSpacing, lineHeight, firstLineHeight, glyph.unicode, false]); |
| 39595 |
} |
| 39596 |
this.glyphs.push([0, 0, 0, "\n", true]); |
| 39597 |
} |
| 39598 |
this.glyphs.pop(); |
| 39599 |
return; |
| 39600 |
} |
| 39601 |
for (const line of str.split(/[\u2029\n]/)) { |
| 39602 |
for (const char of line.split("")) { |
| 39603 |
this.glyphs.push([fontSize, 1.2 * fontSize, fontSize, char, false]); |
| 39604 |
} |
| 39605 |
this.glyphs.push([0, 0, 0, "\n", true]); |
| 39606 |
} |
| 39607 |
this.glyphs.pop(); |
| 39608 |
} |
| 39609 |
compute(maxWidth) { |
| 39610 |
let lastSpacePos = -1, |
| 39611 |
lastSpaceWidth = 0, |
| 39612 |
width = 0, |
| 39613 |
height = 0, |
| 39614 |
currentLineWidth = 0, |
| 39615 |
currentLineHeight = 0; |
| 39616 |
let isBroken = false; |
| 39617 |
let isFirstLine = true; |
| 39618 |
for (let i = 0, ii = this.glyphs.length; i < ii; i++) { |
| 39619 |
const [glyphWidth, lineHeight, firstLineHeight, char, isEOL] = this.glyphs[i]; |
| 39620 |
const isSpace = char === " "; |
| 39621 |
const glyphHeight = isFirstLine ? firstLineHeight : lineHeight; |
| 39622 |
if (isEOL) { |
| 39623 |
width = Math.max(width, currentLineWidth); |
| 39624 |
currentLineWidth = 0; |
| 39625 |
height += currentLineHeight; |
| 39626 |
currentLineHeight = glyphHeight; |
| 39627 |
lastSpacePos = -1; |
| 39628 |
lastSpaceWidth = 0; |
| 39629 |
isFirstLine = false; |
| 39630 |
continue; |
| 39631 |
} |
| 39632 |
if (isSpace) { |
| 39633 |
if (currentLineWidth + glyphWidth > maxWidth) { |
| 39634 |
width = Math.max(width, currentLineWidth); |
| 39635 |
currentLineWidth = 0; |
| 39636 |
height += currentLineHeight; |
| 39637 |
currentLineHeight = glyphHeight; |
| 39638 |
lastSpacePos = -1; |
| 39639 |
lastSpaceWidth = 0; |
| 39640 |
isBroken = true; |
| 39641 |
isFirstLine = false; |
| 39642 |
} else { |
| 39643 |
currentLineHeight = Math.max(glyphHeight, currentLineHeight); |
| 39644 |
lastSpaceWidth = currentLineWidth; |
| 39645 |
currentLineWidth += glyphWidth; |
| 39646 |
lastSpacePos = i; |
| 39647 |
} |
| 39648 |
continue; |
| 39649 |
} |
| 39650 |
if (currentLineWidth + glyphWidth > maxWidth) { |
| 39651 |
height += currentLineHeight; |
| 39652 |
currentLineHeight = glyphHeight; |
| 39653 |
if (lastSpacePos !== -1) { |
| 39654 |
i = lastSpacePos; |
| 39655 |
width = Math.max(width, lastSpaceWidth); |
| 39656 |
currentLineWidth = 0; |
| 39657 |
lastSpacePos = -1; |
| 39658 |
lastSpaceWidth = 0; |
| 39659 |
} else { |
| 39660 |
width = Math.max(width, currentLineWidth); |
| 39661 |
currentLineWidth = glyphWidth; |
| 39662 |
} |
| 39663 |
isBroken = true; |
| 39664 |
isFirstLine = false; |
| 39665 |
continue; |
| 39666 |
} |
| 39667 |
currentLineWidth += glyphWidth; |
| 39668 |
currentLineHeight = Math.max(glyphHeight, currentLineHeight); |
| 39669 |
} |
| 39670 |
width = Math.max(width, currentLineWidth); |
| 39671 |
height += currentLineHeight + this.extraHeight; |
| 39672 |
return { |
| 39673 |
width: WIDTH_FACTOR * width, |
| 39674 |
height, |
| 39675 |
isBroken |
| 39676 |
}; |
| 39677 |
} |
| 39678 |
} |
| 39679 |
|
| 39680 |
;// ./src/core/xfa/som.js |
| 39681 |
|
| 39682 |
|
| 39683 |
const namePattern = /^[^.[]+/; |
| 39684 |
const indexPattern = /^[^\]]+/; |
| 39685 |
const operators = { |
| 39686 |
dot: 0, |
| 39687 |
dotDot: 1, |
| 39688 |
dotHash: 2, |
| 39689 |
dotBracket: 3, |
| 39690 |
dotParen: 4 |
| 39691 |
}; |
| 39692 |
const shortcuts = new Map([["$data", (root, current) => root.datasets ? root.datasets.data : root], ["$record", (root, current) => (root.datasets ? root.datasets.data : root)[$getChildren]()[0]], ["$template", (root, current) => root.template], ["$connectionSet", (root, current) => root.connectionSet], ["$form", (root, current) => root.form], ["$layout", (root, current) => root.layout], ["$host", (root, current) => root.host], ["$dataWindow", (root, current) => root.dataWindow], ["$event", (root, current) => root.event], ["!", (root, current) => root.datasets], ["$xfa", (root, current) => root], ["xfa", (root, current) => root], ["$", (root, current) => current]]); |
| 39693 |
const somCache = new WeakMap(); |
| 39694 |
function parseIndex(index) { |
| 39695 |
index = index.trim(); |
| 39696 |
if (index === "*") { |
| 39697 |
return Infinity; |
| 39698 |
} |
| 39699 |
return parseInt(index, 10) || 0; |
| 39700 |
} |
| 39701 |
function parseExpression(expr, dotDotAllowed, noExpr = true) { |
| 39702 |
let match = expr.match(namePattern); |
| 39703 |
if (!match) { |
| 39704 |
return null; |
| 39705 |
} |
| 39706 |
let [name] = match; |
| 39707 |
const parsed = [{ |
| 39708 |
name, |
| 39709 |
cacheName: "." + name, |
| 39710 |
index: 0, |
| 39711 |
js: null, |
| 39712 |
formCalc: null, |
| 39713 |
operator: operators.dot |
| 39714 |
}]; |
| 39715 |
let pos = name.length; |
| 39716 |
while (pos < expr.length) { |
| 39717 |
const spos = pos; |
| 39718 |
const char = expr.charAt(pos++); |
| 39719 |
if (char === "[") { |
| 39720 |
match = expr.slice(pos).match(indexPattern); |
| 39721 |
if (!match) { |
| 39722 |
warn("XFA - Invalid index in SOM expression"); |
| 39723 |
return null; |
| 39724 |
} |
| 39725 |
parsed.at(-1).index = parseIndex(match[0]); |
| 39726 |
pos += match[0].length + 1; |
| 39727 |
continue; |
| 39728 |
} |
| 39729 |
let operator; |
| 39730 |
switch (expr.charAt(pos)) { |
| 39731 |
case ".": |
| 39732 |
if (!dotDotAllowed) { |
| 39733 |
return null; |
| 39734 |
} |
| 39735 |
pos++; |
| 39736 |
operator = operators.dotDot; |
| 39737 |
break; |
| 39738 |
case "#": |
| 39739 |
pos++; |
| 39740 |
operator = operators.dotHash; |
| 39741 |
break; |
| 39742 |
case "[": |
| 39743 |
if (noExpr) { |
| 39744 |
warn("XFA - SOM expression contains a FormCalc subexpression which is not supported for now."); |
| 39745 |
return null; |
| 39746 |
} |
| 39747 |
operator = operators.dotBracket; |
| 39748 |
break; |
| 39749 |
case "(": |
| 39750 |
if (noExpr) { |
| 39751 |
warn("XFA - SOM expression contains a JavaScript subexpression which is not supported for now."); |
| 39752 |
return null; |
| 39753 |
} |
| 39754 |
operator = operators.dotParen; |
| 39755 |
break; |
| 39756 |
default: |
| 39757 |
operator = operators.dot; |
| 39758 |
break; |
| 39759 |
} |
| 39760 |
match = expr.slice(pos).match(namePattern); |
| 39761 |
if (!match) { |
| 39762 |
break; |
| 39763 |
} |
| 39764 |
[name] = match; |
| 39765 |
pos += name.length; |
| 39766 |
parsed.push({ |
| 39767 |
name, |
| 39768 |
cacheName: expr.slice(spos, pos), |
| 39769 |
operator, |
| 39770 |
index: 0, |
| 39771 |
js: null, |
| 39772 |
formCalc: null |
| 39773 |
}); |
| 39774 |
} |
| 39775 |
return parsed; |
| 39776 |
} |
| 39777 |
function searchNode(root, container, expr, dotDotAllowed = true, useCache = true) { |
| 39778 |
const parsed = parseExpression(expr, dotDotAllowed); |
| 39779 |
if (!parsed) { |
| 39780 |
return null; |
| 39781 |
} |
| 39782 |
const fn = shortcuts.get(parsed[0].name); |
| 39783 |
let i = 0; |
| 39784 |
let isQualified; |
| 39785 |
if (fn) { |
| 39786 |
isQualified = true; |
| 39787 |
root = [fn(root, container)]; |
| 39788 |
i = 1; |
| 39789 |
} else { |
| 39790 |
isQualified = container === null; |
| 39791 |
root = [container || root]; |
| 39792 |
} |
| 39793 |
for (let ii = parsed.length; i < ii; i++) { |
| 39794 |
const { |
| 39795 |
name, |
| 39796 |
cacheName, |
| 39797 |
operator, |
| 39798 |
index |
| 39799 |
} = parsed[i]; |
| 39800 |
const nodes = []; |
| 39801 |
for (const node of root) { |
| 39802 |
if (!node.isXFAObject) { |
| 39803 |
continue; |
| 39804 |
} |
| 39805 |
let children, cached; |
| 39806 |
if (useCache) { |
| 39807 |
cached = somCache.get(node); |
| 39808 |
if (!cached) { |
| 39809 |
cached = new Map(); |
| 39810 |
somCache.set(node, cached); |
| 39811 |
} |
| 39812 |
children = cached.get(cacheName); |
| 39813 |
} |
| 39814 |
if (!children) { |
| 39815 |
switch (operator) { |
| 39816 |
case operators.dot: |
| 39817 |
children = node[$getChildrenByName](name, false); |
| 39818 |
break; |
| 39819 |
case operators.dotDot: |
| 39820 |
children = node[$getChildrenByName](name, true); |
| 39821 |
break; |
| 39822 |
case operators.dotHash: |
| 39823 |
children = node[$getChildrenByClass](name); |
| 39824 |
children = children.isXFAObjectArray ? children.children : [children]; |
| 39825 |
break; |
| 39826 |
default: |
| 39827 |
break; |
| 39828 |
} |
| 39829 |
if (useCache) { |
| 39830 |
cached.set(cacheName, children); |
| 39831 |
} |
| 39832 |
} |
| 39833 |
if (children.length > 0) { |
| 39834 |
nodes.push(children); |
| 39835 |
} |
| 39836 |
} |
| 39837 |
if (nodes.length === 0 && !isQualified && i === 0) { |
| 39838 |
const parent = container[$getParent](); |
| 39839 |
container = parent; |
| 39840 |
if (!container) { |
| 39841 |
return null; |
| 39842 |
} |
| 39843 |
i = -1; |
| 39844 |
root = [container]; |
| 39845 |
continue; |
| 39846 |
} |
| 39847 |
root = isFinite(index) ? nodes.filter(node => index < node.length).map(node => node[index]) : nodes.flat(); |
| 39848 |
} |
| 39849 |
if (root.length === 0) { |
| 39850 |
return null; |
| 39851 |
} |
| 39852 |
return root; |
| 39853 |
} |
| 39854 |
function createDataNode(root, container, expr) { |
| 39855 |
const parsed = parseExpression(expr); |
| 39856 |
if (!parsed) { |
| 39857 |
return null; |
| 39858 |
} |
| 39859 |
if (parsed.some(x => x.operator === operators.dotDot)) { |
| 39860 |
return null; |
| 39861 |
} |
| 39862 |
const fn = shortcuts.get(parsed[0].name); |
| 39863 |
let i = 0; |
| 39864 |
if (fn) { |
| 39865 |
root = fn(root, container); |
| 39866 |
i = 1; |
| 39867 |
} else { |
| 39868 |
root = container || root; |
| 39869 |
} |
| 39870 |
for (let ii = parsed.length; i < ii; i++) { |
| 39871 |
const { |
| 39872 |
name, |
| 39873 |
operator, |
| 39874 |
index |
| 39875 |
} = parsed[i]; |
| 39876 |
if (!isFinite(index)) { |
| 39877 |
parsed[i].index = 0; |
| 39878 |
return root.createNodes(parsed.slice(i)); |
| 39879 |
} |
| 39880 |
let children; |
| 39881 |
switch (operator) { |
| 39882 |
case operators.dot: |
| 39883 |
children = root[$getChildrenByName](name, false); |
| 39884 |
break; |
| 39885 |
case operators.dotDot: |
| 39886 |
children = root[$getChildrenByName](name, true); |
| 39887 |
break; |
| 39888 |
case operators.dotHash: |
| 39889 |
children = root[$getChildrenByClass](name); |
| 39890 |
children = children.isXFAObjectArray ? children.children : [children]; |
| 39891 |
break; |
| 39892 |
default: |
| 39893 |
break; |
| 39894 |
} |
| 39895 |
if (children.length === 0) { |
| 39896 |
return root.createNodes(parsed.slice(i)); |
| 39897 |
} |
| 39898 |
if (index < children.length) { |
| 39899 |
const child = children[index]; |
| 39900 |
if (!child.isXFAObject) { |
| 39901 |
warn(`XFA - Cannot create a node.`); |
| 39902 |
return null; |
| 39903 |
} |
| 39904 |
root = child; |
| 39905 |
} else { |
| 39906 |
parsed[i].index = index - children.length; |
| 39907 |
return root.createNodes(parsed.slice(i)); |
| 39908 |
} |
| 39909 |
} |
| 39910 |
return null; |
| 39911 |
} |
| 39912 |
|
| 39913 |
;// ./src/core/xfa/xfa_object.js |
| 39914 |
|
| 39915 |
|
| 39916 |
|
| 39917 |
|
| 39918 |
|
| 39919 |
|
| 39920 |
const _applyPrototype = Symbol(); |
| 39921 |
const _attributes = Symbol(); |
| 39922 |
const _attributeNames = Symbol(); |
| 39923 |
const _children = Symbol("_children"); |
| 39924 |
const _cloneAttribute = Symbol(); |
| 39925 |
const _dataValue = Symbol(); |
| 39926 |
const _defaultValue = Symbol(); |
| 39927 |
const _filteredChildrenGenerator = Symbol(); |
| 39928 |
const _getPrototype = Symbol(); |
| 39929 |
const _getUnsetAttributes = Symbol(); |
| 39930 |
const _hasChildren = Symbol(); |
| 39931 |
const _max = Symbol(); |
| 39932 |
const _options = Symbol(); |
| 39933 |
const _parent = Symbol("parent"); |
| 39934 |
const _resolvePrototypesHelper = Symbol(); |
| 39935 |
const _setAttributes = Symbol(); |
| 39936 |
const _validator = Symbol(); |
| 39937 |
let uid = 0; |
| 39938 |
const NS_DATASETS = NamespaceIds.datasets.id; |
| 39939 |
class XFAObject { |
| 39940 |
constructor(nsId, name, hasChildren = false) { |
| 39941 |
this[$namespaceId] = nsId; |
| 39942 |
this[$nodeName] = name; |
| 39943 |
this[_hasChildren] = hasChildren; |
| 39944 |
this[_parent] = null; |
| 39945 |
this[_children] = []; |
| 39946 |
this[$uid] = `${name}${uid++}`; |
| 39947 |
this[$globalData] = null; |
| 39948 |
} |
| 39949 |
get isXFAObject() { |
| 39950 |
return true; |
| 39951 |
} |
| 39952 |
get isXFAObjectArray() { |
| 39953 |
return false; |
| 39954 |
} |
| 39955 |
createNodes(path) { |
| 39956 |
let root = this, |
| 39957 |
node = null; |
| 39958 |
for (const { |
| 39959 |
name, |
| 39960 |
index |
| 39961 |
} of path) { |
| 39962 |
for (let i = 0, ii = isFinite(index) ? index : 0; i <= ii; i++) { |
| 39963 |
const nsId = root[$namespaceId] === NS_DATASETS ? -1 : root[$namespaceId]; |
| 39964 |
node = new XmlObject(nsId, name); |
| 39965 |
root[$appendChild](node); |
| 39966 |
} |
| 39967 |
root = node; |
| 39968 |
} |
| 39969 |
return node; |
| 39970 |
} |
| 39971 |
[$onChild](child) { |
| 39972 |
if (!this[_hasChildren] || !this[$onChildCheck](child)) { |
| 39973 |
return false; |
| 39974 |
} |
| 39975 |
const name = child[$nodeName]; |
| 39976 |
const node = this[name]; |
| 39977 |
if (node instanceof XFAObjectArray) { |
| 39978 |
if (node.push(child)) { |
| 39979 |
this[$appendChild](child); |
| 39980 |
return true; |
| 39981 |
} |
| 39982 |
} else { |
| 39983 |
if (node !== null) { |
| 39984 |
this[$removeChild](node); |
| 39985 |
} |
| 39986 |
this[name] = child; |
| 39987 |
this[$appendChild](child); |
| 39988 |
return true; |
| 39989 |
} |
| 39990 |
let id = ""; |
| 39991 |
if (this.id) { |
| 39992 |
id = ` (id: ${this.id})`; |
| 39993 |
} else if (this.name) { |
| 39994 |
id = ` (name: ${this.name} ${this.h.value})`; |
| 39995 |
} |
| 39996 |
warn(`XFA - node "${this[$nodeName]}"${id} has already enough "${name}"!`); |
| 39997 |
return false; |
| 39998 |
} |
| 39999 |
[$onChildCheck](child) { |
| 40000 |
return this.hasOwnProperty(child[$nodeName]) && child[$namespaceId] === this[$namespaceId]; |
| 40001 |
} |
| 40002 |
[$isNsAgnostic]() { |
| 40003 |
return false; |
| 40004 |
} |
| 40005 |
[$acceptWhitespace]() { |
| 40006 |
return false; |
| 40007 |
} |
| 40008 |
[$isCDATAXml]() { |
| 40009 |
return false; |
| 40010 |
} |
| 40011 |
[$isBindable]() { |
| 40012 |
return false; |
| 40013 |
} |
| 40014 |
[$popPara]() { |
| 40015 |
if (this.para) { |
| 40016 |
this[$getTemplateRoot]()[$extra].paraStack.pop(); |
| 40017 |
} |
| 40018 |
} |
| 40019 |
[$pushPara]() { |
| 40020 |
this[$getTemplateRoot]()[$extra].paraStack.push(this.para); |
| 40021 |
} |
| 40022 |
[$setId](ids) { |
| 40023 |
if (this.id && this[$namespaceId] === NamespaceIds.template.id) { |
| 40024 |
ids.set(this.id, this); |
| 40025 |
} |
| 40026 |
} |
| 40027 |
[$getTemplateRoot]() { |
| 40028 |
return this[$globalData].template; |
| 40029 |
} |
| 40030 |
[$isSplittable]() { |
| 40031 |
return false; |
| 40032 |
} |
| 40033 |
[$isThereMoreWidth]() { |
| 40034 |
return false; |
| 40035 |
} |
| 40036 |
[$appendChild](child) { |
| 40037 |
child[_parent] = this; |
| 40038 |
this[_children].push(child); |
| 40039 |
if (!child[$globalData] && this[$globalData]) { |
| 40040 |
child[$globalData] = this[$globalData]; |
| 40041 |
} |
| 40042 |
} |
| 40043 |
[$removeChild](child) { |
| 40044 |
const i = this[_children].indexOf(child); |
| 40045 |
this[_children].splice(i, 1); |
| 40046 |
} |
| 40047 |
[$hasSettableValue]() { |
| 40048 |
return this.hasOwnProperty("value"); |
| 40049 |
} |
| 40050 |
[$setValue](_) {} |
| 40051 |
[$onText](_) {} |
| 40052 |
[$finalize]() {} |
| 40053 |
[$clean](builder) { |
| 40054 |
delete this[_hasChildren]; |
| 40055 |
if (this[$cleanup]) { |
| 40056 |
builder.clean(this[$cleanup]); |
| 40057 |
delete this[$cleanup]; |
| 40058 |
} |
| 40059 |
} |
| 40060 |
[$indexOf](child) { |
| 40061 |
return this[_children].indexOf(child); |
| 40062 |
} |
| 40063 |
[$insertAt](i, child) { |
| 40064 |
child[_parent] = this; |
| 40065 |
this[_children].splice(i, 0, child); |
| 40066 |
if (!child[$globalData] && this[$globalData]) { |
| 40067 |
child[$globalData] = this[$globalData]; |
| 40068 |
} |
| 40069 |
} |
| 40070 |
[$isTransparent]() { |
| 40071 |
return !this.name; |
| 40072 |
} |
| 40073 |
[$lastAttribute]() { |
| 40074 |
return ""; |
| 40075 |
} |
| 40076 |
[$text]() { |
| 40077 |
if (this[_children].length === 0) { |
| 40078 |
return this[$content]; |
| 40079 |
} |
| 40080 |
return this[_children].map(c => c[$text]()).join(""); |
| 40081 |
} |
| 40082 |
get [_attributeNames]() { |
| 40083 |
const proto = Object.getPrototypeOf(this); |
| 40084 |
if (!proto._attributes) { |
| 40085 |
const attributes = proto._attributes = new Set(); |
| 40086 |
for (const name of Object.getOwnPropertyNames(this)) { |
| 40087 |
if (this[name] === null || this[name] instanceof XFAObject || this[name] instanceof XFAObjectArray) { |
| 40088 |
break; |
| 40089 |
} |
| 40090 |
attributes.add(name); |
| 40091 |
} |
| 40092 |
} |
| 40093 |
return shadow(this, _attributeNames, proto._attributes); |
| 40094 |
} |
| 40095 |
[$isDescendent](parent) { |
| 40096 |
let node = this; |
| 40097 |
while (node) { |
| 40098 |
if (node === parent) { |
| 40099 |
return true; |
| 40100 |
} |
| 40101 |
node = node[$getParent](); |
| 40102 |
} |
| 40103 |
return false; |
| 40104 |
} |
| 40105 |
[$getParent]() { |
| 40106 |
return this[_parent]; |
| 40107 |
} |
| 40108 |
[$getSubformParent]() { |
| 40109 |
return this[$getParent](); |
| 40110 |
} |
| 40111 |
[$getChildren](name = null) { |
| 40112 |
if (!name) { |
| 40113 |
return this[_children]; |
| 40114 |
} |
| 40115 |
return this[name]; |
| 40116 |
} |
| 40117 |
[$dump]() { |
| 40118 |
const dumped = Object.create(null); |
| 40119 |
if (this[$content]) { |
| 40120 |
dumped.$content = this[$content]; |
| 40121 |
} |
| 40122 |
for (const name of Object.getOwnPropertyNames(this)) { |
| 40123 |
const value = this[name]; |
| 40124 |
if (value === null) { |
| 40125 |
continue; |
| 40126 |
} |
| 40127 |
if (value instanceof XFAObject) { |
| 40128 |
dumped[name] = value[$dump](); |
| 40129 |
} else if (value instanceof XFAObjectArray) { |
| 40130 |
if (!value.isEmpty()) { |
| 40131 |
dumped[name] = value.dump(); |
| 40132 |
} |
| 40133 |
} else { |
| 40134 |
dumped[name] = value; |
| 40135 |
} |
| 40136 |
} |
| 40137 |
return dumped; |
| 40138 |
} |
| 40139 |
[$toStyle]() { |
| 40140 |
return null; |
| 40141 |
} |
| 40142 |
[$toHTML]() { |
| 40143 |
return HTMLResult.EMPTY; |
| 40144 |
} |
| 40145 |
*[$getContainedChildren]() { |
| 40146 |
for (const node of this[$getChildren]()) { |
| 40147 |
yield node; |
| 40148 |
} |
| 40149 |
} |
| 40150 |
*[_filteredChildrenGenerator](filter, include) { |
| 40151 |
for (const node of this[$getContainedChildren]()) { |
| 40152 |
if (!filter || include === filter.has(node[$nodeName])) { |
| 40153 |
const availableSpace = this[$getAvailableSpace](); |
| 40154 |
const res = node[$toHTML](availableSpace); |
| 40155 |
if (!res.success) { |
| 40156 |
this[$extra].failingNode = node; |
| 40157 |
} |
| 40158 |
yield res; |
| 40159 |
} |
| 40160 |
} |
| 40161 |
} |
| 40162 |
[$flushHTML]() { |
| 40163 |
return null; |
| 40164 |
} |
| 40165 |
[$addHTML](html, bbox) { |
| 40166 |
this[$extra].children.push(html); |
| 40167 |
} |
| 40168 |
[$getAvailableSpace]() {} |
| 40169 |
[$childrenToHTML]({ |
| 40170 |
filter = null, |
| 40171 |
include = true |
| 40172 |
}) { |
| 40173 |
if (!this[$extra].generator) { |
| 40174 |
this[$extra].generator = this[_filteredChildrenGenerator](filter, include); |
| 40175 |
} else { |
| 40176 |
const availableSpace = this[$getAvailableSpace](); |
| 40177 |
const res = this[$extra].failingNode[$toHTML](availableSpace); |
| 40178 |
if (!res.success) { |
| 40179 |
return res; |
| 40180 |
} |
| 40181 |
if (res.html) { |
| 40182 |
this[$addHTML](res.html, res.bbox); |
| 40183 |
} |
| 40184 |
delete this[$extra].failingNode; |
| 40185 |
} |
| 40186 |
while (true) { |
| 40187 |
const gen = this[$extra].generator.next(); |
| 40188 |
if (gen.done) { |
| 40189 |
break; |
| 40190 |
} |
| 40191 |
const res = gen.value; |
| 40192 |
if (!res.success) { |
| 40193 |
return res; |
| 40194 |
} |
| 40195 |
if (res.html) { |
| 40196 |
this[$addHTML](res.html, res.bbox); |
| 40197 |
} |
| 40198 |
} |
| 40199 |
this[$extra].generator = null; |
| 40200 |
return HTMLResult.EMPTY; |
| 40201 |
} |
| 40202 |
[$setSetAttributes](attributes) { |
| 40203 |
this[_setAttributes] = new Set(Object.keys(attributes)); |
| 40204 |
} |
| 40205 |
[_getUnsetAttributes](protoAttributes) { |
| 40206 |
const allAttr = this[_attributeNames]; |
| 40207 |
const setAttr = this[_setAttributes]; |
| 40208 |
return [...protoAttributes].filter(x => allAttr.has(x) && !setAttr.has(x)); |
| 40209 |
} |
| 40210 |
[$resolvePrototypes](ids, ancestors = new Set()) { |
| 40211 |
for (const child of this[_children]) { |
| 40212 |
child[_resolvePrototypesHelper](ids, ancestors); |
| 40213 |
} |
| 40214 |
} |
| 40215 |
[_resolvePrototypesHelper](ids, ancestors) { |
| 40216 |
const proto = this[_getPrototype](ids, ancestors); |
| 40217 |
if (proto) { |
| 40218 |
this[_applyPrototype](proto, ids, ancestors); |
| 40219 |
} else { |
| 40220 |
this[$resolvePrototypes](ids, ancestors); |
| 40221 |
} |
| 40222 |
} |
| 40223 |
[_getPrototype](ids, ancestors) { |
| 40224 |
const { |
| 40225 |
use, |
| 40226 |
usehref |
| 40227 |
} = this; |
| 40228 |
if (!use && !usehref) { |
| 40229 |
return null; |
| 40230 |
} |
| 40231 |
let proto = null; |
| 40232 |
let somExpression = null; |
| 40233 |
let id = null; |
| 40234 |
let ref = use; |
| 40235 |
if (usehref) { |
| 40236 |
ref = usehref; |
| 40237 |
if (usehref.startsWith("#som(") && usehref.endsWith(")")) { |
| 40238 |
somExpression = usehref.slice("#som(".length, -1); |
| 40239 |
} else if (usehref.startsWith(".#som(") && usehref.endsWith(")")) { |
| 40240 |
somExpression = usehref.slice(".#som(".length, -1); |
| 40241 |
} else if (usehref.startsWith("#")) { |
| 40242 |
id = usehref.slice(1); |
| 40243 |
} else if (usehref.startsWith(".#")) { |
| 40244 |
id = usehref.slice(2); |
| 40245 |
} |
| 40246 |
} else if (use.startsWith("#")) { |
| 40247 |
id = use.slice(1); |
| 40248 |
} else { |
| 40249 |
somExpression = use; |
| 40250 |
} |
| 40251 |
this.use = this.usehref = ""; |
| 40252 |
if (id) { |
| 40253 |
proto = ids.get(id); |
| 40254 |
} else { |
| 40255 |
proto = searchNode(ids.get($root), this, somExpression, true, false); |
| 40256 |
if (proto) { |
| 40257 |
proto = proto[0]; |
| 40258 |
} |
| 40259 |
} |
| 40260 |
if (!proto) { |
| 40261 |
warn(`XFA - Invalid prototype reference: ${ref}.`); |
| 40262 |
return null; |
| 40263 |
} |
| 40264 |
if (proto[$nodeName] !== this[$nodeName]) { |
| 40265 |
warn(`XFA - Incompatible prototype: ${proto[$nodeName]} !== ${this[$nodeName]}.`); |
| 40266 |
return null; |
| 40267 |
} |
| 40268 |
if (ancestors.has(proto)) { |
| 40269 |
warn(`XFA - Cycle detected in prototypes use.`); |
| 40270 |
return null; |
| 40271 |
} |
| 40272 |
ancestors.add(proto); |
| 40273 |
const protoProto = proto[_getPrototype](ids, ancestors); |
| 40274 |
if (protoProto) { |
| 40275 |
proto[_applyPrototype](protoProto, ids, ancestors); |
| 40276 |
} |
| 40277 |
proto[$resolvePrototypes](ids, ancestors); |
| 40278 |
ancestors.delete(proto); |
| 40279 |
return proto; |
| 40280 |
} |
| 40281 |
[_applyPrototype](proto, ids, ancestors) { |
| 40282 |
if (ancestors.has(proto)) { |
| 40283 |
warn(`XFA - Cycle detected in prototypes use.`); |
| 40284 |
return; |
| 40285 |
} |
| 40286 |
if (!this[$content] && proto[$content]) { |
| 40287 |
this[$content] = proto[$content]; |
| 40288 |
} |
| 40289 |
const newAncestors = new Set(ancestors); |
| 40290 |
newAncestors.add(proto); |
| 40291 |
for (const unsetAttrName of this[_getUnsetAttributes](proto[_setAttributes])) { |
| 40292 |
this[unsetAttrName] = proto[unsetAttrName]; |
| 40293 |
if (this[_setAttributes]) { |
| 40294 |
this[_setAttributes].add(unsetAttrName); |
| 40295 |
} |
| 40296 |
} |
| 40297 |
for (const name of Object.getOwnPropertyNames(this)) { |
| 40298 |
if (this[_attributeNames].has(name)) { |
| 40299 |
continue; |
| 40300 |
} |
| 40301 |
const value = this[name]; |
| 40302 |
const protoValue = proto[name]; |
| 40303 |
if (value instanceof XFAObjectArray) { |
| 40304 |
for (const child of value[_children]) { |
| 40305 |
child[_resolvePrototypesHelper](ids, ancestors); |
| 40306 |
} |
| 40307 |
for (let i = value[_children].length, ii = protoValue[_children].length; i < ii; i++) { |
| 40308 |
const child = proto[_children][i][$clone](); |
| 40309 |
if (value.push(child)) { |
| 40310 |
child[_parent] = this; |
| 40311 |
this[_children].push(child); |
| 40312 |
child[_resolvePrototypesHelper](ids, ancestors); |
| 40313 |
} else { |
| 40314 |
break; |
| 40315 |
} |
| 40316 |
} |
| 40317 |
continue; |
| 40318 |
} |
| 40319 |
if (value !== null) { |
| 40320 |
value[$resolvePrototypes](ids, ancestors); |
| 40321 |
if (protoValue) { |
| 40322 |
value[_applyPrototype](protoValue, ids, ancestors); |
| 40323 |
} |
| 40324 |
continue; |
| 40325 |
} |
| 40326 |
if (protoValue !== null) { |
| 40327 |
const child = protoValue[$clone](); |
| 40328 |
child[_parent] = this; |
| 40329 |
this[name] = child; |
| 40330 |
this[_children].push(child); |
| 40331 |
child[_resolvePrototypesHelper](ids, ancestors); |
| 40332 |
} |
| 40333 |
} |
| 40334 |
} |
| 40335 |
static [_cloneAttribute](obj) { |
| 40336 |
if (Array.isArray(obj)) { |
| 40337 |
return obj.map(x => XFAObject[_cloneAttribute](x)); |
| 40338 |
} |
| 40339 |
if (typeof obj === "object" && obj !== null) { |
| 40340 |
return Object.assign({}, obj); |
| 40341 |
} |
| 40342 |
return obj; |
| 40343 |
} |
| 40344 |
[$clone]() { |
| 40345 |
const clone = Object.create(Object.getPrototypeOf(this)); |
| 40346 |
for (const $symbol of Object.getOwnPropertySymbols(this)) { |
| 40347 |
try { |
| 40348 |
clone[$symbol] = this[$symbol]; |
| 40349 |
} catch { |
| 40350 |
shadow(clone, $symbol, this[$symbol]); |
| 40351 |
} |
| 40352 |
} |
| 40353 |
clone[$uid] = `${clone[$nodeName]}${uid++}`; |
| 40354 |
clone[_children] = []; |
| 40355 |
for (const name of Object.getOwnPropertyNames(this)) { |
| 40356 |
if (this[_attributeNames].has(name)) { |
| 40357 |
clone[name] = XFAObject[_cloneAttribute](this[name]); |
| 40358 |
continue; |
| 40359 |
} |
| 40360 |
const value = this[name]; |
| 40361 |
clone[name] = value instanceof XFAObjectArray ? new XFAObjectArray(value[_max]) : null; |
| 40362 |
} |
| 40363 |
for (const child of this[_children]) { |
| 40364 |
const name = child[$nodeName]; |
| 40365 |
const clonedChild = child[$clone](); |
| 40366 |
clone[_children].push(clonedChild); |
| 40367 |
clonedChild[_parent] = clone; |
| 40368 |
if (clone[name] === null) { |
| 40369 |
clone[name] = clonedChild; |
| 40370 |
} else { |
| 40371 |
clone[name][_children].push(clonedChild); |
| 40372 |
} |
| 40373 |
} |
| 40374 |
return clone; |
| 40375 |
} |
| 40376 |
[$getChildren](name = null) { |
| 40377 |
if (!name) { |
| 40378 |
return this[_children]; |
| 40379 |
} |
| 40380 |
return this[_children].filter(c => c[$nodeName] === name); |
| 40381 |
} |
| 40382 |
[$getChildrenByClass](name) { |
| 40383 |
return this[name]; |
| 40384 |
} |
| 40385 |
[$getChildrenByName](name, allTransparent, first = true) { |
| 40386 |
return Array.from(this[$getChildrenByNameIt](name, allTransparent, first)); |
| 40387 |
} |
| 40388 |
*[$getChildrenByNameIt](name, allTransparent, first = true) { |
| 40389 |
if (name === "parent") { |
| 40390 |
yield this[_parent]; |
| 40391 |
return; |
| 40392 |
} |
| 40393 |
for (const child of this[_children]) { |
| 40394 |
if (child[$nodeName] === name) { |
| 40395 |
yield child; |
| 40396 |
} |
| 40397 |
if (child.name === name) { |
| 40398 |
yield child; |
| 40399 |
} |
| 40400 |
if (allTransparent || child[$isTransparent]()) { |
| 40401 |
yield* child[$getChildrenByNameIt](name, allTransparent, false); |
| 40402 |
} |
| 40403 |
} |
| 40404 |
if (first && this[_attributeNames].has(name)) { |
| 40405 |
yield new XFAAttribute(this, name, this[name]); |
| 40406 |
} |
| 40407 |
} |
| 40408 |
} |
| 40409 |
class XFAObjectArray { |
| 40410 |
constructor(max = Infinity) { |
| 40411 |
this[_max] = max; |
| 40412 |
this[_children] = []; |
| 40413 |
} |
| 40414 |
get isXFAObject() { |
| 40415 |
return false; |
| 40416 |
} |
| 40417 |
get isXFAObjectArray() { |
| 40418 |
return true; |
| 40419 |
} |
| 40420 |
push(child) { |
| 40421 |
const len = this[_children].length; |
| 40422 |
if (len <= this[_max]) { |
| 40423 |
this[_children].push(child); |
| 40424 |
return true; |
| 40425 |
} |
| 40426 |
warn(`XFA - node "${child[$nodeName]}" accepts no more than ${this[_max]} children`); |
| 40427 |
return false; |
| 40428 |
} |
| 40429 |
isEmpty() { |
| 40430 |
return this[_children].length === 0; |
| 40431 |
} |
| 40432 |
dump() { |
| 40433 |
return this[_children].length === 1 ? this[_children][0][$dump]() : this[_children].map(x => x[$dump]()); |
| 40434 |
} |
| 40435 |
[$clone]() { |
| 40436 |
const clone = new XFAObjectArray(this[_max]); |
| 40437 |
clone[_children] = this[_children].map(c => c[$clone]()); |
| 40438 |
return clone; |
| 40439 |
} |
| 40440 |
get children() { |
| 40441 |
return this[_children]; |
| 40442 |
} |
| 40443 |
clear() { |
| 40444 |
this[_children].length = 0; |
| 40445 |
} |
| 40446 |
} |
| 40447 |
class XFAAttribute { |
| 40448 |
constructor(node, name, value) { |
| 40449 |
this[_parent] = node; |
| 40450 |
this[$nodeName] = name; |
| 40451 |
this[$content] = value; |
| 40452 |
this[$consumed] = false; |
| 40453 |
this[$uid] = `attribute${uid++}`; |
| 40454 |
} |
| 40455 |
[$getParent]() { |
| 40456 |
return this[_parent]; |
| 40457 |
} |
| 40458 |
[$isDataValue]() { |
| 40459 |
return true; |
| 40460 |
} |
| 40461 |
[$getDataValue]() { |
| 40462 |
return this[$content].trim(); |
| 40463 |
} |
| 40464 |
[$setValue](value) { |
| 40465 |
value = value.value || ""; |
| 40466 |
this[$content] = value.toString(); |
| 40467 |
} |
| 40468 |
[$text]() { |
| 40469 |
return this[$content]; |
| 40470 |
} |
| 40471 |
[$isDescendent](parent) { |
| 40472 |
return this[_parent] === parent || this[_parent][$isDescendent](parent); |
| 40473 |
} |
| 40474 |
} |
| 40475 |
class XmlObject extends XFAObject { |
| 40476 |
constructor(nsId, name, attributes = {}) { |
| 40477 |
super(nsId, name); |
| 40478 |
this[$content] = ""; |
| 40479 |
this[_dataValue] = null; |
| 40480 |
if (name !== "#text") { |
| 40481 |
const map = new Map(); |
| 40482 |
this[_attributes] = map; |
| 40483 |
for (const [attrName, value] of Object.entries(attributes)) { |
| 40484 |
map.set(attrName, new XFAAttribute(this, attrName, value)); |
| 40485 |
} |
| 40486 |
if (attributes.hasOwnProperty($nsAttributes)) { |
| 40487 |
const dataNode = attributes[$nsAttributes].xfa.dataNode; |
| 40488 |
if (dataNode !== undefined) { |
| 40489 |
if (dataNode === "dataGroup") { |
| 40490 |
this[_dataValue] = false; |
| 40491 |
} else if (dataNode === "dataValue") { |
| 40492 |
this[_dataValue] = true; |
| 40493 |
} |
| 40494 |
} |
| 40495 |
} |
| 40496 |
} |
| 40497 |
this[$consumed] = false; |
| 40498 |
} |
| 40499 |
[$toString](buf) { |
| 40500 |
const tagName = this[$nodeName]; |
| 40501 |
if (tagName === "#text") { |
| 40502 |
buf.push(encodeToXmlString(this[$content])); |
| 40503 |
return; |
| 40504 |
} |
| 40505 |
const utf8TagName = utf8StringToString(tagName); |
| 40506 |
const prefix = this[$namespaceId] === NS_DATASETS ? "xfa:" : ""; |
| 40507 |
buf.push(`<${prefix}${utf8TagName}`); |
| 40508 |
for (const [name, value] of this[_attributes].entries()) { |
| 40509 |
const utf8Name = utf8StringToString(name); |
| 40510 |
buf.push(` ${utf8Name}="${encodeToXmlString(value[$content])}"`); |
| 40511 |
} |
| 40512 |
if (this[_dataValue] !== null) { |
| 40513 |
if (this[_dataValue]) { |
| 40514 |
buf.push(` xfa:dataNode="dataValue"`); |
| 40515 |
} else { |
| 40516 |
buf.push(` xfa:dataNode="dataGroup"`); |
| 40517 |
} |
| 40518 |
} |
| 40519 |
if (!this[$content] && this[_children].length === 0) { |
| 40520 |
buf.push("/>"); |
| 40521 |
return; |
| 40522 |
} |
| 40523 |
buf.push(">"); |
| 40524 |
if (this[$content]) { |
| 40525 |
if (typeof this[$content] === "string") { |
| 40526 |
buf.push(encodeToXmlString(this[$content])); |
| 40527 |
} else { |
| 40528 |
this[$content][$toString](buf); |
| 40529 |
} |
| 40530 |
} else { |
| 40531 |
for (const child of this[_children]) { |
| 40532 |
child[$toString](buf); |
| 40533 |
} |
| 40534 |
} |
| 40535 |
buf.push(`</${prefix}${utf8TagName}>`); |
| 40536 |
} |
| 40537 |
[$onChild](child) { |
| 40538 |
if (this[$content]) { |
| 40539 |
const node = new XmlObject(this[$namespaceId], "#text"); |
| 40540 |
this[$appendChild](node); |
| 40541 |
node[$content] = this[$content]; |
| 40542 |
this[$content] = ""; |
| 40543 |
} |
| 40544 |
this[$appendChild](child); |
| 40545 |
return true; |
| 40546 |
} |
| 40547 |
[$onText](str) { |
| 40548 |
this[$content] += str; |
| 40549 |
} |
| 40550 |
[$finalize]() { |
| 40551 |
if (this[$content] && this[_children].length > 0) { |
| 40552 |
const node = new XmlObject(this[$namespaceId], "#text"); |
| 40553 |
this[$appendChild](node); |
| 40554 |
node[$content] = this[$content]; |
| 40555 |
delete this[$content]; |
| 40556 |
} |
| 40557 |
} |
| 40558 |
[$toHTML]() { |
| 40559 |
if (this[$nodeName] === "#text") { |
| 40560 |
return HTMLResult.success({ |
| 40561 |
name: "#text", |
| 40562 |
value: this[$content] |
| 40563 |
}); |
| 40564 |
} |
| 40565 |
return HTMLResult.EMPTY; |
| 40566 |
} |
| 40567 |
[$getChildren](name = null) { |
| 40568 |
if (!name) { |
| 40569 |
return this[_children]; |
| 40570 |
} |
| 40571 |
return this[_children].filter(c => c[$nodeName] === name); |
| 40572 |
} |
| 40573 |
[$getAttributes]() { |
| 40574 |
return this[_attributes]; |
| 40575 |
} |
| 40576 |
[$getChildrenByClass](name) { |
| 40577 |
const value = this[_attributes].get(name); |
| 40578 |
if (value !== undefined) { |
| 40579 |
return value; |
| 40580 |
} |
| 40581 |
return this[$getChildren](name); |
| 40582 |
} |
| 40583 |
*[$getChildrenByNameIt](name, allTransparent) { |
| 40584 |
const value = this[_attributes].get(name); |
| 40585 |
if (value) { |
| 40586 |
yield value; |
| 40587 |
} |
| 40588 |
for (const child of this[_children]) { |
| 40589 |
if (child[$nodeName] === name) { |
| 40590 |
yield child; |
| 40591 |
} |
| 40592 |
if (allTransparent) { |
| 40593 |
yield* child[$getChildrenByNameIt](name, allTransparent); |
| 40594 |
} |
| 40595 |
} |
| 40596 |
} |
| 40597 |
*[$getAttributeIt](name, skipConsumed) { |
| 40598 |
const value = this[_attributes].get(name); |
| 40599 |
if (value && (!skipConsumed || !value[$consumed])) { |
| 40600 |
yield value; |
| 40601 |
} |
| 40602 |
for (const child of this[_children]) { |
| 40603 |
yield* child[$getAttributeIt](name, skipConsumed); |
| 40604 |
} |
| 40605 |
} |
| 40606 |
*[$getRealChildrenByNameIt](name, allTransparent, skipConsumed) { |
| 40607 |
for (const child of this[_children]) { |
| 40608 |
if (child[$nodeName] === name && (!skipConsumed || !child[$consumed])) { |
| 40609 |
yield child; |
| 40610 |
} |
| 40611 |
if (allTransparent) { |
| 40612 |
yield* child[$getRealChildrenByNameIt](name, allTransparent, skipConsumed); |
| 40613 |
} |
| 40614 |
} |
| 40615 |
} |
| 40616 |
[$isDataValue]() { |
| 40617 |
if (this[_dataValue] === null) { |
| 40618 |
return this[_children].length === 0 || this[_children][0][$namespaceId] === NamespaceIds.xhtml.id; |
| 40619 |
} |
| 40620 |
return this[_dataValue]; |
| 40621 |
} |
| 40622 |
[$getDataValue]() { |
| 40623 |
if (this[_dataValue] === null) { |
| 40624 |
if (this[_children].length === 0) { |
| 40625 |
return this[$content].trim(); |
| 40626 |
} |
| 40627 |
if (this[_children][0][$namespaceId] === NamespaceIds.xhtml.id) { |
| 40628 |
return this[_children][0][$text]().trim(); |
| 40629 |
} |
| 40630 |
return null; |
| 40631 |
} |
| 40632 |
return this[$content].trim(); |
| 40633 |
} |
| 40634 |
[$setValue](value) { |
| 40635 |
value = value.value || ""; |
| 40636 |
this[$content] = value.toString(); |
| 40637 |
} |
| 40638 |
[$dump](hasNS = false) { |
| 40639 |
const dumped = Object.create(null); |
| 40640 |
if (hasNS) { |
| 40641 |
dumped.$ns = this[$namespaceId]; |
| 40642 |
} |
| 40643 |
if (this[$content]) { |
| 40644 |
dumped.$content = this[$content]; |
| 40645 |
} |
| 40646 |
dumped.$name = this[$nodeName]; |
| 40647 |
dumped.children = []; |
| 40648 |
for (const child of this[_children]) { |
| 40649 |
dumped.children.push(child[$dump](hasNS)); |
| 40650 |
} |
| 40651 |
dumped.attributes = Object.create(null); |
| 40652 |
for (const [name, value] of this[_attributes]) { |
| 40653 |
dumped.attributes[name] = value[$content]; |
| 40654 |
} |
| 40655 |
return dumped; |
| 40656 |
} |
| 40657 |
} |
| 40658 |
class ContentObject extends XFAObject { |
| 40659 |
constructor(nsId, name) { |
| 40660 |
super(nsId, name); |
| 40661 |
this[$content] = ""; |
| 40662 |
} |
| 40663 |
[$onText](text) { |
| 40664 |
this[$content] += text; |
| 40665 |
} |
| 40666 |
[$finalize]() {} |
| 40667 |
} |
| 40668 |
class OptionObject extends ContentObject { |
| 40669 |
constructor(nsId, name, options) { |
| 40670 |
super(nsId, name); |
| 40671 |
this[_options] = options; |
| 40672 |
} |
| 40673 |
[$finalize]() { |
| 40674 |
this[$content] = getKeyword({ |
| 40675 |
data: this[$content], |
| 40676 |
defaultValue: this[_options][0], |
| 40677 |
validate: k => this[_options].includes(k) |
| 40678 |
}); |
| 40679 |
} |
| 40680 |
[$clean](builder) { |
| 40681 |
super[$clean](builder); |
| 40682 |
delete this[_options]; |
| 40683 |
} |
| 40684 |
} |
| 40685 |
class StringObject extends ContentObject { |
| 40686 |
[$finalize]() { |
| 40687 |
this[$content] = this[$content].trim(); |
| 40688 |
} |
| 40689 |
} |
| 40690 |
class IntegerObject extends ContentObject { |
| 40691 |
constructor(nsId, name, defaultValue, validator) { |
| 40692 |
super(nsId, name); |
| 40693 |
this[_defaultValue] = defaultValue; |
| 40694 |
this[_validator] = validator; |
| 40695 |
} |
| 40696 |
[$finalize]() { |
| 40697 |
this[$content] = getInteger({ |
| 40698 |
data: this[$content], |
| 40699 |
defaultValue: this[_defaultValue], |
| 40700 |
validate: this[_validator] |
| 40701 |
}); |
| 40702 |
} |
| 40703 |
[$clean](builder) { |
| 40704 |
super[$clean](builder); |
| 40705 |
delete this[_defaultValue]; |
| 40706 |
delete this[_validator]; |
| 40707 |
} |
| 40708 |
} |
| 40709 |
class Option01 extends IntegerObject { |
| 40710 |
constructor(nsId, name) { |
| 40711 |
super(nsId, name, 0, n => n === 1); |
| 40712 |
} |
| 40713 |
} |
| 40714 |
class Option10 extends IntegerObject { |
| 40715 |
constructor(nsId, name) { |
| 40716 |
super(nsId, name, 1, n => n === 0); |
| 40717 |
} |
| 40718 |
} |
| 40719 |
|
| 40720 |
;// ./src/core/xfa/html_utils.js |
| 40721 |
|
| 40722 |
|
| 40723 |
|
| 40724 |
|
| 40725 |
|
| 40726 |
|
| 40727 |
function measureToString(m) { |
| 40728 |
if (typeof m === "string") { |
| 40729 |
return "0px"; |
| 40730 |
} |
| 40731 |
return Number.isInteger(m) ? `${m}px` : `${m.toFixed(2)}px`; |
| 40732 |
} |
| 40733 |
const converters = { |
| 40734 |
anchorType(node, style) { |
| 40735 |
const parent = node[$getSubformParent](); |
| 40736 |
if (!parent || parent.layout && parent.layout !== "position") { |
| 40737 |
return; |
| 40738 |
} |
| 40739 |
if (!("transform" in style)) { |
| 40740 |
style.transform = ""; |
| 40741 |
} |
| 40742 |
switch (node.anchorType) { |
| 40743 |
case "bottomCenter": |
| 40744 |
style.transform += "translate(-50%, -100%)"; |
| 40745 |
break; |
| 40746 |
case "bottomLeft": |
| 40747 |
style.transform += "translate(0,-100%)"; |
| 40748 |
break; |
| 40749 |
case "bottomRight": |
| 40750 |
style.transform += "translate(-100%,-100%)"; |
| 40751 |
break; |
| 40752 |
case "middleCenter": |
| 40753 |
style.transform += "translate(-50%,-50%)"; |
| 40754 |
break; |
| 40755 |
case "middleLeft": |
| 40756 |
style.transform += "translate(0,-50%)"; |
| 40757 |
break; |
| 40758 |
case "middleRight": |
| 40759 |
style.transform += "translate(-100%,-50%)"; |
| 40760 |
break; |
| 40761 |
case "topCenter": |
| 40762 |
style.transform += "translate(-50%,0)"; |
| 40763 |
break; |
| 40764 |
case "topRight": |
| 40765 |
style.transform += "translate(-100%,0)"; |
| 40766 |
break; |
| 40767 |
} |
| 40768 |
}, |
| 40769 |
dimensions(node, style) { |
| 40770 |
const parent = node[$getSubformParent](); |
| 40771 |
let width = node.w; |
| 40772 |
const height = node.h; |
| 40773 |
if (parent.layout?.includes("row")) { |
| 40774 |
const extra = parent[$extra]; |
| 40775 |
const colSpan = node.colSpan; |
| 40776 |
let w; |
| 40777 |
if (colSpan === -1) { |
| 40778 |
w = extra.columnWidths.slice(extra.currentColumn).reduce((a, x) => a + x, 0); |
| 40779 |
extra.currentColumn = 0; |
| 40780 |
} else { |
| 40781 |
w = extra.columnWidths.slice(extra.currentColumn, extra.currentColumn + colSpan).reduce((a, x) => a + x, 0); |
| 40782 |
extra.currentColumn = (extra.currentColumn + node.colSpan) % extra.columnWidths.length; |
| 40783 |
} |
| 40784 |
if (!isNaN(w)) { |
| 40785 |
width = node.w = w; |
| 40786 |
} |
| 40787 |
} |
| 40788 |
style.width = width !== "" ? measureToString(width) : "auto"; |
| 40789 |
style.height = height !== "" ? measureToString(height) : "auto"; |
| 40790 |
}, |
| 40791 |
position(node, style) { |
| 40792 |
const parent = node[$getSubformParent](); |
| 40793 |
if (parent?.layout && parent.layout !== "position") { |
| 40794 |
return; |
| 40795 |
} |
| 40796 |
style.position = "absolute"; |
| 40797 |
style.left = measureToString(node.x); |
| 40798 |
style.top = measureToString(node.y); |
| 40799 |
}, |
| 40800 |
rotate(node, style) { |
| 40801 |
if (node.rotate) { |
| 40802 |
if (!("transform" in style)) { |
| 40803 |
style.transform = ""; |
| 40804 |
} |
| 40805 |
style.transform += `rotate(-${node.rotate}deg)`; |
| 40806 |
style.transformOrigin = "top left"; |
| 40807 |
} |
| 40808 |
}, |
| 40809 |
presence(node, style) { |
| 40810 |
switch (node.presence) { |
| 40811 |
case "invisible": |
| 40812 |
style.visibility = "hidden"; |
| 40813 |
break; |
| 40814 |
case "hidden": |
| 40815 |
case "inactive": |
| 40816 |
style.display = "none"; |
| 40817 |
break; |
| 40818 |
} |
| 40819 |
}, |
| 40820 |
hAlign(node, style) { |
| 40821 |
if (node[$nodeName] === "para") { |
| 40822 |
switch (node.hAlign) { |
| 40823 |
case "justifyAll": |
| 40824 |
style.textAlign = "justify-all"; |
| 40825 |
break; |
| 40826 |
case "radix": |
| 40827 |
style.textAlign = "left"; |
| 40828 |
break; |
| 40829 |
default: |
| 40830 |
style.textAlign = node.hAlign; |
| 40831 |
} |
| 40832 |
} else { |
| 40833 |
switch (node.hAlign) { |
| 40834 |
case "left": |
| 40835 |
style.alignSelf = "start"; |
| 40836 |
break; |
| 40837 |
case "center": |
| 40838 |
style.alignSelf = "center"; |
| 40839 |
break; |
| 40840 |
case "right": |
| 40841 |
style.alignSelf = "end"; |
| 40842 |
break; |
| 40843 |
} |
| 40844 |
} |
| 40845 |
}, |
| 40846 |
margin(node, style) { |
| 40847 |
if (node.margin) { |
| 40848 |
style.margin = node.margin[$toStyle]().margin; |
| 40849 |
} |
| 40850 |
} |
| 40851 |
}; |
| 40852 |
function setMinMaxDimensions(node, style) { |
| 40853 |
const parent = node[$getSubformParent](); |
| 40854 |
if (parent.layout === "position") { |
| 40855 |
if (node.minW > 0) { |
| 40856 |
style.minWidth = measureToString(node.minW); |
| 40857 |
} |
| 40858 |
if (node.maxW > 0) { |
| 40859 |
style.maxWidth = measureToString(node.maxW); |
| 40860 |
} |
| 40861 |
if (node.minH > 0) { |
| 40862 |
style.minHeight = measureToString(node.minH); |
| 40863 |
} |
| 40864 |
if (node.maxH > 0) { |
| 40865 |
style.maxHeight = measureToString(node.maxH); |
| 40866 |
} |
| 40867 |
} |
| 40868 |
} |
| 40869 |
function layoutText(text, xfaFont, margin, lineHeight, fontFinder, width) { |
| 40870 |
const measure = new TextMeasure(xfaFont, margin, lineHeight, fontFinder); |
| 40871 |
if (typeof text === "string") { |
| 40872 |
measure.addString(text); |
| 40873 |
} else { |
| 40874 |
text[$pushGlyphs](measure); |
| 40875 |
} |
| 40876 |
return measure.compute(width); |
| 40877 |
} |
| 40878 |
function layoutNode(node, availableSpace) { |
| 40879 |
let height = null; |
| 40880 |
let width = null; |
| 40881 |
let isBroken = false; |
| 40882 |
if ((!node.w || !node.h) && node.value) { |
| 40883 |
let marginH = 0; |
| 40884 |
let marginV = 0; |
| 40885 |
if (node.margin) { |
| 40886 |
marginH = node.margin.leftInset + node.margin.rightInset; |
| 40887 |
marginV = node.margin.topInset + node.margin.bottomInset; |
| 40888 |
} |
| 40889 |
let lineHeight = null; |
| 40890 |
let margin = null; |
| 40891 |
if (node.para) { |
| 40892 |
margin = Object.create(null); |
| 40893 |
lineHeight = node.para.lineHeight === "" ? null : node.para.lineHeight; |
| 40894 |
margin.top = node.para.spaceAbove === "" ? 0 : node.para.spaceAbove; |
| 40895 |
margin.bottom = node.para.spaceBelow === "" ? 0 : node.para.spaceBelow; |
| 40896 |
margin.left = node.para.marginLeft === "" ? 0 : node.para.marginLeft; |
| 40897 |
margin.right = node.para.marginRight === "" ? 0 : node.para.marginRight; |
| 40898 |
} |
| 40899 |
let font = node.font; |
| 40900 |
if (!font) { |
| 40901 |
const root = node[$getTemplateRoot](); |
| 40902 |
let parent = node[$getParent](); |
| 40903 |
while (parent && parent !== root) { |
| 40904 |
if (parent.font) { |
| 40905 |
font = parent.font; |
| 40906 |
break; |
| 40907 |
} |
| 40908 |
parent = parent[$getParent](); |
| 40909 |
} |
| 40910 |
} |
| 40911 |
const maxWidth = (node.w || availableSpace.width) - marginH; |
| 40912 |
const fontFinder = node[$globalData].fontFinder; |
| 40913 |
if (node.value.exData && node.value.exData[$content] && node.value.exData.contentType === "text/html") { |
| 40914 |
const res = layoutText(node.value.exData[$content], font, margin, lineHeight, fontFinder, maxWidth); |
| 40915 |
width = res.width; |
| 40916 |
height = res.height; |
| 40917 |
isBroken = res.isBroken; |
| 40918 |
} else { |
| 40919 |
const text = node.value[$text](); |
| 40920 |
if (text) { |
| 40921 |
const res = layoutText(text, font, margin, lineHeight, fontFinder, maxWidth); |
| 40922 |
width = res.width; |
| 40923 |
height = res.height; |
| 40924 |
isBroken = res.isBroken; |
| 40925 |
} |
| 40926 |
} |
| 40927 |
if (width !== null && !node.w) { |
| 40928 |
width += marginH; |
| 40929 |
} |
| 40930 |
if (height !== null && !node.h) { |
| 40931 |
height += marginV; |
| 40932 |
} |
| 40933 |
} |
| 40934 |
return { |
| 40935 |
w: width, |
| 40936 |
h: height, |
| 40937 |
isBroken |
| 40938 |
}; |
| 40939 |
} |
| 40940 |
function computeBbox(node, html, availableSpace) { |
| 40941 |
let bbox; |
| 40942 |
if (node.w !== "" && node.h !== "") { |
| 40943 |
bbox = [node.x, node.y, node.w, node.h]; |
| 40944 |
} else { |
| 40945 |
if (!availableSpace) { |
| 40946 |
return null; |
| 40947 |
} |
| 40948 |
let width = node.w; |
| 40949 |
if (width === "") { |
| 40950 |
if (node.maxW === 0) { |
| 40951 |
const parent = node[$getSubformParent](); |
| 40952 |
width = parent.layout === "position" && parent.w !== "" ? 0 : node.minW; |
| 40953 |
} else { |
| 40954 |
width = Math.min(node.maxW, availableSpace.width); |
| 40955 |
} |
| 40956 |
html.attributes.style.width = measureToString(width); |
| 40957 |
} |
| 40958 |
let height = node.h; |
| 40959 |
if (height === "") { |
| 40960 |
if (node.maxH === 0) { |
| 40961 |
const parent = node[$getSubformParent](); |
| 40962 |
height = parent.layout === "position" && parent.h !== "" ? 0 : node.minH; |
| 40963 |
} else { |
| 40964 |
height = Math.min(node.maxH, availableSpace.height); |
| 40965 |
} |
| 40966 |
html.attributes.style.height = measureToString(height); |
| 40967 |
} |
| 40968 |
bbox = [node.x, node.y, width, height]; |
| 40969 |
} |
| 40970 |
return bbox; |
| 40971 |
} |
| 40972 |
function fixDimensions(node) { |
| 40973 |
const parent = node[$getSubformParent](); |
| 40974 |
if (parent.layout?.includes("row")) { |
| 40975 |
const extra = parent[$extra]; |
| 40976 |
const colSpan = node.colSpan; |
| 40977 |
let width; |
| 40978 |
if (colSpan === -1) { |
| 40979 |
width = extra.columnWidths.slice(extra.currentColumn).reduce((a, w) => a + w, 0); |
| 40980 |
} else { |
| 40981 |
width = extra.columnWidths.slice(extra.currentColumn, extra.currentColumn + colSpan).reduce((a, w) => a + w, 0); |
| 40982 |
} |
| 40983 |
if (!isNaN(width)) { |
| 40984 |
node.w = width; |
| 40985 |
} |
| 40986 |
} |
| 40987 |
if (parent.layout && parent.layout !== "position") { |
| 40988 |
node.x = node.y = 0; |
| 40989 |
} |
| 40990 |
if (node.layout === "table") { |
| 40991 |
if (node.w === "" && Array.isArray(node.columnWidths)) { |
| 40992 |
node.w = node.columnWidths.reduce((a, x) => a + x, 0); |
| 40993 |
} |
| 40994 |
} |
| 40995 |
} |
| 40996 |
function layoutClass(node) { |
| 40997 |
switch (node.layout) { |
| 40998 |
case "position": |
| 40999 |
return "xfaPosition"; |
| 41000 |
case "lr-tb": |
| 41001 |
return "xfaLrTb"; |
| 41002 |
case "rl-row": |
| 41003 |
return "xfaRlRow"; |
| 41004 |
case "rl-tb": |
| 41005 |
return "xfaRlTb"; |
| 41006 |
case "row": |
| 41007 |
return "xfaRow"; |
| 41008 |
case "table": |
| 41009 |
return "xfaTable"; |
| 41010 |
case "tb": |
| 41011 |
return "xfaTb"; |
| 41012 |
default: |
| 41013 |
return "xfaPosition"; |
| 41014 |
} |
| 41015 |
} |
| 41016 |
function toStyle(node, ...names) { |
| 41017 |
const style = Object.create(null); |
| 41018 |
for (const name of names) { |
| 41019 |
const value = node[name]; |
| 41020 |
if (value === null) { |
| 41021 |
continue; |
| 41022 |
} |
| 41023 |
if (converters.hasOwnProperty(name)) { |
| 41024 |
converters[name](node, style); |
| 41025 |
continue; |
| 41026 |
} |
| 41027 |
if (value instanceof XFAObject) { |
| 41028 |
const newStyle = value[$toStyle](); |
| 41029 |
if (newStyle) { |
| 41030 |
Object.assign(style, newStyle); |
| 41031 |
} else { |
| 41032 |
warn(`(DEBUG) - XFA - style for ${name} not implemented yet`); |
| 41033 |
} |
| 41034 |
} |
| 41035 |
} |
| 41036 |
return style; |
| 41037 |
} |
| 41038 |
function createWrapper(node, html) { |
| 41039 |
const { |
| 41040 |
attributes |
| 41041 |
} = html; |
| 41042 |
const { |
| 41043 |
style |
| 41044 |
} = attributes; |
| 41045 |
const wrapper = { |
| 41046 |
name: "div", |
| 41047 |
attributes: { |
| 41048 |
class: ["xfaWrapper"], |
| 41049 |
style: Object.create(null) |
| 41050 |
}, |
| 41051 |
children: [] |
| 41052 |
}; |
| 41053 |
attributes.class.push("xfaWrapped"); |
| 41054 |
if (node.border) { |
| 41055 |
const { |
| 41056 |
widths, |
| 41057 |
insets |
| 41058 |
} = node.border[$extra]; |
| 41059 |
let width, height; |
| 41060 |
let top = insets[0]; |
| 41061 |
let left = insets[3]; |
| 41062 |
const insetsH = insets[0] + insets[2]; |
| 41063 |
const insetsW = insets[1] + insets[3]; |
| 41064 |
switch (node.border.hand) { |
| 41065 |
case "even": |
| 41066 |
top -= widths[0] / 2; |
| 41067 |
left -= widths[3] / 2; |
| 41068 |
width = `calc(100% + ${(widths[1] + widths[3]) / 2 - insetsW}px)`; |
| 41069 |
height = `calc(100% + ${(widths[0] + widths[2]) / 2 - insetsH}px)`; |
| 41070 |
break; |
| 41071 |
case "left": |
| 41072 |
top -= widths[0]; |
| 41073 |
left -= widths[3]; |
| 41074 |
width = `calc(100% + ${widths[1] + widths[3] - insetsW}px)`; |
| 41075 |
height = `calc(100% + ${widths[0] + widths[2] - insetsH}px)`; |
| 41076 |
break; |
| 41077 |
case "right": |
| 41078 |
width = insetsW ? `calc(100% - ${insetsW}px)` : "100%"; |
| 41079 |
height = insetsH ? `calc(100% - ${insetsH}px)` : "100%"; |
| 41080 |
break; |
| 41081 |
} |
| 41082 |
const classNames = ["xfaBorder"]; |
| 41083 |
if (isPrintOnly(node.border)) { |
| 41084 |
classNames.push("xfaPrintOnly"); |
| 41085 |
} |
| 41086 |
const border = { |
| 41087 |
name: "div", |
| 41088 |
attributes: { |
| 41089 |
class: classNames, |
| 41090 |
style: { |
| 41091 |
top: `${top}px`, |
| 41092 |
left: `${left}px`, |
| 41093 |
width, |
| 41094 |
height |
| 41095 |
} |
| 41096 |
}, |
| 41097 |
children: [] |
| 41098 |
}; |
| 41099 |
for (const key of ["border", "borderWidth", "borderColor", "borderRadius", "borderStyle"]) { |
| 41100 |
if (style[key] !== undefined) { |
| 41101 |
border.attributes.style[key] = style[key]; |
| 41102 |
delete style[key]; |
| 41103 |
} |
| 41104 |
} |
| 41105 |
wrapper.children.push(border, html); |
| 41106 |
} else { |
| 41107 |
wrapper.children.push(html); |
| 41108 |
} |
| 41109 |
for (const key of ["background", "backgroundClip", "top", "left", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "transform", "transformOrigin", "visibility"]) { |
| 41110 |
if (style[key] !== undefined) { |
| 41111 |
wrapper.attributes.style[key] = style[key]; |
| 41112 |
delete style[key]; |
| 41113 |
} |
| 41114 |
} |
| 41115 |
wrapper.attributes.style.position = style.position === "absolute" ? "absolute" : "relative"; |
| 41116 |
delete style.position; |
| 41117 |
if (style.alignSelf) { |
| 41118 |
wrapper.attributes.style.alignSelf = style.alignSelf; |
| 41119 |
delete style.alignSelf; |
| 41120 |
} |
| 41121 |
return wrapper; |
| 41122 |
} |
| 41123 |
function fixTextIndent(styles) { |
| 41124 |
const indent = getMeasurement(styles.textIndent, "0px"); |
| 41125 |
if (indent >= 0) { |
| 41126 |
return; |
| 41127 |
} |
| 41128 |
const align = styles.textAlign === "right" ? "right" : "left"; |
| 41129 |
const name = "padding" + (align === "left" ? "Left" : "Right"); |
| 41130 |
const padding = getMeasurement(styles[name], "0px"); |
| 41131 |
styles[name] = `${padding - indent}px`; |
| 41132 |
} |
| 41133 |
function setAccess(node, classNames) { |
| 41134 |
switch (node.access) { |
| 41135 |
case "nonInteractive": |
| 41136 |
classNames.push("xfaNonInteractive"); |
| 41137 |
break; |
| 41138 |
case "readOnly": |
| 41139 |
classNames.push("xfaReadOnly"); |
| 41140 |
break; |
| 41141 |
case "protected": |
| 41142 |
classNames.push("xfaDisabled"); |
| 41143 |
break; |
| 41144 |
} |
| 41145 |
} |
| 41146 |
function isPrintOnly(node) { |
| 41147 |
return node.relevant.length > 0 && !node.relevant[0].excluded && node.relevant[0].viewname === "print"; |
| 41148 |
} |
| 41149 |
function getCurrentPara(node) { |
| 41150 |
const stack = node[$getTemplateRoot]()[$extra].paraStack; |
| 41151 |
return stack.length ? stack.at(-1) : null; |
| 41152 |
} |
| 41153 |
function setPara(node, nodeStyle, value) { |
| 41154 |
if (value.attributes.class?.includes("xfaRich")) { |
| 41155 |
if (nodeStyle) { |
| 41156 |
if (node.h === "") { |
| 41157 |
nodeStyle.height = "auto"; |
| 41158 |
} |
| 41159 |
if (node.w === "") { |
| 41160 |
nodeStyle.width = "auto"; |
| 41161 |
} |
| 41162 |
} |
| 41163 |
const para = getCurrentPara(node); |
| 41164 |
if (para) { |
| 41165 |
const valueStyle = value.attributes.style; |
| 41166 |
valueStyle.display = "flex"; |
| 41167 |
valueStyle.flexDirection = "column"; |
| 41168 |
switch (para.vAlign) { |
| 41169 |
case "top": |
| 41170 |
valueStyle.justifyContent = "start"; |
| 41171 |
break; |
| 41172 |
case "bottom": |
| 41173 |
valueStyle.justifyContent = "end"; |
| 41174 |
break; |
| 41175 |
case "middle": |
| 41176 |
valueStyle.justifyContent = "center"; |
| 41177 |
break; |
| 41178 |
} |
| 41179 |
const paraStyle = para[$toStyle](); |
| 41180 |
for (const [key, val] of Object.entries(paraStyle)) { |
| 41181 |
if (!(key in valueStyle)) { |
| 41182 |
valueStyle[key] = val; |
| 41183 |
} |
| 41184 |
} |
| 41185 |
} |
| 41186 |
} |
| 41187 |
} |
| 41188 |
function setFontFamily(xfaFont, node, fontFinder, style) { |
| 41189 |
if (!fontFinder) { |
| 41190 |
delete style.fontFamily; |
| 41191 |
return; |
| 41192 |
} |
| 41193 |
const name = stripQuotes(xfaFont.typeface); |
| 41194 |
style.fontFamily = `"${name}"`; |
| 41195 |
const typeface = fontFinder.find(name); |
| 41196 |
if (typeface) { |
| 41197 |
const { |
| 41198 |
fontFamily |
| 41199 |
} = typeface.regular.cssFontInfo; |
| 41200 |
if (fontFamily !== name) { |
| 41201 |
style.fontFamily = `"${fontFamily}"`; |
| 41202 |
} |
| 41203 |
const para = getCurrentPara(node); |
| 41204 |
if (para && para.lineHeight !== "") { |
| 41205 |
return; |
| 41206 |
} |
| 41207 |
if (style.lineHeight) { |
| 41208 |
return; |
| 41209 |
} |
| 41210 |
const pdfFont = selectFont(xfaFont, typeface); |
| 41211 |
if (pdfFont) { |
| 41212 |
style.lineHeight = Math.max(1.2, pdfFont.lineHeight); |
| 41213 |
} |
| 41214 |
} |
| 41215 |
} |
| 41216 |
function fixURL(str) { |
| 41217 |
const absoluteUrl = createValidAbsoluteUrl(str, null, { |
| 41218 |
addDefaultProtocol: true, |
| 41219 |
tryConvertEncoding: true |
| 41220 |
}); |
| 41221 |
return absoluteUrl ? absoluteUrl.href : null; |
| 41222 |
} |
| 41223 |
|
| 41224 |
;// ./src/core/xfa/layout.js |
| 41225 |
|
| 41226 |
|
| 41227 |
function createLine(node, children) { |
| 41228 |
return { |
| 41229 |
name: "div", |
| 41230 |
attributes: { |
| 41231 |
class: [node.layout === "lr-tb" ? "xfaLr" : "xfaRl"] |
| 41232 |
}, |
| 41233 |
children |
| 41234 |
}; |
| 41235 |
} |
| 41236 |
function flushHTML(node) { |
| 41237 |
if (!node[$extra]) { |
| 41238 |
return null; |
| 41239 |
} |
| 41240 |
const attributes = node[$extra].attributes; |
| 41241 |
const html = { |
| 41242 |
name: "div", |
| 41243 |
attributes, |
| 41244 |
children: node[$extra].children |
| 41245 |
}; |
| 41246 |
if (node[$extra].failingNode) { |
| 41247 |
const htmlFromFailing = node[$extra].failingNode[$flushHTML](); |
| 41248 |
if (htmlFromFailing) { |
| 41249 |
if (node.layout.endsWith("-tb")) { |
| 41250 |
html.children.push(createLine(node, [htmlFromFailing])); |
| 41251 |
} else { |
| 41252 |
html.children.push(htmlFromFailing); |
| 41253 |
} |
| 41254 |
} |
| 41255 |
} |
| 41256 |
if (html.children.length === 0) { |
| 41257 |
return null; |
| 41258 |
} |
| 41259 |
return html; |
| 41260 |
} |
| 41261 |
function addHTML(node, html, bbox) { |
| 41262 |
const extra = node[$extra]; |
| 41263 |
const availableSpace = extra.availableSpace; |
| 41264 |
const [x, y, w, h] = bbox; |
| 41265 |
switch (node.layout) { |
| 41266 |
case "position": |
| 41267 |
{ |
| 41268 |
extra.width = Math.max(extra.width, x + w); |
| 41269 |
extra.height = Math.max(extra.height, y + h); |
| 41270 |
extra.children.push(html); |
| 41271 |
break; |
| 41272 |
} |
| 41273 |
case "lr-tb": |
| 41274 |
case "rl-tb": |
| 41275 |
if (!extra.line || extra.attempt === 1) { |
| 41276 |
extra.line = createLine(node, []); |
| 41277 |
extra.children.push(extra.line); |
| 41278 |
extra.numberInLine = 0; |
| 41279 |
} |
| 41280 |
extra.numberInLine += 1; |
| 41281 |
extra.line.children.push(html); |
| 41282 |
if (extra.attempt === 0) { |
| 41283 |
extra.currentWidth += w; |
| 41284 |
extra.height = Math.max(extra.height, extra.prevHeight + h); |
| 41285 |
} else { |
| 41286 |
extra.currentWidth = w; |
| 41287 |
extra.prevHeight = extra.height; |
| 41288 |
extra.height += h; |
| 41289 |
extra.attempt = 0; |
| 41290 |
} |
| 41291 |
extra.width = Math.max(extra.width, extra.currentWidth); |
| 41292 |
break; |
| 41293 |
case "rl-row": |
| 41294 |
case "row": |
| 41295 |
{ |
| 41296 |
extra.children.push(html); |
| 41297 |
extra.width += w; |
| 41298 |
extra.height = Math.max(extra.height, h); |
| 41299 |
const height = measureToString(extra.height); |
| 41300 |
for (const child of extra.children) { |
| 41301 |
child.attributes.style.height = height; |
| 41302 |
} |
| 41303 |
break; |
| 41304 |
} |
| 41305 |
case "table": |
| 41306 |
{ |
| 41307 |
extra.width = Math.min(availableSpace.width, Math.max(extra.width, w)); |
| 41308 |
extra.height += h; |
| 41309 |
extra.children.push(html); |
| 41310 |
break; |
| 41311 |
} |
| 41312 |
case "tb": |
| 41313 |
{ |
| 41314 |
extra.width = Math.min(availableSpace.width, Math.max(extra.width, w)); |
| 41315 |
extra.height += h; |
| 41316 |
extra.children.push(html); |
| 41317 |
break; |
| 41318 |
} |
| 41319 |
} |
| 41320 |
} |
| 41321 |
function getAvailableSpace(node) { |
| 41322 |
const availableSpace = node[$extra].availableSpace; |
| 41323 |
const marginV = node.margin ? node.margin.topInset + node.margin.bottomInset : 0; |
| 41324 |
const marginH = node.margin ? node.margin.leftInset + node.margin.rightInset : 0; |
| 41325 |
switch (node.layout) { |
| 41326 |
case "lr-tb": |
| 41327 |
case "rl-tb": |
| 41328 |
if (node[$extra].attempt === 0) { |
| 41329 |
return { |
| 41330 |
width: availableSpace.width - marginH - node[$extra].currentWidth, |
| 41331 |
height: availableSpace.height - marginV - node[$extra].prevHeight |
| 41332 |
}; |
| 41333 |
} |
| 41334 |
return { |
| 41335 |
width: availableSpace.width - marginH, |
| 41336 |
height: availableSpace.height - marginV - node[$extra].height |
| 41337 |
}; |
| 41338 |
case "rl-row": |
| 41339 |
case "row": |
| 41340 |
const width = node[$extra].columnWidths.slice(node[$extra].currentColumn).reduce((a, x) => a + x); |
| 41341 |
return { |
| 41342 |
width, |
| 41343 |
height: availableSpace.height - marginH |
| 41344 |
}; |
| 41345 |
case "table": |
| 41346 |
case "tb": |
| 41347 |
return { |
| 41348 |
width: availableSpace.width - marginH, |
| 41349 |
height: availableSpace.height - marginV - node[$extra].height |
| 41350 |
}; |
| 41351 |
case "position": |
| 41352 |
default: |
| 41353 |
return availableSpace; |
| 41354 |
} |
| 41355 |
} |
| 41356 |
function getTransformedBBox(node) { |
| 41357 |
let w = node.w === "" ? NaN : node.w; |
| 41358 |
let h = node.h === "" ? NaN : node.h; |
| 41359 |
let [centerX, centerY] = [0, 0]; |
| 41360 |
switch (node.anchorType || "") { |
| 41361 |
case "bottomCenter": |
| 41362 |
[centerX, centerY] = [w / 2, h]; |
| 41363 |
break; |
| 41364 |
case "bottomLeft": |
| 41365 |
[centerX, centerY] = [0, h]; |
| 41366 |
break; |
| 41367 |
case "bottomRight": |
| 41368 |
[centerX, centerY] = [w, h]; |
| 41369 |
break; |
| 41370 |
case "middleCenter": |
| 41371 |
[centerX, centerY] = [w / 2, h / 2]; |
| 41372 |
break; |
| 41373 |
case "middleLeft": |
| 41374 |
[centerX, centerY] = [0, h / 2]; |
| 41375 |
break; |
| 41376 |
case "middleRight": |
| 41377 |
[centerX, centerY] = [w, h / 2]; |
| 41378 |
break; |
| 41379 |
case "topCenter": |
| 41380 |
[centerX, centerY] = [w / 2, 0]; |
| 41381 |
break; |
| 41382 |
case "topRight": |
| 41383 |
[centerX, centerY] = [w, 0]; |
| 41384 |
break; |
| 41385 |
} |
| 41386 |
let x, y; |
| 41387 |
switch (node.rotate || 0) { |
| 41388 |
case 0: |
| 41389 |
[x, y] = [-centerX, -centerY]; |
| 41390 |
break; |
| 41391 |
case 90: |
| 41392 |
[x, y] = [-centerY, centerX]; |
| 41393 |
[w, h] = [h, -w]; |
| 41394 |
break; |
| 41395 |
case 180: |
| 41396 |
[x, y] = [centerX, centerY]; |
| 41397 |
[w, h] = [-w, -h]; |
| 41398 |
break; |
| 41399 |
case 270: |
| 41400 |
[x, y] = [centerY, -centerX]; |
| 41401 |
[w, h] = [-h, w]; |
| 41402 |
break; |
| 41403 |
} |
| 41404 |
return [node.x + x + Math.min(0, w), node.y + y + Math.min(0, h), Math.abs(w), Math.abs(h)]; |
| 41405 |
} |
| 41406 |
function checkDimensions(node, space) { |
| 41407 |
if (node[$getTemplateRoot]()[$extra].firstUnsplittable === null) { |
| 41408 |
return true; |
| 41409 |
} |
| 41410 |
if (node.w === 0 || node.h === 0) { |
| 41411 |
return true; |
| 41412 |
} |
| 41413 |
const ERROR = 2; |
| 41414 |
const parent = node[$getSubformParent](); |
| 41415 |
const attempt = parent[$extra]?.attempt || 0; |
| 41416 |
const [, y, w, h] = getTransformedBBox(node); |
| 41417 |
switch (parent.layout) { |
| 41418 |
case "lr-tb": |
| 41419 |
case "rl-tb": |
| 41420 |
if (attempt === 0) { |
| 41421 |
if (!node[$getTemplateRoot]()[$extra].noLayoutFailure) { |
| 41422 |
if (node.h !== "" && Math.round(h - space.height) > ERROR) { |
| 41423 |
return false; |
| 41424 |
} |
| 41425 |
if (node.w !== "") { |
| 41426 |
if (Math.round(w - space.width) <= ERROR) { |
| 41427 |
return true; |
| 41428 |
} |
| 41429 |
if (parent[$extra].numberInLine === 0) { |
| 41430 |
return space.height > ERROR; |
| 41431 |
} |
| 41432 |
return false; |
| 41433 |
} |
| 41434 |
return space.width > ERROR; |
| 41435 |
} |
| 41436 |
if (node.w !== "") { |
| 41437 |
return Math.round(w - space.width) <= ERROR; |
| 41438 |
} |
| 41439 |
return space.width > ERROR; |
| 41440 |
} |
| 41441 |
if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { |
| 41442 |
return true; |
| 41443 |
} |
| 41444 |
if (node.h !== "" && Math.round(h - space.height) > ERROR) { |
| 41445 |
return false; |
| 41446 |
} |
| 41447 |
if (node.w === "" || Math.round(w - space.width) <= ERROR) { |
| 41448 |
return space.height > ERROR; |
| 41449 |
} |
| 41450 |
if (parent[$isThereMoreWidth]()) { |
| 41451 |
return false; |
| 41452 |
} |
| 41453 |
return space.height > ERROR; |
| 41454 |
case "table": |
| 41455 |
case "tb": |
| 41456 |
if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { |
| 41457 |
return true; |
| 41458 |
} |
| 41459 |
if (node.h !== "" && !node[$isSplittable]()) { |
| 41460 |
return Math.round(h - space.height) <= ERROR; |
| 41461 |
} |
| 41462 |
if (node.w === "" || Math.round(w - space.width) <= ERROR) { |
| 41463 |
return space.height > ERROR; |
| 41464 |
} |
| 41465 |
if (parent[$isThereMoreWidth]()) { |
| 41466 |
return false; |
| 41467 |
} |
| 41468 |
return space.height > ERROR; |
| 41469 |
case "position": |
| 41470 |
if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { |
| 41471 |
return true; |
| 41472 |
} |
| 41473 |
if (node.h === "" || Math.round(h + y - space.height) <= ERROR) { |
| 41474 |
return true; |
| 41475 |
} |
| 41476 |
const area = node[$getTemplateRoot]()[$extra].currentContentArea; |
| 41477 |
return h + y > area.h; |
| 41478 |
case "rl-row": |
| 41479 |
case "row": |
| 41480 |
if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { |
| 41481 |
return true; |
| 41482 |
} |
| 41483 |
if (node.h !== "") { |
| 41484 |
return Math.round(h - space.height) <= ERROR; |
| 41485 |
} |
| 41486 |
return true; |
| 41487 |
default: |
| 41488 |
return true; |
| 41489 |
} |
| 41490 |
} |
| 41491 |
|
| 41492 |
;// ./src/core/xfa/template.js |
| 41493 |
|
| 41494 |
|
| 41495 |
|
| 41496 |
|
| 41497 |
|
| 41498 |
|
| 41499 |
|
| 41500 |
|
| 41501 |
|
| 41502 |
|
| 41503 |
const TEMPLATE_NS_ID = NamespaceIds.template.id; |
| 41504 |
const SVG_NS = "http://www.w3.org/2000/svg"; |
| 41505 |
const MAX_ATTEMPTS_FOR_LRTB_LAYOUT = 2; |
| 41506 |
const MAX_EMPTY_PAGES = 3; |
| 41507 |
const DEFAULT_TAB_INDEX = 5000; |
| 41508 |
const HEADING_PATTERN = /^H(\d+)$/; |
| 41509 |
const MIMES = new Set(["image/gif", "image/jpeg", "image/jpg", "image/pjpeg", "image/png", "image/apng", "image/x-png", "image/bmp", "image/x-ms-bmp", "image/tiff", "image/tif", "application/octet-stream"]); |
| 41510 |
const IMAGES_HEADERS = [[[0x42, 0x4d], "image/bmp"], [[0xff, 0xd8, 0xff], "image/jpeg"], [[0x49, 0x49, 0x2a, 0x00], "image/tiff"], [[0x4d, 0x4d, 0x00, 0x2a], "image/tiff"], [[0x47, 0x49, 0x46, 0x38, 0x39, 0x61], "image/gif"], [[0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a], "image/png"]]; |
| 41511 |
function getBorderDims(node) { |
| 41512 |
if (!node || !node.border) { |
| 41513 |
return { |
| 41514 |
w: 0, |
| 41515 |
h: 0 |
| 41516 |
}; |
| 41517 |
} |
| 41518 |
const borderExtra = node.border[$getExtra](); |
| 41519 |
if (!borderExtra) { |
| 41520 |
return { |
| 41521 |
w: 0, |
| 41522 |
h: 0 |
| 41523 |
}; |
| 41524 |
} |
| 41525 |
return { |
| 41526 |
w: borderExtra.widths[0] + borderExtra.widths[2] + borderExtra.insets[0] + borderExtra.insets[2], |
| 41527 |
h: borderExtra.widths[1] + borderExtra.widths[3] + borderExtra.insets[1] + borderExtra.insets[3] |
| 41528 |
}; |
| 41529 |
} |
| 41530 |
function hasMargin(node) { |
| 41531 |
return node.margin && (node.margin.topInset || node.margin.rightInset || node.margin.bottomInset || node.margin.leftInset); |
| 41532 |
} |
| 41533 |
function _setValue(templateNode, value) { |
| 41534 |
if (!templateNode.value) { |
| 41535 |
const nodeValue = new Value({}); |
| 41536 |
templateNode[$appendChild](nodeValue); |
| 41537 |
templateNode.value = nodeValue; |
| 41538 |
} |
| 41539 |
templateNode.value[$setValue](value); |
| 41540 |
} |
| 41541 |
function* getContainedChildren(node) { |
| 41542 |
for (const child of node[$getChildren]()) { |
| 41543 |
if (child instanceof SubformSet) { |
| 41544 |
yield* child[$getContainedChildren](); |
| 41545 |
continue; |
| 41546 |
} |
| 41547 |
yield child; |
| 41548 |
} |
| 41549 |
} |
| 41550 |
function isRequired(node) { |
| 41551 |
return node.validate?.nullTest === "error"; |
| 41552 |
} |
| 41553 |
function setTabIndex(node) { |
| 41554 |
while (node) { |
| 41555 |
if (!node.traversal) { |
| 41556 |
node[$tabIndex] = node[$getParent]()[$tabIndex]; |
| 41557 |
return; |
| 41558 |
} |
| 41559 |
if (node[$tabIndex]) { |
| 41560 |
return; |
| 41561 |
} |
| 41562 |
let next = null; |
| 41563 |
for (const child of node.traversal[$getChildren]()) { |
| 41564 |
if (child.operation === "next") { |
| 41565 |
next = child; |
| 41566 |
break; |
| 41567 |
} |
| 41568 |
} |
| 41569 |
if (!next || !next.ref) { |
| 41570 |
node[$tabIndex] = node[$getParent]()[$tabIndex]; |
| 41571 |
return; |
| 41572 |
} |
| 41573 |
const root = node[$getTemplateRoot](); |
| 41574 |
node[$tabIndex] = ++root[$tabIndex]; |
| 41575 |
const ref = root[$searchNode](next.ref, node); |
| 41576 |
if (!ref) { |
| 41577 |
return; |
| 41578 |
} |
| 41579 |
node = ref[0]; |
| 41580 |
} |
| 41581 |
} |
| 41582 |
function applyAssist(obj, attributes) { |
| 41583 |
const assist = obj.assist; |
| 41584 |
if (assist) { |
| 41585 |
const assistTitle = assist[$toHTML](); |
| 41586 |
if (assistTitle) { |
| 41587 |
attributes.title = assistTitle; |
| 41588 |
} |
| 41589 |
const role = assist.role; |
| 41590 |
const match = role.match(HEADING_PATTERN); |
| 41591 |
if (match) { |
| 41592 |
const ariaRole = "heading"; |
| 41593 |
const ariaLevel = match[1]; |
| 41594 |
attributes.role = ariaRole; |
| 41595 |
attributes["aria-level"] = ariaLevel; |
| 41596 |
} |
| 41597 |
} |
| 41598 |
if (obj.layout === "table") { |
| 41599 |
attributes.role = "table"; |
| 41600 |
} else if (obj.layout === "row") { |
| 41601 |
attributes.role = "row"; |
| 41602 |
} else { |
| 41603 |
const parent = obj[$getParent](); |
| 41604 |
if (parent.layout === "row") { |
| 41605 |
attributes.role = parent.assist?.role === "TH" ? "columnheader" : "cell"; |
| 41606 |
} |
| 41607 |
} |
| 41608 |
} |
| 41609 |
function ariaLabel(obj) { |
| 41610 |
if (!obj.assist) { |
| 41611 |
return null; |
| 41612 |
} |
| 41613 |
const assist = obj.assist; |
| 41614 |
if (assist.speak && assist.speak[$content] !== "") { |
| 41615 |
return assist.speak[$content]; |
| 41616 |
} |
| 41617 |
if (assist.toolTip) { |
| 41618 |
return assist.toolTip[$content]; |
| 41619 |
} |
| 41620 |
return null; |
| 41621 |
} |
| 41622 |
function valueToHtml(value) { |
| 41623 |
return HTMLResult.success({ |
| 41624 |
name: "div", |
| 41625 |
attributes: { |
| 41626 |
class: ["xfaRich"], |
| 41627 |
style: Object.create(null) |
| 41628 |
}, |
| 41629 |
children: [{ |
| 41630 |
name: "span", |
| 41631 |
attributes: { |
| 41632 |
style: Object.create(null) |
| 41633 |
}, |
| 41634 |
value |
| 41635 |
}] |
| 41636 |
}); |
| 41637 |
} |
| 41638 |
function setFirstUnsplittable(node) { |
| 41639 |
const root = node[$getTemplateRoot](); |
| 41640 |
if (root[$extra].firstUnsplittable === null) { |
| 41641 |
root[$extra].firstUnsplittable = node; |
| 41642 |
root[$extra].noLayoutFailure = true; |
| 41643 |
} |
| 41644 |
} |
| 41645 |
function unsetFirstUnsplittable(node) { |
| 41646 |
const root = node[$getTemplateRoot](); |
| 41647 |
if (root[$extra].firstUnsplittable === node) { |
| 41648 |
root[$extra].noLayoutFailure = false; |
| 41649 |
} |
| 41650 |
} |
| 41651 |
function handleBreak(node) { |
| 41652 |
if (node[$extra]) { |
| 41653 |
return false; |
| 41654 |
} |
| 41655 |
node[$extra] = Object.create(null); |
| 41656 |
if (node.targetType === "auto") { |
| 41657 |
return false; |
| 41658 |
} |
| 41659 |
const root = node[$getTemplateRoot](); |
| 41660 |
let target = null; |
| 41661 |
if (node.target) { |
| 41662 |
target = root[$searchNode](node.target, node[$getParent]()); |
| 41663 |
if (!target) { |
| 41664 |
return false; |
| 41665 |
} |
| 41666 |
target = target[0]; |
| 41667 |
} |
| 41668 |
const { |
| 41669 |
currentPageArea, |
| 41670 |
currentContentArea |
| 41671 |
} = root[$extra]; |
| 41672 |
if (node.targetType === "pageArea") { |
| 41673 |
if (!(target instanceof PageArea)) { |
| 41674 |
target = null; |
| 41675 |
} |
| 41676 |
if (node.startNew) { |
| 41677 |
node[$extra].target = target || currentPageArea; |
| 41678 |
return true; |
| 41679 |
} else if (target && target !== currentPageArea) { |
| 41680 |
node[$extra].target = target; |
| 41681 |
return true; |
| 41682 |
} |
| 41683 |
return false; |
| 41684 |
} |
| 41685 |
if (!(target instanceof ContentArea)) { |
| 41686 |
target = null; |
| 41687 |
} |
| 41688 |
const pageArea = target && target[$getParent](); |
| 41689 |
let index; |
| 41690 |
let nextPageArea = pageArea; |
| 41691 |
if (node.startNew) { |
| 41692 |
if (target) { |
| 41693 |
const contentAreas = pageArea.contentArea.children; |
| 41694 |
const indexForCurrent = contentAreas.indexOf(currentContentArea); |
| 41695 |
const indexForTarget = contentAreas.indexOf(target); |
| 41696 |
if (indexForCurrent !== -1 && indexForCurrent < indexForTarget) { |
| 41697 |
nextPageArea = null; |
| 41698 |
} |
| 41699 |
index = indexForTarget - 1; |
| 41700 |
} else { |
| 41701 |
index = currentPageArea.contentArea.children.indexOf(currentContentArea); |
| 41702 |
} |
| 41703 |
} else if (target && target !== currentContentArea) { |
| 41704 |
const contentAreas = pageArea.contentArea.children; |
| 41705 |
index = contentAreas.indexOf(target) - 1; |
| 41706 |
nextPageArea = pageArea === currentPageArea ? null : pageArea; |
| 41707 |
} else { |
| 41708 |
return false; |
| 41709 |
} |
| 41710 |
node[$extra].target = nextPageArea; |
| 41711 |
node[$extra].index = index; |
| 41712 |
return true; |
| 41713 |
} |
| 41714 |
function handleOverflow(node, extraNode, space) { |
| 41715 |
const root = node[$getTemplateRoot](); |
| 41716 |
const saved = root[$extra].noLayoutFailure; |
| 41717 |
const savedMethod = extraNode[$getSubformParent]; |
| 41718 |
extraNode[$getSubformParent] = () => node; |
| 41719 |
root[$extra].noLayoutFailure = true; |
| 41720 |
const res = extraNode[$toHTML](space); |
| 41721 |
node[$addHTML](res.html, res.bbox); |
| 41722 |
root[$extra].noLayoutFailure = saved; |
| 41723 |
extraNode[$getSubformParent] = savedMethod; |
| 41724 |
} |
| 41725 |
class AppearanceFilter extends StringObject { |
| 41726 |
constructor(attributes) { |
| 41727 |
super(TEMPLATE_NS_ID, "appearanceFilter"); |
| 41728 |
this.id = attributes.id || ""; |
| 41729 |
this.type = getStringOption(attributes.type, ["optional", "required"]); |
| 41730 |
this.use = attributes.use || ""; |
| 41731 |
this.usehref = attributes.usehref || ""; |
| 41732 |
} |
| 41733 |
} |
| 41734 |
class Arc extends XFAObject { |
| 41735 |
constructor(attributes) { |
| 41736 |
super(TEMPLATE_NS_ID, "arc", true); |
| 41737 |
this.circular = getInteger({ |
| 41738 |
data: attributes.circular, |
| 41739 |
defaultValue: 0, |
| 41740 |
validate: x => x === 1 |
| 41741 |
}); |
| 41742 |
this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); |
| 41743 |
this.id = attributes.id || ""; |
| 41744 |
this.startAngle = getFloat({ |
| 41745 |
data: attributes.startAngle, |
| 41746 |
defaultValue: 0, |
| 41747 |
validate: x => true |
| 41748 |
}); |
| 41749 |
this.sweepAngle = getFloat({ |
| 41750 |
data: attributes.sweepAngle, |
| 41751 |
defaultValue: 360, |
| 41752 |
validate: x => true |
| 41753 |
}); |
| 41754 |
this.use = attributes.use || ""; |
| 41755 |
this.usehref = attributes.usehref || ""; |
| 41756 |
this.edge = null; |
| 41757 |
this.fill = null; |
| 41758 |
} |
| 41759 |
[$toHTML]() { |
| 41760 |
const edge = this.edge || new Edge({}); |
| 41761 |
const edgeStyle = edge[$toStyle](); |
| 41762 |
const style = Object.create(null); |
| 41763 |
if (this.fill?.presence === "visible") { |
| 41764 |
Object.assign(style, this.fill[$toStyle]()); |
| 41765 |
} else { |
| 41766 |
style.fill = "transparent"; |
| 41767 |
} |
| 41768 |
style.strokeWidth = measureToString(edge.presence === "visible" ? edge.thickness : 0); |
| 41769 |
style.stroke = edgeStyle.color; |
| 41770 |
let arc; |
| 41771 |
const attributes = { |
| 41772 |
xmlns: SVG_NS, |
| 41773 |
style: { |
| 41774 |
width: "100%", |
| 41775 |
height: "100%", |
| 41776 |
overflow: "visible" |
| 41777 |
} |
| 41778 |
}; |
| 41779 |
if (this.sweepAngle === 360) { |
| 41780 |
arc = { |
| 41781 |
name: "ellipse", |
| 41782 |
attributes: { |
| 41783 |
xmlns: SVG_NS, |
| 41784 |
cx: "50%", |
| 41785 |
cy: "50%", |
| 41786 |
rx: "50%", |
| 41787 |
ry: "50%", |
| 41788 |
style |
| 41789 |
} |
| 41790 |
}; |
| 41791 |
} else { |
| 41792 |
const startAngle = this.startAngle * Math.PI / 180; |
| 41793 |
const sweepAngle = this.sweepAngle * Math.PI / 180; |
| 41794 |
const largeArc = this.sweepAngle > 180 ? 1 : 0; |
| 41795 |
const [x1, y1, x2, y2] = [50 * (1 + Math.cos(startAngle)), 50 * (1 - Math.sin(startAngle)), 50 * (1 + Math.cos(startAngle + sweepAngle)), 50 * (1 - Math.sin(startAngle + sweepAngle))]; |
| 41796 |
arc = { |
| 41797 |
name: "path", |
| 41798 |
attributes: { |
| 41799 |
xmlns: SVG_NS, |
| 41800 |
d: `M ${x1} ${y1} A 50 50 0 ${largeArc} 0 ${x2} ${y2}`, |
| 41801 |
vectorEffect: "non-scaling-stroke", |
| 41802 |
style |
| 41803 |
} |
| 41804 |
}; |
| 41805 |
Object.assign(attributes, { |
| 41806 |
viewBox: "0 0 100 100", |
| 41807 |
preserveAspectRatio: "none" |
| 41808 |
}); |
| 41809 |
} |
| 41810 |
const svg = { |
| 41811 |
name: "svg", |
| 41812 |
children: [arc], |
| 41813 |
attributes |
| 41814 |
}; |
| 41815 |
const parent = this[$getParent]()[$getParent](); |
| 41816 |
if (hasMargin(parent)) { |
| 41817 |
return HTMLResult.success({ |
| 41818 |
name: "div", |
| 41819 |
attributes: { |
| 41820 |
style: { |
| 41821 |
display: "inline", |
| 41822 |
width: "100%", |
| 41823 |
height: "100%" |
| 41824 |
} |
| 41825 |
}, |
| 41826 |
children: [svg] |
| 41827 |
}); |
| 41828 |
} |
| 41829 |
svg.attributes.style.position = "absolute"; |
| 41830 |
return HTMLResult.success(svg); |
| 41831 |
} |
| 41832 |
} |
| 41833 |
class Area extends XFAObject { |
| 41834 |
constructor(attributes) { |
| 41835 |
super(TEMPLATE_NS_ID, "area", true); |
| 41836 |
this.colSpan = getInteger({ |
| 41837 |
data: attributes.colSpan, |
| 41838 |
defaultValue: 1, |
| 41839 |
validate: n => n >= 1 || n === -1 |
| 41840 |
}); |
| 41841 |
this.id = attributes.id || ""; |
| 41842 |
this.name = attributes.name || ""; |
| 41843 |
this.relevant = getRelevant(attributes.relevant); |
| 41844 |
this.use = attributes.use || ""; |
| 41845 |
this.usehref = attributes.usehref || ""; |
| 41846 |
this.x = getMeasurement(attributes.x, "0pt"); |
| 41847 |
this.y = getMeasurement(attributes.y, "0pt"); |
| 41848 |
this.desc = null; |
| 41849 |
this.extras = null; |
| 41850 |
this.area = new XFAObjectArray(); |
| 41851 |
this.draw = new XFAObjectArray(); |
| 41852 |
this.exObject = new XFAObjectArray(); |
| 41853 |
this.exclGroup = new XFAObjectArray(); |
| 41854 |
this.field = new XFAObjectArray(); |
| 41855 |
this.subform = new XFAObjectArray(); |
| 41856 |
this.subformSet = new XFAObjectArray(); |
| 41857 |
} |
| 41858 |
*[$getContainedChildren]() { |
| 41859 |
yield* getContainedChildren(this); |
| 41860 |
} |
| 41861 |
[$isTransparent]() { |
| 41862 |
return true; |
| 41863 |
} |
| 41864 |
[$isBindable]() { |
| 41865 |
return true; |
| 41866 |
} |
| 41867 |
[$addHTML](html, bbox) { |
| 41868 |
const [x, y, w, h] = bbox; |
| 41869 |
this[$extra].width = Math.max(this[$extra].width, x + w); |
| 41870 |
this[$extra].height = Math.max(this[$extra].height, y + h); |
| 41871 |
this[$extra].children.push(html); |
| 41872 |
} |
| 41873 |
[$getAvailableSpace]() { |
| 41874 |
return this[$extra].availableSpace; |
| 41875 |
} |
| 41876 |
[$toHTML](availableSpace) { |
| 41877 |
const style = toStyle(this, "position"); |
| 41878 |
const attributes = { |
| 41879 |
style, |
| 41880 |
id: this[$uid], |
| 41881 |
class: ["xfaArea"] |
| 41882 |
}; |
| 41883 |
if (isPrintOnly(this)) { |
| 41884 |
attributes.class.push("xfaPrintOnly"); |
| 41885 |
} |
| 41886 |
if (this.name) { |
| 41887 |
attributes.xfaName = this.name; |
| 41888 |
} |
| 41889 |
const children = []; |
| 41890 |
this[$extra] = { |
| 41891 |
children, |
| 41892 |
width: 0, |
| 41893 |
height: 0, |
| 41894 |
availableSpace |
| 41895 |
}; |
| 41896 |
const result = this[$childrenToHTML]({ |
| 41897 |
filter: new Set(["area", "draw", "field", "exclGroup", "subform", "subformSet"]), |
| 41898 |
include: true |
| 41899 |
}); |
| 41900 |
if (!result.success) { |
| 41901 |
if (result.isBreak()) { |
| 41902 |
return result; |
| 41903 |
} |
| 41904 |
delete this[$extra]; |
| 41905 |
return HTMLResult.FAILURE; |
| 41906 |
} |
| 41907 |
style.width = measureToString(this[$extra].width); |
| 41908 |
style.height = measureToString(this[$extra].height); |
| 41909 |
const html = { |
| 41910 |
name: "div", |
| 41911 |
attributes, |
| 41912 |
children |
| 41913 |
}; |
| 41914 |
const bbox = [this.x, this.y, this[$extra].width, this[$extra].height]; |
| 41915 |
delete this[$extra]; |
| 41916 |
return HTMLResult.success(html, bbox); |
| 41917 |
} |
| 41918 |
} |
| 41919 |
class Assist extends XFAObject { |
| 41920 |
constructor(attributes) { |
| 41921 |
super(TEMPLATE_NS_ID, "assist", true); |
| 41922 |
this.id = attributes.id || ""; |
| 41923 |
this.role = attributes.role || ""; |
| 41924 |
this.use = attributes.use || ""; |
| 41925 |
this.usehref = attributes.usehref || ""; |
| 41926 |
this.speak = null; |
| 41927 |
this.toolTip = null; |
| 41928 |
} |
| 41929 |
[$toHTML]() { |
| 41930 |
return this.toolTip?.[$content] || null; |
| 41931 |
} |
| 41932 |
} |
| 41933 |
class Barcode extends XFAObject { |
| 41934 |
constructor(attributes) { |
| 41935 |
super(TEMPLATE_NS_ID, "barcode", true); |
| 41936 |
this.charEncoding = getKeyword({ |
| 41937 |
data: attributes.charEncoding ? attributes.charEncoding.toLowerCase() : "", |
| 41938 |
defaultValue: "", |
| 41939 |
validate: k => ["utf-8", "big-five", "fontspecific", "gbk", "gb-18030", "gb-2312", "ksc-5601", "none", "shift-jis", "ucs-2", "utf-16"].includes(k) || k.match(/iso-8859-\d{2}/) |
| 41940 |
}); |
| 41941 |
this.checksum = getStringOption(attributes.checksum, ["none", "1mod10", "1mod10_1mod11", "2mod10", "auto"]); |
| 41942 |
this.dataColumnCount = getInteger({ |
| 41943 |
data: attributes.dataColumnCount, |
| 41944 |
defaultValue: -1, |
| 41945 |
validate: x => x >= 0 |
| 41946 |
}); |
| 41947 |
this.dataLength = getInteger({ |
| 41948 |
data: attributes.dataLength, |
| 41949 |
defaultValue: -1, |
| 41950 |
validate: x => x >= 0 |
| 41951 |
}); |
| 41952 |
this.dataPrep = getStringOption(attributes.dataPrep, ["none", "flateCompress"]); |
| 41953 |
this.dataRowCount = getInteger({ |
| 41954 |
data: attributes.dataRowCount, |
| 41955 |
defaultValue: -1, |
| 41956 |
validate: x => x >= 0 |
| 41957 |
}); |
| 41958 |
this.endChar = attributes.endChar || ""; |
| 41959 |
this.errorCorrectionLevel = getInteger({ |
| 41960 |
data: attributes.errorCorrectionLevel, |
| 41961 |
defaultValue: -1, |
| 41962 |
validate: x => x >= 0 && x <= 8 |
| 41963 |
}); |
| 41964 |
this.id = attributes.id || ""; |
| 41965 |
this.moduleHeight = getMeasurement(attributes.moduleHeight, "5mm"); |
| 41966 |
this.moduleWidth = getMeasurement(attributes.moduleWidth, "0.25mm"); |
| 41967 |
this.printCheckDigit = getInteger({ |
| 41968 |
data: attributes.printCheckDigit, |
| 41969 |
defaultValue: 0, |
| 41970 |
validate: x => x === 1 |
| 41971 |
}); |
| 41972 |
this.rowColumnRatio = getRatio(attributes.rowColumnRatio); |
| 41973 |
this.startChar = attributes.startChar || ""; |
| 41974 |
this.textLocation = getStringOption(attributes.textLocation, ["below", "above", "aboveEmbedded", "belowEmbedded", "none"]); |
| 41975 |
this.truncate = getInteger({ |
| 41976 |
data: attributes.truncate, |
| 41977 |
defaultValue: 0, |
| 41978 |
validate: x => x === 1 |
| 41979 |
}); |
| 41980 |
this.type = getStringOption(attributes.type ? attributes.type.toLowerCase() : "", ["aztec", "codabar", "code2of5industrial", "code2of5interleaved", "code2of5matrix", "code2of5standard", "code3of9", "code3of9extended", "code11", "code49", "code93", "code128", "code128a", "code128b", "code128c", "code128sscc", "datamatrix", "ean8", "ean8add2", "ean8add5", "ean13", "ean13add2", "ean13add5", "ean13pwcd", "fim", "logmars", "maxicode", "msi", "pdf417", "pdf417macro", "plessey", "postauscust2", "postauscust3", "postausreplypaid", "postausstandard", "postukrm4scc", "postusdpbc", "postusimb", "postusstandard", "postus5zip", "qrcode", "rfid", "rss14", "rss14expanded", "rss14limited", "rss14stacked", "rss14stackedomni", "rss14truncated", "telepen", "ucc128", "ucc128random", "ucc128sscc", "upca", "upcaadd2", "upcaadd5", "upcapwcd", "upce", "upceadd2", "upceadd5", "upcean2", "upcean5", "upsmaxicode"]); |
| 41981 |
this.upsMode = getStringOption(attributes.upsMode, ["usCarrier", "internationalCarrier", "secureSymbol", "standardSymbol"]); |
| 41982 |
this.use = attributes.use || ""; |
| 41983 |
this.usehref = attributes.usehref || ""; |
| 41984 |
this.wideNarrowRatio = getRatio(attributes.wideNarrowRatio); |
| 41985 |
this.encrypt = null; |
| 41986 |
this.extras = null; |
| 41987 |
} |
| 41988 |
} |
| 41989 |
class Bind extends XFAObject { |
| 41990 |
constructor(attributes) { |
| 41991 |
super(TEMPLATE_NS_ID, "bind", true); |
| 41992 |
this.match = getStringOption(attributes.match, ["once", "dataRef", "global", "none"]); |
| 41993 |
this.ref = attributes.ref || ""; |
| 41994 |
this.picture = null; |
| 41995 |
} |
| 41996 |
} |
| 41997 |
class BindItems extends XFAObject { |
| 41998 |
constructor(attributes) { |
| 41999 |
super(TEMPLATE_NS_ID, "bindItems"); |
| 42000 |
this.connection = attributes.connection || ""; |
| 42001 |
this.labelRef = attributes.labelRef || ""; |
| 42002 |
this.ref = attributes.ref || ""; |
| 42003 |
this.valueRef = attributes.valueRef || ""; |
| 42004 |
} |
| 42005 |
} |
| 42006 |
class Bookend extends XFAObject { |
| 42007 |
constructor(attributes) { |
| 42008 |
super(TEMPLATE_NS_ID, "bookend"); |
| 42009 |
this.id = attributes.id || ""; |
| 42010 |
this.leader = attributes.leader || ""; |
| 42011 |
this.trailer = attributes.trailer || ""; |
| 42012 |
this.use = attributes.use || ""; |
| 42013 |
this.usehref = attributes.usehref || ""; |
| 42014 |
} |
| 42015 |
} |
| 42016 |
class BooleanElement extends Option01 { |
| 42017 |
constructor(attributes) { |
| 42018 |
super(TEMPLATE_NS_ID, "boolean"); |
| 42019 |
this.id = attributes.id || ""; |
| 42020 |
this.name = attributes.name || ""; |
| 42021 |
this.use = attributes.use || ""; |
| 42022 |
this.usehref = attributes.usehref || ""; |
| 42023 |
} |
| 42024 |
[$toHTML](availableSpace) { |
| 42025 |
return valueToHtml(this[$content] === 1 ? "1" : "0"); |
| 42026 |
} |
| 42027 |
} |
| 42028 |
class Border extends XFAObject { |
| 42029 |
constructor(attributes) { |
| 42030 |
super(TEMPLATE_NS_ID, "border", true); |
| 42031 |
this.break = getStringOption(attributes.break, ["close", "open"]); |
| 42032 |
this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); |
| 42033 |
this.id = attributes.id || ""; |
| 42034 |
this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); |
| 42035 |
this.relevant = getRelevant(attributes.relevant); |
| 42036 |
this.use = attributes.use || ""; |
| 42037 |
this.usehref = attributes.usehref || ""; |
| 42038 |
this.corner = new XFAObjectArray(4); |
| 42039 |
this.edge = new XFAObjectArray(4); |
| 42040 |
this.extras = null; |
| 42041 |
this.fill = null; |
| 42042 |
this.margin = null; |
| 42043 |
} |
| 42044 |
[$getExtra]() { |
| 42045 |
if (!this[$extra]) { |
| 42046 |
const edges = this.edge.children.slice(); |
| 42047 |
if (edges.length < 4) { |
| 42048 |
const defaultEdge = edges.at(-1) || new Edge({}); |
| 42049 |
for (let i = edges.length; i < 4; i++) { |
| 42050 |
edges.push(defaultEdge); |
| 42051 |
} |
| 42052 |
} |
| 42053 |
const widths = edges.map(edge => edge.thickness); |
| 42054 |
const insets = [0, 0, 0, 0]; |
| 42055 |
if (this.margin) { |
| 42056 |
insets[0] = this.margin.topInset; |
| 42057 |
insets[1] = this.margin.rightInset; |
| 42058 |
insets[2] = this.margin.bottomInset; |
| 42059 |
insets[3] = this.margin.leftInset; |
| 42060 |
} |
| 42061 |
this[$extra] = { |
| 42062 |
widths, |
| 42063 |
insets, |
| 42064 |
edges |
| 42065 |
}; |
| 42066 |
} |
| 42067 |
return this[$extra]; |
| 42068 |
} |
| 42069 |
[$toStyle]() { |
| 42070 |
const { |
| 42071 |
edges |
| 42072 |
} = this[$getExtra](); |
| 42073 |
const edgeStyles = edges.map(node => { |
| 42074 |
const style = node[$toStyle](); |
| 42075 |
style.color ||= "#000000"; |
| 42076 |
return style; |
| 42077 |
}); |
| 42078 |
const style = Object.create(null); |
| 42079 |
if (this.margin) { |
| 42080 |
Object.assign(style, this.margin[$toStyle]()); |
| 42081 |
} |
| 42082 |
if (this.fill?.presence === "visible") { |
| 42083 |
Object.assign(style, this.fill[$toStyle]()); |
| 42084 |
} |
| 42085 |
if (this.corner.children.some(node => node.radius !== 0)) { |
| 42086 |
const cornerStyles = this.corner.children.map(node => node[$toStyle]()); |
| 42087 |
if (cornerStyles.length === 2 || cornerStyles.length === 3) { |
| 42088 |
const last = cornerStyles.at(-1); |
| 42089 |
for (let i = cornerStyles.length; i < 4; i++) { |
| 42090 |
cornerStyles.push(last); |
| 42091 |
} |
| 42092 |
} |
| 42093 |
style.borderRadius = cornerStyles.map(s => s.radius).join(" "); |
| 42094 |
} |
| 42095 |
switch (this.presence) { |
| 42096 |
case "invisible": |
| 42097 |
case "hidden": |
| 42098 |
style.borderStyle = ""; |
| 42099 |
break; |
| 42100 |
case "inactive": |
| 42101 |
style.borderStyle = "none"; |
| 42102 |
break; |
| 42103 |
default: |
| 42104 |
style.borderStyle = edgeStyles.map(s => s.style).join(" "); |
| 42105 |
break; |
| 42106 |
} |
| 42107 |
style.borderWidth = edgeStyles.map(s => s.width).join(" "); |
| 42108 |
style.borderColor = edgeStyles.map(s => s.color).join(" "); |
| 42109 |
return style; |
| 42110 |
} |
| 42111 |
} |
| 42112 |
class Break extends XFAObject { |
| 42113 |
constructor(attributes) { |
| 42114 |
super(TEMPLATE_NS_ID, "break", true); |
| 42115 |
this.after = getStringOption(attributes.after, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]); |
| 42116 |
this.afterTarget = attributes.afterTarget || ""; |
| 42117 |
this.before = getStringOption(attributes.before, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]); |
| 42118 |
this.beforeTarget = attributes.beforeTarget || ""; |
| 42119 |
this.bookendLeader = attributes.bookendLeader || ""; |
| 42120 |
this.bookendTrailer = attributes.bookendTrailer || ""; |
| 42121 |
this.id = attributes.id || ""; |
| 42122 |
this.overflowLeader = attributes.overflowLeader || ""; |
| 42123 |
this.overflowTarget = attributes.overflowTarget || ""; |
| 42124 |
this.overflowTrailer = attributes.overflowTrailer || ""; |
| 42125 |
this.startNew = getInteger({ |
| 42126 |
data: attributes.startNew, |
| 42127 |
defaultValue: 0, |
| 42128 |
validate: x => x === 1 |
| 42129 |
}); |
| 42130 |
this.use = attributes.use || ""; |
| 42131 |
this.usehref = attributes.usehref || ""; |
| 42132 |
this.extras = null; |
| 42133 |
} |
| 42134 |
} |
| 42135 |
class BreakAfter extends XFAObject { |
| 42136 |
constructor(attributes) { |
| 42137 |
super(TEMPLATE_NS_ID, "breakAfter", true); |
| 42138 |
this.id = attributes.id || ""; |
| 42139 |
this.leader = attributes.leader || ""; |
| 42140 |
this.startNew = getInteger({ |
| 42141 |
data: attributes.startNew, |
| 42142 |
defaultValue: 0, |
| 42143 |
validate: x => x === 1 |
| 42144 |
}); |
| 42145 |
this.target = attributes.target || ""; |
| 42146 |
this.targetType = getStringOption(attributes.targetType, ["auto", "contentArea", "pageArea"]); |
| 42147 |
this.trailer = attributes.trailer || ""; |
| 42148 |
this.use = attributes.use || ""; |
| 42149 |
this.usehref = attributes.usehref || ""; |
| 42150 |
this.script = null; |
| 42151 |
} |
| 42152 |
} |
| 42153 |
class BreakBefore extends XFAObject { |
| 42154 |
constructor(attributes) { |
| 42155 |
super(TEMPLATE_NS_ID, "breakBefore", true); |
| 42156 |
this.id = attributes.id || ""; |
| 42157 |
this.leader = attributes.leader || ""; |
| 42158 |
this.startNew = getInteger({ |
| 42159 |
data: attributes.startNew, |
| 42160 |
defaultValue: 0, |
| 42161 |
validate: x => x === 1 |
| 42162 |
}); |
| 42163 |
this.target = attributes.target || ""; |
| 42164 |
this.targetType = getStringOption(attributes.targetType, ["auto", "contentArea", "pageArea"]); |
| 42165 |
this.trailer = attributes.trailer || ""; |
| 42166 |
this.use = attributes.use || ""; |
| 42167 |
this.usehref = attributes.usehref || ""; |
| 42168 |
this.script = null; |
| 42169 |
} |
| 42170 |
[$toHTML](availableSpace) { |
| 42171 |
this[$extra] = {}; |
| 42172 |
return HTMLResult.FAILURE; |
| 42173 |
} |
| 42174 |
} |
| 42175 |
class Button extends XFAObject { |
| 42176 |
constructor(attributes) { |
| 42177 |
super(TEMPLATE_NS_ID, "button", true); |
| 42178 |
this.highlight = getStringOption(attributes.highlight, ["inverted", "none", "outline", "push"]); |
| 42179 |
this.id = attributes.id || ""; |
| 42180 |
this.use = attributes.use || ""; |
| 42181 |
this.usehref = attributes.usehref || ""; |
| 42182 |
this.extras = null; |
| 42183 |
} |
| 42184 |
[$toHTML](availableSpace) { |
| 42185 |
const parent = this[$getParent](); |
| 42186 |
const grandpa = parent[$getParent](); |
| 42187 |
const htmlButton = { |
| 42188 |
name: "button", |
| 42189 |
attributes: { |
| 42190 |
id: this[$uid], |
| 42191 |
class: ["xfaButton"], |
| 42192 |
style: {} |
| 42193 |
}, |
| 42194 |
children: [] |
| 42195 |
}; |
| 42196 |
for (const event of grandpa.event.children) { |
| 42197 |
if (event.activity !== "click" || !event.script) { |
| 42198 |
continue; |
| 42199 |
} |
| 42200 |
const jsURL = recoverJsURL(event.script[$content]); |
| 42201 |
if (!jsURL) { |
| 42202 |
continue; |
| 42203 |
} |
| 42204 |
const href = fixURL(jsURL.url); |
| 42205 |
if (!href) { |
| 42206 |
continue; |
| 42207 |
} |
| 42208 |
htmlButton.children.push({ |
| 42209 |
name: "a", |
| 42210 |
attributes: { |
| 42211 |
id: "link" + this[$uid], |
| 42212 |
href, |
| 42213 |
newWindow: jsURL.newWindow, |
| 42214 |
class: ["xfaLink"], |
| 42215 |
style: {} |
| 42216 |
}, |
| 42217 |
children: [] |
| 42218 |
}); |
| 42219 |
} |
| 42220 |
return HTMLResult.success(htmlButton); |
| 42221 |
} |
| 42222 |
} |
| 42223 |
class Calculate extends XFAObject { |
| 42224 |
constructor(attributes) { |
| 42225 |
super(TEMPLATE_NS_ID, "calculate", true); |
| 42226 |
this.id = attributes.id || ""; |
| 42227 |
this.override = getStringOption(attributes.override, ["disabled", "error", "ignore", "warning"]); |
| 42228 |
this.use = attributes.use || ""; |
| 42229 |
this.usehref = attributes.usehref || ""; |
| 42230 |
this.extras = null; |
| 42231 |
this.message = null; |
| 42232 |
this.script = null; |
| 42233 |
} |
| 42234 |
} |
| 42235 |
class Caption extends XFAObject { |
| 42236 |
constructor(attributes) { |
| 42237 |
super(TEMPLATE_NS_ID, "caption", true); |
| 42238 |
this.id = attributes.id || ""; |
| 42239 |
this.placement = getStringOption(attributes.placement, ["left", "bottom", "inline", "right", "top"]); |
| 42240 |
this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); |
| 42241 |
this.reserve = Math.ceil(getMeasurement(attributes.reserve)); |
| 42242 |
this.use = attributes.use || ""; |
| 42243 |
this.usehref = attributes.usehref || ""; |
| 42244 |
this.extras = null; |
| 42245 |
this.font = null; |
| 42246 |
this.margin = null; |
| 42247 |
this.para = null; |
| 42248 |
this.value = null; |
| 42249 |
} |
| 42250 |
[$setValue](value) { |
| 42251 |
_setValue(this, value); |
| 42252 |
} |
| 42253 |
[$getExtra](availableSpace) { |
| 42254 |
if (!this[$extra]) { |
| 42255 |
let { |
| 42256 |
width, |
| 42257 |
height |
| 42258 |
} = availableSpace; |
| 42259 |
switch (this.placement) { |
| 42260 |
case "left": |
| 42261 |
case "right": |
| 42262 |
case "inline": |
| 42263 |
width = this.reserve <= 0 ? width : this.reserve; |
| 42264 |
break; |
| 42265 |
case "top": |
| 42266 |
case "bottom": |
| 42267 |
height = this.reserve <= 0 ? height : this.reserve; |
| 42268 |
break; |
| 42269 |
} |
| 42270 |
this[$extra] = layoutNode(this, { |
| 42271 |
width, |
| 42272 |
height |
| 42273 |
}); |
| 42274 |
} |
| 42275 |
return this[$extra]; |
| 42276 |
} |
| 42277 |
[$toHTML](availableSpace) { |
| 42278 |
if (!this.value) { |
| 42279 |
return HTMLResult.EMPTY; |
| 42280 |
} |
| 42281 |
this[$pushPara](); |
| 42282 |
const value = this.value[$toHTML](availableSpace).html; |
| 42283 |
if (!value) { |
| 42284 |
this[$popPara](); |
| 42285 |
return HTMLResult.EMPTY; |
| 42286 |
} |
| 42287 |
const savedReserve = this.reserve; |
| 42288 |
if (this.reserve <= 0) { |
| 42289 |
const { |
| 42290 |
w, |
| 42291 |
h |
| 42292 |
} = this[$getExtra](availableSpace); |
| 42293 |
switch (this.placement) { |
| 42294 |
case "left": |
| 42295 |
case "right": |
| 42296 |
case "inline": |
| 42297 |
this.reserve = w; |
| 42298 |
break; |
| 42299 |
case "top": |
| 42300 |
case "bottom": |
| 42301 |
this.reserve = h; |
| 42302 |
break; |
| 42303 |
} |
| 42304 |
} |
| 42305 |
const children = []; |
| 42306 |
if (typeof value === "string") { |
| 42307 |
children.push({ |
| 42308 |
name: "#text", |
| 42309 |
value |
| 42310 |
}); |
| 42311 |
} else { |
| 42312 |
children.push(value); |
| 42313 |
} |
| 42314 |
const style = toStyle(this, "font", "margin", "visibility"); |
| 42315 |
switch (this.placement) { |
| 42316 |
case "left": |
| 42317 |
case "right": |
| 42318 |
if (this.reserve > 0) { |
| 42319 |
style.width = measureToString(this.reserve); |
| 42320 |
} |
| 42321 |
break; |
| 42322 |
case "top": |
| 42323 |
case "bottom": |
| 42324 |
if (this.reserve > 0) { |
| 42325 |
style.height = measureToString(this.reserve); |
| 42326 |
} |
| 42327 |
break; |
| 42328 |
} |
| 42329 |
setPara(this, null, value); |
| 42330 |
this[$popPara](); |
| 42331 |
this.reserve = savedReserve; |
| 42332 |
return HTMLResult.success({ |
| 42333 |
name: "div", |
| 42334 |
attributes: { |
| 42335 |
style, |
| 42336 |
class: ["xfaCaption"] |
| 42337 |
}, |
| 42338 |
children |
| 42339 |
}); |
| 42340 |
} |
| 42341 |
} |
| 42342 |
class Certificate extends StringObject { |
| 42343 |
constructor(attributes) { |
| 42344 |
super(TEMPLATE_NS_ID, "certificate"); |
| 42345 |
this.id = attributes.id || ""; |
| 42346 |
this.name = attributes.name || ""; |
| 42347 |
this.use = attributes.use || ""; |
| 42348 |
this.usehref = attributes.usehref || ""; |
| 42349 |
} |
| 42350 |
} |
| 42351 |
class Certificates extends XFAObject { |
| 42352 |
constructor(attributes) { |
| 42353 |
super(TEMPLATE_NS_ID, "certificates", true); |
| 42354 |
this.credentialServerPolicy = getStringOption(attributes.credentialServerPolicy, ["optional", "required"]); |
| 42355 |
this.id = attributes.id || ""; |
| 42356 |
this.url = attributes.url || ""; |
| 42357 |
this.urlPolicy = attributes.urlPolicy || ""; |
| 42358 |
this.use = attributes.use || ""; |
| 42359 |
this.usehref = attributes.usehref || ""; |
| 42360 |
this.encryption = null; |
| 42361 |
this.issuers = null; |
| 42362 |
this.keyUsage = null; |
| 42363 |
this.oids = null; |
| 42364 |
this.signing = null; |
| 42365 |
this.subjectDNs = null; |
| 42366 |
} |
| 42367 |
} |
| 42368 |
class CheckButton extends XFAObject { |
| 42369 |
constructor(attributes) { |
| 42370 |
super(TEMPLATE_NS_ID, "checkButton", true); |
| 42371 |
this.id = attributes.id || ""; |
| 42372 |
this.mark = getStringOption(attributes.mark, ["default", "check", "circle", "cross", "diamond", "square", "star"]); |
| 42373 |
this.shape = getStringOption(attributes.shape, ["square", "round"]); |
| 42374 |
this.size = getMeasurement(attributes.size, "10pt"); |
| 42375 |
this.use = attributes.use || ""; |
| 42376 |
this.usehref = attributes.usehref || ""; |
| 42377 |
this.border = null; |
| 42378 |
this.extras = null; |
| 42379 |
this.margin = null; |
| 42380 |
} |
| 42381 |
[$toHTML](availableSpace) { |
| 42382 |
const style = toStyle("margin"); |
| 42383 |
const size = measureToString(this.size); |
| 42384 |
style.width = style.height = size; |
| 42385 |
let type; |
| 42386 |
let className; |
| 42387 |
let groupId; |
| 42388 |
const field = this[$getParent]()[$getParent](); |
| 42389 |
const items = field.items.children.length && field.items.children[0][$toHTML]().html || []; |
| 42390 |
const exportedValue = { |
| 42391 |
on: (items[0] !== undefined ? items[0] : "on").toString(), |
| 42392 |
off: (items[1] !== undefined ? items[1] : "off").toString() |
| 42393 |
}; |
| 42394 |
const value = field.value?.[$text]() || "off"; |
| 42395 |
const checked = value === exportedValue.on || undefined; |
| 42396 |
const container = field[$getSubformParent](); |
| 42397 |
const fieldId = field[$uid]; |
| 42398 |
let dataId; |
| 42399 |
if (container instanceof ExclGroup) { |
| 42400 |
groupId = container[$uid]; |
| 42401 |
type = "radio"; |
| 42402 |
className = "xfaRadio"; |
| 42403 |
dataId = container[$data]?.[$uid] || container[$uid]; |
| 42404 |
} else { |
| 42405 |
type = "checkbox"; |
| 42406 |
className = "xfaCheckbox"; |
| 42407 |
dataId = field[$data]?.[$uid] || field[$uid]; |
| 42408 |
} |
| 42409 |
const input = { |
| 42410 |
name: "input", |
| 42411 |
attributes: { |
| 42412 |
class: [className], |
| 42413 |
style, |
| 42414 |
fieldId, |
| 42415 |
dataId, |
| 42416 |
type, |
| 42417 |
checked, |
| 42418 |
xfaOn: exportedValue.on, |
| 42419 |
xfaOff: exportedValue.off, |
| 42420 |
"aria-label": ariaLabel(field), |
| 42421 |
"aria-required": false |
| 42422 |
} |
| 42423 |
}; |
| 42424 |
if (groupId) { |
| 42425 |
input.attributes.name = groupId; |
| 42426 |
} |
| 42427 |
if (isRequired(field)) { |
| 42428 |
input.attributes["aria-required"] = true; |
| 42429 |
input.attributes.required = true; |
| 42430 |
} |
| 42431 |
return HTMLResult.success({ |
| 42432 |
name: "label", |
| 42433 |
attributes: { |
| 42434 |
class: ["xfaLabel"] |
| 42435 |
}, |
| 42436 |
children: [input] |
| 42437 |
}); |
| 42438 |
} |
| 42439 |
} |
| 42440 |
class ChoiceList extends XFAObject { |
| 42441 |
constructor(attributes) { |
| 42442 |
super(TEMPLATE_NS_ID, "choiceList", true); |
| 42443 |
this.commitOn = getStringOption(attributes.commitOn, ["select", "exit"]); |
| 42444 |
this.id = attributes.id || ""; |
| 42445 |
this.open = getStringOption(attributes.open, ["userControl", "always", "multiSelect", "onEntry"]); |
| 42446 |
this.textEntry = getInteger({ |
| 42447 |
data: attributes.textEntry, |
| 42448 |
defaultValue: 0, |
| 42449 |
validate: x => x === 1 |
| 42450 |
}); |
| 42451 |
this.use = attributes.use || ""; |
| 42452 |
this.usehref = attributes.usehref || ""; |
| 42453 |
this.border = null; |
| 42454 |
this.extras = null; |
| 42455 |
this.margin = null; |
| 42456 |
} |
| 42457 |
[$toHTML](availableSpace) { |
| 42458 |
const style = toStyle(this, "border", "margin"); |
| 42459 |
const ui = this[$getParent](); |
| 42460 |
const field = ui[$getParent](); |
| 42461 |
const fontSize = field.font?.size || 10; |
| 42462 |
const optionStyle = { |
| 42463 |
fontSize: `calc(${fontSize}px * var(--scale-factor))` |
| 42464 |
}; |
| 42465 |
const children = []; |
| 42466 |
if (field.items.children.length > 0) { |
| 42467 |
const items = field.items; |
| 42468 |
let displayedIndex = 0; |
| 42469 |
let saveIndex = 0; |
| 42470 |
if (items.children.length === 2) { |
| 42471 |
displayedIndex = items.children[0].save; |
| 42472 |
saveIndex = 1 - displayedIndex; |
| 42473 |
} |
| 42474 |
const displayed = items.children[displayedIndex][$toHTML]().html; |
| 42475 |
const values = items.children[saveIndex][$toHTML]().html; |
| 42476 |
let selected = false; |
| 42477 |
const value = field.value?.[$text]() || ""; |
| 42478 |
for (let i = 0, ii = displayed.length; i < ii; i++) { |
| 42479 |
const option = { |
| 42480 |
name: "option", |
| 42481 |
attributes: { |
| 42482 |
value: values[i] || displayed[i], |
| 42483 |
style: optionStyle |
| 42484 |
}, |
| 42485 |
value: displayed[i] |
| 42486 |
}; |
| 42487 |
if (values[i] === value) { |
| 42488 |
option.attributes.selected = selected = true; |
| 42489 |
} |
| 42490 |
children.push(option); |
| 42491 |
} |
| 42492 |
if (!selected) { |
| 42493 |
children.splice(0, 0, { |
| 42494 |
name: "option", |
| 42495 |
attributes: { |
| 42496 |
hidden: true, |
| 42497 |
selected: true |
| 42498 |
}, |
| 42499 |
value: " " |
| 42500 |
}); |
| 42501 |
} |
| 42502 |
} |
| 42503 |
const selectAttributes = { |
| 42504 |
class: ["xfaSelect"], |
| 42505 |
fieldId: field[$uid], |
| 42506 |
dataId: field[$data]?.[$uid] || field[$uid], |
| 42507 |
style, |
| 42508 |
"aria-label": ariaLabel(field), |
| 42509 |
"aria-required": false |
| 42510 |
}; |
| 42511 |
if (isRequired(field)) { |
| 42512 |
selectAttributes["aria-required"] = true; |
| 42513 |
selectAttributes.required = true; |
| 42514 |
} |
| 42515 |
if (this.open === "multiSelect") { |
| 42516 |
selectAttributes.multiple = true; |
| 42517 |
} |
| 42518 |
return HTMLResult.success({ |
| 42519 |
name: "label", |
| 42520 |
attributes: { |
| 42521 |
class: ["xfaLabel"] |
| 42522 |
}, |
| 42523 |
children: [{ |
| 42524 |
name: "select", |
| 42525 |
children, |
| 42526 |
attributes: selectAttributes |
| 42527 |
}] |
| 42528 |
}); |
| 42529 |
} |
| 42530 |
} |
| 42531 |
class Color extends XFAObject { |
| 42532 |
constructor(attributes) { |
| 42533 |
super(TEMPLATE_NS_ID, "color", true); |
| 42534 |
this.cSpace = getStringOption(attributes.cSpace, ["SRGB"]); |
| 42535 |
this.id = attributes.id || ""; |
| 42536 |
this.use = attributes.use || ""; |
| 42537 |
this.usehref = attributes.usehref || ""; |
| 42538 |
this.value = attributes.value ? getColor(attributes.value) : ""; |
| 42539 |
this.extras = null; |
| 42540 |
} |
| 42541 |
[$hasSettableValue]() { |
| 42542 |
return false; |
| 42543 |
} |
| 42544 |
[$toStyle]() { |
| 42545 |
return this.value ? Util.makeHexColor(this.value.r, this.value.g, this.value.b) : null; |
| 42546 |
} |
| 42547 |
} |
| 42548 |
class Comb extends XFAObject { |
| 42549 |
constructor(attributes) { |
| 42550 |
super(TEMPLATE_NS_ID, "comb"); |
| 42551 |
this.id = attributes.id || ""; |
| 42552 |
this.numberOfCells = getInteger({ |
| 42553 |
data: attributes.numberOfCells, |
| 42554 |
defaultValue: 0, |
| 42555 |
validate: x => x >= 0 |
| 42556 |
}); |
| 42557 |
this.use = attributes.use || ""; |
| 42558 |
this.usehref = attributes.usehref || ""; |
| 42559 |
} |
| 42560 |
} |
| 42561 |
class Connect extends XFAObject { |
| 42562 |
constructor(attributes) { |
| 42563 |
super(TEMPLATE_NS_ID, "connect", true); |
| 42564 |
this.connection = attributes.connection || ""; |
| 42565 |
this.id = attributes.id || ""; |
| 42566 |
this.ref = attributes.ref || ""; |
| 42567 |
this.usage = getStringOption(attributes.usage, ["exportAndImport", "exportOnly", "importOnly"]); |
| 42568 |
this.use = attributes.use || ""; |
| 42569 |
this.usehref = attributes.usehref || ""; |
| 42570 |
this.picture = null; |
| 42571 |
} |
| 42572 |
} |
| 42573 |
class ContentArea extends XFAObject { |
| 42574 |
constructor(attributes) { |
| 42575 |
super(TEMPLATE_NS_ID, "contentArea", true); |
| 42576 |
this.h = getMeasurement(attributes.h); |
| 42577 |
this.id = attributes.id || ""; |
| 42578 |
this.name = attributes.name || ""; |
| 42579 |
this.relevant = getRelevant(attributes.relevant); |
| 42580 |
this.use = attributes.use || ""; |
| 42581 |
this.usehref = attributes.usehref || ""; |
| 42582 |
this.w = getMeasurement(attributes.w); |
| 42583 |
this.x = getMeasurement(attributes.x, "0pt"); |
| 42584 |
this.y = getMeasurement(attributes.y, "0pt"); |
| 42585 |
this.desc = null; |
| 42586 |
this.extras = null; |
| 42587 |
} |
| 42588 |
[$toHTML](availableSpace) { |
| 42589 |
const left = measureToString(this.x); |
| 42590 |
const top = measureToString(this.y); |
| 42591 |
const style = { |
| 42592 |
left, |
| 42593 |
top, |
| 42594 |
width: measureToString(this.w), |
| 42595 |
height: measureToString(this.h) |
| 42596 |
}; |
| 42597 |
const classNames = ["xfaContentarea"]; |
| 42598 |
if (isPrintOnly(this)) { |
| 42599 |
classNames.push("xfaPrintOnly"); |
| 42600 |
} |
| 42601 |
return HTMLResult.success({ |
| 42602 |
name: "div", |
| 42603 |
children: [], |
| 42604 |
attributes: { |
| 42605 |
style, |
| 42606 |
class: classNames, |
| 42607 |
id: this[$uid] |
| 42608 |
} |
| 42609 |
}); |
| 42610 |
} |
| 42611 |
} |
| 42612 |
class Corner extends XFAObject { |
| 42613 |
constructor(attributes) { |
| 42614 |
super(TEMPLATE_NS_ID, "corner", true); |
| 42615 |
this.id = attributes.id || ""; |
| 42616 |
this.inverted = getInteger({ |
| 42617 |
data: attributes.inverted, |
| 42618 |
defaultValue: 0, |
| 42619 |
validate: x => x === 1 |
| 42620 |
}); |
| 42621 |
this.join = getStringOption(attributes.join, ["square", "round"]); |
| 42622 |
this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); |
| 42623 |
this.radius = getMeasurement(attributes.radius); |
| 42624 |
this.stroke = getStringOption(attributes.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]); |
| 42625 |
this.thickness = getMeasurement(attributes.thickness, "0.5pt"); |
| 42626 |
this.use = attributes.use || ""; |
| 42627 |
this.usehref = attributes.usehref || ""; |
| 42628 |
this.color = null; |
| 42629 |
this.extras = null; |
| 42630 |
} |
| 42631 |
[$toStyle]() { |
| 42632 |
const style = toStyle(this, "visibility"); |
| 42633 |
style.radius = measureToString(this.join === "square" ? 0 : this.radius); |
| 42634 |
return style; |
| 42635 |
} |
| 42636 |
} |
| 42637 |
class DateElement extends ContentObject { |
| 42638 |
constructor(attributes) { |
| 42639 |
super(TEMPLATE_NS_ID, "date"); |
| 42640 |
this.id = attributes.id || ""; |
| 42641 |
this.name = attributes.name || ""; |
| 42642 |
this.use = attributes.use || ""; |
| 42643 |
this.usehref = attributes.usehref || ""; |
| 42644 |
} |
| 42645 |
[$finalize]() { |
| 42646 |
const date = this[$content].trim(); |
| 42647 |
this[$content] = date ? new Date(date) : null; |
| 42648 |
} |
| 42649 |
[$toHTML](availableSpace) { |
| 42650 |
return valueToHtml(this[$content] ? this[$content].toString() : ""); |
| 42651 |
} |
| 42652 |
} |
| 42653 |
class DateTime extends ContentObject { |
| 42654 |
constructor(attributes) { |
| 42655 |
super(TEMPLATE_NS_ID, "dateTime"); |
| 42656 |
this.id = attributes.id || ""; |
| 42657 |
this.name = attributes.name || ""; |
| 42658 |
this.use = attributes.use || ""; |
| 42659 |
this.usehref = attributes.usehref || ""; |
| 42660 |
} |
| 42661 |
[$finalize]() { |
| 42662 |
const date = this[$content].trim(); |
| 42663 |
this[$content] = date ? new Date(date) : null; |
| 42664 |
} |
| 42665 |
[$toHTML](availableSpace) { |
| 42666 |
return valueToHtml(this[$content] ? this[$content].toString() : ""); |
| 42667 |
} |
| 42668 |
} |
| 42669 |
class DateTimeEdit extends XFAObject { |
| 42670 |
constructor(attributes) { |
| 42671 |
super(TEMPLATE_NS_ID, "dateTimeEdit", true); |
| 42672 |
this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]); |
| 42673 |
this.id = attributes.id || ""; |
| 42674 |
this.picker = getStringOption(attributes.picker, ["host", "none"]); |
| 42675 |
this.use = attributes.use || ""; |
| 42676 |
this.usehref = attributes.usehref || ""; |
| 42677 |
this.border = null; |
| 42678 |
this.comb = null; |
| 42679 |
this.extras = null; |
| 42680 |
this.margin = null; |
| 42681 |
} |
| 42682 |
[$toHTML](availableSpace) { |
| 42683 |
const style = toStyle(this, "border", "font", "margin"); |
| 42684 |
const field = this[$getParent]()[$getParent](); |
| 42685 |
const html = { |
| 42686 |
name: "input", |
| 42687 |
attributes: { |
| 42688 |
type: "text", |
| 42689 |
fieldId: field[$uid], |
| 42690 |
dataId: field[$data]?.[$uid] || field[$uid], |
| 42691 |
class: ["xfaTextfield"], |
| 42692 |
style, |
| 42693 |
"aria-label": ariaLabel(field), |
| 42694 |
"aria-required": false |
| 42695 |
} |
| 42696 |
}; |
| 42697 |
if (isRequired(field)) { |
| 42698 |
html.attributes["aria-required"] = true; |
| 42699 |
html.attributes.required = true; |
| 42700 |
} |
| 42701 |
return HTMLResult.success({ |
| 42702 |
name: "label", |
| 42703 |
attributes: { |
| 42704 |
class: ["xfaLabel"] |
| 42705 |
}, |
| 42706 |
children: [html] |
| 42707 |
}); |
| 42708 |
} |
| 42709 |
} |
| 42710 |
class Decimal extends ContentObject { |
| 42711 |
constructor(attributes) { |
| 42712 |
super(TEMPLATE_NS_ID, "decimal"); |
| 42713 |
this.fracDigits = getInteger({ |
| 42714 |
data: attributes.fracDigits, |
| 42715 |
defaultValue: 2, |
| 42716 |
validate: x => true |
| 42717 |
}); |
| 42718 |
this.id = attributes.id || ""; |
| 42719 |
this.leadDigits = getInteger({ |
| 42720 |
data: attributes.leadDigits, |
| 42721 |
defaultValue: -1, |
| 42722 |
validate: x => true |
| 42723 |
}); |
| 42724 |
this.name = attributes.name || ""; |
| 42725 |
this.use = attributes.use || ""; |
| 42726 |
this.usehref = attributes.usehref || ""; |
| 42727 |
} |
| 42728 |
[$finalize]() { |
| 42729 |
const number = parseFloat(this[$content].trim()); |
| 42730 |
this[$content] = isNaN(number) ? null : number; |
| 42731 |
} |
| 42732 |
[$toHTML](availableSpace) { |
| 42733 |
return valueToHtml(this[$content] !== null ? this[$content].toString() : ""); |
| 42734 |
} |
| 42735 |
} |
| 42736 |
class DefaultUi extends XFAObject { |
| 42737 |
constructor(attributes) { |
| 42738 |
super(TEMPLATE_NS_ID, "defaultUi", true); |
| 42739 |
this.id = attributes.id || ""; |
| 42740 |
this.use = attributes.use || ""; |
| 42741 |
this.usehref = attributes.usehref || ""; |
| 42742 |
this.extras = null; |
| 42743 |
} |
| 42744 |
} |
| 42745 |
class Desc extends XFAObject { |
| 42746 |
constructor(attributes) { |
| 42747 |
super(TEMPLATE_NS_ID, "desc", true); |
| 42748 |
this.id = attributes.id || ""; |
| 42749 |
this.use = attributes.use || ""; |
| 42750 |
this.usehref = attributes.usehref || ""; |
| 42751 |
this.boolean = new XFAObjectArray(); |
| 42752 |
this.date = new XFAObjectArray(); |
| 42753 |
this.dateTime = new XFAObjectArray(); |
| 42754 |
this.decimal = new XFAObjectArray(); |
| 42755 |
this.exData = new XFAObjectArray(); |
| 42756 |
this.float = new XFAObjectArray(); |
| 42757 |
this.image = new XFAObjectArray(); |
| 42758 |
this.integer = new XFAObjectArray(); |
| 42759 |
this.text = new XFAObjectArray(); |
| 42760 |
this.time = new XFAObjectArray(); |
| 42761 |
} |
| 42762 |
} |
| 42763 |
class DigestMethod extends OptionObject { |
| 42764 |
constructor(attributes) { |
| 42765 |
super(TEMPLATE_NS_ID, "digestMethod", ["", "SHA1", "SHA256", "SHA512", "RIPEMD160"]); |
| 42766 |
this.id = attributes.id || ""; |
| 42767 |
this.use = attributes.use || ""; |
| 42768 |
this.usehref = attributes.usehref || ""; |
| 42769 |
} |
| 42770 |
} |
| 42771 |
class DigestMethods extends XFAObject { |
| 42772 |
constructor(attributes) { |
| 42773 |
super(TEMPLATE_NS_ID, "digestMethods", true); |
| 42774 |
this.id = attributes.id || ""; |
| 42775 |
this.type = getStringOption(attributes.type, ["optional", "required"]); |
| 42776 |
this.use = attributes.use || ""; |
| 42777 |
this.usehref = attributes.usehref || ""; |
| 42778 |
this.digestMethod = new XFAObjectArray(); |
| 42779 |
} |
| 42780 |
} |
| 42781 |
class Draw extends XFAObject { |
| 42782 |
constructor(attributes) { |
| 42783 |
super(TEMPLATE_NS_ID, "draw", true); |
| 42784 |
this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]); |
| 42785 |
this.colSpan = getInteger({ |
| 42786 |
data: attributes.colSpan, |
| 42787 |
defaultValue: 1, |
| 42788 |
validate: n => n >= 1 || n === -1 |
| 42789 |
}); |
| 42790 |
this.h = attributes.h ? getMeasurement(attributes.h) : ""; |
| 42791 |
this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); |
| 42792 |
this.id = attributes.id || ""; |
| 42793 |
this.locale = attributes.locale || ""; |
| 42794 |
this.maxH = getMeasurement(attributes.maxH, "0pt"); |
| 42795 |
this.maxW = getMeasurement(attributes.maxW, "0pt"); |
| 42796 |
this.minH = getMeasurement(attributes.minH, "0pt"); |
| 42797 |
this.minW = getMeasurement(attributes.minW, "0pt"); |
| 42798 |
this.name = attributes.name || ""; |
| 42799 |
this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); |
| 42800 |
this.relevant = getRelevant(attributes.relevant); |
| 42801 |
this.rotate = getInteger({ |
| 42802 |
data: attributes.rotate, |
| 42803 |
defaultValue: 0, |
| 42804 |
validate: x => x % 90 === 0 |
| 42805 |
}); |
| 42806 |
this.use = attributes.use || ""; |
| 42807 |
this.usehref = attributes.usehref || ""; |
| 42808 |
this.w = attributes.w ? getMeasurement(attributes.w) : ""; |
| 42809 |
this.x = getMeasurement(attributes.x, "0pt"); |
| 42810 |
this.y = getMeasurement(attributes.y, "0pt"); |
| 42811 |
this.assist = null; |
| 42812 |
this.border = null; |
| 42813 |
this.caption = null; |
| 42814 |
this.desc = null; |
| 42815 |
this.extras = null; |
| 42816 |
this.font = null; |
| 42817 |
this.keep = null; |
| 42818 |
this.margin = null; |
| 42819 |
this.para = null; |
| 42820 |
this.traversal = null; |
| 42821 |
this.ui = null; |
| 42822 |
this.value = null; |
| 42823 |
this.setProperty = new XFAObjectArray(); |
| 42824 |
} |
| 42825 |
[$setValue](value) { |
| 42826 |
_setValue(this, value); |
| 42827 |
} |
| 42828 |
[$toHTML](availableSpace) { |
| 42829 |
setTabIndex(this); |
| 42830 |
if (this.presence === "hidden" || this.presence === "inactive") { |
| 42831 |
return HTMLResult.EMPTY; |
| 42832 |
} |
| 42833 |
fixDimensions(this); |
| 42834 |
this[$pushPara](); |
| 42835 |
const savedW = this.w; |
| 42836 |
const savedH = this.h; |
| 42837 |
const { |
| 42838 |
w, |
| 42839 |
h, |
| 42840 |
isBroken |
| 42841 |
} = layoutNode(this, availableSpace); |
| 42842 |
if (w && this.w === "") { |
| 42843 |
if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) { |
| 42844 |
this[$popPara](); |
| 42845 |
return HTMLResult.FAILURE; |
| 42846 |
} |
| 42847 |
this.w = w; |
| 42848 |
} |
| 42849 |
if (h && this.h === "") { |
| 42850 |
this.h = h; |
| 42851 |
} |
| 42852 |
setFirstUnsplittable(this); |
| 42853 |
if (!checkDimensions(this, availableSpace)) { |
| 42854 |
this.w = savedW; |
| 42855 |
this.h = savedH; |
| 42856 |
this[$popPara](); |
| 42857 |
return HTMLResult.FAILURE; |
| 42858 |
} |
| 42859 |
unsetFirstUnsplittable(this); |
| 42860 |
const style = toStyle(this, "font", "hAlign", "dimensions", "position", "presence", "rotate", "anchorType", "border", "margin"); |
| 42861 |
setMinMaxDimensions(this, style); |
| 42862 |
if (style.margin) { |
| 42863 |
style.padding = style.margin; |
| 42864 |
delete style.margin; |
| 42865 |
} |
| 42866 |
const classNames = ["xfaDraw"]; |
| 42867 |
if (this.font) { |
| 42868 |
classNames.push("xfaFont"); |
| 42869 |
} |
| 42870 |
if (isPrintOnly(this)) { |
| 42871 |
classNames.push("xfaPrintOnly"); |
| 42872 |
} |
| 42873 |
const attributes = { |
| 42874 |
style, |
| 42875 |
id: this[$uid], |
| 42876 |
class: classNames |
| 42877 |
}; |
| 42878 |
if (this.name) { |
| 42879 |
attributes.xfaName = this.name; |
| 42880 |
} |
| 42881 |
const html = { |
| 42882 |
name: "div", |
| 42883 |
attributes, |
| 42884 |
children: [] |
| 42885 |
}; |
| 42886 |
applyAssist(this, attributes); |
| 42887 |
const bbox = computeBbox(this, html, availableSpace); |
| 42888 |
const value = this.value ? this.value[$toHTML](availableSpace).html : null; |
| 42889 |
if (value === null) { |
| 42890 |
this.w = savedW; |
| 42891 |
this.h = savedH; |
| 42892 |
this[$popPara](); |
| 42893 |
return HTMLResult.success(createWrapper(this, html), bbox); |
| 42894 |
} |
| 42895 |
html.children.push(value); |
| 42896 |
setPara(this, style, value); |
| 42897 |
this.w = savedW; |
| 42898 |
this.h = savedH; |
| 42899 |
this[$popPara](); |
| 42900 |
return HTMLResult.success(createWrapper(this, html), bbox); |
| 42901 |
} |
| 42902 |
} |
| 42903 |
class Edge extends XFAObject { |
| 42904 |
constructor(attributes) { |
| 42905 |
super(TEMPLATE_NS_ID, "edge", true); |
| 42906 |
this.cap = getStringOption(attributes.cap, ["square", "butt", "round"]); |
| 42907 |
this.id = attributes.id || ""; |
| 42908 |
this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); |
| 42909 |
this.stroke = getStringOption(attributes.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]); |
| 42910 |
this.thickness = getMeasurement(attributes.thickness, "0.5pt"); |
| 42911 |
this.use = attributes.use || ""; |
| 42912 |
this.usehref = attributes.usehref || ""; |
| 42913 |
this.color = null; |
| 42914 |
this.extras = null; |
| 42915 |
} |
| 42916 |
[$toStyle]() { |
| 42917 |
const style = toStyle(this, "visibility"); |
| 42918 |
Object.assign(style, { |
| 42919 |
linecap: this.cap, |
| 42920 |
width: measureToString(this.thickness), |
| 42921 |
color: this.color ? this.color[$toStyle]() : "#000000", |
| 42922 |
style: "" |
| 42923 |
}); |
| 42924 |
if (this.presence !== "visible") { |
| 42925 |
style.style = "none"; |
| 42926 |
} else { |
| 42927 |
switch (this.stroke) { |
| 42928 |
case "solid": |
| 42929 |
style.style = "solid"; |
| 42930 |
break; |
| 42931 |
case "dashDot": |
| 42932 |
style.style = "dashed"; |
| 42933 |
break; |
| 42934 |
case "dashDotDot": |
| 42935 |
style.style = "dashed"; |
| 42936 |
break; |
| 42937 |
case "dashed": |
| 42938 |
style.style = "dashed"; |
| 42939 |
break; |
| 42940 |
case "dotted": |
| 42941 |
style.style = "dotted"; |
| 42942 |
break; |
| 42943 |
case "embossed": |
| 42944 |
style.style = "ridge"; |
| 42945 |
break; |
| 42946 |
case "etched": |
| 42947 |
style.style = "groove"; |
| 42948 |
break; |
| 42949 |
case "lowered": |
| 42950 |
style.style = "inset"; |
| 42951 |
break; |
| 42952 |
case "raised": |
| 42953 |
style.style = "outset"; |
| 42954 |
break; |
| 42955 |
} |
| 42956 |
} |
| 42957 |
return style; |
| 42958 |
} |
| 42959 |
} |
| 42960 |
class Encoding extends OptionObject { |
| 42961 |
constructor(attributes) { |
| 42962 |
super(TEMPLATE_NS_ID, "encoding", ["adbe.x509.rsa_sha1", "adbe.pkcs7.detached", "adbe.pkcs7.sha1"]); |
| 42963 |
this.id = attributes.id || ""; |
| 42964 |
this.use = attributes.use || ""; |
| 42965 |
this.usehref = attributes.usehref || ""; |
| 42966 |
} |
| 42967 |
} |
| 42968 |
class Encodings extends XFAObject { |
| 42969 |
constructor(attributes) { |
| 42970 |
super(TEMPLATE_NS_ID, "encodings", true); |
| 42971 |
this.id = attributes.id || ""; |
| 42972 |
this.type = getStringOption(attributes.type, ["optional", "required"]); |
| 42973 |
this.use = attributes.use || ""; |
| 42974 |
this.usehref = attributes.usehref || ""; |
| 42975 |
this.encoding = new XFAObjectArray(); |
| 42976 |
} |
| 42977 |
} |
| 42978 |
class Encrypt extends XFAObject { |
| 42979 |
constructor(attributes) { |
| 42980 |
super(TEMPLATE_NS_ID, "encrypt", true); |
| 42981 |
this.id = attributes.id || ""; |
| 42982 |
this.use = attributes.use || ""; |
| 42983 |
this.usehref = attributes.usehref || ""; |
| 42984 |
this.certificate = null; |
| 42985 |
} |
| 42986 |
} |
| 42987 |
class EncryptData extends XFAObject { |
| 42988 |
constructor(attributes) { |
| 42989 |
super(TEMPLATE_NS_ID, "encryptData", true); |
| 42990 |
this.id = attributes.id || ""; |
| 42991 |
this.operation = getStringOption(attributes.operation, ["encrypt", "decrypt"]); |
| 42992 |
this.target = attributes.target || ""; |
| 42993 |
this.use = attributes.use || ""; |
| 42994 |
this.usehref = attributes.usehref || ""; |
| 42995 |
this.filter = null; |
| 42996 |
this.manifest = null; |
| 42997 |
} |
| 42998 |
} |
| 42999 |
class Encryption extends XFAObject { |
| 43000 |
constructor(attributes) { |
| 43001 |
super(TEMPLATE_NS_ID, "encryption", true); |
| 43002 |
this.id = attributes.id || ""; |
| 43003 |
this.type = getStringOption(attributes.type, ["optional", "required"]); |
| 43004 |
this.use = attributes.use || ""; |
| 43005 |
this.usehref = attributes.usehref || ""; |
| 43006 |
this.certificate = new XFAObjectArray(); |
| 43007 |
} |
| 43008 |
} |
| 43009 |
class EncryptionMethod extends OptionObject { |
| 43010 |
constructor(attributes) { |
| 43011 |
super(TEMPLATE_NS_ID, "encryptionMethod", ["", "AES256-CBC", "TRIPLEDES-CBC", "AES128-CBC", "AES192-CBC"]); |
| 43012 |
this.id = attributes.id || ""; |
| 43013 |
this.use = attributes.use || ""; |
| 43014 |
this.usehref = attributes.usehref || ""; |
| 43015 |
} |
| 43016 |
} |
| 43017 |
class EncryptionMethods extends XFAObject { |
| 43018 |
constructor(attributes) { |
| 43019 |
super(TEMPLATE_NS_ID, "encryptionMethods", true); |
| 43020 |
this.id = attributes.id || ""; |
| 43021 |
this.type = getStringOption(attributes.type, ["optional", "required"]); |
| 43022 |
this.use = attributes.use || ""; |
| 43023 |
this.usehref = attributes.usehref || ""; |
| 43024 |
this.encryptionMethod = new XFAObjectArray(); |
| 43025 |
} |
| 43026 |
} |
| 43027 |
class Event extends XFAObject { |
| 43028 |
constructor(attributes) { |
| 43029 |
super(TEMPLATE_NS_ID, "event", true); |
| 43030 |
this.activity = getStringOption(attributes.activity, ["click", "change", "docClose", "docReady", "enter", "exit", "full", "indexChange", "initialize", "mouseDown", "mouseEnter", "mouseExit", "mouseUp", "postExecute", "postOpen", "postPrint", "postSave", "postSign", "postSubmit", "preExecute", "preOpen", "prePrint", "preSave", "preSign", "preSubmit", "ready", "validationState"]); |
| 43031 |
this.id = attributes.id || ""; |
| 43032 |
this.listen = getStringOption(attributes.listen, ["refOnly", "refAndDescendents"]); |
| 43033 |
this.name = attributes.name || ""; |
| 43034 |
this.ref = attributes.ref || ""; |
| 43035 |
this.use = attributes.use || ""; |
| 43036 |
this.usehref = attributes.usehref || ""; |
| 43037 |
this.extras = null; |
| 43038 |
this.encryptData = null; |
| 43039 |
this.execute = null; |
| 43040 |
this.script = null; |
| 43041 |
this.signData = null; |
| 43042 |
this.submit = null; |
| 43043 |
} |
| 43044 |
} |
| 43045 |
class ExData extends ContentObject { |
| 43046 |
constructor(attributes) { |
| 43047 |
super(TEMPLATE_NS_ID, "exData"); |
| 43048 |
this.contentType = attributes.contentType || ""; |
| 43049 |
this.href = attributes.href || ""; |
| 43050 |
this.id = attributes.id || ""; |
| 43051 |
this.maxLength = getInteger({ |
| 43052 |
data: attributes.maxLength, |
| 43053 |
defaultValue: -1, |
| 43054 |
validate: x => x >= -1 |
| 43055 |
}); |
| 43056 |
this.name = attributes.name || ""; |
| 43057 |
this.rid = attributes.rid || ""; |
| 43058 |
this.transferEncoding = getStringOption(attributes.transferEncoding, ["none", "base64", "package"]); |
| 43059 |
this.use = attributes.use || ""; |
| 43060 |
this.usehref = attributes.usehref || ""; |
| 43061 |
} |
| 43062 |
[$isCDATAXml]() { |
| 43063 |
return this.contentType === "text/html"; |
| 43064 |
} |
| 43065 |
[$onChild](child) { |
| 43066 |
if (this.contentType === "text/html" && child[$namespaceId] === NamespaceIds.xhtml.id) { |
| 43067 |
this[$content] = child; |
| 43068 |
return true; |
| 43069 |
} |
| 43070 |
if (this.contentType === "text/xml") { |
| 43071 |
this[$content] = child; |
| 43072 |
return true; |
| 43073 |
} |
| 43074 |
return false; |
| 43075 |
} |
| 43076 |
[$toHTML](availableSpace) { |
| 43077 |
if (this.contentType !== "text/html" || !this[$content]) { |
| 43078 |
return HTMLResult.EMPTY; |
| 43079 |
} |
| 43080 |
return this[$content][$toHTML](availableSpace); |
| 43081 |
} |
| 43082 |
} |
| 43083 |
class ExObject extends XFAObject { |
| 43084 |
constructor(attributes) { |
| 43085 |
super(TEMPLATE_NS_ID, "exObject", true); |
| 43086 |
this.archive = attributes.archive || ""; |
| 43087 |
this.classId = attributes.classId || ""; |
| 43088 |
this.codeBase = attributes.codeBase || ""; |
| 43089 |
this.codeType = attributes.codeType || ""; |
| 43090 |
this.id = attributes.id || ""; |
| 43091 |
this.name = attributes.name || ""; |
| 43092 |
this.use = attributes.use || ""; |
| 43093 |
this.usehref = attributes.usehref || ""; |
| 43094 |
this.extras = null; |
| 43095 |
this.boolean = new XFAObjectArray(); |
| 43096 |
this.date = new XFAObjectArray(); |
| 43097 |
this.dateTime = new XFAObjectArray(); |
| 43098 |
this.decimal = new XFAObjectArray(); |
| 43099 |
this.exData = new XFAObjectArray(); |
| 43100 |
this.exObject = new XFAObjectArray(); |
| 43101 |
this.float = new XFAObjectArray(); |
| 43102 |
this.image = new XFAObjectArray(); |
| 43103 |
this.integer = new XFAObjectArray(); |
| 43104 |
this.text = new XFAObjectArray(); |
| 43105 |
this.time = new XFAObjectArray(); |
| 43106 |
} |
| 43107 |
} |
| 43108 |
class ExclGroup extends XFAObject { |
| 43109 |
constructor(attributes) { |
| 43110 |
super(TEMPLATE_NS_ID, "exclGroup", true); |
| 43111 |
this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]); |
| 43112 |
this.accessKey = attributes.accessKey || ""; |
| 43113 |
this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]); |
| 43114 |
this.colSpan = getInteger({ |
| 43115 |
data: attributes.colSpan, |
| 43116 |
defaultValue: 1, |
| 43117 |
validate: n => n >= 1 || n === -1 |
| 43118 |
}); |
| 43119 |
this.h = attributes.h ? getMeasurement(attributes.h) : ""; |
| 43120 |
this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); |
| 43121 |
this.id = attributes.id || ""; |
| 43122 |
this.layout = getStringOption(attributes.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]); |
| 43123 |
this.maxH = getMeasurement(attributes.maxH, "0pt"); |
| 43124 |
this.maxW = getMeasurement(attributes.maxW, "0pt"); |
| 43125 |
this.minH = getMeasurement(attributes.minH, "0pt"); |
| 43126 |
this.minW = getMeasurement(attributes.minW, "0pt"); |
| 43127 |
this.name = attributes.name || ""; |
| 43128 |
this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); |
| 43129 |
this.relevant = getRelevant(attributes.relevant); |
| 43130 |
this.use = attributes.use || ""; |
| 43131 |
this.usehref = attributes.usehref || ""; |
| 43132 |
this.w = attributes.w ? getMeasurement(attributes.w) : ""; |
| 43133 |
this.x = getMeasurement(attributes.x, "0pt"); |
| 43134 |
this.y = getMeasurement(attributes.y, "0pt"); |
| 43135 |
this.assist = null; |
| 43136 |
this.bind = null; |
| 43137 |
this.border = null; |
| 43138 |
this.calculate = null; |
| 43139 |
this.caption = null; |
| 43140 |
this.desc = null; |
| 43141 |
this.extras = null; |
| 43142 |
this.margin = null; |
| 43143 |
this.para = null; |
| 43144 |
this.traversal = null; |
| 43145 |
this.validate = null; |
| 43146 |
this.connect = new XFAObjectArray(); |
| 43147 |
this.event = new XFAObjectArray(); |
| 43148 |
this.field = new XFAObjectArray(); |
| 43149 |
this.setProperty = new XFAObjectArray(); |
| 43150 |
} |
| 43151 |
[$isBindable]() { |
| 43152 |
return true; |
| 43153 |
} |
| 43154 |
[$hasSettableValue]() { |
| 43155 |
return true; |
| 43156 |
} |
| 43157 |
[$setValue](value) { |
| 43158 |
for (const field of this.field.children) { |
| 43159 |
if (!field.value) { |
| 43160 |
const nodeValue = new Value({}); |
| 43161 |
field[$appendChild](nodeValue); |
| 43162 |
field.value = nodeValue; |
| 43163 |
} |
| 43164 |
field.value[$setValue](value); |
| 43165 |
} |
| 43166 |
} |
| 43167 |
[$isThereMoreWidth]() { |
| 43168 |
return this.layout.endsWith("-tb") && this[$extra].attempt === 0 && this[$extra].numberInLine > 0 || this[$getParent]()[$isThereMoreWidth](); |
| 43169 |
} |
| 43170 |
[$isSplittable]() { |
| 43171 |
const parent = this[$getSubformParent](); |
| 43172 |
if (!parent[$isSplittable]()) { |
| 43173 |
return false; |
| 43174 |
} |
| 43175 |
if (this[$extra]._isSplittable !== undefined) { |
| 43176 |
return this[$extra]._isSplittable; |
| 43177 |
} |
| 43178 |
if (this.layout === "position" || this.layout.includes("row")) { |
| 43179 |
this[$extra]._isSplittable = false; |
| 43180 |
return false; |
| 43181 |
} |
| 43182 |
if (parent.layout?.endsWith("-tb") && parent[$extra].numberInLine !== 0) { |
| 43183 |
return false; |
| 43184 |
} |
| 43185 |
this[$extra]._isSplittable = true; |
| 43186 |
return true; |
| 43187 |
} |
| 43188 |
[$flushHTML]() { |
| 43189 |
return flushHTML(this); |
| 43190 |
} |
| 43191 |
[$addHTML](html, bbox) { |
| 43192 |
addHTML(this, html, bbox); |
| 43193 |
} |
| 43194 |
[$getAvailableSpace]() { |
| 43195 |
return getAvailableSpace(this); |
| 43196 |
} |
| 43197 |
[$toHTML](availableSpace) { |
| 43198 |
setTabIndex(this); |
| 43199 |
if (this.presence === "hidden" || this.presence === "inactive" || this.h === 0 || this.w === 0) { |
| 43200 |
return HTMLResult.EMPTY; |
| 43201 |
} |
| 43202 |
fixDimensions(this); |
| 43203 |
const children = []; |
| 43204 |
const attributes = { |
| 43205 |
id: this[$uid], |
| 43206 |
class: [] |
| 43207 |
}; |
| 43208 |
setAccess(this, attributes.class); |
| 43209 |
if (!this[$extra]) { |
| 43210 |
this[$extra] = Object.create(null); |
| 43211 |
} |
| 43212 |
Object.assign(this[$extra], { |
| 43213 |
children, |
| 43214 |
attributes, |
| 43215 |
attempt: 0, |
| 43216 |
line: null, |
| 43217 |
numberInLine: 0, |
| 43218 |
availableSpace: { |
| 43219 |
width: Math.min(this.w || Infinity, availableSpace.width), |
| 43220 |
height: Math.min(this.h || Infinity, availableSpace.height) |
| 43221 |
}, |
| 43222 |
width: 0, |
| 43223 |
height: 0, |
| 43224 |
prevHeight: 0, |
| 43225 |
currentWidth: 0 |
| 43226 |
}); |
| 43227 |
const isSplittable = this[$isSplittable](); |
| 43228 |
if (!isSplittable) { |
| 43229 |
setFirstUnsplittable(this); |
| 43230 |
} |
| 43231 |
if (!checkDimensions(this, availableSpace)) { |
| 43232 |
return HTMLResult.FAILURE; |
| 43233 |
} |
| 43234 |
const filter = new Set(["field"]); |
| 43235 |
if (this.layout.includes("row")) { |
| 43236 |
const columnWidths = this[$getSubformParent]().columnWidths; |
| 43237 |
if (Array.isArray(columnWidths) && columnWidths.length > 0) { |
| 43238 |
this[$extra].columnWidths = columnWidths; |
| 43239 |
this[$extra].currentColumn = 0; |
| 43240 |
} |
| 43241 |
} |
| 43242 |
const style = toStyle(this, "anchorType", "dimensions", "position", "presence", "border", "margin", "hAlign"); |
| 43243 |
const classNames = ["xfaExclgroup"]; |
| 43244 |
const cl = layoutClass(this); |
| 43245 |
if (cl) { |
| 43246 |
classNames.push(cl); |
| 43247 |
} |
| 43248 |
if (isPrintOnly(this)) { |
| 43249 |
classNames.push("xfaPrintOnly"); |
| 43250 |
} |
| 43251 |
attributes.style = style; |
| 43252 |
attributes.class = classNames; |
| 43253 |
if (this.name) { |
| 43254 |
attributes.xfaName = this.name; |
| 43255 |
} |
| 43256 |
this[$pushPara](); |
| 43257 |
const isLrTb = this.layout === "lr-tb" || this.layout === "rl-tb"; |
| 43258 |
const maxRun = isLrTb ? MAX_ATTEMPTS_FOR_LRTB_LAYOUT : 1; |
| 43259 |
for (; this[$extra].attempt < maxRun; this[$extra].attempt++) { |
| 43260 |
if (isLrTb && this[$extra].attempt === MAX_ATTEMPTS_FOR_LRTB_LAYOUT - 1) { |
| 43261 |
this[$extra].numberInLine = 0; |
| 43262 |
} |
| 43263 |
const result = this[$childrenToHTML]({ |
| 43264 |
filter, |
| 43265 |
include: true |
| 43266 |
}); |
| 43267 |
if (result.success) { |
| 43268 |
break; |
| 43269 |
} |
| 43270 |
if (result.isBreak()) { |
| 43271 |
this[$popPara](); |
| 43272 |
return result; |
| 43273 |
} |
| 43274 |
if (isLrTb && this[$extra].attempt === 0 && this[$extra].numberInLine === 0 && !this[$getTemplateRoot]()[$extra].noLayoutFailure) { |
| 43275 |
this[$extra].attempt = maxRun; |
| 43276 |
break; |
| 43277 |
} |
| 43278 |
} |
| 43279 |
this[$popPara](); |
| 43280 |
if (!isSplittable) { |
| 43281 |
unsetFirstUnsplittable(this); |
| 43282 |
} |
| 43283 |
if (this[$extra].attempt === maxRun) { |
| 43284 |
if (!isSplittable) { |
| 43285 |
delete this[$extra]; |
| 43286 |
} |
| 43287 |
return HTMLResult.FAILURE; |
| 43288 |
} |
| 43289 |
let marginH = 0; |
| 43290 |
let marginV = 0; |
| 43291 |
if (this.margin) { |
| 43292 |
marginH = this.margin.leftInset + this.margin.rightInset; |
| 43293 |
marginV = this.margin.topInset + this.margin.bottomInset; |
| 43294 |
} |
| 43295 |
const width = Math.max(this[$extra].width + marginH, this.w || 0); |
| 43296 |
const height = Math.max(this[$extra].height + marginV, this.h || 0); |
| 43297 |
const bbox = [this.x, this.y, width, height]; |
| 43298 |
if (this.w === "") { |
| 43299 |
style.width = measureToString(width); |
| 43300 |
} |
| 43301 |
if (this.h === "") { |
| 43302 |
style.height = measureToString(height); |
| 43303 |
} |
| 43304 |
const html = { |
| 43305 |
name: "div", |
| 43306 |
attributes, |
| 43307 |
children |
| 43308 |
}; |
| 43309 |
applyAssist(this, attributes); |
| 43310 |
delete this[$extra]; |
| 43311 |
return HTMLResult.success(createWrapper(this, html), bbox); |
| 43312 |
} |
| 43313 |
} |
| 43314 |
class Execute extends XFAObject { |
| 43315 |
constructor(attributes) { |
| 43316 |
super(TEMPLATE_NS_ID, "execute"); |
| 43317 |
this.connection = attributes.connection || ""; |
| 43318 |
this.executeType = getStringOption(attributes.executeType, ["import", "remerge"]); |
| 43319 |
this.id = attributes.id || ""; |
| 43320 |
this.runAt = getStringOption(attributes.runAt, ["client", "both", "server"]); |
| 43321 |
this.use = attributes.use || ""; |
| 43322 |
this.usehref = attributes.usehref || ""; |
| 43323 |
} |
| 43324 |
} |
| 43325 |
class Extras extends XFAObject { |
| 43326 |
constructor(attributes) { |
| 43327 |
super(TEMPLATE_NS_ID, "extras", true); |
| 43328 |
this.id = attributes.id || ""; |
| 43329 |
this.name = attributes.name || ""; |
| 43330 |
this.use = attributes.use || ""; |
| 43331 |
this.usehref = attributes.usehref || ""; |
| 43332 |
this.boolean = new XFAObjectArray(); |
| 43333 |
this.date = new XFAObjectArray(); |
| 43334 |
this.dateTime = new XFAObjectArray(); |
| 43335 |
this.decimal = new XFAObjectArray(); |
| 43336 |
this.exData = new XFAObjectArray(); |
| 43337 |
this.extras = new XFAObjectArray(); |
| 43338 |
this.float = new XFAObjectArray(); |
| 43339 |
this.image = new XFAObjectArray(); |
| 43340 |
this.integer = new XFAObjectArray(); |
| 43341 |
this.text = new XFAObjectArray(); |
| 43342 |
this.time = new XFAObjectArray(); |
| 43343 |
} |
| 43344 |
} |
| 43345 |
class Field extends XFAObject { |
| 43346 |
constructor(attributes) { |
| 43347 |
super(TEMPLATE_NS_ID, "field", true); |
| 43348 |
this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]); |
| 43349 |
this.accessKey = attributes.accessKey || ""; |
| 43350 |
this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]); |
| 43351 |
this.colSpan = getInteger({ |
| 43352 |
data: attributes.colSpan, |
| 43353 |
defaultValue: 1, |
| 43354 |
validate: n => n >= 1 || n === -1 |
| 43355 |
}); |
| 43356 |
this.h = attributes.h ? getMeasurement(attributes.h) : ""; |
| 43357 |
this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); |
| 43358 |
this.id = attributes.id || ""; |
| 43359 |
this.locale = attributes.locale || ""; |
| 43360 |
this.maxH = getMeasurement(attributes.maxH, "0pt"); |
| 43361 |
this.maxW = getMeasurement(attributes.maxW, "0pt"); |
| 43362 |
this.minH = getMeasurement(attributes.minH, "0pt"); |
| 43363 |
this.minW = getMeasurement(attributes.minW, "0pt"); |
| 43364 |
this.name = attributes.name || ""; |
| 43365 |
this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); |
| 43366 |
this.relevant = getRelevant(attributes.relevant); |
| 43367 |
this.rotate = getInteger({ |
| 43368 |
data: attributes.rotate, |
| 43369 |
defaultValue: 0, |
| 43370 |
validate: x => x % 90 === 0 |
| 43371 |
}); |
| 43372 |
this.use = attributes.use || ""; |
| 43373 |
this.usehref = attributes.usehref || ""; |
| 43374 |
this.w = attributes.w ? getMeasurement(attributes.w) : ""; |
| 43375 |
this.x = getMeasurement(attributes.x, "0pt"); |
| 43376 |
this.y = getMeasurement(attributes.y, "0pt"); |
| 43377 |
this.assist = null; |
| 43378 |
this.bind = null; |
| 43379 |
this.border = null; |
| 43380 |
this.calculate = null; |
| 43381 |
this.caption = null; |
| 43382 |
this.desc = null; |
| 43383 |
this.extras = null; |
| 43384 |
this.font = null; |
| 43385 |
this.format = null; |
| 43386 |
this.items = new XFAObjectArray(2); |
| 43387 |
this.keep = null; |
| 43388 |
this.margin = null; |
| 43389 |
this.para = null; |
| 43390 |
this.traversal = null; |
| 43391 |
this.ui = null; |
| 43392 |
this.validate = null; |
| 43393 |
this.value = null; |
| 43394 |
this.bindItems = new XFAObjectArray(); |
| 43395 |
this.connect = new XFAObjectArray(); |
| 43396 |
this.event = new XFAObjectArray(); |
| 43397 |
this.setProperty = new XFAObjectArray(); |
| 43398 |
} |
| 43399 |
[$isBindable]() { |
| 43400 |
return true; |
| 43401 |
} |
| 43402 |
[$setValue](value) { |
| 43403 |
_setValue(this, value); |
| 43404 |
} |
| 43405 |
[$toHTML](availableSpace) { |
| 43406 |
setTabIndex(this); |
| 43407 |
if (!this.ui) { |
| 43408 |
this.ui = new Ui({}); |
| 43409 |
this.ui[$globalData] = this[$globalData]; |
| 43410 |
this[$appendChild](this.ui); |
| 43411 |
let node; |
| 43412 |
switch (this.items.children.length) { |
| 43413 |
case 0: |
| 43414 |
node = new TextEdit({}); |
| 43415 |
this.ui.textEdit = node; |
| 43416 |
break; |
| 43417 |
case 1: |
| 43418 |
node = new CheckButton({}); |
| 43419 |
this.ui.checkButton = node; |
| 43420 |
break; |
| 43421 |
case 2: |
| 43422 |
node = new ChoiceList({}); |
| 43423 |
this.ui.choiceList = node; |
| 43424 |
break; |
| 43425 |
} |
| 43426 |
this.ui[$appendChild](node); |
| 43427 |
} |
| 43428 |
if (!this.ui || this.presence === "hidden" || this.presence === "inactive" || this.h === 0 || this.w === 0) { |
| 43429 |
return HTMLResult.EMPTY; |
| 43430 |
} |
| 43431 |
if (this.caption) { |
| 43432 |
delete this.caption[$extra]; |
| 43433 |
} |
| 43434 |
this[$pushPara](); |
| 43435 |
const caption = this.caption ? this.caption[$toHTML](availableSpace).html : null; |
| 43436 |
const savedW = this.w; |
| 43437 |
const savedH = this.h; |
| 43438 |
let marginH = 0; |
| 43439 |
let marginV = 0; |
| 43440 |
if (this.margin) { |
| 43441 |
marginH = this.margin.leftInset + this.margin.rightInset; |
| 43442 |
marginV = this.margin.topInset + this.margin.bottomInset; |
| 43443 |
} |
| 43444 |
let borderDims = null; |
| 43445 |
if (this.w === "" || this.h === "") { |
| 43446 |
let width = null; |
| 43447 |
let height = null; |
| 43448 |
let uiW = 0; |
| 43449 |
let uiH = 0; |
| 43450 |
if (this.ui.checkButton) { |
| 43451 |
uiW = uiH = this.ui.checkButton.size; |
| 43452 |
} else { |
| 43453 |
const { |
| 43454 |
w, |
| 43455 |
h |
| 43456 |
} = layoutNode(this, availableSpace); |
| 43457 |
if (w !== null) { |
| 43458 |
uiW = w; |
| 43459 |
uiH = h; |
| 43460 |
} else { |
| 43461 |
uiH = fonts_getMetrics(this.font, true).lineNoGap; |
| 43462 |
} |
| 43463 |
} |
| 43464 |
borderDims = getBorderDims(this.ui[$getExtra]()); |
| 43465 |
uiW += borderDims.w; |
| 43466 |
uiH += borderDims.h; |
| 43467 |
if (this.caption) { |
| 43468 |
const { |
| 43469 |
w, |
| 43470 |
h, |
| 43471 |
isBroken |
| 43472 |
} = this.caption[$getExtra](availableSpace); |
| 43473 |
if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) { |
| 43474 |
this[$popPara](); |
| 43475 |
return HTMLResult.FAILURE; |
| 43476 |
} |
| 43477 |
width = w; |
| 43478 |
height = h; |
| 43479 |
switch (this.caption.placement) { |
| 43480 |
case "left": |
| 43481 |
case "right": |
| 43482 |
case "inline": |
| 43483 |
width += uiW; |
| 43484 |
break; |
| 43485 |
case "top": |
| 43486 |
case "bottom": |
| 43487 |
height += uiH; |
| 43488 |
break; |
| 43489 |
} |
| 43490 |
} else { |
| 43491 |
width = uiW; |
| 43492 |
height = uiH; |
| 43493 |
} |
| 43494 |
if (width && this.w === "") { |
| 43495 |
width += marginH; |
| 43496 |
this.w = Math.min(this.maxW <= 0 ? Infinity : this.maxW, this.minW + 1 < width ? width : this.minW); |
| 43497 |
} |
| 43498 |
if (height && this.h === "") { |
| 43499 |
height += marginV; |
| 43500 |
this.h = Math.min(this.maxH <= 0 ? Infinity : this.maxH, this.minH + 1 < height ? height : this.minH); |
| 43501 |
} |
| 43502 |
} |
| 43503 |
this[$popPara](); |
| 43504 |
fixDimensions(this); |
| 43505 |
setFirstUnsplittable(this); |
| 43506 |
if (!checkDimensions(this, availableSpace)) { |
| 43507 |
this.w = savedW; |
| 43508 |
this.h = savedH; |
| 43509 |
this[$popPara](); |
| 43510 |
return HTMLResult.FAILURE; |
| 43511 |
} |
| 43512 |
unsetFirstUnsplittable(this); |
| 43513 |
const style = toStyle(this, "font", "dimensions", "position", "rotate", "anchorType", "presence", "margin", "hAlign"); |
| 43514 |
setMinMaxDimensions(this, style); |
| 43515 |
const classNames = ["xfaField"]; |
| 43516 |
if (this.font) { |
| 43517 |
classNames.push("xfaFont"); |
| 43518 |
} |
| 43519 |
if (isPrintOnly(this)) { |
| 43520 |
classNames.push("xfaPrintOnly"); |
| 43521 |
} |
| 43522 |
const attributes = { |
| 43523 |
style, |
| 43524 |
id: this[$uid], |
| 43525 |
class: classNames |
| 43526 |
}; |
| 43527 |
if (style.margin) { |
| 43528 |
style.padding = style.margin; |
| 43529 |
delete style.margin; |
| 43530 |
} |
| 43531 |
setAccess(this, classNames); |
| 43532 |
if (this.name) { |
| 43533 |
attributes.xfaName = this.name; |
| 43534 |
} |
| 43535 |
const children = []; |
| 43536 |
const html = { |
| 43537 |
name: "div", |
| 43538 |
attributes, |
| 43539 |
children |
| 43540 |
}; |
| 43541 |
applyAssist(this, attributes); |
| 43542 |
const borderStyle = this.border ? this.border[$toStyle]() : null; |
| 43543 |
const bbox = computeBbox(this, html, availableSpace); |
| 43544 |
const ui = this.ui[$toHTML]().html; |
| 43545 |
if (!ui) { |
| 43546 |
Object.assign(style, borderStyle); |
| 43547 |
return HTMLResult.success(createWrapper(this, html), bbox); |
| 43548 |
} |
| 43549 |
if (this[$tabIndex]) { |
| 43550 |
if (ui.children?.[0]) { |
| 43551 |
ui.children[0].attributes.tabindex = this[$tabIndex]; |
| 43552 |
} else { |
| 43553 |
ui.attributes.tabindex = this[$tabIndex]; |
| 43554 |
} |
| 43555 |
} |
| 43556 |
if (!ui.attributes.style) { |
| 43557 |
ui.attributes.style = Object.create(null); |
| 43558 |
} |
| 43559 |
let aElement = null; |
| 43560 |
if (this.ui.button) { |
| 43561 |
if (ui.children.length === 1) { |
| 43562 |
[aElement] = ui.children.splice(0, 1); |
| 43563 |
} |
| 43564 |
Object.assign(ui.attributes.style, borderStyle); |
| 43565 |
} else { |
| 43566 |
Object.assign(style, borderStyle); |
| 43567 |
} |
| 43568 |
children.push(ui); |
| 43569 |
if (this.value) { |
| 43570 |
if (this.ui.imageEdit) { |
| 43571 |
ui.children.push(this.value[$toHTML]().html); |
| 43572 |
} else if (!this.ui.button) { |
| 43573 |
let value = ""; |
| 43574 |
if (this.value.exData) { |
| 43575 |
value = this.value.exData[$text](); |
| 43576 |
} else if (this.value.text) { |
| 43577 |
value = this.value.text[$getExtra](); |
| 43578 |
} else { |
| 43579 |
const htmlValue = this.value[$toHTML]().html; |
| 43580 |
if (htmlValue !== null) { |
| 43581 |
value = htmlValue.children[0].value; |
| 43582 |
} |
| 43583 |
} |
| 43584 |
if (this.ui.textEdit && this.value.text?.maxChars) { |
| 43585 |
ui.children[0].attributes.maxLength = this.value.text.maxChars; |
| 43586 |
} |
| 43587 |
if (value) { |
| 43588 |
if (this.ui.numericEdit) { |
| 43589 |
value = parseFloat(value); |
| 43590 |
value = isNaN(value) ? "" : value.toString(); |
| 43591 |
} |
| 43592 |
if (ui.children[0].name === "textarea") { |
| 43593 |
ui.children[0].attributes.textContent = value; |
| 43594 |
} else { |
| 43595 |
ui.children[0].attributes.value = value; |
| 43596 |
} |
| 43597 |
} |
| 43598 |
} |
| 43599 |
} |
| 43600 |
if (!this.ui.imageEdit && ui.children?.[0] && this.h) { |
| 43601 |
borderDims = borderDims || getBorderDims(this.ui[$getExtra]()); |
| 43602 |
let captionHeight = 0; |
| 43603 |
if (this.caption && ["top", "bottom"].includes(this.caption.placement)) { |
| 43604 |
captionHeight = this.caption.reserve; |
| 43605 |
if (captionHeight <= 0) { |
| 43606 |
captionHeight = this.caption[$getExtra](availableSpace).h; |
| 43607 |
} |
| 43608 |
const inputHeight = this.h - captionHeight - marginV - borderDims.h; |
| 43609 |
ui.children[0].attributes.style.height = measureToString(inputHeight); |
| 43610 |
} else { |
| 43611 |
ui.children[0].attributes.style.height = "100%"; |
| 43612 |
} |
| 43613 |
} |
| 43614 |
if (aElement) { |
| 43615 |
ui.children.push(aElement); |
| 43616 |
} |
| 43617 |
if (!caption) { |
| 43618 |
if (ui.attributes.class) { |
| 43619 |
ui.attributes.class.push("xfaLeft"); |
| 43620 |
} |
| 43621 |
this.w = savedW; |
| 43622 |
this.h = savedH; |
| 43623 |
return HTMLResult.success(createWrapper(this, html), bbox); |
| 43624 |
} |
| 43625 |
if (this.ui.button) { |
| 43626 |
if (style.padding) { |
| 43627 |
delete style.padding; |
| 43628 |
} |
| 43629 |
if (caption.name === "div") { |
| 43630 |
caption.name = "span"; |
| 43631 |
} |
| 43632 |
ui.children.push(caption); |
| 43633 |
return HTMLResult.success(html, bbox); |
| 43634 |
} else if (this.ui.checkButton) { |
| 43635 |
caption.attributes.class[0] = "xfaCaptionForCheckButton"; |
| 43636 |
} |
| 43637 |
if (!ui.attributes.class) { |
| 43638 |
ui.attributes.class = []; |
| 43639 |
} |
| 43640 |
ui.children.splice(0, 0, caption); |
| 43641 |
switch (this.caption.placement) { |
| 43642 |
case "left": |
| 43643 |
ui.attributes.class.push("xfaLeft"); |
| 43644 |
break; |
| 43645 |
case "right": |
| 43646 |
ui.attributes.class.push("xfaRight"); |
| 43647 |
break; |
| 43648 |
case "top": |
| 43649 |
ui.attributes.class.push("xfaTop"); |
| 43650 |
break; |
| 43651 |
case "bottom": |
| 43652 |
ui.attributes.class.push("xfaBottom"); |
| 43653 |
break; |
| 43654 |
case "inline": |
| 43655 |
ui.attributes.class.push("xfaLeft"); |
| 43656 |
break; |
| 43657 |
} |
| 43658 |
this.w = savedW; |
| 43659 |
this.h = savedH; |
| 43660 |
return HTMLResult.success(createWrapper(this, html), bbox); |
| 43661 |
} |
| 43662 |
} |
| 43663 |
class Fill extends XFAObject { |
| 43664 |
constructor(attributes) { |
| 43665 |
super(TEMPLATE_NS_ID, "fill", true); |
| 43666 |
this.id = attributes.id || ""; |
| 43667 |
this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); |
| 43668 |
this.use = attributes.use || ""; |
| 43669 |
this.usehref = attributes.usehref || ""; |
| 43670 |
this.color = null; |
| 43671 |
this.extras = null; |
| 43672 |
this.linear = null; |
| 43673 |
this.pattern = null; |
| 43674 |
this.radial = null; |
| 43675 |
this.solid = null; |
| 43676 |
this.stipple = null; |
| 43677 |
} |
| 43678 |
[$toStyle]() { |
| 43679 |
const parent = this[$getParent](); |
| 43680 |
const grandpa = parent[$getParent](); |
| 43681 |
const ggrandpa = grandpa[$getParent](); |
| 43682 |
const style = Object.create(null); |
| 43683 |
let propName = "color"; |
| 43684 |
let altPropName = propName; |
| 43685 |
if (parent instanceof Border) { |
| 43686 |
propName = "background-color"; |
| 43687 |
altPropName = "background"; |
| 43688 |
if (ggrandpa instanceof Ui) { |
| 43689 |
style.backgroundColor = "white"; |
| 43690 |
} |
| 43691 |
} |
| 43692 |
if (parent instanceof Rectangle || parent instanceof Arc) { |
| 43693 |
propName = altPropName = "fill"; |
| 43694 |
style.fill = "white"; |
| 43695 |
} |
| 43696 |
for (const name of Object.getOwnPropertyNames(this)) { |
| 43697 |
if (name === "extras" || name === "color") { |
| 43698 |
continue; |
| 43699 |
} |
| 43700 |
const obj = this[name]; |
| 43701 |
if (!(obj instanceof XFAObject)) { |
| 43702 |
continue; |
| 43703 |
} |
| 43704 |
const color = obj[$toStyle](this.color); |
| 43705 |
if (color) { |
| 43706 |
style[color.startsWith("#") ? propName : altPropName] = color; |
| 43707 |
} |
| 43708 |
return style; |
| 43709 |
} |
| 43710 |
if (this.color?.value) { |
| 43711 |
const color = this.color[$toStyle](); |
| 43712 |
style[color.startsWith("#") ? propName : altPropName] = color; |
| 43713 |
} |
| 43714 |
return style; |
| 43715 |
} |
| 43716 |
} |
| 43717 |
class Filter extends XFAObject { |
| 43718 |
constructor(attributes) { |
| 43719 |
super(TEMPLATE_NS_ID, "filter", true); |
| 43720 |
this.addRevocationInfo = getStringOption(attributes.addRevocationInfo, ["", "required", "optional", "none"]); |
| 43721 |
this.id = attributes.id || ""; |
| 43722 |
this.name = attributes.name || ""; |
| 43723 |
this.use = attributes.use || ""; |
| 43724 |
this.usehref = attributes.usehref || ""; |
| 43725 |
this.version = getInteger({ |
| 43726 |
data: this.version, |
| 43727 |
defaultValue: 5, |
| 43728 |
validate: x => x >= 1 && x <= 5 |
| 43729 |
}); |
| 43730 |
this.appearanceFilter = null; |
| 43731 |
this.certificates = null; |
| 43732 |
this.digestMethods = null; |
| 43733 |
this.encodings = null; |
| 43734 |
this.encryptionMethods = null; |
| 43735 |
this.handler = null; |
| 43736 |
this.lockDocument = null; |
| 43737 |
this.mdp = null; |
| 43738 |
this.reasons = null; |
| 43739 |
this.timeStamp = null; |
| 43740 |
} |
| 43741 |
} |
| 43742 |
class Float extends ContentObject { |
| 43743 |
constructor(attributes) { |
| 43744 |
super(TEMPLATE_NS_ID, "float"); |
| 43745 |
this.id = attributes.id || ""; |
| 43746 |
this.name = attributes.name || ""; |
| 43747 |
this.use = attributes.use || ""; |
| 43748 |
this.usehref = attributes.usehref || ""; |
| 43749 |
} |
| 43750 |
[$finalize]() { |
| 43751 |
const number = parseFloat(this[$content].trim()); |
| 43752 |
this[$content] = isNaN(number) ? null : number; |
| 43753 |
} |
| 43754 |
[$toHTML](availableSpace) { |
| 43755 |
return valueToHtml(this[$content] !== null ? this[$content].toString() : ""); |
| 43756 |
} |
| 43757 |
} |
| 43758 |
class template_Font extends XFAObject { |
| 43759 |
constructor(attributes) { |
| 43760 |
super(TEMPLATE_NS_ID, "font", true); |
| 43761 |
this.baselineShift = getMeasurement(attributes.baselineShift); |
| 43762 |
this.fontHorizontalScale = getFloat({ |
| 43763 |
data: attributes.fontHorizontalScale, |
| 43764 |
defaultValue: 100, |
| 43765 |
validate: x => x >= 0 |
| 43766 |
}); |
| 43767 |
this.fontVerticalScale = getFloat({ |
| 43768 |
data: attributes.fontVerticalScale, |
| 43769 |
defaultValue: 100, |
| 43770 |
validate: x => x >= 0 |
| 43771 |
}); |
| 43772 |
this.id = attributes.id || ""; |
| 43773 |
this.kerningMode = getStringOption(attributes.kerningMode, ["none", "pair"]); |
| 43774 |
this.letterSpacing = getMeasurement(attributes.letterSpacing, "0"); |
| 43775 |
this.lineThrough = getInteger({ |
| 43776 |
data: attributes.lineThrough, |
| 43777 |
defaultValue: 0, |
| 43778 |
validate: x => x === 1 || x === 2 |
| 43779 |
}); |
| 43780 |
this.lineThroughPeriod = getStringOption(attributes.lineThroughPeriod, ["all", "word"]); |
| 43781 |
this.overline = getInteger({ |
| 43782 |
data: attributes.overline, |
| 43783 |
defaultValue: 0, |
| 43784 |
validate: x => x === 1 || x === 2 |
| 43785 |
}); |
| 43786 |
this.overlinePeriod = getStringOption(attributes.overlinePeriod, ["all", "word"]); |
| 43787 |
this.posture = getStringOption(attributes.posture, ["normal", "italic"]); |
| 43788 |
this.size = getMeasurement(attributes.size, "10pt"); |
| 43789 |
this.typeface = attributes.typeface || "Courier"; |
| 43790 |
this.underline = getInteger({ |
| 43791 |
data: attributes.underline, |
| 43792 |
defaultValue: 0, |
| 43793 |
validate: x => x === 1 || x === 2 |
| 43794 |
}); |
| 43795 |
this.underlinePeriod = getStringOption(attributes.underlinePeriod, ["all", "word"]); |
| 43796 |
this.use = attributes.use || ""; |
| 43797 |
this.usehref = attributes.usehref || ""; |
| 43798 |
this.weight = getStringOption(attributes.weight, ["normal", "bold"]); |
| 43799 |
this.extras = null; |
| 43800 |
this.fill = null; |
| 43801 |
} |
| 43802 |
[$clean](builder) { |
| 43803 |
super[$clean](builder); |
| 43804 |
this[$globalData].usedTypefaces.add(this.typeface); |
| 43805 |
} |
| 43806 |
[$toStyle]() { |
| 43807 |
const style = toStyle(this, "fill"); |
| 43808 |
const color = style.color; |
| 43809 |
if (color) { |
| 43810 |
if (color === "#000000") { |
| 43811 |
delete style.color; |
| 43812 |
} else if (!color.startsWith("#")) { |
| 43813 |
style.background = color; |
| 43814 |
style.backgroundClip = "text"; |
| 43815 |
style.color = "transparent"; |
| 43816 |
} |
| 43817 |
} |
| 43818 |
if (this.baselineShift) { |
| 43819 |
style.verticalAlign = measureToString(this.baselineShift); |
| 43820 |
} |
| 43821 |
style.fontKerning = this.kerningMode === "none" ? "none" : "normal"; |
| 43822 |
style.letterSpacing = measureToString(this.letterSpacing); |
| 43823 |
if (this.lineThrough !== 0) { |
| 43824 |
style.textDecoration = "line-through"; |
| 43825 |
if (this.lineThrough === 2) { |
| 43826 |
style.textDecorationStyle = "double"; |
| 43827 |
} |
| 43828 |
} |
| 43829 |
if (this.overline !== 0) { |
| 43830 |
style.textDecoration = "overline"; |
| 43831 |
if (this.overline === 2) { |
| 43832 |
style.textDecorationStyle = "double"; |
| 43833 |
} |
| 43834 |
} |
| 43835 |
style.fontStyle = this.posture; |
| 43836 |
style.fontSize = measureToString(0.99 * this.size); |
| 43837 |
setFontFamily(this, this, this[$globalData].fontFinder, style); |
| 43838 |
if (this.underline !== 0) { |
| 43839 |
style.textDecoration = "underline"; |
| 43840 |
if (this.underline === 2) { |
| 43841 |
style.textDecorationStyle = "double"; |
| 43842 |
} |
| 43843 |
} |
| 43844 |
style.fontWeight = this.weight; |
| 43845 |
return style; |
| 43846 |
} |
| 43847 |
} |
| 43848 |
class Format extends XFAObject { |
| 43849 |
constructor(attributes) { |
| 43850 |
super(TEMPLATE_NS_ID, "format", true); |
| 43851 |
this.id = attributes.id || ""; |
| 43852 |
this.use = attributes.use || ""; |
| 43853 |
this.usehref = attributes.usehref || ""; |
| 43854 |
this.extras = null; |
| 43855 |
this.picture = null; |
| 43856 |
} |
| 43857 |
} |
| 43858 |
class Handler extends StringObject { |
| 43859 |
constructor(attributes) { |
| 43860 |
super(TEMPLATE_NS_ID, "handler"); |
| 43861 |
this.id = attributes.id || ""; |
| 43862 |
this.type = getStringOption(attributes.type, ["optional", "required"]); |
| 43863 |
this.use = attributes.use || ""; |
| 43864 |
this.usehref = attributes.usehref || ""; |
| 43865 |
} |
| 43866 |
} |
| 43867 |
class Hyphenation extends XFAObject { |
| 43868 |
constructor(attributes) { |
| 43869 |
super(TEMPLATE_NS_ID, "hyphenation"); |
| 43870 |
this.excludeAllCaps = getInteger({ |
| 43871 |
data: attributes.excludeAllCaps, |
| 43872 |
defaultValue: 0, |
| 43873 |
validate: x => x === 1 |
| 43874 |
}); |
| 43875 |
this.excludeInitialCap = getInteger({ |
| 43876 |
data: attributes.excludeInitialCap, |
| 43877 |
defaultValue: 0, |
| 43878 |
validate: x => x === 1 |
| 43879 |
}); |
| 43880 |
this.hyphenate = getInteger({ |
| 43881 |
data: attributes.hyphenate, |
| 43882 |
defaultValue: 0, |
| 43883 |
validate: x => x === 1 |
| 43884 |
}); |
| 43885 |
this.id = attributes.id || ""; |
| 43886 |
this.pushCharacterCount = getInteger({ |
| 43887 |
data: attributes.pushCharacterCount, |
| 43888 |
defaultValue: 3, |
| 43889 |
validate: x => x >= 0 |
| 43890 |
}); |
| 43891 |
this.remainCharacterCount = getInteger({ |
| 43892 |
data: attributes.remainCharacterCount, |
| 43893 |
defaultValue: 3, |
| 43894 |
validate: x => x >= 0 |
| 43895 |
}); |
| 43896 |
this.use = attributes.use || ""; |
| 43897 |
this.usehref = attributes.usehref || ""; |
| 43898 |
this.wordCharacterCount = getInteger({ |
| 43899 |
data: attributes.wordCharacterCount, |
| 43900 |
defaultValue: 7, |
| 43901 |
validate: x => x >= 0 |
| 43902 |
}); |
| 43903 |
} |
| 43904 |
} |
| 43905 |
class Image extends StringObject { |
| 43906 |
constructor(attributes) { |
| 43907 |
super(TEMPLATE_NS_ID, "image"); |
| 43908 |
this.aspect = getStringOption(attributes.aspect, ["fit", "actual", "height", "none", "width"]); |
| 43909 |
this.contentType = attributes.contentType || ""; |
| 43910 |
this.href = attributes.href || ""; |
| 43911 |
this.id = attributes.id || ""; |
| 43912 |
this.name = attributes.name || ""; |
| 43913 |
this.transferEncoding = getStringOption(attributes.transferEncoding, ["base64", "none", "package"]); |
| 43914 |
this.use = attributes.use || ""; |
| 43915 |
this.usehref = attributes.usehref || ""; |
| 43916 |
} |
| 43917 |
[$toHTML]() { |
| 43918 |
if (this.contentType && !MIMES.has(this.contentType.toLowerCase())) { |
| 43919 |
return HTMLResult.EMPTY; |
| 43920 |
} |
| 43921 |
let buffer = this[$globalData].images && this[$globalData].images.get(this.href); |
| 43922 |
if (!buffer && (this.href || !this[$content])) { |
| 43923 |
return HTMLResult.EMPTY; |
| 43924 |
} |
| 43925 |
if (!buffer && this.transferEncoding === "base64") { |
| 43926 |
buffer = stringToBytes(atob(this[$content])); |
| 43927 |
} |
| 43928 |
if (!buffer) { |
| 43929 |
return HTMLResult.EMPTY; |
| 43930 |
} |
| 43931 |
if (!this.contentType) { |
| 43932 |
for (const [header, type] of IMAGES_HEADERS) { |
| 43933 |
if (buffer.length > header.length && header.every((x, i) => x === buffer[i])) { |
| 43934 |
this.contentType = type; |
| 43935 |
break; |
| 43936 |
} |
| 43937 |
} |
| 43938 |
if (!this.contentType) { |
| 43939 |
return HTMLResult.EMPTY; |
| 43940 |
} |
| 43941 |
} |
| 43942 |
const blob = new Blob([buffer], { |
| 43943 |
type: this.contentType |
| 43944 |
}); |
| 43945 |
let style; |
| 43946 |
switch (this.aspect) { |
| 43947 |
case "fit": |
| 43948 |
case "actual": |
| 43949 |
break; |
| 43950 |
case "height": |
| 43951 |
style = { |
| 43952 |
height: "100%", |
| 43953 |
objectFit: "fill" |
| 43954 |
}; |
| 43955 |
break; |
| 43956 |
case "none": |
| 43957 |
style = { |
| 43958 |
width: "100%", |
| 43959 |
height: "100%", |
| 43960 |
objectFit: "fill" |
| 43961 |
}; |
| 43962 |
break; |
| 43963 |
case "width": |
| 43964 |
style = { |
| 43965 |
width: "100%", |
| 43966 |
objectFit: "fill" |
| 43967 |
}; |
| 43968 |
break; |
| 43969 |
} |
| 43970 |
const parent = this[$getParent](); |
| 43971 |
return HTMLResult.success({ |
| 43972 |
name: "img", |
| 43973 |
attributes: { |
| 43974 |
class: ["xfaImage"], |
| 43975 |
style, |
| 43976 |
src: URL.createObjectURL(blob), |
| 43977 |
alt: parent ? ariaLabel(parent[$getParent]()) : null |
| 43978 |
} |
| 43979 |
}); |
| 43980 |
} |
| 43981 |
} |
| 43982 |
class ImageEdit extends XFAObject { |
| 43983 |
constructor(attributes) { |
| 43984 |
super(TEMPLATE_NS_ID, "imageEdit", true); |
| 43985 |
this.data = getStringOption(attributes.data, ["link", "embed"]); |
| 43986 |
this.id = attributes.id || ""; |
| 43987 |
this.use = attributes.use || ""; |
| 43988 |
this.usehref = attributes.usehref || ""; |
| 43989 |
this.border = null; |
| 43990 |
this.extras = null; |
| 43991 |
this.margin = null; |
| 43992 |
} |
| 43993 |
[$toHTML](availableSpace) { |
| 43994 |
if (this.data === "embed") { |
| 43995 |
return HTMLResult.success({ |
| 43996 |
name: "div", |
| 43997 |
children: [], |
| 43998 |
attributes: {} |
| 43999 |
}); |
| 44000 |
} |
| 44001 |
return HTMLResult.EMPTY; |
| 44002 |
} |
| 44003 |
} |
| 44004 |
class Integer extends ContentObject { |
| 44005 |
constructor(attributes) { |
| 44006 |
super(TEMPLATE_NS_ID, "integer"); |
| 44007 |
this.id = attributes.id || ""; |
| 44008 |
this.name = attributes.name || ""; |
| 44009 |
this.use = attributes.use || ""; |
| 44010 |
this.usehref = attributes.usehref || ""; |
| 44011 |
} |
| 44012 |
[$finalize]() { |
| 44013 |
const number = parseInt(this[$content].trim(), 10); |
| 44014 |
this[$content] = isNaN(number) ? null : number; |
| 44015 |
} |
| 44016 |
[$toHTML](availableSpace) { |
| 44017 |
return valueToHtml(this[$content] !== null ? this[$content].toString() : ""); |
| 44018 |
} |
| 44019 |
} |
| 44020 |
class Issuers extends XFAObject { |
| 44021 |
constructor(attributes) { |
| 44022 |
super(TEMPLATE_NS_ID, "issuers", true); |
| 44023 |
this.id = attributes.id || ""; |
| 44024 |
this.type = getStringOption(attributes.type, ["optional", "required"]); |
| 44025 |
this.use = attributes.use || ""; |
| 44026 |
this.usehref = attributes.usehref || ""; |
| 44027 |
this.certificate = new XFAObjectArray(); |
| 44028 |
} |
| 44029 |
} |
| 44030 |
class Items extends XFAObject { |
| 44031 |
constructor(attributes) { |
| 44032 |
super(TEMPLATE_NS_ID, "items", true); |
| 44033 |
this.id = attributes.id || ""; |
| 44034 |
this.name = attributes.name || ""; |
| 44035 |
this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); |
| 44036 |
this.ref = attributes.ref || ""; |
| 44037 |
this.save = getInteger({ |
| 44038 |
data: attributes.save, |
| 44039 |
defaultValue: 0, |
| 44040 |
validate: x => x === 1 |
| 44041 |
}); |
| 44042 |
this.use = attributes.use || ""; |
| 44043 |
this.usehref = attributes.usehref || ""; |
| 44044 |
this.boolean = new XFAObjectArray(); |
| 44045 |
this.date = new XFAObjectArray(); |
| 44046 |
this.dateTime = new XFAObjectArray(); |
| 44047 |
this.decimal = new XFAObjectArray(); |
| 44048 |
this.exData = new XFAObjectArray(); |
| 44049 |
this.float = new XFAObjectArray(); |
| 44050 |
this.image = new XFAObjectArray(); |
| 44051 |
this.integer = new XFAObjectArray(); |
| 44052 |
this.text = new XFAObjectArray(); |
| 44053 |
this.time = new XFAObjectArray(); |
| 44054 |
} |
| 44055 |
[$toHTML]() { |
| 44056 |
const output = []; |
| 44057 |
for (const child of this[$getChildren]()) { |
| 44058 |
output.push(child[$text]()); |
| 44059 |
} |
| 44060 |
return HTMLResult.success(output); |
| 44061 |
} |
| 44062 |
} |
| 44063 |
class Keep extends XFAObject { |
| 44064 |
constructor(attributes) { |
| 44065 |
super(TEMPLATE_NS_ID, "keep", true); |
| 44066 |
this.id = attributes.id || ""; |
| 44067 |
const options = ["none", "contentArea", "pageArea"]; |
| 44068 |
this.intact = getStringOption(attributes.intact, options); |
| 44069 |
this.next = getStringOption(attributes.next, options); |
| 44070 |
this.previous = getStringOption(attributes.previous, options); |
| 44071 |
this.use = attributes.use || ""; |
| 44072 |
this.usehref = attributes.usehref || ""; |
| 44073 |
this.extras = null; |
| 44074 |
} |
| 44075 |
} |
| 44076 |
class KeyUsage extends XFAObject { |
| 44077 |
constructor(attributes) { |
| 44078 |
super(TEMPLATE_NS_ID, "keyUsage"); |
| 44079 |
const options = ["", "yes", "no"]; |
| 44080 |
this.crlSign = getStringOption(attributes.crlSign, options); |
| 44081 |
this.dataEncipherment = getStringOption(attributes.dataEncipherment, options); |
| 44082 |
this.decipherOnly = getStringOption(attributes.decipherOnly, options); |
| 44083 |
this.digitalSignature = getStringOption(attributes.digitalSignature, options); |
| 44084 |
this.encipherOnly = getStringOption(attributes.encipherOnly, options); |
| 44085 |
this.id = attributes.id || ""; |
| 44086 |
this.keyAgreement = getStringOption(attributes.keyAgreement, options); |
| 44087 |
this.keyCertSign = getStringOption(attributes.keyCertSign, options); |
| 44088 |
this.keyEncipherment = getStringOption(attributes.keyEncipherment, options); |
| 44089 |
this.nonRepudiation = getStringOption(attributes.nonRepudiation, options); |
| 44090 |
this.type = getStringOption(attributes.type, ["optional", "required"]); |
| 44091 |
this.use = attributes.use || ""; |
| 44092 |
this.usehref = attributes.usehref || ""; |
| 44093 |
} |
| 44094 |
} |
| 44095 |
class Line extends XFAObject { |
| 44096 |
constructor(attributes) { |
| 44097 |
super(TEMPLATE_NS_ID, "line", true); |
| 44098 |
this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); |
| 44099 |
this.id = attributes.id || ""; |
| 44100 |
this.slope = getStringOption(attributes.slope, ["\\", "/"]); |
| 44101 |
this.use = attributes.use || ""; |
| 44102 |
this.usehref = attributes.usehref || ""; |
| 44103 |
this.edge = null; |
| 44104 |
} |
| 44105 |
[$toHTML]() { |
| 44106 |
const parent = this[$getParent]()[$getParent](); |
| 44107 |
const edge = this.edge || new Edge({}); |
| 44108 |
const edgeStyle = edge[$toStyle](); |
| 44109 |
const style = Object.create(null); |
| 44110 |
const thickness = edge.presence === "visible" ? edge.thickness : 0; |
| 44111 |
style.strokeWidth = measureToString(thickness); |
| 44112 |
style.stroke = edgeStyle.color; |
| 44113 |
let x1, y1, x2, y2; |
| 44114 |
let width = "100%"; |
| 44115 |
let height = "100%"; |
| 44116 |
if (parent.w <= thickness) { |
| 44117 |
[x1, y1, x2, y2] = ["50%", 0, "50%", "100%"]; |
| 44118 |
width = style.strokeWidth; |
| 44119 |
} else if (parent.h <= thickness) { |
| 44120 |
[x1, y1, x2, y2] = [0, "50%", "100%", "50%"]; |
| 44121 |
height = style.strokeWidth; |
| 44122 |
} else if (this.slope === "\\") { |
| 44123 |
[x1, y1, x2, y2] = [0, 0, "100%", "100%"]; |
| 44124 |
} else { |
| 44125 |
[x1, y1, x2, y2] = [0, "100%", "100%", 0]; |
| 44126 |
} |
| 44127 |
const line = { |
| 44128 |
name: "line", |
| 44129 |
attributes: { |
| 44130 |
xmlns: SVG_NS, |
| 44131 |
x1, |
| 44132 |
y1, |
| 44133 |
x2, |
| 44134 |
y2, |
| 44135 |
style |
| 44136 |
} |
| 44137 |
}; |
| 44138 |
const svg = { |
| 44139 |
name: "svg", |
| 44140 |
children: [line], |
| 44141 |
attributes: { |
| 44142 |
xmlns: SVG_NS, |
| 44143 |
width, |
| 44144 |
height, |
| 44145 |
style: { |
| 44146 |
overflow: "visible" |
| 44147 |
} |
| 44148 |
} |
| 44149 |
}; |
| 44150 |
if (hasMargin(parent)) { |
| 44151 |
return HTMLResult.success({ |
| 44152 |
name: "div", |
| 44153 |
attributes: { |
| 44154 |
style: { |
| 44155 |
display: "inline", |
| 44156 |
width: "100%", |
| 44157 |
height: "100%" |
| 44158 |
} |
| 44159 |
}, |
| 44160 |
children: [svg] |
| 44161 |
}); |
| 44162 |
} |
| 44163 |
svg.attributes.style.position = "absolute"; |
| 44164 |
return HTMLResult.success(svg); |
| 44165 |
} |
| 44166 |
} |
| 44167 |
class Linear extends XFAObject { |
| 44168 |
constructor(attributes) { |
| 44169 |
super(TEMPLATE_NS_ID, "linear", true); |
| 44170 |
this.id = attributes.id || ""; |
| 44171 |
this.type = getStringOption(attributes.type, ["toRight", "toBottom", "toLeft", "toTop"]); |
| 44172 |
this.use = attributes.use || ""; |
| 44173 |
this.usehref = attributes.usehref || ""; |
| 44174 |
this.color = null; |
| 44175 |
this.extras = null; |
| 44176 |
} |
| 44177 |
[$toStyle](startColor) { |
| 44178 |
startColor = startColor ? startColor[$toStyle]() : "#FFFFFF"; |
| 44179 |
const transf = this.type.replace(/([RBLT])/, " $1").toLowerCase(); |
| 44180 |
const endColor = this.color ? this.color[$toStyle]() : "#000000"; |
| 44181 |
return `linear-gradient(${transf}, ${startColor}, ${endColor})`; |
| 44182 |
} |
| 44183 |
} |
| 44184 |
class LockDocument extends ContentObject { |
| 44185 |
constructor(attributes) { |
| 44186 |
super(TEMPLATE_NS_ID, "lockDocument"); |
| 44187 |
this.id = attributes.id || ""; |
| 44188 |
this.type = getStringOption(attributes.type, ["optional", "required"]); |
| 44189 |
this.use = attributes.use || ""; |
| 44190 |
this.usehref = attributes.usehref || ""; |
| 44191 |
} |
| 44192 |
[$finalize]() { |
| 44193 |
this[$content] = getStringOption(this[$content], ["auto", "0", "1"]); |
| 44194 |
} |
| 44195 |
} |
| 44196 |
class Manifest extends XFAObject { |
| 44197 |
constructor(attributes) { |
| 44198 |
super(TEMPLATE_NS_ID, "manifest", true); |
| 44199 |
this.action = getStringOption(attributes.action, ["include", "all", "exclude"]); |
| 44200 |
this.id = attributes.id || ""; |
| 44201 |
this.name = attributes.name || ""; |
| 44202 |
this.use = attributes.use || ""; |
| 44203 |
this.usehref = attributes.usehref || ""; |
| 44204 |
this.extras = null; |
| 44205 |
this.ref = new XFAObjectArray(); |
| 44206 |
} |
| 44207 |
} |
| 44208 |
class Margin extends XFAObject { |
| 44209 |
constructor(attributes) { |
| 44210 |
super(TEMPLATE_NS_ID, "margin", true); |
| 44211 |
this.bottomInset = getMeasurement(attributes.bottomInset, "0"); |
| 44212 |
this.id = attributes.id || ""; |
| 44213 |
this.leftInset = getMeasurement(attributes.leftInset, "0"); |
| 44214 |
this.rightInset = getMeasurement(attributes.rightInset, "0"); |
| 44215 |
this.topInset = getMeasurement(attributes.topInset, "0"); |
| 44216 |
this.use = attributes.use || ""; |
| 44217 |
this.usehref = attributes.usehref || ""; |
| 44218 |
this.extras = null; |
| 44219 |
} |
| 44220 |
[$toStyle]() { |
| 44221 |
return { |
| 44222 |
margin: measureToString(this.topInset) + " " + measureToString(this.rightInset) + " " + measureToString(this.bottomInset) + " " + measureToString(this.leftInset) |
| 44223 |
}; |
| 44224 |
} |
| 44225 |
} |
| 44226 |
class Mdp extends XFAObject { |
| 44227 |
constructor(attributes) { |
| 44228 |
super(TEMPLATE_NS_ID, "mdp"); |
| 44229 |
this.id = attributes.id || ""; |
| 44230 |
this.permissions = getInteger({ |
| 44231 |
data: attributes.permissions, |
| 44232 |
defaultValue: 2, |
| 44233 |
validate: x => x === 1 || x === 3 |
| 44234 |
}); |
| 44235 |
this.signatureType = getStringOption(attributes.signatureType, ["filler", "author"]); |
| 44236 |
this.use = attributes.use || ""; |
| 44237 |
this.usehref = attributes.usehref || ""; |
| 44238 |
} |
| 44239 |
} |
| 44240 |
class Medium extends XFAObject { |
| 44241 |
constructor(attributes) { |
| 44242 |
super(TEMPLATE_NS_ID, "medium"); |
| 44243 |
this.id = attributes.id || ""; |
| 44244 |
this.imagingBBox = getBBox(attributes.imagingBBox); |
| 44245 |
this.long = getMeasurement(attributes.long); |
| 44246 |
this.orientation = getStringOption(attributes.orientation, ["portrait", "landscape"]); |
| 44247 |
this.short = getMeasurement(attributes.short); |
| 44248 |
this.stock = attributes.stock || ""; |
| 44249 |
this.trayIn = getStringOption(attributes.trayIn, ["auto", "delegate", "pageFront"]); |
| 44250 |
this.trayOut = getStringOption(attributes.trayOut, ["auto", "delegate"]); |
| 44251 |
this.use = attributes.use || ""; |
| 44252 |
this.usehref = attributes.usehref || ""; |
| 44253 |
} |
| 44254 |
} |
| 44255 |
class Message extends XFAObject { |
| 44256 |
constructor(attributes) { |
| 44257 |
super(TEMPLATE_NS_ID, "message", true); |
| 44258 |
this.id = attributes.id || ""; |
| 44259 |
this.use = attributes.use || ""; |
| 44260 |
this.usehref = attributes.usehref || ""; |
| 44261 |
this.text = new XFAObjectArray(); |
| 44262 |
} |
| 44263 |
} |
| 44264 |
class NumericEdit extends XFAObject { |
| 44265 |
constructor(attributes) { |
| 44266 |
super(TEMPLATE_NS_ID, "numericEdit", true); |
| 44267 |
this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]); |
| 44268 |
this.id = attributes.id || ""; |
| 44269 |
this.use = attributes.use || ""; |
| 44270 |
this.usehref = attributes.usehref || ""; |
| 44271 |
this.border = null; |
| 44272 |
this.comb = null; |
| 44273 |
this.extras = null; |
| 44274 |
this.margin = null; |
| 44275 |
} |
| 44276 |
[$toHTML](availableSpace) { |
| 44277 |
const style = toStyle(this, "border", "font", "margin"); |
| 44278 |
const field = this[$getParent]()[$getParent](); |
| 44279 |
const html = { |
| 44280 |
name: "input", |
| 44281 |
attributes: { |
| 44282 |
type: "text", |
| 44283 |
fieldId: field[$uid], |
| 44284 |
dataId: field[$data]?.[$uid] || field[$uid], |
| 44285 |
class: ["xfaTextfield"], |
| 44286 |
style, |
| 44287 |
"aria-label": ariaLabel(field), |
| 44288 |
"aria-required": false |
| 44289 |
} |
| 44290 |
}; |
| 44291 |
if (isRequired(field)) { |
| 44292 |
html.attributes["aria-required"] = true; |
| 44293 |
html.attributes.required = true; |
| 44294 |
} |
| 44295 |
return HTMLResult.success({ |
| 44296 |
name: "label", |
| 44297 |
attributes: { |
| 44298 |
class: ["xfaLabel"] |
| 44299 |
}, |
| 44300 |
children: [html] |
| 44301 |
}); |
| 44302 |
} |
| 44303 |
} |
| 44304 |
class Occur extends XFAObject { |
| 44305 |
constructor(attributes) { |
| 44306 |
super(TEMPLATE_NS_ID, "occur", true); |
| 44307 |
this.id = attributes.id || ""; |
| 44308 |
this.initial = attributes.initial !== "" ? getInteger({ |
| 44309 |
data: attributes.initial, |
| 44310 |
defaultValue: "", |
| 44311 |
validate: x => true |
| 44312 |
}) : ""; |
| 44313 |
this.max = attributes.max !== "" ? getInteger({ |
| 44314 |
data: attributes.max, |
| 44315 |
defaultValue: 1, |
| 44316 |
validate: x => true |
| 44317 |
}) : ""; |
| 44318 |
this.min = attributes.min !== "" ? getInteger({ |
| 44319 |
data: attributes.min, |
| 44320 |
defaultValue: 1, |
| 44321 |
validate: x => true |
| 44322 |
}) : ""; |
| 44323 |
this.use = attributes.use || ""; |
| 44324 |
this.usehref = attributes.usehref || ""; |
| 44325 |
this.extras = null; |
| 44326 |
} |
| 44327 |
[$clean]() { |
| 44328 |
const parent = this[$getParent](); |
| 44329 |
const originalMin = this.min; |
| 44330 |
if (this.min === "") { |
| 44331 |
this.min = parent instanceof PageArea || parent instanceof PageSet ? 0 : 1; |
| 44332 |
} |
| 44333 |
if (this.max === "") { |
| 44334 |
if (originalMin === "") { |
| 44335 |
this.max = parent instanceof PageArea || parent instanceof PageSet ? -1 : 1; |
| 44336 |
} else { |
| 44337 |
this.max = this.min; |
| 44338 |
} |
| 44339 |
} |
| 44340 |
if (this.max !== -1 && this.max < this.min) { |
| 44341 |
this.max = this.min; |
| 44342 |
} |
| 44343 |
if (this.initial === "") { |
| 44344 |
this.initial = parent instanceof Template ? 1 : this.min; |
| 44345 |
} |
| 44346 |
} |
| 44347 |
} |
| 44348 |
class Oid extends StringObject { |
| 44349 |
constructor(attributes) { |
| 44350 |
super(TEMPLATE_NS_ID, "oid"); |
| 44351 |
this.id = attributes.id || ""; |
| 44352 |
this.name = attributes.name || ""; |
| 44353 |
this.use = attributes.use || ""; |
| 44354 |
this.usehref = attributes.usehref || ""; |
| 44355 |
} |
| 44356 |
} |
| 44357 |
class Oids extends XFAObject { |
| 44358 |
constructor(attributes) { |
| 44359 |
super(TEMPLATE_NS_ID, "oids", true); |
| 44360 |
this.id = attributes.id || ""; |
| 44361 |
this.type = getStringOption(attributes.type, ["optional", "required"]); |
| 44362 |
this.use = attributes.use || ""; |
| 44363 |
this.usehref = attributes.usehref || ""; |
| 44364 |
this.oid = new XFAObjectArray(); |
| 44365 |
} |
| 44366 |
} |
| 44367 |
class Overflow extends XFAObject { |
| 44368 |
constructor(attributes) { |
| 44369 |
super(TEMPLATE_NS_ID, "overflow"); |
| 44370 |
this.id = attributes.id || ""; |
| 44371 |
this.leader = attributes.leader || ""; |
| 44372 |
this.target = attributes.target || ""; |
| 44373 |
this.trailer = attributes.trailer || ""; |
| 44374 |
this.use = attributes.use || ""; |
| 44375 |
this.usehref = attributes.usehref || ""; |
| 44376 |
} |
| 44377 |
[$getExtra]() { |
| 44378 |
if (!this[$extra]) { |
| 44379 |
const parent = this[$getParent](); |
| 44380 |
const root = this[$getTemplateRoot](); |
| 44381 |
const target = root[$searchNode](this.target, parent); |
| 44382 |
const leader = root[$searchNode](this.leader, parent); |
| 44383 |
const trailer = root[$searchNode](this.trailer, parent); |
| 44384 |
this[$extra] = { |
| 44385 |
target: target?.[0] || null, |
| 44386 |
leader: leader?.[0] || null, |
| 44387 |
trailer: trailer?.[0] || null, |
| 44388 |
addLeader: false, |
| 44389 |
addTrailer: false |
| 44390 |
}; |
| 44391 |
} |
| 44392 |
return this[$extra]; |
| 44393 |
} |
| 44394 |
} |
| 44395 |
class PageArea extends XFAObject { |
| 44396 |
constructor(attributes) { |
| 44397 |
super(TEMPLATE_NS_ID, "pageArea", true); |
| 44398 |
this.blankOrNotBlank = getStringOption(attributes.blankOrNotBlank, ["any", "blank", "notBlank"]); |
| 44399 |
this.id = attributes.id || ""; |
| 44400 |
this.initialNumber = getInteger({ |
| 44401 |
data: attributes.initialNumber, |
| 44402 |
defaultValue: 1, |
| 44403 |
validate: x => true |
| 44404 |
}); |
| 44405 |
this.name = attributes.name || ""; |
| 44406 |
this.numbered = getInteger({ |
| 44407 |
data: attributes.numbered, |
| 44408 |
defaultValue: 1, |
| 44409 |
validate: x => true |
| 44410 |
}); |
| 44411 |
this.oddOrEven = getStringOption(attributes.oddOrEven, ["any", "even", "odd"]); |
| 44412 |
this.pagePosition = getStringOption(attributes.pagePosition, ["any", "first", "last", "only", "rest"]); |
| 44413 |
this.relevant = getRelevant(attributes.relevant); |
| 44414 |
this.use = attributes.use || ""; |
| 44415 |
this.usehref = attributes.usehref || ""; |
| 44416 |
this.desc = null; |
| 44417 |
this.extras = null; |
| 44418 |
this.medium = null; |
| 44419 |
this.occur = null; |
| 44420 |
this.area = new XFAObjectArray(); |
| 44421 |
this.contentArea = new XFAObjectArray(); |
| 44422 |
this.draw = new XFAObjectArray(); |
| 44423 |
this.exclGroup = new XFAObjectArray(); |
| 44424 |
this.field = new XFAObjectArray(); |
| 44425 |
this.subform = new XFAObjectArray(); |
| 44426 |
} |
| 44427 |
[$isUsable]() { |
| 44428 |
if (!this[$extra]) { |
| 44429 |
this[$extra] = { |
| 44430 |
numberOfUse: 0 |
| 44431 |
}; |
| 44432 |
return true; |
| 44433 |
} |
| 44434 |
return !this.occur || this.occur.max === -1 || this[$extra].numberOfUse < this.occur.max; |
| 44435 |
} |
| 44436 |
[$cleanPage]() { |
| 44437 |
delete this[$extra]; |
| 44438 |
} |
| 44439 |
[$getNextPage]() { |
| 44440 |
if (!this[$extra]) { |
| 44441 |
this[$extra] = { |
| 44442 |
numberOfUse: 0 |
| 44443 |
}; |
| 44444 |
} |
| 44445 |
const parent = this[$getParent](); |
| 44446 |
if (parent.relation === "orderedOccurrence") { |
| 44447 |
if (this[$isUsable]()) { |
| 44448 |
this[$extra].numberOfUse += 1; |
| 44449 |
return this; |
| 44450 |
} |
| 44451 |
} |
| 44452 |
return parent[$getNextPage](); |
| 44453 |
} |
| 44454 |
[$getAvailableSpace]() { |
| 44455 |
return this[$extra].space || { |
| 44456 |
width: 0, |
| 44457 |
height: 0 |
| 44458 |
}; |
| 44459 |
} |
| 44460 |
[$toHTML]() { |
| 44461 |
if (!this[$extra]) { |
| 44462 |
this[$extra] = { |
| 44463 |
numberOfUse: 1 |
| 44464 |
}; |
| 44465 |
} |
| 44466 |
const children = []; |
| 44467 |
this[$extra].children = children; |
| 44468 |
const style = Object.create(null); |
| 44469 |
if (this.medium && this.medium.short && this.medium.long) { |
| 44470 |
style.width = measureToString(this.medium.short); |
| 44471 |
style.height = measureToString(this.medium.long); |
| 44472 |
this[$extra].space = { |
| 44473 |
width: this.medium.short, |
| 44474 |
height: this.medium.long |
| 44475 |
}; |
| 44476 |
if (this.medium.orientation === "landscape") { |
| 44477 |
const x = style.width; |
| 44478 |
style.width = style.height; |
| 44479 |
style.height = x; |
| 44480 |
this[$extra].space = { |
| 44481 |
width: this.medium.long, |
| 44482 |
height: this.medium.short |
| 44483 |
}; |
| 44484 |
} |
| 44485 |
} else { |
| 44486 |
warn("XFA - No medium specified in pageArea: please file a bug."); |
| 44487 |
} |
| 44488 |
this[$childrenToHTML]({ |
| 44489 |
filter: new Set(["area", "draw", "field", "subform"]), |
| 44490 |
include: true |
| 44491 |
}); |
| 44492 |
this[$childrenToHTML]({ |
| 44493 |
filter: new Set(["contentArea"]), |
| 44494 |
include: true |
| 44495 |
}); |
| 44496 |
return HTMLResult.success({ |
| 44497 |
name: "div", |
| 44498 |
children, |
| 44499 |
attributes: { |
| 44500 |
class: ["xfaPage"], |
| 44501 |
id: this[$uid], |
| 44502 |
style, |
| 44503 |
xfaName: this.name |
| 44504 |
} |
| 44505 |
}); |
| 44506 |
} |
| 44507 |
} |
| 44508 |
class PageSet extends XFAObject { |
| 44509 |
constructor(attributes) { |
| 44510 |
super(TEMPLATE_NS_ID, "pageSet", true); |
| 44511 |
this.duplexImposition = getStringOption(attributes.duplexImposition, ["longEdge", "shortEdge"]); |
| 44512 |
this.id = attributes.id || ""; |
| 44513 |
this.name = attributes.name || ""; |
| 44514 |
this.relation = getStringOption(attributes.relation, ["orderedOccurrence", "duplexPaginated", "simplexPaginated"]); |
| 44515 |
this.relevant = getRelevant(attributes.relevant); |
| 44516 |
this.use = attributes.use || ""; |
| 44517 |
this.usehref = attributes.usehref || ""; |
| 44518 |
this.extras = null; |
| 44519 |
this.occur = null; |
| 44520 |
this.pageArea = new XFAObjectArray(); |
| 44521 |
this.pageSet = new XFAObjectArray(); |
| 44522 |
} |
| 44523 |
[$cleanPage]() { |
| 44524 |
for (const page of this.pageArea.children) { |
| 44525 |
page[$cleanPage](); |
| 44526 |
} |
| 44527 |
for (const page of this.pageSet.children) { |
| 44528 |
page[$cleanPage](); |
| 44529 |
} |
| 44530 |
} |
| 44531 |
[$isUsable]() { |
| 44532 |
return !this.occur || this.occur.max === -1 || this[$extra].numberOfUse < this.occur.max; |
| 44533 |
} |
| 44534 |
[$getNextPage]() { |
| 44535 |
if (!this[$extra]) { |
| 44536 |
this[$extra] = { |
| 44537 |
numberOfUse: 1, |
| 44538 |
pageIndex: -1, |
| 44539 |
pageSetIndex: -1 |
| 44540 |
}; |
| 44541 |
} |
| 44542 |
if (this.relation === "orderedOccurrence") { |
| 44543 |
if (this[$extra].pageIndex + 1 < this.pageArea.children.length) { |
| 44544 |
this[$extra].pageIndex += 1; |
| 44545 |
const pageArea = this.pageArea.children[this[$extra].pageIndex]; |
| 44546 |
return pageArea[$getNextPage](); |
| 44547 |
} |
| 44548 |
if (this[$extra].pageSetIndex + 1 < this.pageSet.children.length) { |
| 44549 |
this[$extra].pageSetIndex += 1; |
| 44550 |
return this.pageSet.children[this[$extra].pageSetIndex][$getNextPage](); |
| 44551 |
} |
| 44552 |
if (this[$isUsable]()) { |
| 44553 |
this[$extra].numberOfUse += 1; |
| 44554 |
this[$extra].pageIndex = -1; |
| 44555 |
this[$extra].pageSetIndex = -1; |
| 44556 |
return this[$getNextPage](); |
| 44557 |
} |
| 44558 |
const parent = this[$getParent](); |
| 44559 |
if (parent instanceof PageSet) { |
| 44560 |
return parent[$getNextPage](); |
| 44561 |
} |
| 44562 |
this[$cleanPage](); |
| 44563 |
return this[$getNextPage](); |
| 44564 |
} |
| 44565 |
const pageNumber = this[$getTemplateRoot]()[$extra].pageNumber; |
| 44566 |
const parity = pageNumber % 2 === 0 ? "even" : "odd"; |
| 44567 |
const position = pageNumber === 0 ? "first" : "rest"; |
| 44568 |
let page = this.pageArea.children.find(p => p.oddOrEven === parity && p.pagePosition === position); |
| 44569 |
if (page) { |
| 44570 |
return page; |
| 44571 |
} |
| 44572 |
page = this.pageArea.children.find(p => p.oddOrEven === "any" && p.pagePosition === position); |
| 44573 |
if (page) { |
| 44574 |
return page; |
| 44575 |
} |
| 44576 |
page = this.pageArea.children.find(p => p.oddOrEven === "any" && p.pagePosition === "any"); |
| 44577 |
if (page) { |
| 44578 |
return page; |
| 44579 |
} |
| 44580 |
return this.pageArea.children[0]; |
| 44581 |
} |
| 44582 |
} |
| 44583 |
class Para extends XFAObject { |
| 44584 |
constructor(attributes) { |
| 44585 |
super(TEMPLATE_NS_ID, "para", true); |
| 44586 |
this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); |
| 44587 |
this.id = attributes.id || ""; |
| 44588 |
this.lineHeight = attributes.lineHeight ? getMeasurement(attributes.lineHeight, "0pt") : ""; |
| 44589 |
this.marginLeft = attributes.marginLeft ? getMeasurement(attributes.marginLeft, "0pt") : ""; |
| 44590 |
this.marginRight = attributes.marginRight ? getMeasurement(attributes.marginRight, "0pt") : ""; |
| 44591 |
this.orphans = getInteger({ |
| 44592 |
data: attributes.orphans, |
| 44593 |
defaultValue: 0, |
| 44594 |
validate: x => x >= 0 |
| 44595 |
}); |
| 44596 |
this.preserve = attributes.preserve || ""; |
| 44597 |
this.radixOffset = attributes.radixOffset ? getMeasurement(attributes.radixOffset, "0pt") : ""; |
| 44598 |
this.spaceAbove = attributes.spaceAbove ? getMeasurement(attributes.spaceAbove, "0pt") : ""; |
| 44599 |
this.spaceBelow = attributes.spaceBelow ? getMeasurement(attributes.spaceBelow, "0pt") : ""; |
| 44600 |
this.tabDefault = attributes.tabDefault ? getMeasurement(this.tabDefault) : ""; |
| 44601 |
this.tabStops = (attributes.tabStops || "").trim().split(/\s+/).map((x, i) => i % 2 === 1 ? getMeasurement(x) : x); |
| 44602 |
this.textIndent = attributes.textIndent ? getMeasurement(attributes.textIndent, "0pt") : ""; |
| 44603 |
this.use = attributes.use || ""; |
| 44604 |
this.usehref = attributes.usehref || ""; |
| 44605 |
this.vAlign = getStringOption(attributes.vAlign, ["top", "bottom", "middle"]); |
| 44606 |
this.widows = getInteger({ |
| 44607 |
data: attributes.widows, |
| 44608 |
defaultValue: 0, |
| 44609 |
validate: x => x >= 0 |
| 44610 |
}); |
| 44611 |
this.hyphenation = null; |
| 44612 |
} |
| 44613 |
[$toStyle]() { |
| 44614 |
const style = toStyle(this, "hAlign"); |
| 44615 |
if (this.marginLeft !== "") { |
| 44616 |
style.paddingLeft = measureToString(this.marginLeft); |
| 44617 |
} |
| 44618 |
if (this.marginRight !== "") { |
| 44619 |
style.paddingight = measureToString(this.marginRight); |
| 44620 |
} |
| 44621 |
if (this.spaceAbove !== "") { |
| 44622 |
style.paddingTop = measureToString(this.spaceAbove); |
| 44623 |
} |
| 44624 |
if (this.spaceBelow !== "") { |
| 44625 |
style.paddingBottom = measureToString(this.spaceBelow); |
| 44626 |
} |
| 44627 |
if (this.textIndent !== "") { |
| 44628 |
style.textIndent = measureToString(this.textIndent); |
| 44629 |
fixTextIndent(style); |
| 44630 |
} |
| 44631 |
if (this.lineHeight > 0) { |
| 44632 |
style.lineHeight = measureToString(this.lineHeight); |
| 44633 |
} |
| 44634 |
if (this.tabDefault !== "") { |
| 44635 |
style.tabSize = measureToString(this.tabDefault); |
| 44636 |
} |
| 44637 |
if (this.tabStops.length > 0) {} |
| 44638 |
if (this.hyphenatation) { |
| 44639 |
Object.assign(style, this.hyphenatation[$toStyle]()); |
| 44640 |
} |
| 44641 |
return style; |
| 44642 |
} |
| 44643 |
} |
| 44644 |
class PasswordEdit extends XFAObject { |
| 44645 |
constructor(attributes) { |
| 44646 |
super(TEMPLATE_NS_ID, "passwordEdit", true); |
| 44647 |
this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]); |
| 44648 |
this.id = attributes.id || ""; |
| 44649 |
this.passwordChar = attributes.passwordChar || "*"; |
| 44650 |
this.use = attributes.use || ""; |
| 44651 |
this.usehref = attributes.usehref || ""; |
| 44652 |
this.border = null; |
| 44653 |
this.extras = null; |
| 44654 |
this.margin = null; |
| 44655 |
} |
| 44656 |
} |
| 44657 |
class template_Pattern extends XFAObject { |
| 44658 |
constructor(attributes) { |
| 44659 |
super(TEMPLATE_NS_ID, "pattern", true); |
| 44660 |
this.id = attributes.id || ""; |
| 44661 |
this.type = getStringOption(attributes.type, ["crossHatch", "crossDiagonal", "diagonalLeft", "diagonalRight", "horizontal", "vertical"]); |
| 44662 |
this.use = attributes.use || ""; |
| 44663 |
this.usehref = attributes.usehref || ""; |
| 44664 |
this.color = null; |
| 44665 |
this.extras = null; |
| 44666 |
} |
| 44667 |
[$toStyle](startColor) { |
| 44668 |
startColor = startColor ? startColor[$toStyle]() : "#FFFFFF"; |
| 44669 |
const endColor = this.color ? this.color[$toStyle]() : "#000000"; |
| 44670 |
const width = 5; |
| 44671 |
const cmd = "repeating-linear-gradient"; |
| 44672 |
const colors = `${startColor},${startColor} ${width}px,${endColor} ${width}px,${endColor} ${2 * width}px`; |
| 44673 |
switch (this.type) { |
| 44674 |
case "crossHatch": |
| 44675 |
return `${cmd}(to top,${colors}) ${cmd}(to right,${colors})`; |
| 44676 |
case "crossDiagonal": |
| 44677 |
return `${cmd}(45deg,${colors}) ${cmd}(-45deg,${colors})`; |
| 44678 |
case "diagonalLeft": |
| 44679 |
return `${cmd}(45deg,${colors})`; |
| 44680 |
case "diagonalRight": |
| 44681 |
return `${cmd}(-45deg,${colors})`; |
| 44682 |
case "horizontal": |
| 44683 |
return `${cmd}(to top,${colors})`; |
| 44684 |
case "vertical": |
| 44685 |
return `${cmd}(to right,${colors})`; |
| 44686 |
} |
| 44687 |
return ""; |
| 44688 |
} |
| 44689 |
} |
| 44690 |
class Picture extends StringObject { |
| 44691 |
constructor(attributes) { |
| 44692 |
super(TEMPLATE_NS_ID, "picture"); |
| 44693 |
this.id = attributes.id || ""; |
| 44694 |
this.use = attributes.use || ""; |
| 44695 |
this.usehref = attributes.usehref || ""; |
| 44696 |
} |
| 44697 |
} |
| 44698 |
class Proto extends XFAObject { |
| 44699 |
constructor(attributes) { |
| 44700 |
super(TEMPLATE_NS_ID, "proto", true); |
| 44701 |
this.appearanceFilter = new XFAObjectArray(); |
| 44702 |
this.arc = new XFAObjectArray(); |
| 44703 |
this.area = new XFAObjectArray(); |
| 44704 |
this.assist = new XFAObjectArray(); |
| 44705 |
this.barcode = new XFAObjectArray(); |
| 44706 |
this.bindItems = new XFAObjectArray(); |
| 44707 |
this.bookend = new XFAObjectArray(); |
| 44708 |
this.boolean = new XFAObjectArray(); |
| 44709 |
this.border = new XFAObjectArray(); |
| 44710 |
this.break = new XFAObjectArray(); |
| 44711 |
this.breakAfter = new XFAObjectArray(); |
| 44712 |
this.breakBefore = new XFAObjectArray(); |
| 44713 |
this.button = new XFAObjectArray(); |
| 44714 |
this.calculate = new XFAObjectArray(); |
| 44715 |
this.caption = new XFAObjectArray(); |
| 44716 |
this.certificate = new XFAObjectArray(); |
| 44717 |
this.certificates = new XFAObjectArray(); |
| 44718 |
this.checkButton = new XFAObjectArray(); |
| 44719 |
this.choiceList = new XFAObjectArray(); |
| 44720 |
this.color = new XFAObjectArray(); |
| 44721 |
this.comb = new XFAObjectArray(); |
| 44722 |
this.connect = new XFAObjectArray(); |
| 44723 |
this.contentArea = new XFAObjectArray(); |
| 44724 |
this.corner = new XFAObjectArray(); |
| 44725 |
this.date = new XFAObjectArray(); |
| 44726 |
this.dateTime = new XFAObjectArray(); |
| 44727 |
this.dateTimeEdit = new XFAObjectArray(); |
| 44728 |
this.decimal = new XFAObjectArray(); |
| 44729 |
this.defaultUi = new XFAObjectArray(); |
| 44730 |
this.desc = new XFAObjectArray(); |
| 44731 |
this.digestMethod = new XFAObjectArray(); |
| 44732 |
this.digestMethods = new XFAObjectArray(); |
| 44733 |
this.draw = new XFAObjectArray(); |
| 44734 |
this.edge = new XFAObjectArray(); |
| 44735 |
this.encoding = new XFAObjectArray(); |
| 44736 |
this.encodings = new XFAObjectArray(); |
| 44737 |
this.encrypt = new XFAObjectArray(); |
| 44738 |
this.encryptData = new XFAObjectArray(); |
| 44739 |
this.encryption = new XFAObjectArray(); |
| 44740 |
this.encryptionMethod = new XFAObjectArray(); |
| 44741 |
this.encryptionMethods = new XFAObjectArray(); |
| 44742 |
this.event = new XFAObjectArray(); |
| 44743 |
this.exData = new XFAObjectArray(); |
| 44744 |
this.exObject = new XFAObjectArray(); |
| 44745 |
this.exclGroup = new XFAObjectArray(); |
| 44746 |
this.execute = new XFAObjectArray(); |
| 44747 |
this.extras = new XFAObjectArray(); |
| 44748 |
this.field = new XFAObjectArray(); |
| 44749 |
this.fill = new XFAObjectArray(); |
| 44750 |
this.filter = new XFAObjectArray(); |
| 44751 |
this.float = new XFAObjectArray(); |
| 44752 |
this.font = new XFAObjectArray(); |
| 44753 |
this.format = new XFAObjectArray(); |
| 44754 |
this.handler = new XFAObjectArray(); |
| 44755 |
this.hyphenation = new XFAObjectArray(); |
| 44756 |
this.image = new XFAObjectArray(); |
| 44757 |
this.imageEdit = new XFAObjectArray(); |
| 44758 |
this.integer = new XFAObjectArray(); |
| 44759 |
this.issuers = new XFAObjectArray(); |
| 44760 |
this.items = new XFAObjectArray(); |
| 44761 |
this.keep = new XFAObjectArray(); |
| 44762 |
this.keyUsage = new XFAObjectArray(); |
| 44763 |
this.line = new XFAObjectArray(); |
| 44764 |
this.linear = new XFAObjectArray(); |
| 44765 |
this.lockDocument = new XFAObjectArray(); |
| 44766 |
this.manifest = new XFAObjectArray(); |
| 44767 |
this.margin = new XFAObjectArray(); |
| 44768 |
this.mdp = new XFAObjectArray(); |
| 44769 |
this.medium = new XFAObjectArray(); |
| 44770 |
this.message = new XFAObjectArray(); |
| 44771 |
this.numericEdit = new XFAObjectArray(); |
| 44772 |
this.occur = new XFAObjectArray(); |
| 44773 |
this.oid = new XFAObjectArray(); |
| 44774 |
this.oids = new XFAObjectArray(); |
| 44775 |
this.overflow = new XFAObjectArray(); |
| 44776 |
this.pageArea = new XFAObjectArray(); |
| 44777 |
this.pageSet = new XFAObjectArray(); |
| 44778 |
this.para = new XFAObjectArray(); |
| 44779 |
this.passwordEdit = new XFAObjectArray(); |
| 44780 |
this.pattern = new XFAObjectArray(); |
| 44781 |
this.picture = new XFAObjectArray(); |
| 44782 |
this.radial = new XFAObjectArray(); |
| 44783 |
this.reason = new XFAObjectArray(); |
| 44784 |
this.reasons = new XFAObjectArray(); |
| 44785 |
this.rectangle = new XFAObjectArray(); |
| 44786 |
this.ref = new XFAObjectArray(); |
| 44787 |
this.script = new XFAObjectArray(); |
| 44788 |
this.setProperty = new XFAObjectArray(); |
| 44789 |
this.signData = new XFAObjectArray(); |
| 44790 |
this.signature = new XFAObjectArray(); |
| 44791 |
this.signing = new XFAObjectArray(); |
| 44792 |
this.solid = new XFAObjectArray(); |
| 44793 |
this.speak = new XFAObjectArray(); |
| 44794 |
this.stipple = new XFAObjectArray(); |
| 44795 |
this.subform = new XFAObjectArray(); |
| 44796 |
this.subformSet = new XFAObjectArray(); |
| 44797 |
this.subjectDN = new XFAObjectArray(); |
| 44798 |
this.subjectDNs = new XFAObjectArray(); |
| 44799 |
this.submit = new XFAObjectArray(); |
| 44800 |
this.text = new XFAObjectArray(); |
| 44801 |
this.textEdit = new XFAObjectArray(); |
| 44802 |
this.time = new XFAObjectArray(); |
| 44803 |
this.timeStamp = new XFAObjectArray(); |
| 44804 |
this.toolTip = new XFAObjectArray(); |
| 44805 |
this.traversal = new XFAObjectArray(); |
| 44806 |
this.traverse = new XFAObjectArray(); |
| 44807 |
this.ui = new XFAObjectArray(); |
| 44808 |
this.validate = new XFAObjectArray(); |
| 44809 |
this.value = new XFAObjectArray(); |
| 44810 |
this.variables = new XFAObjectArray(); |
| 44811 |
} |
| 44812 |
} |
| 44813 |
class Radial extends XFAObject { |
| 44814 |
constructor(attributes) { |
| 44815 |
super(TEMPLATE_NS_ID, "radial", true); |
| 44816 |
this.id = attributes.id || ""; |
| 44817 |
this.type = getStringOption(attributes.type, ["toEdge", "toCenter"]); |
| 44818 |
this.use = attributes.use || ""; |
| 44819 |
this.usehref = attributes.usehref || ""; |
| 44820 |
this.color = null; |
| 44821 |
this.extras = null; |
| 44822 |
} |
| 44823 |
[$toStyle](startColor) { |
| 44824 |
startColor = startColor ? startColor[$toStyle]() : "#FFFFFF"; |
| 44825 |
const endColor = this.color ? this.color[$toStyle]() : "#000000"; |
| 44826 |
const colors = this.type === "toEdge" ? `${startColor},${endColor}` : `${endColor},${startColor}`; |
| 44827 |
return `radial-gradient(circle at center, ${colors})`; |
| 44828 |
} |
| 44829 |
} |
| 44830 |
class Reason extends StringObject { |
| 44831 |
constructor(attributes) { |
| 44832 |
super(TEMPLATE_NS_ID, "reason"); |
| 44833 |
this.id = attributes.id || ""; |
| 44834 |
this.name = attributes.name || ""; |
| 44835 |
this.use = attributes.use || ""; |
| 44836 |
this.usehref = attributes.usehref || ""; |
| 44837 |
} |
| 44838 |
} |
| 44839 |
class Reasons extends XFAObject { |
| 44840 |
constructor(attributes) { |
| 44841 |
super(TEMPLATE_NS_ID, "reasons", true); |
| 44842 |
this.id = attributes.id || ""; |
| 44843 |
this.type = getStringOption(attributes.type, ["optional", "required"]); |
| 44844 |
this.use = attributes.use || ""; |
| 44845 |
this.usehref = attributes.usehref || ""; |
| 44846 |
this.reason = new XFAObjectArray(); |
| 44847 |
} |
| 44848 |
} |
| 44849 |
class Rectangle extends XFAObject { |
| 44850 |
constructor(attributes) { |
| 44851 |
super(TEMPLATE_NS_ID, "rectangle", true); |
| 44852 |
this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); |
| 44853 |
this.id = attributes.id || ""; |
| 44854 |
this.use = attributes.use || ""; |
| 44855 |
this.usehref = attributes.usehref || ""; |
| 44856 |
this.corner = new XFAObjectArray(4); |
| 44857 |
this.edge = new XFAObjectArray(4); |
| 44858 |
this.fill = null; |
| 44859 |
} |
| 44860 |
[$toHTML]() { |
| 44861 |
const edge = this.edge.children.length ? this.edge.children[0] : new Edge({}); |
| 44862 |
const edgeStyle = edge[$toStyle](); |
| 44863 |
const style = Object.create(null); |
| 44864 |
if (this.fill?.presence === "visible") { |
| 44865 |
Object.assign(style, this.fill[$toStyle]()); |
| 44866 |
} else { |
| 44867 |
style.fill = "transparent"; |
| 44868 |
} |
| 44869 |
style.strokeWidth = measureToString(edge.presence === "visible" ? edge.thickness : 0); |
| 44870 |
style.stroke = edgeStyle.color; |
| 44871 |
const corner = this.corner.children.length ? this.corner.children[0] : new Corner({}); |
| 44872 |
const cornerStyle = corner[$toStyle](); |
| 44873 |
const rect = { |
| 44874 |
name: "rect", |
| 44875 |
attributes: { |
| 44876 |
xmlns: SVG_NS, |
| 44877 |
width: "100%", |
| 44878 |
height: "100%", |
| 44879 |
x: 0, |
| 44880 |
y: 0, |
| 44881 |
rx: cornerStyle.radius, |
| 44882 |
ry: cornerStyle.radius, |
| 44883 |
style |
| 44884 |
} |
| 44885 |
}; |
| 44886 |
const svg = { |
| 44887 |
name: "svg", |
| 44888 |
children: [rect], |
| 44889 |
attributes: { |
| 44890 |
xmlns: SVG_NS, |
| 44891 |
style: { |
| 44892 |
overflow: "visible" |
| 44893 |
}, |
| 44894 |
width: "100%", |
| 44895 |
height: "100%" |
| 44896 |
} |
| 44897 |
}; |
| 44898 |
const parent = this[$getParent]()[$getParent](); |
| 44899 |
if (hasMargin(parent)) { |
| 44900 |
return HTMLResult.success({ |
| 44901 |
name: "div", |
| 44902 |
attributes: { |
| 44903 |
style: { |
| 44904 |
display: "inline", |
| 44905 |
width: "100%", |
| 44906 |
height: "100%" |
| 44907 |
} |
| 44908 |
}, |
| 44909 |
children: [svg] |
| 44910 |
}); |
| 44911 |
} |
| 44912 |
svg.attributes.style.position = "absolute"; |
| 44913 |
return HTMLResult.success(svg); |
| 44914 |
} |
| 44915 |
} |
| 44916 |
class RefElement extends StringObject { |
| 44917 |
constructor(attributes) { |
| 44918 |
super(TEMPLATE_NS_ID, "ref"); |
| 44919 |
this.id = attributes.id || ""; |
| 44920 |
this.use = attributes.use || ""; |
| 44921 |
this.usehref = attributes.usehref || ""; |
| 44922 |
} |
| 44923 |
} |
| 44924 |
class Script extends StringObject { |
| 44925 |
constructor(attributes) { |
| 44926 |
super(TEMPLATE_NS_ID, "script"); |
| 44927 |
this.binding = attributes.binding || ""; |
| 44928 |
this.contentType = attributes.contentType || ""; |
| 44929 |
this.id = attributes.id || ""; |
| 44930 |
this.name = attributes.name || ""; |
| 44931 |
this.runAt = getStringOption(attributes.runAt, ["client", "both", "server"]); |
| 44932 |
this.use = attributes.use || ""; |
| 44933 |
this.usehref = attributes.usehref || ""; |
| 44934 |
} |
| 44935 |
} |
| 44936 |
class SetProperty extends XFAObject { |
| 44937 |
constructor(attributes) { |
| 44938 |
super(TEMPLATE_NS_ID, "setProperty"); |
| 44939 |
this.connection = attributes.connection || ""; |
| 44940 |
this.ref = attributes.ref || ""; |
| 44941 |
this.target = attributes.target || ""; |
| 44942 |
} |
| 44943 |
} |
| 44944 |
class SignData extends XFAObject { |
| 44945 |
constructor(attributes) { |
| 44946 |
super(TEMPLATE_NS_ID, "signData", true); |
| 44947 |
this.id = attributes.id || ""; |
| 44948 |
this.operation = getStringOption(attributes.operation, ["sign", "clear", "verify"]); |
| 44949 |
this.ref = attributes.ref || ""; |
| 44950 |
this.target = attributes.target || ""; |
| 44951 |
this.use = attributes.use || ""; |
| 44952 |
this.usehref = attributes.usehref || ""; |
| 44953 |
this.filter = null; |
| 44954 |
this.manifest = null; |
| 44955 |
} |
| 44956 |
} |
| 44957 |
class Signature extends XFAObject { |
| 44958 |
constructor(attributes) { |
| 44959 |
super(TEMPLATE_NS_ID, "signature", true); |
| 44960 |
this.id = attributes.id || ""; |
| 44961 |
this.type = getStringOption(attributes.type, ["PDF1.3", "PDF1.6"]); |
| 44962 |
this.use = attributes.use || ""; |
| 44963 |
this.usehref = attributes.usehref || ""; |
| 44964 |
this.border = null; |
| 44965 |
this.extras = null; |
| 44966 |
this.filter = null; |
| 44967 |
this.manifest = null; |
| 44968 |
this.margin = null; |
| 44969 |
} |
| 44970 |
} |
| 44971 |
class Signing extends XFAObject { |
| 44972 |
constructor(attributes) { |
| 44973 |
super(TEMPLATE_NS_ID, "signing", true); |
| 44974 |
this.id = attributes.id || ""; |
| 44975 |
this.type = getStringOption(attributes.type, ["optional", "required"]); |
| 44976 |
this.use = attributes.use || ""; |
| 44977 |
this.usehref = attributes.usehref || ""; |
| 44978 |
this.certificate = new XFAObjectArray(); |
| 44979 |
} |
| 44980 |
} |
| 44981 |
class Solid extends XFAObject { |
| 44982 |
constructor(attributes) { |
| 44983 |
super(TEMPLATE_NS_ID, "solid", true); |
| 44984 |
this.id = attributes.id || ""; |
| 44985 |
this.use = attributes.use || ""; |
| 44986 |
this.usehref = attributes.usehref || ""; |
| 44987 |
this.extras = null; |
| 44988 |
} |
| 44989 |
[$toStyle](startColor) { |
| 44990 |
return startColor ? startColor[$toStyle]() : "#FFFFFF"; |
| 44991 |
} |
| 44992 |
} |
| 44993 |
class Speak extends StringObject { |
| 44994 |
constructor(attributes) { |
| 44995 |
super(TEMPLATE_NS_ID, "speak"); |
| 44996 |
this.disable = getInteger({ |
| 44997 |
data: attributes.disable, |
| 44998 |
defaultValue: 0, |
| 44999 |
validate: x => x === 1 |
| 45000 |
}); |
| 45001 |
this.id = attributes.id || ""; |
| 45002 |
this.priority = getStringOption(attributes.priority, ["custom", "caption", "name", "toolTip"]); |
| 45003 |
this.rid = attributes.rid || ""; |
| 45004 |
this.use = attributes.use || ""; |
| 45005 |
this.usehref = attributes.usehref || ""; |
| 45006 |
} |
| 45007 |
} |
| 45008 |
class Stipple extends XFAObject { |
| 45009 |
constructor(attributes) { |
| 45010 |
super(TEMPLATE_NS_ID, "stipple", true); |
| 45011 |
this.id = attributes.id || ""; |
| 45012 |
this.rate = getInteger({ |
| 45013 |
data: attributes.rate, |
| 45014 |
defaultValue: 50, |
| 45015 |
validate: x => x >= 0 && x <= 100 |
| 45016 |
}); |
| 45017 |
this.use = attributes.use || ""; |
| 45018 |
this.usehref = attributes.usehref || ""; |
| 45019 |
this.color = null; |
| 45020 |
this.extras = null; |
| 45021 |
} |
| 45022 |
[$toStyle](bgColor) { |
| 45023 |
const alpha = this.rate / 100; |
| 45024 |
return Util.makeHexColor(Math.round(bgColor.value.r * (1 - alpha) + this.value.r * alpha), Math.round(bgColor.value.g * (1 - alpha) + this.value.g * alpha), Math.round(bgColor.value.b * (1 - alpha) + this.value.b * alpha)); |
| 45025 |
} |
| 45026 |
} |
| 45027 |
class Subform extends XFAObject { |
| 45028 |
constructor(attributes) { |
| 45029 |
super(TEMPLATE_NS_ID, "subform", true); |
| 45030 |
this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]); |
| 45031 |
this.allowMacro = getInteger({ |
| 45032 |
data: attributes.allowMacro, |
| 45033 |
defaultValue: 0, |
| 45034 |
validate: x => x === 1 |
| 45035 |
}); |
| 45036 |
this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]); |
| 45037 |
this.colSpan = getInteger({ |
| 45038 |
data: attributes.colSpan, |
| 45039 |
defaultValue: 1, |
| 45040 |
validate: n => n >= 1 || n === -1 |
| 45041 |
}); |
| 45042 |
this.columnWidths = (attributes.columnWidths || "").trim().split(/\s+/).map(x => x === "-1" ? -1 : getMeasurement(x)); |
| 45043 |
this.h = attributes.h ? getMeasurement(attributes.h) : ""; |
| 45044 |
this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); |
| 45045 |
this.id = attributes.id || ""; |
| 45046 |
this.layout = getStringOption(attributes.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]); |
| 45047 |
this.locale = attributes.locale || ""; |
| 45048 |
this.maxH = getMeasurement(attributes.maxH, "0pt"); |
| 45049 |
this.maxW = getMeasurement(attributes.maxW, "0pt"); |
| 45050 |
this.mergeMode = getStringOption(attributes.mergeMode, ["consumeData", "matchTemplate"]); |
| 45051 |
this.minH = getMeasurement(attributes.minH, "0pt"); |
| 45052 |
this.minW = getMeasurement(attributes.minW, "0pt"); |
| 45053 |
this.name = attributes.name || ""; |
| 45054 |
this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); |
| 45055 |
this.relevant = getRelevant(attributes.relevant); |
| 45056 |
this.restoreState = getStringOption(attributes.restoreState, ["manual", "auto"]); |
| 45057 |
this.scope = getStringOption(attributes.scope, ["name", "none"]); |
| 45058 |
this.use = attributes.use || ""; |
| 45059 |
this.usehref = attributes.usehref || ""; |
| 45060 |
this.w = attributes.w ? getMeasurement(attributes.w) : ""; |
| 45061 |
this.x = getMeasurement(attributes.x, "0pt"); |
| 45062 |
this.y = getMeasurement(attributes.y, "0pt"); |
| 45063 |
this.assist = null; |
| 45064 |
this.bind = null; |
| 45065 |
this.bookend = null; |
| 45066 |
this.border = null; |
| 45067 |
this.break = null; |
| 45068 |
this.calculate = null; |
| 45069 |
this.desc = null; |
| 45070 |
this.extras = null; |
| 45071 |
this.keep = null; |
| 45072 |
this.margin = null; |
| 45073 |
this.occur = null; |
| 45074 |
this.overflow = null; |
| 45075 |
this.pageSet = null; |
| 45076 |
this.para = null; |
| 45077 |
this.traversal = null; |
| 45078 |
this.validate = null; |
| 45079 |
this.variables = null; |
| 45080 |
this.area = new XFAObjectArray(); |
| 45081 |
this.breakAfter = new XFAObjectArray(); |
| 45082 |
this.breakBefore = new XFAObjectArray(); |
| 45083 |
this.connect = new XFAObjectArray(); |
| 45084 |
this.draw = new XFAObjectArray(); |
| 45085 |
this.event = new XFAObjectArray(); |
| 45086 |
this.exObject = new XFAObjectArray(); |
| 45087 |
this.exclGroup = new XFAObjectArray(); |
| 45088 |
this.field = new XFAObjectArray(); |
| 45089 |
this.proto = new XFAObjectArray(); |
| 45090 |
this.setProperty = new XFAObjectArray(); |
| 45091 |
this.subform = new XFAObjectArray(); |
| 45092 |
this.subformSet = new XFAObjectArray(); |
| 45093 |
} |
| 45094 |
[$getSubformParent]() { |
| 45095 |
const parent = this[$getParent](); |
| 45096 |
if (parent instanceof SubformSet) { |
| 45097 |
return parent[$getSubformParent](); |
| 45098 |
} |
| 45099 |
return parent; |
| 45100 |
} |
| 45101 |
[$isBindable]() { |
| 45102 |
return true; |
| 45103 |
} |
| 45104 |
[$isThereMoreWidth]() { |
| 45105 |
return this.layout.endsWith("-tb") && this[$extra].attempt === 0 && this[$extra].numberInLine > 0 || this[$getParent]()[$isThereMoreWidth](); |
| 45106 |
} |
| 45107 |
*[$getContainedChildren]() { |
| 45108 |
yield* getContainedChildren(this); |
| 45109 |
} |
| 45110 |
[$flushHTML]() { |
| 45111 |
return flushHTML(this); |
| 45112 |
} |
| 45113 |
[$addHTML](html, bbox) { |
| 45114 |
addHTML(this, html, bbox); |
| 45115 |
} |
| 45116 |
[$getAvailableSpace]() { |
| 45117 |
return getAvailableSpace(this); |
| 45118 |
} |
| 45119 |
[$isSplittable]() { |
| 45120 |
const parent = this[$getSubformParent](); |
| 45121 |
if (!parent[$isSplittable]()) { |
| 45122 |
return false; |
| 45123 |
} |
| 45124 |
if (this[$extra]._isSplittable !== undefined) { |
| 45125 |
return this[$extra]._isSplittable; |
| 45126 |
} |
| 45127 |
if (this.layout === "position" || this.layout.includes("row")) { |
| 45128 |
this[$extra]._isSplittable = false; |
| 45129 |
return false; |
| 45130 |
} |
| 45131 |
if (this.keep && this.keep.intact !== "none") { |
| 45132 |
this[$extra]._isSplittable = false; |
| 45133 |
return false; |
| 45134 |
} |
| 45135 |
if (parent.layout?.endsWith("-tb") && parent[$extra].numberInLine !== 0) { |
| 45136 |
return false; |
| 45137 |
} |
| 45138 |
this[$extra]._isSplittable = true; |
| 45139 |
return true; |
| 45140 |
} |
| 45141 |
[$toHTML](availableSpace) { |
| 45142 |
setTabIndex(this); |
| 45143 |
if (this.break) { |
| 45144 |
if (this.break.after !== "auto" || this.break.afterTarget !== "") { |
| 45145 |
const node = new BreakAfter({ |
| 45146 |
targetType: this.break.after, |
| 45147 |
target: this.break.afterTarget, |
| 45148 |
startNew: this.break.startNew.toString() |
| 45149 |
}); |
| 45150 |
node[$globalData] = this[$globalData]; |
| 45151 |
this[$appendChild](node); |
| 45152 |
this.breakAfter.push(node); |
| 45153 |
} |
| 45154 |
if (this.break.before !== "auto" || this.break.beforeTarget !== "") { |
| 45155 |
const node = new BreakBefore({ |
| 45156 |
targetType: this.break.before, |
| 45157 |
target: this.break.beforeTarget, |
| 45158 |
startNew: this.break.startNew.toString() |
| 45159 |
}); |
| 45160 |
node[$globalData] = this[$globalData]; |
| 45161 |
this[$appendChild](node); |
| 45162 |
this.breakBefore.push(node); |
| 45163 |
} |
| 45164 |
if (this.break.overflowTarget !== "") { |
| 45165 |
const node = new Overflow({ |
| 45166 |
target: this.break.overflowTarget, |
| 45167 |
leader: this.break.overflowLeader, |
| 45168 |
trailer: this.break.overflowTrailer |
| 45169 |
}); |
| 45170 |
node[$globalData] = this[$globalData]; |
| 45171 |
this[$appendChild](node); |
| 45172 |
this.overflow.push(node); |
| 45173 |
} |
| 45174 |
this[$removeChild](this.break); |
| 45175 |
this.break = null; |
| 45176 |
} |
| 45177 |
if (this.presence === "hidden" || this.presence === "inactive") { |
| 45178 |
return HTMLResult.EMPTY; |
| 45179 |
} |
| 45180 |
if (this.breakBefore.children.length > 1 || this.breakAfter.children.length > 1) { |
| 45181 |
warn("XFA - Several breakBefore or breakAfter in subforms: please file a bug."); |
| 45182 |
} |
| 45183 |
if (this.breakBefore.children.length >= 1) { |
| 45184 |
const breakBefore = this.breakBefore.children[0]; |
| 45185 |
if (handleBreak(breakBefore)) { |
| 45186 |
return HTMLResult.breakNode(breakBefore); |
| 45187 |
} |
| 45188 |
} |
| 45189 |
if (this[$extra]?.afterBreakAfter) { |
| 45190 |
return HTMLResult.EMPTY; |
| 45191 |
} |
| 45192 |
fixDimensions(this); |
| 45193 |
const children = []; |
| 45194 |
const attributes = { |
| 45195 |
id: this[$uid], |
| 45196 |
class: [] |
| 45197 |
}; |
| 45198 |
setAccess(this, attributes.class); |
| 45199 |
if (!this[$extra]) { |
| 45200 |
this[$extra] = Object.create(null); |
| 45201 |
} |
| 45202 |
Object.assign(this[$extra], { |
| 45203 |
children, |
| 45204 |
line: null, |
| 45205 |
attributes, |
| 45206 |
attempt: 0, |
| 45207 |
numberInLine: 0, |
| 45208 |
availableSpace: { |
| 45209 |
width: Math.min(this.w || Infinity, availableSpace.width), |
| 45210 |
height: Math.min(this.h || Infinity, availableSpace.height) |
| 45211 |
}, |
| 45212 |
width: 0, |
| 45213 |
height: 0, |
| 45214 |
prevHeight: 0, |
| 45215 |
currentWidth: 0 |
| 45216 |
}); |
| 45217 |
const root = this[$getTemplateRoot](); |
| 45218 |
const savedNoLayoutFailure = root[$extra].noLayoutFailure; |
| 45219 |
const isSplittable = this[$isSplittable](); |
| 45220 |
if (!isSplittable) { |
| 45221 |
setFirstUnsplittable(this); |
| 45222 |
} |
| 45223 |
if (!checkDimensions(this, availableSpace)) { |
| 45224 |
return HTMLResult.FAILURE; |
| 45225 |
} |
| 45226 |
const filter = new Set(["area", "draw", "exclGroup", "field", "subform", "subformSet"]); |
| 45227 |
if (this.layout.includes("row")) { |
| 45228 |
const columnWidths = this[$getSubformParent]().columnWidths; |
| 45229 |
if (Array.isArray(columnWidths) && columnWidths.length > 0) { |
| 45230 |
this[$extra].columnWidths = columnWidths; |
| 45231 |
this[$extra].currentColumn = 0; |
| 45232 |
} |
| 45233 |
} |
| 45234 |
const style = toStyle(this, "anchorType", "dimensions", "position", "presence", "border", "margin", "hAlign"); |
| 45235 |
const classNames = ["xfaSubform"]; |
| 45236 |
const cl = layoutClass(this); |
| 45237 |
if (cl) { |
| 45238 |
classNames.push(cl); |
| 45239 |
} |
| 45240 |
attributes.style = style; |
| 45241 |
attributes.class = classNames; |
| 45242 |
if (this.name) { |
| 45243 |
attributes.xfaName = this.name; |
| 45244 |
} |
| 45245 |
if (this.overflow) { |
| 45246 |
const overflowExtra = this.overflow[$getExtra](); |
| 45247 |
if (overflowExtra.addLeader) { |
| 45248 |
overflowExtra.addLeader = false; |
| 45249 |
handleOverflow(this, overflowExtra.leader, availableSpace); |
| 45250 |
} |
| 45251 |
} |
| 45252 |
this[$pushPara](); |
| 45253 |
const isLrTb = this.layout === "lr-tb" || this.layout === "rl-tb"; |
| 45254 |
const maxRun = isLrTb ? MAX_ATTEMPTS_FOR_LRTB_LAYOUT : 1; |
| 45255 |
for (; this[$extra].attempt < maxRun; this[$extra].attempt++) { |
| 45256 |
if (isLrTb && this[$extra].attempt === MAX_ATTEMPTS_FOR_LRTB_LAYOUT - 1) { |
| 45257 |
this[$extra].numberInLine = 0; |
| 45258 |
} |
| 45259 |
const result = this[$childrenToHTML]({ |
| 45260 |
filter, |
| 45261 |
include: true |
| 45262 |
}); |
| 45263 |
if (result.success) { |
| 45264 |
break; |
| 45265 |
} |
| 45266 |
if (result.isBreak()) { |
| 45267 |
this[$popPara](); |
| 45268 |
return result; |
| 45269 |
} |
| 45270 |
if (isLrTb && this[$extra].attempt === 0 && this[$extra].numberInLine === 0 && !root[$extra].noLayoutFailure) { |
| 45271 |
this[$extra].attempt = maxRun; |
| 45272 |
break; |
| 45273 |
} |
| 45274 |
} |
| 45275 |
this[$popPara](); |
| 45276 |
if (!isSplittable) { |
| 45277 |
unsetFirstUnsplittable(this); |
| 45278 |
} |
| 45279 |
root[$extra].noLayoutFailure = savedNoLayoutFailure; |
| 45280 |
if (this[$extra].attempt === maxRun) { |
| 45281 |
if (this.overflow) { |
| 45282 |
this[$getTemplateRoot]()[$extra].overflowNode = this.overflow; |
| 45283 |
} |
| 45284 |
if (!isSplittable) { |
| 45285 |
delete this[$extra]; |
| 45286 |
} |
| 45287 |
return HTMLResult.FAILURE; |
| 45288 |
} |
| 45289 |
if (this.overflow) { |
| 45290 |
const overflowExtra = this.overflow[$getExtra](); |
| 45291 |
if (overflowExtra.addTrailer) { |
| 45292 |
overflowExtra.addTrailer = false; |
| 45293 |
handleOverflow(this, overflowExtra.trailer, availableSpace); |
| 45294 |
} |
| 45295 |
} |
| 45296 |
let marginH = 0; |
| 45297 |
let marginV = 0; |
| 45298 |
if (this.margin) { |
| 45299 |
marginH = this.margin.leftInset + this.margin.rightInset; |
| 45300 |
marginV = this.margin.topInset + this.margin.bottomInset; |
| 45301 |
} |
| 45302 |
const width = Math.max(this[$extra].width + marginH, this.w || 0); |
| 45303 |
const height = Math.max(this[$extra].height + marginV, this.h || 0); |
| 45304 |
const bbox = [this.x, this.y, width, height]; |
| 45305 |
if (this.w === "") { |
| 45306 |
style.width = measureToString(width); |
| 45307 |
} |
| 45308 |
if (this.h === "") { |
| 45309 |
style.height = measureToString(height); |
| 45310 |
} |
| 45311 |
if ((style.width === "0px" || style.height === "0px") && children.length === 0) { |
| 45312 |
return HTMLResult.EMPTY; |
| 45313 |
} |
| 45314 |
const html = { |
| 45315 |
name: "div", |
| 45316 |
attributes, |
| 45317 |
children |
| 45318 |
}; |
| 45319 |
applyAssist(this, attributes); |
| 45320 |
const result = HTMLResult.success(createWrapper(this, html), bbox); |
| 45321 |
if (this.breakAfter.children.length >= 1) { |
| 45322 |
const breakAfter = this.breakAfter.children[0]; |
| 45323 |
if (handleBreak(breakAfter)) { |
| 45324 |
this[$extra].afterBreakAfter = result; |
| 45325 |
return HTMLResult.breakNode(breakAfter); |
| 45326 |
} |
| 45327 |
} |
| 45328 |
delete this[$extra]; |
| 45329 |
return result; |
| 45330 |
} |
| 45331 |
} |
| 45332 |
class SubformSet extends XFAObject { |
| 45333 |
constructor(attributes) { |
| 45334 |
super(TEMPLATE_NS_ID, "subformSet", true); |
| 45335 |
this.id = attributes.id || ""; |
| 45336 |
this.name = attributes.name || ""; |
| 45337 |
this.relation = getStringOption(attributes.relation, ["ordered", "choice", "unordered"]); |
| 45338 |
this.relevant = getRelevant(attributes.relevant); |
| 45339 |
this.use = attributes.use || ""; |
| 45340 |
this.usehref = attributes.usehref || ""; |
| 45341 |
this.bookend = null; |
| 45342 |
this.break = null; |
| 45343 |
this.desc = null; |
| 45344 |
this.extras = null; |
| 45345 |
this.occur = null; |
| 45346 |
this.overflow = null; |
| 45347 |
this.breakAfter = new XFAObjectArray(); |
| 45348 |
this.breakBefore = new XFAObjectArray(); |
| 45349 |
this.subform = new XFAObjectArray(); |
| 45350 |
this.subformSet = new XFAObjectArray(); |
| 45351 |
} |
| 45352 |
*[$getContainedChildren]() { |
| 45353 |
yield* getContainedChildren(this); |
| 45354 |
} |
| 45355 |
[$getSubformParent]() { |
| 45356 |
let parent = this[$getParent](); |
| 45357 |
while (!(parent instanceof Subform)) { |
| 45358 |
parent = parent[$getParent](); |
| 45359 |
} |
| 45360 |
return parent; |
| 45361 |
} |
| 45362 |
[$isBindable]() { |
| 45363 |
return true; |
| 45364 |
} |
| 45365 |
} |
| 45366 |
class SubjectDN extends ContentObject { |
| 45367 |
constructor(attributes) { |
| 45368 |
super(TEMPLATE_NS_ID, "subjectDN"); |
| 45369 |
this.delimiter = attributes.delimiter || ","; |
| 45370 |
this.id = attributes.id || ""; |
| 45371 |
this.name = attributes.name || ""; |
| 45372 |
this.use = attributes.use || ""; |
| 45373 |
this.usehref = attributes.usehref || ""; |
| 45374 |
} |
| 45375 |
[$finalize]() { |
| 45376 |
this[$content] = new Map(this[$content].split(this.delimiter).map(kv => { |
| 45377 |
kv = kv.split("=", 2); |
| 45378 |
kv[0] = kv[0].trim(); |
| 45379 |
return kv; |
| 45380 |
})); |
| 45381 |
} |
| 45382 |
} |
| 45383 |
class SubjectDNs extends XFAObject { |
| 45384 |
constructor(attributes) { |
| 45385 |
super(TEMPLATE_NS_ID, "subjectDNs", true); |
| 45386 |
this.id = attributes.id || ""; |
| 45387 |
this.type = getStringOption(attributes.type, ["optional", "required"]); |
| 45388 |
this.use = attributes.use || ""; |
| 45389 |
this.usehref = attributes.usehref || ""; |
| 45390 |
this.subjectDN = new XFAObjectArray(); |
| 45391 |
} |
| 45392 |
} |
| 45393 |
class Submit extends XFAObject { |
| 45394 |
constructor(attributes) { |
| 45395 |
super(TEMPLATE_NS_ID, "submit", true); |
| 45396 |
this.embedPDF = getInteger({ |
| 45397 |
data: attributes.embedPDF, |
| 45398 |
defaultValue: 0, |
| 45399 |
validate: x => x === 1 |
| 45400 |
}); |
| 45401 |
this.format = getStringOption(attributes.format, ["xdp", "formdata", "pdf", "urlencoded", "xfd", "xml"]); |
| 45402 |
this.id = attributes.id || ""; |
| 45403 |
this.target = attributes.target || ""; |
| 45404 |
this.textEncoding = getKeyword({ |
| 45405 |
data: attributes.textEncoding ? attributes.textEncoding.toLowerCase() : "", |
| 45406 |
defaultValue: "", |
| 45407 |
validate: k => ["utf-8", "big-five", "fontspecific", "gbk", "gb-18030", "gb-2312", "ksc-5601", "none", "shift-jis", "ucs-2", "utf-16"].includes(k) || k.match(/iso-8859-\d{2}/) |
| 45408 |
}); |
| 45409 |
this.use = attributes.use || ""; |
| 45410 |
this.usehref = attributes.usehref || ""; |
| 45411 |
this.xdpContent = attributes.xdpContent || ""; |
| 45412 |
this.encrypt = null; |
| 45413 |
this.encryptData = new XFAObjectArray(); |
| 45414 |
this.signData = new XFAObjectArray(); |
| 45415 |
} |
| 45416 |
} |
| 45417 |
class Template extends XFAObject { |
| 45418 |
constructor(attributes) { |
| 45419 |
super(TEMPLATE_NS_ID, "template", true); |
| 45420 |
this.baseProfile = getStringOption(attributes.baseProfile, ["full", "interactiveForms"]); |
| 45421 |
this.extras = null; |
| 45422 |
this.subform = new XFAObjectArray(); |
| 45423 |
} |
| 45424 |
[$finalize]() { |
| 45425 |
if (this.subform.children.length === 0) { |
| 45426 |
warn("XFA - No subforms in template node."); |
| 45427 |
} |
| 45428 |
if (this.subform.children.length >= 2) { |
| 45429 |
warn("XFA - Several subforms in template node: please file a bug."); |
| 45430 |
} |
| 45431 |
this[$tabIndex] = DEFAULT_TAB_INDEX; |
| 45432 |
} |
| 45433 |
[$isSplittable]() { |
| 45434 |
return true; |
| 45435 |
} |
| 45436 |
[$searchNode](expr, container) { |
| 45437 |
if (expr.startsWith("#")) { |
| 45438 |
return [this[$ids].get(expr.slice(1))]; |
| 45439 |
} |
| 45440 |
return searchNode(this, container, expr, true, true); |
| 45441 |
} |
| 45442 |
*[$toPages]() { |
| 45443 |
if (!this.subform.children.length) { |
| 45444 |
return HTMLResult.success({ |
| 45445 |
name: "div", |
| 45446 |
children: [] |
| 45447 |
}); |
| 45448 |
} |
| 45449 |
this[$extra] = { |
| 45450 |
overflowNode: null, |
| 45451 |
firstUnsplittable: null, |
| 45452 |
currentContentArea: null, |
| 45453 |
currentPageArea: null, |
| 45454 |
noLayoutFailure: false, |
| 45455 |
pageNumber: 1, |
| 45456 |
pagePosition: "first", |
| 45457 |
oddOrEven: "odd", |
| 45458 |
blankOrNotBlank: "nonBlank", |
| 45459 |
paraStack: [] |
| 45460 |
}; |
| 45461 |
const root = this.subform.children[0]; |
| 45462 |
root.pageSet[$cleanPage](); |
| 45463 |
const pageAreas = root.pageSet.pageArea.children; |
| 45464 |
const mainHtml = { |
| 45465 |
name: "div", |
| 45466 |
children: [] |
| 45467 |
}; |
| 45468 |
let pageArea = null; |
| 45469 |
let breakBefore = null; |
| 45470 |
let breakBeforeTarget = null; |
| 45471 |
if (root.breakBefore.children.length >= 1) { |
| 45472 |
breakBefore = root.breakBefore.children[0]; |
| 45473 |
breakBeforeTarget = breakBefore.target; |
| 45474 |
} else if (root.subform.children.length >= 1 && root.subform.children[0].breakBefore.children.length >= 1) { |
| 45475 |
breakBefore = root.subform.children[0].breakBefore.children[0]; |
| 45476 |
breakBeforeTarget = breakBefore.target; |
| 45477 |
} else if (root.break?.beforeTarget) { |
| 45478 |
breakBefore = root.break; |
| 45479 |
breakBeforeTarget = breakBefore.beforeTarget; |
| 45480 |
} else if (root.subform.children.length >= 1 && root.subform.children[0].break?.beforeTarget) { |
| 45481 |
breakBefore = root.subform.children[0].break; |
| 45482 |
breakBeforeTarget = breakBefore.beforeTarget; |
| 45483 |
} |
| 45484 |
if (breakBefore) { |
| 45485 |
const target = this[$searchNode](breakBeforeTarget, breakBefore[$getParent]()); |
| 45486 |
if (target instanceof PageArea) { |
| 45487 |
pageArea = target; |
| 45488 |
breakBefore[$extra] = {}; |
| 45489 |
} |
| 45490 |
} |
| 45491 |
if (!pageArea) { |
| 45492 |
pageArea = pageAreas[0]; |
| 45493 |
} |
| 45494 |
pageArea[$extra] = { |
| 45495 |
numberOfUse: 1 |
| 45496 |
}; |
| 45497 |
const pageAreaParent = pageArea[$getParent](); |
| 45498 |
pageAreaParent[$extra] = { |
| 45499 |
numberOfUse: 1, |
| 45500 |
pageIndex: pageAreaParent.pageArea.children.indexOf(pageArea), |
| 45501 |
pageSetIndex: 0 |
| 45502 |
}; |
| 45503 |
let targetPageArea; |
| 45504 |
let leader = null; |
| 45505 |
let trailer = null; |
| 45506 |
let hasSomething = true; |
| 45507 |
let hasSomethingCounter = 0; |
| 45508 |
let startIndex = 0; |
| 45509 |
while (true) { |
| 45510 |
if (!hasSomething) { |
| 45511 |
mainHtml.children.pop(); |
| 45512 |
if (++hasSomethingCounter === MAX_EMPTY_PAGES) { |
| 45513 |
warn("XFA - Something goes wrong: please file a bug."); |
| 45514 |
return mainHtml; |
| 45515 |
} |
| 45516 |
} else { |
| 45517 |
hasSomethingCounter = 0; |
| 45518 |
} |
| 45519 |
targetPageArea = null; |
| 45520 |
this[$extra].currentPageArea = pageArea; |
| 45521 |
const page = pageArea[$toHTML]().html; |
| 45522 |
mainHtml.children.push(page); |
| 45523 |
if (leader) { |
| 45524 |
this[$extra].noLayoutFailure = true; |
| 45525 |
page.children.push(leader[$toHTML](pageArea[$extra].space).html); |
| 45526 |
leader = null; |
| 45527 |
} |
| 45528 |
if (trailer) { |
| 45529 |
this[$extra].noLayoutFailure = true; |
| 45530 |
page.children.push(trailer[$toHTML](pageArea[$extra].space).html); |
| 45531 |
trailer = null; |
| 45532 |
} |
| 45533 |
const contentAreas = pageArea.contentArea.children; |
| 45534 |
const htmlContentAreas = page.children.filter(node => node.attributes.class.includes("xfaContentarea")); |
| 45535 |
hasSomething = false; |
| 45536 |
this[$extra].firstUnsplittable = null; |
| 45537 |
this[$extra].noLayoutFailure = false; |
| 45538 |
const flush = index => { |
| 45539 |
const html = root[$flushHTML](); |
| 45540 |
if (html) { |
| 45541 |
hasSomething ||= html.children?.length > 0; |
| 45542 |
htmlContentAreas[index].children.push(html); |
| 45543 |
} |
| 45544 |
}; |
| 45545 |
for (let i = startIndex, ii = contentAreas.length; i < ii; i++) { |
| 45546 |
const contentArea = this[$extra].currentContentArea = contentAreas[i]; |
| 45547 |
const space = { |
| 45548 |
width: contentArea.w, |
| 45549 |
height: contentArea.h |
| 45550 |
}; |
| 45551 |
startIndex = 0; |
| 45552 |
if (leader) { |
| 45553 |
htmlContentAreas[i].children.push(leader[$toHTML](space).html); |
| 45554 |
leader = null; |
| 45555 |
} |
| 45556 |
if (trailer) { |
| 45557 |
htmlContentAreas[i].children.push(trailer[$toHTML](space).html); |
| 45558 |
trailer = null; |
| 45559 |
} |
| 45560 |
const html = root[$toHTML](space); |
| 45561 |
if (html.success) { |
| 45562 |
if (html.html) { |
| 45563 |
hasSomething ||= html.html.children?.length > 0; |
| 45564 |
htmlContentAreas[i].children.push(html.html); |
| 45565 |
} else if (!hasSomething && mainHtml.children.length > 1) { |
| 45566 |
mainHtml.children.pop(); |
| 45567 |
} |
| 45568 |
return mainHtml; |
| 45569 |
} |
| 45570 |
if (html.isBreak()) { |
| 45571 |
const node = html.breakNode; |
| 45572 |
flush(i); |
| 45573 |
if (node.targetType === "auto") { |
| 45574 |
continue; |
| 45575 |
} |
| 45576 |
if (node.leader) { |
| 45577 |
leader = this[$searchNode](node.leader, node[$getParent]()); |
| 45578 |
leader = leader ? leader[0] : null; |
| 45579 |
} |
| 45580 |
if (node.trailer) { |
| 45581 |
trailer = this[$searchNode](node.trailer, node[$getParent]()); |
| 45582 |
trailer = trailer ? trailer[0] : null; |
| 45583 |
} |
| 45584 |
if (node.targetType === "pageArea") { |
| 45585 |
targetPageArea = node[$extra].target; |
| 45586 |
i = Infinity; |
| 45587 |
} else if (!node[$extra].target) { |
| 45588 |
i = node[$extra].index; |
| 45589 |
} else { |
| 45590 |
targetPageArea = node[$extra].target; |
| 45591 |
startIndex = node[$extra].index + 1; |
| 45592 |
i = Infinity; |
| 45593 |
} |
| 45594 |
continue; |
| 45595 |
} |
| 45596 |
if (this[$extra].overflowNode) { |
| 45597 |
const node = this[$extra].overflowNode; |
| 45598 |
this[$extra].overflowNode = null; |
| 45599 |
const overflowExtra = node[$getExtra](); |
| 45600 |
const target = overflowExtra.target; |
| 45601 |
overflowExtra.addLeader = overflowExtra.leader !== null; |
| 45602 |
overflowExtra.addTrailer = overflowExtra.trailer !== null; |
| 45603 |
flush(i); |
| 45604 |
const currentIndex = i; |
| 45605 |
i = Infinity; |
| 45606 |
if (target instanceof PageArea) { |
| 45607 |
targetPageArea = target; |
| 45608 |
} else if (target instanceof ContentArea) { |
| 45609 |
const index = contentAreas.indexOf(target); |
| 45610 |
if (index !== -1) { |
| 45611 |
if (index > currentIndex) { |
| 45612 |
i = index - 1; |
| 45613 |
} else { |
| 45614 |
startIndex = index; |
| 45615 |
} |
| 45616 |
} else { |
| 45617 |
targetPageArea = target[$getParent](); |
| 45618 |
startIndex = targetPageArea.contentArea.children.indexOf(target); |
| 45619 |
} |
| 45620 |
} |
| 45621 |
continue; |
| 45622 |
} |
| 45623 |
flush(i); |
| 45624 |
} |
| 45625 |
this[$extra].pageNumber += 1; |
| 45626 |
if (targetPageArea) { |
| 45627 |
if (targetPageArea[$isUsable]()) { |
| 45628 |
targetPageArea[$extra].numberOfUse += 1; |
| 45629 |
} else { |
| 45630 |
targetPageArea = null; |
| 45631 |
} |
| 45632 |
} |
| 45633 |
pageArea = targetPageArea || pageArea[$getNextPage](); |
| 45634 |
yield null; |
| 45635 |
} |
| 45636 |
} |
| 45637 |
} |
| 45638 |
class Text extends ContentObject { |
| 45639 |
constructor(attributes) { |
| 45640 |
super(TEMPLATE_NS_ID, "text"); |
| 45641 |
this.id = attributes.id || ""; |
| 45642 |
this.maxChars = getInteger({ |
| 45643 |
data: attributes.maxChars, |
| 45644 |
defaultValue: 0, |
| 45645 |
validate: x => x >= 0 |
| 45646 |
}); |
| 45647 |
this.name = attributes.name || ""; |
| 45648 |
this.rid = attributes.rid || ""; |
| 45649 |
this.use = attributes.use || ""; |
| 45650 |
this.usehref = attributes.usehref || ""; |
| 45651 |
} |
| 45652 |
[$acceptWhitespace]() { |
| 45653 |
return true; |
| 45654 |
} |
| 45655 |
[$onChild](child) { |
| 45656 |
if (child[$namespaceId] === NamespaceIds.xhtml.id) { |
| 45657 |
this[$content] = child; |
| 45658 |
return true; |
| 45659 |
} |
| 45660 |
warn(`XFA - Invalid content in Text: ${child[$nodeName]}.`); |
| 45661 |
return false; |
| 45662 |
} |
| 45663 |
[$onText](str) { |
| 45664 |
if (this[$content] instanceof XFAObject) { |
| 45665 |
return; |
| 45666 |
} |
| 45667 |
super[$onText](str); |
| 45668 |
} |
| 45669 |
[$finalize]() { |
| 45670 |
if (typeof this[$content] === "string") { |
| 45671 |
this[$content] = this[$content].replaceAll("\r\n", "\n"); |
| 45672 |
} |
| 45673 |
} |
| 45674 |
[$getExtra]() { |
| 45675 |
if (typeof this[$content] === "string") { |
| 45676 |
return this[$content].split(/[\u2029\u2028\n]/).reduce((acc, line) => { |
| 45677 |
if (line) { |
| 45678 |
acc.push(line); |
| 45679 |
} |
| 45680 |
return acc; |
| 45681 |
}, []).join("\n"); |
| 45682 |
} |
| 45683 |
return this[$content][$text](); |
| 45684 |
} |
| 45685 |
[$toHTML](availableSpace) { |
| 45686 |
if (typeof this[$content] === "string") { |
| 45687 |
const html = valueToHtml(this[$content]).html; |
| 45688 |
if (this[$content].includes("\u2029")) { |
| 45689 |
html.name = "div"; |
| 45690 |
html.children = []; |
| 45691 |
this[$content].split("\u2029").map(para => para.split(/[\u2028\n]/).reduce((acc, line) => { |
| 45692 |
acc.push({ |
| 45693 |
name: "span", |
| 45694 |
value: line |
| 45695 |
}, { |
| 45696 |
name: "br" |
| 45697 |
}); |
| 45698 |
return acc; |
| 45699 |
}, [])).forEach(lines => { |
| 45700 |
html.children.push({ |
| 45701 |
name: "p", |
| 45702 |
children: lines |
| 45703 |
}); |
| 45704 |
}); |
| 45705 |
} else if (/[\u2028\n]/.test(this[$content])) { |
| 45706 |
html.name = "div"; |
| 45707 |
html.children = []; |
| 45708 |
this[$content].split(/[\u2028\n]/).forEach(line => { |
| 45709 |
html.children.push({ |
| 45710 |
name: "span", |
| 45711 |
value: line |
| 45712 |
}, { |
| 45713 |
name: "br" |
| 45714 |
}); |
| 45715 |
}); |
| 45716 |
} |
| 45717 |
return HTMLResult.success(html); |
| 45718 |
} |
| 45719 |
return this[$content][$toHTML](availableSpace); |
| 45720 |
} |
| 45721 |
} |
| 45722 |
class TextEdit extends XFAObject { |
| 45723 |
constructor(attributes) { |
| 45724 |
super(TEMPLATE_NS_ID, "textEdit", true); |
| 45725 |
this.allowRichText = getInteger({ |
| 45726 |
data: attributes.allowRichText, |
| 45727 |
defaultValue: 0, |
| 45728 |
validate: x => x === 1 |
| 45729 |
}); |
| 45730 |
this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]); |
| 45731 |
this.id = attributes.id || ""; |
| 45732 |
this.multiLine = getInteger({ |
| 45733 |
data: attributes.multiLine, |
| 45734 |
defaultValue: "", |
| 45735 |
validate: x => x === 0 || x === 1 |
| 45736 |
}); |
| 45737 |
this.use = attributes.use || ""; |
| 45738 |
this.usehref = attributes.usehref || ""; |
| 45739 |
this.vScrollPolicy = getStringOption(attributes.vScrollPolicy, ["auto", "off", "on"]); |
| 45740 |
this.border = null; |
| 45741 |
this.comb = null; |
| 45742 |
this.extras = null; |
| 45743 |
this.margin = null; |
| 45744 |
} |
| 45745 |
[$toHTML](availableSpace) { |
| 45746 |
const style = toStyle(this, "border", "font", "margin"); |
| 45747 |
let html; |
| 45748 |
const field = this[$getParent]()[$getParent](); |
| 45749 |
if (this.multiLine === "") { |
| 45750 |
this.multiLine = field instanceof Draw ? 1 : 0; |
| 45751 |
} |
| 45752 |
if (this.multiLine === 1) { |
| 45753 |
html = { |
| 45754 |
name: "textarea", |
| 45755 |
attributes: { |
| 45756 |
dataId: field[$data]?.[$uid] || field[$uid], |
| 45757 |
fieldId: field[$uid], |
| 45758 |
class: ["xfaTextfield"], |
| 45759 |
style, |
| 45760 |
"aria-label": ariaLabel(field), |
| 45761 |
"aria-required": false |
| 45762 |
} |
| 45763 |
}; |
| 45764 |
} else { |
| 45765 |
html = { |
| 45766 |
name: "input", |
| 45767 |
attributes: { |
| 45768 |
type: "text", |
| 45769 |
dataId: field[$data]?.[$uid] || field[$uid], |
| 45770 |
fieldId: field[$uid], |
| 45771 |
class: ["xfaTextfield"], |
| 45772 |
style, |
| 45773 |
"aria-label": ariaLabel(field), |
| 45774 |
"aria-required": false |
| 45775 |
} |
| 45776 |
}; |
| 45777 |
} |
| 45778 |
if (isRequired(field)) { |
| 45779 |
html.attributes["aria-required"] = true; |
| 45780 |
html.attributes.required = true; |
| 45781 |
} |
| 45782 |
return HTMLResult.success({ |
| 45783 |
name: "label", |
| 45784 |
attributes: { |
| 45785 |
class: ["xfaLabel"] |
| 45786 |
}, |
| 45787 |
children: [html] |
| 45788 |
}); |
| 45789 |
} |
| 45790 |
} |
| 45791 |
class Time extends StringObject { |
| 45792 |
constructor(attributes) { |
| 45793 |
super(TEMPLATE_NS_ID, "time"); |
| 45794 |
this.id = attributes.id || ""; |
| 45795 |
this.name = attributes.name || ""; |
| 45796 |
this.use = attributes.use || ""; |
| 45797 |
this.usehref = attributes.usehref || ""; |
| 45798 |
} |
| 45799 |
[$finalize]() { |
| 45800 |
const date = this[$content].trim(); |
| 45801 |
this[$content] = date ? new Date(date) : null; |
| 45802 |
} |
| 45803 |
[$toHTML](availableSpace) { |
| 45804 |
return valueToHtml(this[$content] ? this[$content].toString() : ""); |
| 45805 |
} |
| 45806 |
} |
| 45807 |
class TimeStamp extends XFAObject { |
| 45808 |
constructor(attributes) { |
| 45809 |
super(TEMPLATE_NS_ID, "timeStamp"); |
| 45810 |
this.id = attributes.id || ""; |
| 45811 |
this.server = attributes.server || ""; |
| 45812 |
this.type = getStringOption(attributes.type, ["optional", "required"]); |
| 45813 |
this.use = attributes.use || ""; |
| 45814 |
this.usehref = attributes.usehref || ""; |
| 45815 |
} |
| 45816 |
} |
| 45817 |
class ToolTip extends StringObject { |
| 45818 |
constructor(attributes) { |
| 45819 |
super(TEMPLATE_NS_ID, "toolTip"); |
| 45820 |
this.id = attributes.id || ""; |
| 45821 |
this.rid = attributes.rid || ""; |
| 45822 |
this.use = attributes.use || ""; |
| 45823 |
this.usehref = attributes.usehref || ""; |
| 45824 |
} |
| 45825 |
} |
| 45826 |
class Traversal extends XFAObject { |
| 45827 |
constructor(attributes) { |
| 45828 |
super(TEMPLATE_NS_ID, "traversal", true); |
| 45829 |
this.id = attributes.id || ""; |
| 45830 |
this.use = attributes.use || ""; |
| 45831 |
this.usehref = attributes.usehref || ""; |
| 45832 |
this.extras = null; |
| 45833 |
this.traverse = new XFAObjectArray(); |
| 45834 |
} |
| 45835 |
} |
| 45836 |
class Traverse extends XFAObject { |
| 45837 |
constructor(attributes) { |
| 45838 |
super(TEMPLATE_NS_ID, "traverse", true); |
| 45839 |
this.id = attributes.id || ""; |
| 45840 |
this.operation = getStringOption(attributes.operation, ["next", "back", "down", "first", "left", "right", "up"]); |
| 45841 |
this.ref = attributes.ref || ""; |
| 45842 |
this.use = attributes.use || ""; |
| 45843 |
this.usehref = attributes.usehref || ""; |
| 45844 |
this.extras = null; |
| 45845 |
this.script = null; |
| 45846 |
} |
| 45847 |
get name() { |
| 45848 |
return this.operation; |
| 45849 |
} |
| 45850 |
[$isTransparent]() { |
| 45851 |
return false; |
| 45852 |
} |
| 45853 |
} |
| 45854 |
class Ui extends XFAObject { |
| 45855 |
constructor(attributes) { |
| 45856 |
super(TEMPLATE_NS_ID, "ui", true); |
| 45857 |
this.id = attributes.id || ""; |
| 45858 |
this.use = attributes.use || ""; |
| 45859 |
this.usehref = attributes.usehref || ""; |
| 45860 |
this.extras = null; |
| 45861 |
this.picture = null; |
| 45862 |
this.barcode = null; |
| 45863 |
this.button = null; |
| 45864 |
this.checkButton = null; |
| 45865 |
this.choiceList = null; |
| 45866 |
this.dateTimeEdit = null; |
| 45867 |
this.defaultUi = null; |
| 45868 |
this.imageEdit = null; |
| 45869 |
this.numericEdit = null; |
| 45870 |
this.passwordEdit = null; |
| 45871 |
this.signature = null; |
| 45872 |
this.textEdit = null; |
| 45873 |
} |
| 45874 |
[$getExtra]() { |
| 45875 |
if (this[$extra] === undefined) { |
| 45876 |
for (const name of Object.getOwnPropertyNames(this)) { |
| 45877 |
if (name === "extras" || name === "picture") { |
| 45878 |
continue; |
| 45879 |
} |
| 45880 |
const obj = this[name]; |
| 45881 |
if (!(obj instanceof XFAObject)) { |
| 45882 |
continue; |
| 45883 |
} |
| 45884 |
this[$extra] = obj; |
| 45885 |
return obj; |
| 45886 |
} |
| 45887 |
this[$extra] = null; |
| 45888 |
} |
| 45889 |
return this[$extra]; |
| 45890 |
} |
| 45891 |
[$toHTML](availableSpace) { |
| 45892 |
const obj = this[$getExtra](); |
| 45893 |
if (obj) { |
| 45894 |
return obj[$toHTML](availableSpace); |
| 45895 |
} |
| 45896 |
return HTMLResult.EMPTY; |
| 45897 |
} |
| 45898 |
} |
| 45899 |
class Validate extends XFAObject { |
| 45900 |
constructor(attributes) { |
| 45901 |
super(TEMPLATE_NS_ID, "validate", true); |
| 45902 |
this.formatTest = getStringOption(attributes.formatTest, ["warning", "disabled", "error"]); |
| 45903 |
this.id = attributes.id || ""; |
| 45904 |
this.nullTest = getStringOption(attributes.nullTest, ["disabled", "error", "warning"]); |
| 45905 |
this.scriptTest = getStringOption(attributes.scriptTest, ["error", "disabled", "warning"]); |
| 45906 |
this.use = attributes.use || ""; |
| 45907 |
this.usehref = attributes.usehref || ""; |
| 45908 |
this.extras = null; |
| 45909 |
this.message = null; |
| 45910 |
this.picture = null; |
| 45911 |
this.script = null; |
| 45912 |
} |
| 45913 |
} |
| 45914 |
class Value extends XFAObject { |
| 45915 |
constructor(attributes) { |
| 45916 |
super(TEMPLATE_NS_ID, "value", true); |
| 45917 |
this.id = attributes.id || ""; |
| 45918 |
this.override = getInteger({ |
| 45919 |
data: attributes.override, |
| 45920 |
defaultValue: 0, |
| 45921 |
validate: x => x === 1 |
| 45922 |
}); |
| 45923 |
this.relevant = getRelevant(attributes.relevant); |
| 45924 |
this.use = attributes.use || ""; |
| 45925 |
this.usehref = attributes.usehref || ""; |
| 45926 |
this.arc = null; |
| 45927 |
this.boolean = null; |
| 45928 |
this.date = null; |
| 45929 |
this.dateTime = null; |
| 45930 |
this.decimal = null; |
| 45931 |
this.exData = null; |
| 45932 |
this.float = null; |
| 45933 |
this.image = null; |
| 45934 |
this.integer = null; |
| 45935 |
this.line = null; |
| 45936 |
this.rectangle = null; |
| 45937 |
this.text = null; |
| 45938 |
this.time = null; |
| 45939 |
} |
| 45940 |
[$setValue](value) { |
| 45941 |
const parent = this[$getParent](); |
| 45942 |
if (parent instanceof Field) { |
| 45943 |
if (parent.ui?.imageEdit) { |
| 45944 |
if (!this.image) { |
| 45945 |
this.image = new Image({}); |
| 45946 |
this[$appendChild](this.image); |
| 45947 |
} |
| 45948 |
this.image[$content] = value[$content]; |
| 45949 |
return; |
| 45950 |
} |
| 45951 |
} |
| 45952 |
const valueName = value[$nodeName]; |
| 45953 |
if (this[valueName] !== null) { |
| 45954 |
this[valueName][$content] = value[$content]; |
| 45955 |
return; |
| 45956 |
} |
| 45957 |
for (const name of Object.getOwnPropertyNames(this)) { |
| 45958 |
const obj = this[name]; |
| 45959 |
if (obj instanceof XFAObject) { |
| 45960 |
this[name] = null; |
| 45961 |
this[$removeChild](obj); |
| 45962 |
} |
| 45963 |
} |
| 45964 |
this[value[$nodeName]] = value; |
| 45965 |
this[$appendChild](value); |
| 45966 |
} |
| 45967 |
[$text]() { |
| 45968 |
if (this.exData) { |
| 45969 |
if (typeof this.exData[$content] === "string") { |
| 45970 |
return this.exData[$content].trim(); |
| 45971 |
} |
| 45972 |
return this.exData[$content][$text]().trim(); |
| 45973 |
} |
| 45974 |
for (const name of Object.getOwnPropertyNames(this)) { |
| 45975 |
if (name === "image") { |
| 45976 |
continue; |
| 45977 |
} |
| 45978 |
const obj = this[name]; |
| 45979 |
if (obj instanceof XFAObject) { |
| 45980 |
return (obj[$content] || "").toString().trim(); |
| 45981 |
} |
| 45982 |
} |
| 45983 |
return null; |
| 45984 |
} |
| 45985 |
[$toHTML](availableSpace) { |
| 45986 |
for (const name of Object.getOwnPropertyNames(this)) { |
| 45987 |
const obj = this[name]; |
| 45988 |
if (!(obj instanceof XFAObject)) { |
| 45989 |
continue; |
| 45990 |
} |
| 45991 |
return obj[$toHTML](availableSpace); |
| 45992 |
} |
| 45993 |
return HTMLResult.EMPTY; |
| 45994 |
} |
| 45995 |
} |
| 45996 |
class Variables extends XFAObject { |
| 45997 |
constructor(attributes) { |
| 45998 |
super(TEMPLATE_NS_ID, "variables", true); |
| 45999 |
this.id = attributes.id || ""; |
| 46000 |
this.use = attributes.use || ""; |
| 46001 |
this.usehref = attributes.usehref || ""; |
| 46002 |
this.boolean = new XFAObjectArray(); |
| 46003 |
this.date = new XFAObjectArray(); |
| 46004 |
this.dateTime = new XFAObjectArray(); |
| 46005 |
this.decimal = new XFAObjectArray(); |
| 46006 |
this.exData = new XFAObjectArray(); |
| 46007 |
this.float = new XFAObjectArray(); |
| 46008 |
this.image = new XFAObjectArray(); |
| 46009 |
this.integer = new XFAObjectArray(); |
| 46010 |
this.manifest = new XFAObjectArray(); |
| 46011 |
this.script = new XFAObjectArray(); |
| 46012 |
this.text = new XFAObjectArray(); |
| 46013 |
this.time = new XFAObjectArray(); |
| 46014 |
} |
| 46015 |
[$isTransparent]() { |
| 46016 |
return true; |
| 46017 |
} |
| 46018 |
} |
| 46019 |
class TemplateNamespace { |
| 46020 |
static [$buildXFAObject](name, attributes) { |
| 46021 |
if (TemplateNamespace.hasOwnProperty(name)) { |
| 46022 |
const node = TemplateNamespace[name](attributes); |
| 46023 |
node[$setSetAttributes](attributes); |
| 46024 |
return node; |
| 46025 |
} |
| 46026 |
return undefined; |
| 46027 |
} |
| 46028 |
static appearanceFilter(attrs) { |
| 46029 |
return new AppearanceFilter(attrs); |
| 46030 |
} |
| 46031 |
static arc(attrs) { |
| 46032 |
return new Arc(attrs); |
| 46033 |
} |
| 46034 |
static area(attrs) { |
| 46035 |
return new Area(attrs); |
| 46036 |
} |
| 46037 |
static assist(attrs) { |
| 46038 |
return new Assist(attrs); |
| 46039 |
} |
| 46040 |
static barcode(attrs) { |
| 46041 |
return new Barcode(attrs); |
| 46042 |
} |
| 46043 |
static bind(attrs) { |
| 46044 |
return new Bind(attrs); |
| 46045 |
} |
| 46046 |
static bindItems(attrs) { |
| 46047 |
return new BindItems(attrs); |
| 46048 |
} |
| 46049 |
static bookend(attrs) { |
| 46050 |
return new Bookend(attrs); |
| 46051 |
} |
| 46052 |
static boolean(attrs) { |
| 46053 |
return new BooleanElement(attrs); |
| 46054 |
} |
| 46055 |
static border(attrs) { |
| 46056 |
return new Border(attrs); |
| 46057 |
} |
| 46058 |
static break(attrs) { |
| 46059 |
return new Break(attrs); |
| 46060 |
} |
| 46061 |
static breakAfter(attrs) { |
| 46062 |
return new BreakAfter(attrs); |
| 46063 |
} |
| 46064 |
static breakBefore(attrs) { |
| 46065 |
return new BreakBefore(attrs); |
| 46066 |
} |
| 46067 |
static button(attrs) { |
| 46068 |
return new Button(attrs); |
| 46069 |
} |
| 46070 |
static calculate(attrs) { |
| 46071 |
return new Calculate(attrs); |
| 46072 |
} |
| 46073 |
static caption(attrs) { |
| 46074 |
return new Caption(attrs); |
| 46075 |
} |
| 46076 |
static certificate(attrs) { |
| 46077 |
return new Certificate(attrs); |
| 46078 |
} |
| 46079 |
static certificates(attrs) { |
| 46080 |
return new Certificates(attrs); |
| 46081 |
} |
| 46082 |
static checkButton(attrs) { |
| 46083 |
return new CheckButton(attrs); |
| 46084 |
} |
| 46085 |
static choiceList(attrs) { |
| 46086 |
return new ChoiceList(attrs); |
| 46087 |
} |
| 46088 |
static color(attrs) { |
| 46089 |
return new Color(attrs); |
| 46090 |
} |
| 46091 |
static comb(attrs) { |
| 46092 |
return new Comb(attrs); |
| 46093 |
} |
| 46094 |
static connect(attrs) { |
| 46095 |
return new Connect(attrs); |
| 46096 |
} |
| 46097 |
static contentArea(attrs) { |
| 46098 |
return new ContentArea(attrs); |
| 46099 |
} |
| 46100 |
static corner(attrs) { |
| 46101 |
return new Corner(attrs); |
| 46102 |
} |
| 46103 |
static date(attrs) { |
| 46104 |
return new DateElement(attrs); |
| 46105 |
} |
| 46106 |
static dateTime(attrs) { |
| 46107 |
return new DateTime(attrs); |
| 46108 |
} |
| 46109 |
static dateTimeEdit(attrs) { |
| 46110 |
return new DateTimeEdit(attrs); |
| 46111 |
} |
| 46112 |
static decimal(attrs) { |
| 46113 |
return new Decimal(attrs); |
| 46114 |
} |
| 46115 |
static defaultUi(attrs) { |
| 46116 |
return new DefaultUi(attrs); |
| 46117 |
} |
| 46118 |
static desc(attrs) { |
| 46119 |
return new Desc(attrs); |
| 46120 |
} |
| 46121 |
static digestMethod(attrs) { |
| 46122 |
return new DigestMethod(attrs); |
| 46123 |
} |
| 46124 |
static digestMethods(attrs) { |
| 46125 |
return new DigestMethods(attrs); |
| 46126 |
} |
| 46127 |
static draw(attrs) { |
| 46128 |
return new Draw(attrs); |
| 46129 |
} |
| 46130 |
static edge(attrs) { |
| 46131 |
return new Edge(attrs); |
| 46132 |
} |
| 46133 |
static encoding(attrs) { |
| 46134 |
return new Encoding(attrs); |
| 46135 |
} |
| 46136 |
static encodings(attrs) { |
| 46137 |
return new Encodings(attrs); |
| 46138 |
} |
| 46139 |
static encrypt(attrs) { |
| 46140 |
return new Encrypt(attrs); |
| 46141 |
} |
| 46142 |
static encryptData(attrs) { |
| 46143 |
return new EncryptData(attrs); |
| 46144 |
} |
| 46145 |
static encryption(attrs) { |
| 46146 |
return new Encryption(attrs); |
| 46147 |
} |
| 46148 |
static encryptionMethod(attrs) { |
| 46149 |
return new EncryptionMethod(attrs); |
| 46150 |
} |
| 46151 |
static encryptionMethods(attrs) { |
| 46152 |
return new EncryptionMethods(attrs); |
| 46153 |
} |
| 46154 |
static event(attrs) { |
| 46155 |
return new Event(attrs); |
| 46156 |
} |
| 46157 |
static exData(attrs) { |
| 46158 |
return new ExData(attrs); |
| 46159 |
} |
| 46160 |
static exObject(attrs) { |
| 46161 |
return new ExObject(attrs); |
| 46162 |
} |
| 46163 |
static exclGroup(attrs) { |
| 46164 |
return new ExclGroup(attrs); |
| 46165 |
} |
| 46166 |
static execute(attrs) { |
| 46167 |
return new Execute(attrs); |
| 46168 |
} |
| 46169 |
static extras(attrs) { |
| 46170 |
return new Extras(attrs); |
| 46171 |
} |
| 46172 |
static field(attrs) { |
| 46173 |
return new Field(attrs); |
| 46174 |
} |
| 46175 |
static fill(attrs) { |
| 46176 |
return new Fill(attrs); |
| 46177 |
} |
| 46178 |
static filter(attrs) { |
| 46179 |
return new Filter(attrs); |
| 46180 |
} |
| 46181 |
static float(attrs) { |
| 46182 |
return new Float(attrs); |
| 46183 |
} |
| 46184 |
static font(attrs) { |
| 46185 |
return new template_Font(attrs); |
| 46186 |
} |
| 46187 |
static format(attrs) { |
| 46188 |
return new Format(attrs); |
| 46189 |
} |
| 46190 |
static handler(attrs) { |
| 46191 |
return new Handler(attrs); |
| 46192 |
} |
| 46193 |
static hyphenation(attrs) { |
| 46194 |
return new Hyphenation(attrs); |
| 46195 |
} |
| 46196 |
static image(attrs) { |
| 46197 |
return new Image(attrs); |
| 46198 |
} |
| 46199 |
static imageEdit(attrs) { |
| 46200 |
return new ImageEdit(attrs); |
| 46201 |
} |
| 46202 |
static integer(attrs) { |
| 46203 |
return new Integer(attrs); |
| 46204 |
} |
| 46205 |
static issuers(attrs) { |
| 46206 |
return new Issuers(attrs); |
| 46207 |
} |
| 46208 |
static items(attrs) { |
| 46209 |
return new Items(attrs); |
| 46210 |
} |
| 46211 |
static keep(attrs) { |
| 46212 |
return new Keep(attrs); |
| 46213 |
} |
| 46214 |
static keyUsage(attrs) { |
| 46215 |
return new KeyUsage(attrs); |
| 46216 |
} |
| 46217 |
static line(attrs) { |
| 46218 |
return new Line(attrs); |
| 46219 |
} |
| 46220 |
static linear(attrs) { |
| 46221 |
return new Linear(attrs); |
| 46222 |
} |
| 46223 |
static lockDocument(attrs) { |
| 46224 |
return new LockDocument(attrs); |
| 46225 |
} |
| 46226 |
static manifest(attrs) { |
| 46227 |
return new Manifest(attrs); |
| 46228 |
} |
| 46229 |
static margin(attrs) { |
| 46230 |
return new Margin(attrs); |
| 46231 |
} |
| 46232 |
static mdp(attrs) { |
| 46233 |
return new Mdp(attrs); |
| 46234 |
} |
| 46235 |
static medium(attrs) { |
| 46236 |
return new Medium(attrs); |
| 46237 |
} |
| 46238 |
static message(attrs) { |
| 46239 |
return new Message(attrs); |
| 46240 |
} |
| 46241 |
static numericEdit(attrs) { |
| 46242 |
return new NumericEdit(attrs); |
| 46243 |
} |
| 46244 |
static occur(attrs) { |
| 46245 |
return new Occur(attrs); |
| 46246 |
} |
| 46247 |
static oid(attrs) { |
| 46248 |
return new Oid(attrs); |
| 46249 |
} |
| 46250 |
static oids(attrs) { |
| 46251 |
return new Oids(attrs); |
| 46252 |
} |
| 46253 |
static overflow(attrs) { |
| 46254 |
return new Overflow(attrs); |
| 46255 |
} |
| 46256 |
static pageArea(attrs) { |
| 46257 |
return new PageArea(attrs); |
| 46258 |
} |
| 46259 |
static pageSet(attrs) { |
| 46260 |
return new PageSet(attrs); |
| 46261 |
} |
| 46262 |
static para(attrs) { |
| 46263 |
return new Para(attrs); |
| 46264 |
} |
| 46265 |
static passwordEdit(attrs) { |
| 46266 |
return new PasswordEdit(attrs); |
| 46267 |
} |
| 46268 |
static pattern(attrs) { |
| 46269 |
return new template_Pattern(attrs); |
| 46270 |
} |
| 46271 |
static picture(attrs) { |
| 46272 |
return new Picture(attrs); |
| 46273 |
} |
| 46274 |
static proto(attrs) { |
| 46275 |
return new Proto(attrs); |
| 46276 |
} |
| 46277 |
static radial(attrs) { |
| 46278 |
return new Radial(attrs); |
| 46279 |
} |
| 46280 |
static reason(attrs) { |
| 46281 |
return new Reason(attrs); |
| 46282 |
} |
| 46283 |
static reasons(attrs) { |
| 46284 |
return new Reasons(attrs); |
| 46285 |
} |
| 46286 |
static rectangle(attrs) { |
| 46287 |
return new Rectangle(attrs); |
| 46288 |
} |
| 46289 |
static ref(attrs) { |
| 46290 |
return new RefElement(attrs); |
| 46291 |
} |
| 46292 |
static script(attrs) { |
| 46293 |
return new Script(attrs); |
| 46294 |
} |
| 46295 |
static setProperty(attrs) { |
| 46296 |
return new SetProperty(attrs); |
| 46297 |
} |
| 46298 |
static signData(attrs) { |
| 46299 |
return new SignData(attrs); |
| 46300 |
} |
| 46301 |
static signature(attrs) { |
| 46302 |
return new Signature(attrs); |
| 46303 |
} |
| 46304 |
static signing(attrs) { |
| 46305 |
return new Signing(attrs); |
| 46306 |
} |
| 46307 |
static solid(attrs) { |
| 46308 |
return new Solid(attrs); |
| 46309 |
} |
| 46310 |
static speak(attrs) { |
| 46311 |
return new Speak(attrs); |
| 46312 |
} |
| 46313 |
static stipple(attrs) { |
| 46314 |
return new Stipple(attrs); |
| 46315 |
} |
| 46316 |
static subform(attrs) { |
| 46317 |
return new Subform(attrs); |
| 46318 |
} |
| 46319 |
static subformSet(attrs) { |
| 46320 |
return new SubformSet(attrs); |
| 46321 |
} |
| 46322 |
static subjectDN(attrs) { |
| 46323 |
return new SubjectDN(attrs); |
| 46324 |
} |
| 46325 |
static subjectDNs(attrs) { |
| 46326 |
return new SubjectDNs(attrs); |
| 46327 |
} |
| 46328 |
static submit(attrs) { |
| 46329 |
return new Submit(attrs); |
| 46330 |
} |
| 46331 |
static template(attrs) { |
| 46332 |
return new Template(attrs); |
| 46333 |
} |
| 46334 |
static text(attrs) { |
| 46335 |
return new Text(attrs); |
| 46336 |
} |
| 46337 |
static textEdit(attrs) { |
| 46338 |
return new TextEdit(attrs); |
| 46339 |
} |
| 46340 |
static time(attrs) { |
| 46341 |
return new Time(attrs); |
| 46342 |
} |
| 46343 |
static timeStamp(attrs) { |
| 46344 |
return new TimeStamp(attrs); |
| 46345 |
} |
| 46346 |
static toolTip(attrs) { |
| 46347 |
return new ToolTip(attrs); |
| 46348 |
} |
| 46349 |
static traversal(attrs) { |
| 46350 |
return new Traversal(attrs); |
| 46351 |
} |
| 46352 |
static traverse(attrs) { |
| 46353 |
return new Traverse(attrs); |
| 46354 |
} |
| 46355 |
static ui(attrs) { |
| 46356 |
return new Ui(attrs); |
| 46357 |
} |
| 46358 |
static validate(attrs) { |
| 46359 |
return new Validate(attrs); |
| 46360 |
} |
| 46361 |
static value(attrs) { |
| 46362 |
return new Value(attrs); |
| 46363 |
} |
| 46364 |
static variables(attrs) { |
| 46365 |
return new Variables(attrs); |
| 46366 |
} |
| 46367 |
} |
| 46368 |
|
| 46369 |
;// ./src/core/xfa/bind.js |
| 46370 |
|
| 46371 |
|
| 46372 |
|
| 46373 |
|
| 46374 |
|
| 46375 |
|
| 46376 |
const bind_NS_DATASETS = NamespaceIds.datasets.id; |
| 46377 |
function createText(content) { |
| 46378 |
const node = new Text({}); |
| 46379 |
node[$content] = content; |
| 46380 |
return node; |
| 46381 |
} |
| 46382 |
class Binder { |
| 46383 |
constructor(root) { |
| 46384 |
this.root = root; |
| 46385 |
this.datasets = root.datasets; |
| 46386 |
this.data = root.datasets?.data || new XmlObject(NamespaceIds.datasets.id, "data"); |
| 46387 |
this.emptyMerge = this.data[$getChildren]().length === 0; |
| 46388 |
this.root.form = this.form = root.template[$clone](); |
| 46389 |
} |
| 46390 |
_isConsumeData() { |
| 46391 |
return !this.emptyMerge && this._mergeMode; |
| 46392 |
} |
| 46393 |
_isMatchTemplate() { |
| 46394 |
return !this._isConsumeData(); |
| 46395 |
} |
| 46396 |
bind() { |
| 46397 |
this._bindElement(this.form, this.data); |
| 46398 |
return this.form; |
| 46399 |
} |
| 46400 |
getData() { |
| 46401 |
return this.data; |
| 46402 |
} |
| 46403 |
_bindValue(formNode, data, picture) { |
| 46404 |
formNode[$data] = data; |
| 46405 |
if (formNode[$hasSettableValue]()) { |
| 46406 |
if (data[$isDataValue]()) { |
| 46407 |
const value = data[$getDataValue](); |
| 46408 |
formNode[$setValue](createText(value)); |
| 46409 |
} else if (formNode instanceof Field && formNode.ui?.choiceList?.open === "multiSelect") { |
| 46410 |
const value = data[$getChildren]().map(child => child[$content].trim()).join("\n"); |
| 46411 |
formNode[$setValue](createText(value)); |
| 46412 |
} else if (this._isConsumeData()) { |
| 46413 |
warn(`XFA - Nodes haven't the same type.`); |
| 46414 |
} |
| 46415 |
} else if (!data[$isDataValue]() || this._isMatchTemplate()) { |
| 46416 |
this._bindElement(formNode, data); |
| 46417 |
} else { |
| 46418 |
warn(`XFA - Nodes haven't the same type.`); |
| 46419 |
} |
| 46420 |
} |
| 46421 |
_findDataByNameToConsume(name, isValue, dataNode, global) { |
| 46422 |
if (!name) { |
| 46423 |
return null; |
| 46424 |
} |
| 46425 |
let generator, match; |
| 46426 |
for (let i = 0; i < 3; i++) { |
| 46427 |
generator = dataNode[$getRealChildrenByNameIt](name, false, true); |
| 46428 |
while (true) { |
| 46429 |
match = generator.next().value; |
| 46430 |
if (!match) { |
| 46431 |
break; |
| 46432 |
} |
| 46433 |
if (isValue === match[$isDataValue]()) { |
| 46434 |
return match; |
| 46435 |
} |
| 46436 |
} |
| 46437 |
if (dataNode[$namespaceId] === NamespaceIds.datasets.id && dataNode[$nodeName] === "data") { |
| 46438 |
break; |
| 46439 |
} |
| 46440 |
dataNode = dataNode[$getParent](); |
| 46441 |
} |
| 46442 |
if (!global) { |
| 46443 |
return null; |
| 46444 |
} |
| 46445 |
generator = this.data[$getRealChildrenByNameIt](name, true, false); |
| 46446 |
match = generator.next().value; |
| 46447 |
if (match) { |
| 46448 |
return match; |
| 46449 |
} |
| 46450 |
generator = this.data[$getAttributeIt](name, true); |
| 46451 |
match = generator.next().value; |
| 46452 |
if (match?.[$isDataValue]()) { |
| 46453 |
return match; |
| 46454 |
} |
| 46455 |
return null; |
| 46456 |
} |
| 46457 |
_setProperties(formNode, dataNode) { |
| 46458 |
if (!formNode.hasOwnProperty("setProperty")) { |
| 46459 |
return; |
| 46460 |
} |
| 46461 |
for (const { |
| 46462 |
ref, |
| 46463 |
target, |
| 46464 |
connection |
| 46465 |
} of formNode.setProperty.children) { |
| 46466 |
if (connection) { |
| 46467 |
continue; |
| 46468 |
} |
| 46469 |
if (!ref) { |
| 46470 |
continue; |
| 46471 |
} |
| 46472 |
const nodes = searchNode(this.root, dataNode, ref, false, false); |
| 46473 |
if (!nodes) { |
| 46474 |
warn(`XFA - Invalid reference: ${ref}.`); |
| 46475 |
continue; |
| 46476 |
} |
| 46477 |
const [node] = nodes; |
| 46478 |
if (!node[$isDescendent](this.data)) { |
| 46479 |
warn(`XFA - Invalid node: must be a data node.`); |
| 46480 |
continue; |
| 46481 |
} |
| 46482 |
const targetNodes = searchNode(this.root, formNode, target, false, false); |
| 46483 |
if (!targetNodes) { |
| 46484 |
warn(`XFA - Invalid target: ${target}.`); |
| 46485 |
continue; |
| 46486 |
} |
| 46487 |
const [targetNode] = targetNodes; |
| 46488 |
if (!targetNode[$isDescendent](formNode)) { |
| 46489 |
warn(`XFA - Invalid target: must be a property or subproperty.`); |
| 46490 |
continue; |
| 46491 |
} |
| 46492 |
const targetParent = targetNode[$getParent](); |
| 46493 |
if (targetNode instanceof SetProperty || targetParent instanceof SetProperty) { |
| 46494 |
warn(`XFA - Invalid target: cannot be a setProperty or one of its properties.`); |
| 46495 |
continue; |
| 46496 |
} |
| 46497 |
if (targetNode instanceof BindItems || targetParent instanceof BindItems) { |
| 46498 |
warn(`XFA - Invalid target: cannot be a bindItems or one of its properties.`); |
| 46499 |
continue; |
| 46500 |
} |
| 46501 |
const content = node[$text](); |
| 46502 |
const name = targetNode[$nodeName]; |
| 46503 |
if (targetNode instanceof XFAAttribute) { |
| 46504 |
const attrs = Object.create(null); |
| 46505 |
attrs[name] = content; |
| 46506 |
const obj = Reflect.construct(Object.getPrototypeOf(targetParent).constructor, [attrs]); |
| 46507 |
targetParent[name] = obj[name]; |
| 46508 |
continue; |
| 46509 |
} |
| 46510 |
if (!targetNode.hasOwnProperty($content)) { |
| 46511 |
warn(`XFA - Invalid node to use in setProperty`); |
| 46512 |
continue; |
| 46513 |
} |
| 46514 |
targetNode[$data] = node; |
| 46515 |
targetNode[$content] = content; |
| 46516 |
targetNode[$finalize](); |
| 46517 |
} |
| 46518 |
} |
| 46519 |
_bindItems(formNode, dataNode) { |
| 46520 |
if (!formNode.hasOwnProperty("items") || !formNode.hasOwnProperty("bindItems") || formNode.bindItems.isEmpty()) { |
| 46521 |
return; |
| 46522 |
} |
| 46523 |
for (const item of formNode.items.children) { |
| 46524 |
formNode[$removeChild](item); |
| 46525 |
} |
| 46526 |
formNode.items.clear(); |
| 46527 |
const labels = new Items({}); |
| 46528 |
const values = new Items({}); |
| 46529 |
formNode[$appendChild](labels); |
| 46530 |
formNode.items.push(labels); |
| 46531 |
formNode[$appendChild](values); |
| 46532 |
formNode.items.push(values); |
| 46533 |
for (const { |
| 46534 |
ref, |
| 46535 |
labelRef, |
| 46536 |
valueRef, |
| 46537 |
connection |
| 46538 |
} of formNode.bindItems.children) { |
| 46539 |
if (connection) { |
| 46540 |
continue; |
| 46541 |
} |
| 46542 |
if (!ref) { |
| 46543 |
continue; |
| 46544 |
} |
| 46545 |
const nodes = searchNode(this.root, dataNode, ref, false, false); |
| 46546 |
if (!nodes) { |
| 46547 |
warn(`XFA - Invalid reference: ${ref}.`); |
| 46548 |
continue; |
| 46549 |
} |
| 46550 |
for (const node of nodes) { |
| 46551 |
if (!node[$isDescendent](this.datasets)) { |
| 46552 |
warn(`XFA - Invalid ref (${ref}): must be a datasets child.`); |
| 46553 |
continue; |
| 46554 |
} |
| 46555 |
const labelNodes = searchNode(this.root, node, labelRef, true, false); |
| 46556 |
if (!labelNodes) { |
| 46557 |
warn(`XFA - Invalid label: ${labelRef}.`); |
| 46558 |
continue; |
| 46559 |
} |
| 46560 |
const [labelNode] = labelNodes; |
| 46561 |
if (!labelNode[$isDescendent](this.datasets)) { |
| 46562 |
warn(`XFA - Invalid label: must be a datasets child.`); |
| 46563 |
continue; |
| 46564 |
} |
| 46565 |
const valueNodes = searchNode(this.root, node, valueRef, true, false); |
| 46566 |
if (!valueNodes) { |
| 46567 |
warn(`XFA - Invalid value: ${valueRef}.`); |
| 46568 |
continue; |
| 46569 |
} |
| 46570 |
const [valueNode] = valueNodes; |
| 46571 |
if (!valueNode[$isDescendent](this.datasets)) { |
| 46572 |
warn(`XFA - Invalid value: must be a datasets child.`); |
| 46573 |
continue; |
| 46574 |
} |
| 46575 |
const label = createText(labelNode[$text]()); |
| 46576 |
const value = createText(valueNode[$text]()); |
| 46577 |
labels[$appendChild](label); |
| 46578 |
labels.text.push(label); |
| 46579 |
values[$appendChild](value); |
| 46580 |
values.text.push(value); |
| 46581 |
} |
| 46582 |
} |
| 46583 |
} |
| 46584 |
_bindOccurrences(formNode, matches, picture) { |
| 46585 |
let baseClone; |
| 46586 |
if (matches.length > 1) { |
| 46587 |
baseClone = formNode[$clone](); |
| 46588 |
baseClone[$removeChild](baseClone.occur); |
| 46589 |
baseClone.occur = null; |
| 46590 |
} |
| 46591 |
this._bindValue(formNode, matches[0], picture); |
| 46592 |
this._setProperties(formNode, matches[0]); |
| 46593 |
this._bindItems(formNode, matches[0]); |
| 46594 |
if (matches.length === 1) { |
| 46595 |
return; |
| 46596 |
} |
| 46597 |
const parent = formNode[$getParent](); |
| 46598 |
const name = formNode[$nodeName]; |
| 46599 |
const pos = parent[$indexOf](formNode); |
| 46600 |
for (let i = 1, ii = matches.length; i < ii; i++) { |
| 46601 |
const match = matches[i]; |
| 46602 |
const clone = baseClone[$clone](); |
| 46603 |
parent[name].push(clone); |
| 46604 |
parent[$insertAt](pos + i, clone); |
| 46605 |
this._bindValue(clone, match, picture); |
| 46606 |
this._setProperties(clone, match); |
| 46607 |
this._bindItems(clone, match); |
| 46608 |
} |
| 46609 |
} |
| 46610 |
_createOccurrences(formNode) { |
| 46611 |
if (!this.emptyMerge) { |
| 46612 |
return; |
| 46613 |
} |
| 46614 |
const { |
| 46615 |
occur |
| 46616 |
} = formNode; |
| 46617 |
if (!occur || occur.initial <= 1) { |
| 46618 |
return; |
| 46619 |
} |
| 46620 |
const parent = formNode[$getParent](); |
| 46621 |
const name = formNode[$nodeName]; |
| 46622 |
if (!(parent[name] instanceof XFAObjectArray)) { |
| 46623 |
return; |
| 46624 |
} |
| 46625 |
let currentNumber; |
| 46626 |
if (formNode.name) { |
| 46627 |
currentNumber = parent[name].children.filter(e => e.name === formNode.name).length; |
| 46628 |
} else { |
| 46629 |
currentNumber = parent[name].children.length; |
| 46630 |
} |
| 46631 |
const pos = parent[$indexOf](formNode) + 1; |
| 46632 |
const ii = occur.initial - currentNumber; |
| 46633 |
if (ii) { |
| 46634 |
const nodeClone = formNode[$clone](); |
| 46635 |
nodeClone[$removeChild](nodeClone.occur); |
| 46636 |
nodeClone.occur = null; |
| 46637 |
parent[name].push(nodeClone); |
| 46638 |
parent[$insertAt](pos, nodeClone); |
| 46639 |
for (let i = 1; i < ii; i++) { |
| 46640 |
const clone = nodeClone[$clone](); |
| 46641 |
parent[name].push(clone); |
| 46642 |
parent[$insertAt](pos + i, clone); |
| 46643 |
} |
| 46644 |
} |
| 46645 |
} |
| 46646 |
_getOccurInfo(formNode) { |
| 46647 |
const { |
| 46648 |
name, |
| 46649 |
occur |
| 46650 |
} = formNode; |
| 46651 |
if (!occur || !name) { |
| 46652 |
return [1, 1]; |
| 46653 |
} |
| 46654 |
const max = occur.max === -1 ? Infinity : occur.max; |
| 46655 |
return [occur.min, max]; |
| 46656 |
} |
| 46657 |
_setAndBind(formNode, dataNode) { |
| 46658 |
this._setProperties(formNode, dataNode); |
| 46659 |
this._bindItems(formNode, dataNode); |
| 46660 |
this._bindElement(formNode, dataNode); |
| 46661 |
} |
| 46662 |
_bindElement(formNode, dataNode) { |
| 46663 |
const uselessNodes = []; |
| 46664 |
this._createOccurrences(formNode); |
| 46665 |
for (const child of formNode[$getChildren]()) { |
| 46666 |
if (child[$data]) { |
| 46667 |
continue; |
| 46668 |
} |
| 46669 |
if (this._mergeMode === undefined && child[$nodeName] === "subform") { |
| 46670 |
this._mergeMode = child.mergeMode === "consumeData"; |
| 46671 |
const dataChildren = dataNode[$getChildren](); |
| 46672 |
if (dataChildren.length > 0) { |
| 46673 |
this._bindOccurrences(child, [dataChildren[0]], null); |
| 46674 |
} else if (this.emptyMerge) { |
| 46675 |
const nsId = dataNode[$namespaceId] === bind_NS_DATASETS ? -1 : dataNode[$namespaceId]; |
| 46676 |
const dataChild = child[$data] = new XmlObject(nsId, child.name || "root"); |
| 46677 |
dataNode[$appendChild](dataChild); |
| 46678 |
this._bindElement(child, dataChild); |
| 46679 |
} |
| 46680 |
continue; |
| 46681 |
} |
| 46682 |
if (!child[$isBindable]()) { |
| 46683 |
continue; |
| 46684 |
} |
| 46685 |
let global = false; |
| 46686 |
let picture = null; |
| 46687 |
let ref = null; |
| 46688 |
let match = null; |
| 46689 |
if (child.bind) { |
| 46690 |
switch (child.bind.match) { |
| 46691 |
case "none": |
| 46692 |
this._setAndBind(child, dataNode); |
| 46693 |
continue; |
| 46694 |
case "global": |
| 46695 |
global = true; |
| 46696 |
break; |
| 46697 |
case "dataRef": |
| 46698 |
if (!child.bind.ref) { |
| 46699 |
warn(`XFA - ref is empty in node ${child[$nodeName]}.`); |
| 46700 |
this._setAndBind(child, dataNode); |
| 46701 |
continue; |
| 46702 |
} |
| 46703 |
ref = child.bind.ref; |
| 46704 |
break; |
| 46705 |
default: |
| 46706 |
break; |
| 46707 |
} |
| 46708 |
if (child.bind.picture) { |
| 46709 |
picture = child.bind.picture[$content]; |
| 46710 |
} |
| 46711 |
} |
| 46712 |
const [min, max] = this._getOccurInfo(child); |
| 46713 |
if (ref) { |
| 46714 |
match = searchNode(this.root, dataNode, ref, true, false); |
| 46715 |
if (match === null) { |
| 46716 |
match = createDataNode(this.data, dataNode, ref); |
| 46717 |
if (!match) { |
| 46718 |
continue; |
| 46719 |
} |
| 46720 |
if (this._isConsumeData()) { |
| 46721 |
match[$consumed] = true; |
| 46722 |
} |
| 46723 |
this._setAndBind(child, match); |
| 46724 |
continue; |
| 46725 |
} else { |
| 46726 |
if (this._isConsumeData()) { |
| 46727 |
match = match.filter(node => !node[$consumed]); |
| 46728 |
} |
| 46729 |
if (match.length > max) { |
| 46730 |
match = match.slice(0, max); |
| 46731 |
} else if (match.length === 0) { |
| 46732 |
match = null; |
| 46733 |
} |
| 46734 |
if (match && this._isConsumeData()) { |
| 46735 |
match.forEach(node => { |
| 46736 |
node[$consumed] = true; |
| 46737 |
}); |
| 46738 |
} |
| 46739 |
} |
| 46740 |
} else { |
| 46741 |
if (!child.name) { |
| 46742 |
this._setAndBind(child, dataNode); |
| 46743 |
continue; |
| 46744 |
} |
| 46745 |
if (this._isConsumeData()) { |
| 46746 |
const matches = []; |
| 46747 |
while (matches.length < max) { |
| 46748 |
const found = this._findDataByNameToConsume(child.name, child[$hasSettableValue](), dataNode, global); |
| 46749 |
if (!found) { |
| 46750 |
break; |
| 46751 |
} |
| 46752 |
found[$consumed] = true; |
| 46753 |
matches.push(found); |
| 46754 |
} |
| 46755 |
match = matches.length > 0 ? matches : null; |
| 46756 |
} else { |
| 46757 |
match = dataNode[$getRealChildrenByNameIt](child.name, false, this.emptyMerge).next().value; |
| 46758 |
if (!match) { |
| 46759 |
if (min === 0) { |
| 46760 |
uselessNodes.push(child); |
| 46761 |
continue; |
| 46762 |
} |
| 46763 |
const nsId = dataNode[$namespaceId] === bind_NS_DATASETS ? -1 : dataNode[$namespaceId]; |
| 46764 |
match = child[$data] = new XmlObject(nsId, child.name); |
| 46765 |
if (this.emptyMerge) { |
| 46766 |
match[$consumed] = true; |
| 46767 |
} |
| 46768 |
dataNode[$appendChild](match); |
| 46769 |
this._setAndBind(child, match); |
| 46770 |
continue; |
| 46771 |
} |
| 46772 |
if (this.emptyMerge) { |
| 46773 |
match[$consumed] = true; |
| 46774 |
} |
| 46775 |
match = [match]; |
| 46776 |
} |
| 46777 |
} |
| 46778 |
if (match) { |
| 46779 |
this._bindOccurrences(child, match, picture); |
| 46780 |
} else if (min > 0) { |
| 46781 |
this._setAndBind(child, dataNode); |
| 46782 |
} else { |
| 46783 |
uselessNodes.push(child); |
| 46784 |
} |
| 46785 |
} |
| 46786 |
uselessNodes.forEach(node => node[$getParent]()[$removeChild](node)); |
| 46787 |
} |
| 46788 |
} |
| 46789 |
|
| 46790 |
;// ./src/core/xfa/data.js |
| 46791 |
|
| 46792 |
class DataHandler { |
| 46793 |
constructor(root, data) { |
| 46794 |
this.data = data; |
| 46795 |
this.dataset = root.datasets || null; |
| 46796 |
} |
| 46797 |
serialize(storage) { |
| 46798 |
const stack = [[-1, this.data[$getChildren]()]]; |
| 46799 |
while (stack.length > 0) { |
| 46800 |
const last = stack.at(-1); |
| 46801 |
const [i, children] = last; |
| 46802 |
if (i + 1 === children.length) { |
| 46803 |
stack.pop(); |
| 46804 |
continue; |
| 46805 |
} |
| 46806 |
const child = children[++last[0]]; |
| 46807 |
const storageEntry = storage.get(child[$uid]); |
| 46808 |
if (storageEntry) { |
| 46809 |
child[$setValue](storageEntry); |
| 46810 |
} else { |
| 46811 |
const attributes = child[$getAttributes](); |
| 46812 |
for (const value of attributes.values()) { |
| 46813 |
const entry = storage.get(value[$uid]); |
| 46814 |
if (entry) { |
| 46815 |
value[$setValue](entry); |
| 46816 |
break; |
| 46817 |
} |
| 46818 |
} |
| 46819 |
} |
| 46820 |
const nodes = child[$getChildren](); |
| 46821 |
if (nodes.length > 0) { |
| 46822 |
stack.push([-1, nodes]); |
| 46823 |
} |
| 46824 |
} |
| 46825 |
const buf = [`<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">`]; |
| 46826 |
if (this.dataset) { |
| 46827 |
for (const child of this.dataset[$getChildren]()) { |
| 46828 |
if (child[$nodeName] !== "data") { |
| 46829 |
child[$toString](buf); |
| 46830 |
} |
| 46831 |
} |
| 46832 |
} |
| 46833 |
this.data[$toString](buf); |
| 46834 |
buf.push("</xfa:datasets>"); |
| 46835 |
return buf.join(""); |
| 46836 |
} |
| 46837 |
} |
| 46838 |
|
| 46839 |
;// ./src/core/xfa/config.js |
| 46840 |
|
| 46841 |
|
| 46842 |
|
| 46843 |
|
| 46844 |
|
| 46845 |
const CONFIG_NS_ID = NamespaceIds.config.id; |
| 46846 |
class Acrobat extends XFAObject { |
| 46847 |
constructor(attributes) { |
| 46848 |
super(CONFIG_NS_ID, "acrobat", true); |
| 46849 |
this.acrobat7 = null; |
| 46850 |
this.autoSave = null; |
| 46851 |
this.common = null; |
| 46852 |
this.validate = null; |
| 46853 |
this.validateApprovalSignatures = null; |
| 46854 |
this.submitUrl = new XFAObjectArray(); |
| 46855 |
} |
| 46856 |
} |
| 46857 |
class Acrobat7 extends XFAObject { |
| 46858 |
constructor(attributes) { |
| 46859 |
super(CONFIG_NS_ID, "acrobat7", true); |
| 46860 |
this.dynamicRender = null; |
| 46861 |
} |
| 46862 |
} |
| 46863 |
class ADBE_JSConsole extends OptionObject { |
| 46864 |
constructor(attributes) { |
| 46865 |
super(CONFIG_NS_ID, "ADBE_JSConsole", ["delegate", "Enable", "Disable"]); |
| 46866 |
} |
| 46867 |
} |
| 46868 |
class ADBE_JSDebugger extends OptionObject { |
| 46869 |
constructor(attributes) { |
| 46870 |
super(CONFIG_NS_ID, "ADBE_JSDebugger", ["delegate", "Enable", "Disable"]); |
| 46871 |
} |
| 46872 |
} |
| 46873 |
class AddSilentPrint extends Option01 { |
| 46874 |
constructor(attributes) { |
| 46875 |
super(CONFIG_NS_ID, "addSilentPrint"); |
| 46876 |
} |
| 46877 |
} |
| 46878 |
class AddViewerPreferences extends Option01 { |
| 46879 |
constructor(attributes) { |
| 46880 |
super(CONFIG_NS_ID, "addViewerPreferences"); |
| 46881 |
} |
| 46882 |
} |
| 46883 |
class AdjustData extends Option10 { |
| 46884 |
constructor(attributes) { |
| 46885 |
super(CONFIG_NS_ID, "adjustData"); |
| 46886 |
} |
| 46887 |
} |
| 46888 |
class AdobeExtensionLevel extends IntegerObject { |
| 46889 |
constructor(attributes) { |
| 46890 |
super(CONFIG_NS_ID, "adobeExtensionLevel", 0, n => n >= 1 && n <= 8); |
| 46891 |
} |
| 46892 |
} |
| 46893 |
class Agent extends XFAObject { |
| 46894 |
constructor(attributes) { |
| 46895 |
super(CONFIG_NS_ID, "agent", true); |
| 46896 |
this.name = attributes.name ? attributes.name.trim() : ""; |
| 46897 |
this.common = new XFAObjectArray(); |
| 46898 |
} |
| 46899 |
} |
| 46900 |
class AlwaysEmbed extends ContentObject { |
| 46901 |
constructor(attributes) { |
| 46902 |
super(CONFIG_NS_ID, "alwaysEmbed"); |
| 46903 |
} |
| 46904 |
} |
| 46905 |
class Amd extends StringObject { |
| 46906 |
constructor(attributes) { |
| 46907 |
super(CONFIG_NS_ID, "amd"); |
| 46908 |
} |
| 46909 |
} |
| 46910 |
class config_Area extends XFAObject { |
| 46911 |
constructor(attributes) { |
| 46912 |
super(CONFIG_NS_ID, "area"); |
| 46913 |
this.level = getInteger({ |
| 46914 |
data: attributes.level, |
| 46915 |
defaultValue: 0, |
| 46916 |
validate: n => n >= 1 && n <= 3 |
| 46917 |
}); |
| 46918 |
this.name = getStringOption(attributes.name, ["", "barcode", "coreinit", "deviceDriver", "font", "general", "layout", "merge", "script", "signature", "sourceSet", "templateCache"]); |
| 46919 |
} |
| 46920 |
} |
| 46921 |
class Attributes extends OptionObject { |
| 46922 |
constructor(attributes) { |
| 46923 |
super(CONFIG_NS_ID, "attributes", ["preserve", "delegate", "ignore"]); |
| 46924 |
} |
| 46925 |
} |
| 46926 |
class AutoSave extends OptionObject { |
| 46927 |
constructor(attributes) { |
| 46928 |
super(CONFIG_NS_ID, "autoSave", ["disabled", "enabled"]); |
| 46929 |
} |
| 46930 |
} |
| 46931 |
class Base extends StringObject { |
| 46932 |
constructor(attributes) { |
| 46933 |
super(CONFIG_NS_ID, "base"); |
| 46934 |
} |
| 46935 |
} |
| 46936 |
class BatchOutput extends XFAObject { |
| 46937 |
constructor(attributes) { |
| 46938 |
super(CONFIG_NS_ID, "batchOutput"); |
| 46939 |
this.format = getStringOption(attributes.format, ["none", "concat", "zip", "zipCompress"]); |
| 46940 |
} |
| 46941 |
} |
| 46942 |
class BehaviorOverride extends ContentObject { |
| 46943 |
constructor(attributes) { |
| 46944 |
super(CONFIG_NS_ID, "behaviorOverride"); |
| 46945 |
} |
| 46946 |
[$finalize]() { |
| 46947 |
this[$content] = new Map(this[$content].trim().split(/\s+/).filter(x => x.includes(":")).map(x => x.split(":", 2))); |
| 46948 |
} |
| 46949 |
} |
| 46950 |
class Cache extends XFAObject { |
| 46951 |
constructor(attributes) { |
| 46952 |
super(CONFIG_NS_ID, "cache", true); |
| 46953 |
this.templateCache = null; |
| 46954 |
} |
| 46955 |
} |
| 46956 |
class Change extends Option01 { |
| 46957 |
constructor(attributes) { |
| 46958 |
super(CONFIG_NS_ID, "change"); |
| 46959 |
} |
| 46960 |
} |
| 46961 |
class Common extends XFAObject { |
| 46962 |
constructor(attributes) { |
| 46963 |
super(CONFIG_NS_ID, "common", true); |
| 46964 |
this.data = null; |
| 46965 |
this.locale = null; |
| 46966 |
this.localeSet = null; |
| 46967 |
this.messaging = null; |
| 46968 |
this.suppressBanner = null; |
| 46969 |
this.template = null; |
| 46970 |
this.validationMessaging = null; |
| 46971 |
this.versionControl = null; |
| 46972 |
this.log = new XFAObjectArray(); |
| 46973 |
} |
| 46974 |
} |
| 46975 |
class Compress extends XFAObject { |
| 46976 |
constructor(attributes) { |
| 46977 |
super(CONFIG_NS_ID, "compress"); |
| 46978 |
this.scope = getStringOption(attributes.scope, ["imageOnly", "document"]); |
| 46979 |
} |
| 46980 |
} |
| 46981 |
class CompressLogicalStructure extends Option01 { |
| 46982 |
constructor(attributes) { |
| 46983 |
super(CONFIG_NS_ID, "compressLogicalStructure"); |
| 46984 |
} |
| 46985 |
} |
| 46986 |
class CompressObjectStream extends Option10 { |
| 46987 |
constructor(attributes) { |
| 46988 |
super(CONFIG_NS_ID, "compressObjectStream"); |
| 46989 |
} |
| 46990 |
} |
| 46991 |
class Compression extends XFAObject { |
| 46992 |
constructor(attributes) { |
| 46993 |
super(CONFIG_NS_ID, "compression", true); |
| 46994 |
this.compressLogicalStructure = null; |
| 46995 |
this.compressObjectStream = null; |
| 46996 |
this.level = null; |
| 46997 |
this.type = null; |
| 46998 |
} |
| 46999 |
} |
| 47000 |
class Config extends XFAObject { |
| 47001 |
constructor(attributes) { |
| 47002 |
super(CONFIG_NS_ID, "config", true); |
| 47003 |
this.acrobat = null; |
| 47004 |
this.present = null; |
| 47005 |
this.trace = null; |
| 47006 |
this.agent = new XFAObjectArray(); |
| 47007 |
} |
| 47008 |
} |
| 47009 |
class Conformance extends OptionObject { |
| 47010 |
constructor(attributes) { |
| 47011 |
super(CONFIG_NS_ID, "conformance", ["A", "B"]); |
| 47012 |
} |
| 47013 |
} |
| 47014 |
class ContentCopy extends Option01 { |
| 47015 |
constructor(attributes) { |
| 47016 |
super(CONFIG_NS_ID, "contentCopy"); |
| 47017 |
} |
| 47018 |
} |
| 47019 |
class Copies extends IntegerObject { |
| 47020 |
constructor(attributes) { |
| 47021 |
super(CONFIG_NS_ID, "copies", 1, n => n >= 1); |
| 47022 |
} |
| 47023 |
} |
| 47024 |
class Creator extends StringObject { |
| 47025 |
constructor(attributes) { |
| 47026 |
super(CONFIG_NS_ID, "creator"); |
| 47027 |
} |
| 47028 |
} |
| 47029 |
class CurrentPage extends IntegerObject { |
| 47030 |
constructor(attributes) { |
| 47031 |
super(CONFIG_NS_ID, "currentPage", 0, n => n >= 0); |
| 47032 |
} |
| 47033 |
} |
| 47034 |
class Data extends XFAObject { |
| 47035 |
constructor(attributes) { |
| 47036 |
super(CONFIG_NS_ID, "data", true); |
| 47037 |
this.adjustData = null; |
| 47038 |
this.attributes = null; |
| 47039 |
this.incrementalLoad = null; |
| 47040 |
this.outputXSL = null; |
| 47041 |
this.range = null; |
| 47042 |
this.record = null; |
| 47043 |
this.startNode = null; |
| 47044 |
this.uri = null; |
| 47045 |
this.window = null; |
| 47046 |
this.xsl = null; |
| 47047 |
this.excludeNS = new XFAObjectArray(); |
| 47048 |
this.transform = new XFAObjectArray(); |
| 47049 |
} |
| 47050 |
} |
| 47051 |
class Debug extends XFAObject { |
| 47052 |
constructor(attributes) { |
| 47053 |
super(CONFIG_NS_ID, "debug", true); |
| 47054 |
this.uri = null; |
| 47055 |
} |
| 47056 |
} |
| 47057 |
class DefaultTypeface extends ContentObject { |
| 47058 |
constructor(attributes) { |
| 47059 |
super(CONFIG_NS_ID, "defaultTypeface"); |
| 47060 |
this.writingScript = getStringOption(attributes.writingScript, ["*", "Arabic", "Cyrillic", "EastEuropeanRoman", "Greek", "Hebrew", "Japanese", "Korean", "Roman", "SimplifiedChinese", "Thai", "TraditionalChinese", "Vietnamese"]); |
| 47061 |
} |
| 47062 |
} |
| 47063 |
class Destination extends OptionObject { |
| 47064 |
constructor(attributes) { |
| 47065 |
super(CONFIG_NS_ID, "destination", ["pdf", "pcl", "ps", "webClient", "zpl"]); |
| 47066 |
} |
| 47067 |
} |
| 47068 |
class DocumentAssembly extends Option01 { |
| 47069 |
constructor(attributes) { |
| 47070 |
super(CONFIG_NS_ID, "documentAssembly"); |
| 47071 |
} |
| 47072 |
} |
| 47073 |
class Driver extends XFAObject { |
| 47074 |
constructor(attributes) { |
| 47075 |
super(CONFIG_NS_ID, "driver", true); |
| 47076 |
this.name = attributes.name ? attributes.name.trim() : ""; |
| 47077 |
this.fontInfo = null; |
| 47078 |
this.xdc = null; |
| 47079 |
} |
| 47080 |
} |
| 47081 |
class DuplexOption extends OptionObject { |
| 47082 |
constructor(attributes) { |
| 47083 |
super(CONFIG_NS_ID, "duplexOption", ["simplex", "duplexFlipLongEdge", "duplexFlipShortEdge"]); |
| 47084 |
} |
| 47085 |
} |
| 47086 |
class DynamicRender extends OptionObject { |
| 47087 |
constructor(attributes) { |
| 47088 |
super(CONFIG_NS_ID, "dynamicRender", ["forbidden", "required"]); |
| 47089 |
} |
| 47090 |
} |
| 47091 |
class Embed extends Option01 { |
| 47092 |
constructor(attributes) { |
| 47093 |
super(CONFIG_NS_ID, "embed"); |
| 47094 |
} |
| 47095 |
} |
| 47096 |
class config_Encrypt extends Option01 { |
| 47097 |
constructor(attributes) { |
| 47098 |
super(CONFIG_NS_ID, "encrypt"); |
| 47099 |
} |
| 47100 |
} |
| 47101 |
class config_Encryption extends XFAObject { |
| 47102 |
constructor(attributes) { |
| 47103 |
super(CONFIG_NS_ID, "encryption", true); |
| 47104 |
this.encrypt = null; |
| 47105 |
this.encryptionLevel = null; |
| 47106 |
this.permissions = null; |
| 47107 |
} |
| 47108 |
} |
| 47109 |
class EncryptionLevel extends OptionObject { |
| 47110 |
constructor(attributes) { |
| 47111 |
super(CONFIG_NS_ID, "encryptionLevel", ["40bit", "128bit"]); |
| 47112 |
} |
| 47113 |
} |
| 47114 |
class Enforce extends StringObject { |
| 47115 |
constructor(attributes) { |
| 47116 |
super(CONFIG_NS_ID, "enforce"); |
| 47117 |
} |
| 47118 |
} |
| 47119 |
class Equate extends XFAObject { |
| 47120 |
constructor(attributes) { |
| 47121 |
super(CONFIG_NS_ID, "equate"); |
| 47122 |
this.force = getInteger({ |
| 47123 |
data: attributes.force, |
| 47124 |
defaultValue: 1, |
| 47125 |
validate: n => n === 0 |
| 47126 |
}); |
| 47127 |
this.from = attributes.from || ""; |
| 47128 |
this.to = attributes.to || ""; |
| 47129 |
} |
| 47130 |
} |
| 47131 |
class EquateRange extends XFAObject { |
| 47132 |
constructor(attributes) { |
| 47133 |
super(CONFIG_NS_ID, "equateRange"); |
| 47134 |
this.from = attributes.from || ""; |
| 47135 |
this.to = attributes.to || ""; |
| 47136 |
this._unicodeRange = attributes.unicodeRange || ""; |
| 47137 |
} |
| 47138 |
get unicodeRange() { |
| 47139 |
const ranges = []; |
| 47140 |
const unicodeRegex = /U\+([0-9a-fA-F]+)/; |
| 47141 |
const unicodeRange = this._unicodeRange; |
| 47142 |
for (let range of unicodeRange.split(",").map(x => x.trim()).filter(x => !!x)) { |
| 47143 |
range = range.split("-", 2).map(x => { |
| 47144 |
const found = x.match(unicodeRegex); |
| 47145 |
if (!found) { |
| 47146 |
return 0; |
| 47147 |
} |
| 47148 |
return parseInt(found[1], 16); |
| 47149 |
}); |
| 47150 |
if (range.length === 1) { |
| 47151 |
range.push(range[0]); |
| 47152 |
} |
| 47153 |
ranges.push(range); |
| 47154 |
} |
| 47155 |
return shadow(this, "unicodeRange", ranges); |
| 47156 |
} |
| 47157 |
} |
| 47158 |
class Exclude extends ContentObject { |
| 47159 |
constructor(attributes) { |
| 47160 |
super(CONFIG_NS_ID, "exclude"); |
| 47161 |
} |
| 47162 |
[$finalize]() { |
| 47163 |
this[$content] = this[$content].trim().split(/\s+/).filter(x => x && ["calculate", "close", "enter", "exit", "initialize", "ready", "validate"].includes(x)); |
| 47164 |
} |
| 47165 |
} |
| 47166 |
class ExcludeNS extends StringObject { |
| 47167 |
constructor(attributes) { |
| 47168 |
super(CONFIG_NS_ID, "excludeNS"); |
| 47169 |
} |
| 47170 |
} |
| 47171 |
class FlipLabel extends OptionObject { |
| 47172 |
constructor(attributes) { |
| 47173 |
super(CONFIG_NS_ID, "flipLabel", ["usePrinterSetting", "on", "off"]); |
| 47174 |
} |
| 47175 |
} |
| 47176 |
class config_FontInfo extends XFAObject { |
| 47177 |
constructor(attributes) { |
| 47178 |
super(CONFIG_NS_ID, "fontInfo", true); |
| 47179 |
this.embed = null; |
| 47180 |
this.map = null; |
| 47181 |
this.subsetBelow = null; |
| 47182 |
this.alwaysEmbed = new XFAObjectArray(); |
| 47183 |
this.defaultTypeface = new XFAObjectArray(); |
| 47184 |
this.neverEmbed = new XFAObjectArray(); |
| 47185 |
} |
| 47186 |
} |
| 47187 |
class FormFieldFilling extends Option01 { |
| 47188 |
constructor(attributes) { |
| 47189 |
super(CONFIG_NS_ID, "formFieldFilling"); |
| 47190 |
} |
| 47191 |
} |
| 47192 |
class GroupParent extends StringObject { |
| 47193 |
constructor(attributes) { |
| 47194 |
super(CONFIG_NS_ID, "groupParent"); |
| 47195 |
} |
| 47196 |
} |
| 47197 |
class IfEmpty extends OptionObject { |
| 47198 |
constructor(attributes) { |
| 47199 |
super(CONFIG_NS_ID, "ifEmpty", ["dataValue", "dataGroup", "ignore", "remove"]); |
| 47200 |
} |
| 47201 |
} |
| 47202 |
class IncludeXDPContent extends StringObject { |
| 47203 |
constructor(attributes) { |
| 47204 |
super(CONFIG_NS_ID, "includeXDPContent"); |
| 47205 |
} |
| 47206 |
} |
| 47207 |
class IncrementalLoad extends OptionObject { |
| 47208 |
constructor(attributes) { |
| 47209 |
super(CONFIG_NS_ID, "incrementalLoad", ["none", "forwardOnly"]); |
| 47210 |
} |
| 47211 |
} |
| 47212 |
class IncrementalMerge extends Option01 { |
| 47213 |
constructor(attributes) { |
| 47214 |
super(CONFIG_NS_ID, "incrementalMerge"); |
| 47215 |
} |
| 47216 |
} |
| 47217 |
class Interactive extends Option01 { |
| 47218 |
constructor(attributes) { |
| 47219 |
super(CONFIG_NS_ID, "interactive"); |
| 47220 |
} |
| 47221 |
} |
| 47222 |
class Jog extends OptionObject { |
| 47223 |
constructor(attributes) { |
| 47224 |
super(CONFIG_NS_ID, "jog", ["usePrinterSetting", "none", "pageSet"]); |
| 47225 |
} |
| 47226 |
} |
| 47227 |
class LabelPrinter extends XFAObject { |
| 47228 |
constructor(attributes) { |
| 47229 |
super(CONFIG_NS_ID, "labelPrinter", true); |
| 47230 |
this.name = getStringOption(attributes.name, ["zpl", "dpl", "ipl", "tcpl"]); |
| 47231 |
this.batchOutput = null; |
| 47232 |
this.flipLabel = null; |
| 47233 |
this.fontInfo = null; |
| 47234 |
this.xdc = null; |
| 47235 |
} |
| 47236 |
} |
| 47237 |
class Layout extends OptionObject { |
| 47238 |
constructor(attributes) { |
| 47239 |
super(CONFIG_NS_ID, "layout", ["paginate", "panel"]); |
| 47240 |
} |
| 47241 |
} |
| 47242 |
class Level extends IntegerObject { |
| 47243 |
constructor(attributes) { |
| 47244 |
super(CONFIG_NS_ID, "level", 0, n => n > 0); |
| 47245 |
} |
| 47246 |
} |
| 47247 |
class Linearized extends Option01 { |
| 47248 |
constructor(attributes) { |
| 47249 |
super(CONFIG_NS_ID, "linearized"); |
| 47250 |
} |
| 47251 |
} |
| 47252 |
class Locale extends StringObject { |
| 47253 |
constructor(attributes) { |
| 47254 |
super(CONFIG_NS_ID, "locale"); |
| 47255 |
} |
| 47256 |
} |
| 47257 |
class LocaleSet extends StringObject { |
| 47258 |
constructor(attributes) { |
| 47259 |
super(CONFIG_NS_ID, "localeSet"); |
| 47260 |
} |
| 47261 |
} |
| 47262 |
class Log extends XFAObject { |
| 47263 |
constructor(attributes) { |
| 47264 |
super(CONFIG_NS_ID, "log", true); |
| 47265 |
this.mode = null; |
| 47266 |
this.threshold = null; |
| 47267 |
this.to = null; |
| 47268 |
this.uri = null; |
| 47269 |
} |
| 47270 |
} |
| 47271 |
class MapElement extends XFAObject { |
| 47272 |
constructor(attributes) { |
| 47273 |
super(CONFIG_NS_ID, "map", true); |
| 47274 |
this.equate = new XFAObjectArray(); |
| 47275 |
this.equateRange = new XFAObjectArray(); |
| 47276 |
} |
| 47277 |
} |
| 47278 |
class MediumInfo extends XFAObject { |
| 47279 |
constructor(attributes) { |
| 47280 |
super(CONFIG_NS_ID, "mediumInfo", true); |
| 47281 |
this.map = null; |
| 47282 |
} |
| 47283 |
} |
| 47284 |
class config_Message extends XFAObject { |
| 47285 |
constructor(attributes) { |
| 47286 |
super(CONFIG_NS_ID, "message", true); |
| 47287 |
this.msgId = null; |
| 47288 |
this.severity = null; |
| 47289 |
} |
| 47290 |
} |
| 47291 |
class Messaging extends XFAObject { |
| 47292 |
constructor(attributes) { |
| 47293 |
super(CONFIG_NS_ID, "messaging", true); |
| 47294 |
this.message = new XFAObjectArray(); |
| 47295 |
} |
| 47296 |
} |
| 47297 |
class Mode extends OptionObject { |
| 47298 |
constructor(attributes) { |
| 47299 |
super(CONFIG_NS_ID, "mode", ["append", "overwrite"]); |
| 47300 |
} |
| 47301 |
} |
| 47302 |
class ModifyAnnots extends Option01 { |
| 47303 |
constructor(attributes) { |
| 47304 |
super(CONFIG_NS_ID, "modifyAnnots"); |
| 47305 |
} |
| 47306 |
} |
| 47307 |
class MsgId extends IntegerObject { |
| 47308 |
constructor(attributes) { |
| 47309 |
super(CONFIG_NS_ID, "msgId", 1, n => n >= 1); |
| 47310 |
} |
| 47311 |
} |
| 47312 |
class NameAttr extends StringObject { |
| 47313 |
constructor(attributes) { |
| 47314 |
super(CONFIG_NS_ID, "nameAttr"); |
| 47315 |
} |
| 47316 |
} |
| 47317 |
class NeverEmbed extends ContentObject { |
| 47318 |
constructor(attributes) { |
| 47319 |
super(CONFIG_NS_ID, "neverEmbed"); |
| 47320 |
} |
| 47321 |
} |
| 47322 |
class NumberOfCopies extends IntegerObject { |
| 47323 |
constructor(attributes) { |
| 47324 |
super(CONFIG_NS_ID, "numberOfCopies", null, n => n >= 2 && n <= 5); |
| 47325 |
} |
| 47326 |
} |
| 47327 |
class OpenAction extends XFAObject { |
| 47328 |
constructor(attributes) { |
| 47329 |
super(CONFIG_NS_ID, "openAction", true); |
| 47330 |
this.destination = null; |
| 47331 |
} |
| 47332 |
} |
| 47333 |
class Output extends XFAObject { |
| 47334 |
constructor(attributes) { |
| 47335 |
super(CONFIG_NS_ID, "output", true); |
| 47336 |
this.to = null; |
| 47337 |
this.type = null; |
| 47338 |
this.uri = null; |
| 47339 |
} |
| 47340 |
} |
| 47341 |
class OutputBin extends StringObject { |
| 47342 |
constructor(attributes) { |
| 47343 |
super(CONFIG_NS_ID, "outputBin"); |
| 47344 |
} |
| 47345 |
} |
| 47346 |
class OutputXSL extends XFAObject { |
| 47347 |
constructor(attributes) { |
| 47348 |
super(CONFIG_NS_ID, "outputXSL", true); |
| 47349 |
this.uri = null; |
| 47350 |
} |
| 47351 |
} |
| 47352 |
class Overprint extends OptionObject { |
| 47353 |
constructor(attributes) { |
| 47354 |
super(CONFIG_NS_ID, "overprint", ["none", "both", "draw", "field"]); |
| 47355 |
} |
| 47356 |
} |
| 47357 |
class Packets extends StringObject { |
| 47358 |
constructor(attributes) { |
| 47359 |
super(CONFIG_NS_ID, "packets"); |
| 47360 |
} |
| 47361 |
[$finalize]() { |
| 47362 |
if (this[$content] === "*") { |
| 47363 |
return; |
| 47364 |
} |
| 47365 |
this[$content] = this[$content].trim().split(/\s+/).filter(x => ["config", "datasets", "template", "xfdf", "xslt"].includes(x)); |
| 47366 |
} |
| 47367 |
} |
| 47368 |
class PageOffset extends XFAObject { |
| 47369 |
constructor(attributes) { |
| 47370 |
super(CONFIG_NS_ID, "pageOffset"); |
| 47371 |
this.x = getInteger({ |
| 47372 |
data: attributes.x, |
| 47373 |
defaultValue: "useXDCSetting", |
| 47374 |
validate: n => true |
| 47375 |
}); |
| 47376 |
this.y = getInteger({ |
| 47377 |
data: attributes.y, |
| 47378 |
defaultValue: "useXDCSetting", |
| 47379 |
validate: n => true |
| 47380 |
}); |
| 47381 |
} |
| 47382 |
} |
| 47383 |
class PageRange extends StringObject { |
| 47384 |
constructor(attributes) { |
| 47385 |
super(CONFIG_NS_ID, "pageRange"); |
| 47386 |
} |
| 47387 |
[$finalize]() { |
| 47388 |
const numbers = this[$content].trim().split(/\s+/).map(x => parseInt(x, 10)); |
| 47389 |
const ranges = []; |
| 47390 |
for (let i = 0, ii = numbers.length; i < ii; i += 2) { |
| 47391 |
ranges.push(numbers.slice(i, i + 2)); |
| 47392 |
} |
| 47393 |
this[$content] = ranges; |
| 47394 |
} |
| 47395 |
} |
| 47396 |
class Pagination extends OptionObject { |
| 47397 |
constructor(attributes) { |
| 47398 |
super(CONFIG_NS_ID, "pagination", ["simplex", "duplexShortEdge", "duplexLongEdge"]); |
| 47399 |
} |
| 47400 |
} |
| 47401 |
class PaginationOverride extends OptionObject { |
| 47402 |
constructor(attributes) { |
| 47403 |
super(CONFIG_NS_ID, "paginationOverride", ["none", "forceDuplex", "forceDuplexLongEdge", "forceDuplexShortEdge", "forceSimplex"]); |
| 47404 |
} |
| 47405 |
} |
| 47406 |
class Part extends IntegerObject { |
| 47407 |
constructor(attributes) { |
| 47408 |
super(CONFIG_NS_ID, "part", 1, n => false); |
| 47409 |
} |
| 47410 |
} |
| 47411 |
class Pcl extends XFAObject { |
| 47412 |
constructor(attributes) { |
| 47413 |
super(CONFIG_NS_ID, "pcl", true); |
| 47414 |
this.name = attributes.name || ""; |
| 47415 |
this.batchOutput = null; |
| 47416 |
this.fontInfo = null; |
| 47417 |
this.jog = null; |
| 47418 |
this.mediumInfo = null; |
| 47419 |
this.outputBin = null; |
| 47420 |
this.pageOffset = null; |
| 47421 |
this.staple = null; |
| 47422 |
this.xdc = null; |
| 47423 |
} |
| 47424 |
} |
| 47425 |
class Pdf extends XFAObject { |
| 47426 |
constructor(attributes) { |
| 47427 |
super(CONFIG_NS_ID, "pdf", true); |
| 47428 |
this.name = attributes.name || ""; |
| 47429 |
this.adobeExtensionLevel = null; |
| 47430 |
this.batchOutput = null; |
| 47431 |
this.compression = null; |
| 47432 |
this.creator = null; |
| 47433 |
this.encryption = null; |
| 47434 |
this.fontInfo = null; |
| 47435 |
this.interactive = null; |
| 47436 |
this.linearized = null; |
| 47437 |
this.openAction = null; |
| 47438 |
this.pdfa = null; |
| 47439 |
this.producer = null; |
| 47440 |
this.renderPolicy = null; |
| 47441 |
this.scriptModel = null; |
| 47442 |
this.silentPrint = null; |
| 47443 |
this.submitFormat = null; |
| 47444 |
this.tagged = null; |
| 47445 |
this.version = null; |
| 47446 |
this.viewerPreferences = null; |
| 47447 |
this.xdc = null; |
| 47448 |
} |
| 47449 |
} |
| 47450 |
class Pdfa extends XFAObject { |
| 47451 |
constructor(attributes) { |
| 47452 |
super(CONFIG_NS_ID, "pdfa", true); |
| 47453 |
this.amd = null; |
| 47454 |
this.conformance = null; |
| 47455 |
this.includeXDPContent = null; |
| 47456 |
this.part = null; |
| 47457 |
} |
| 47458 |
} |
| 47459 |
class Permissions extends XFAObject { |
| 47460 |
constructor(attributes) { |
| 47461 |
super(CONFIG_NS_ID, "permissions", true); |
| 47462 |
this.accessibleContent = null; |
| 47463 |
this.change = null; |
| 47464 |
this.contentCopy = null; |
| 47465 |
this.documentAssembly = null; |
| 47466 |
this.formFieldFilling = null; |
| 47467 |
this.modifyAnnots = null; |
| 47468 |
this.plaintextMetadata = null; |
| 47469 |
this.print = null; |
| 47470 |
this.printHighQuality = null; |
| 47471 |
} |
| 47472 |
} |
| 47473 |
class PickTrayByPDFSize extends Option01 { |
| 47474 |
constructor(attributes) { |
| 47475 |
super(CONFIG_NS_ID, "pickTrayByPDFSize"); |
| 47476 |
} |
| 47477 |
} |
| 47478 |
class config_Picture extends StringObject { |
| 47479 |
constructor(attributes) { |
| 47480 |
super(CONFIG_NS_ID, "picture"); |
| 47481 |
} |
| 47482 |
} |
| 47483 |
class PlaintextMetadata extends Option01 { |
| 47484 |
constructor(attributes) { |
| 47485 |
super(CONFIG_NS_ID, "plaintextMetadata"); |
| 47486 |
} |
| 47487 |
} |
| 47488 |
class Presence extends OptionObject { |
| 47489 |
constructor(attributes) { |
| 47490 |
super(CONFIG_NS_ID, "presence", ["preserve", "dissolve", "dissolveStructure", "ignore", "remove"]); |
| 47491 |
} |
| 47492 |
} |
| 47493 |
class Present extends XFAObject { |
| 47494 |
constructor(attributes) { |
| 47495 |
super(CONFIG_NS_ID, "present", true); |
| 47496 |
this.behaviorOverride = null; |
| 47497 |
this.cache = null; |
| 47498 |
this.common = null; |
| 47499 |
this.copies = null; |
| 47500 |
this.destination = null; |
| 47501 |
this.incrementalMerge = null; |
| 47502 |
this.layout = null; |
| 47503 |
this.output = null; |
| 47504 |
this.overprint = null; |
| 47505 |
this.pagination = null; |
| 47506 |
this.paginationOverride = null; |
| 47507 |
this.script = null; |
| 47508 |
this.validate = null; |
| 47509 |
this.xdp = null; |
| 47510 |
this.driver = new XFAObjectArray(); |
| 47511 |
this.labelPrinter = new XFAObjectArray(); |
| 47512 |
this.pcl = new XFAObjectArray(); |
| 47513 |
this.pdf = new XFAObjectArray(); |
| 47514 |
this.ps = new XFAObjectArray(); |
| 47515 |
this.submitUrl = new XFAObjectArray(); |
| 47516 |
this.webClient = new XFAObjectArray(); |
| 47517 |
this.zpl = new XFAObjectArray(); |
| 47518 |
} |
| 47519 |
} |
| 47520 |
class Print extends Option01 { |
| 47521 |
constructor(attributes) { |
| 47522 |
super(CONFIG_NS_ID, "print"); |
| 47523 |
} |
| 47524 |
} |
| 47525 |
class PrintHighQuality extends Option01 { |
| 47526 |
constructor(attributes) { |
| 47527 |
super(CONFIG_NS_ID, "printHighQuality"); |
| 47528 |
} |
| 47529 |
} |
| 47530 |
class PrintScaling extends OptionObject { |
| 47531 |
constructor(attributes) { |
| 47532 |
super(CONFIG_NS_ID, "printScaling", ["appdefault", "noScaling"]); |
| 47533 |
} |
| 47534 |
} |
| 47535 |
class PrinterName extends StringObject { |
| 47536 |
constructor(attributes) { |
| 47537 |
super(CONFIG_NS_ID, "printerName"); |
| 47538 |
} |
| 47539 |
} |
| 47540 |
class Producer extends StringObject { |
| 47541 |
constructor(attributes) { |
| 47542 |
super(CONFIG_NS_ID, "producer"); |
| 47543 |
} |
| 47544 |
} |
| 47545 |
class Ps extends XFAObject { |
| 47546 |
constructor(attributes) { |
| 47547 |
super(CONFIG_NS_ID, "ps", true); |
| 47548 |
this.name = attributes.name || ""; |
| 47549 |
this.batchOutput = null; |
| 47550 |
this.fontInfo = null; |
| 47551 |
this.jog = null; |
| 47552 |
this.mediumInfo = null; |
| 47553 |
this.outputBin = null; |
| 47554 |
this.staple = null; |
| 47555 |
this.xdc = null; |
| 47556 |
} |
| 47557 |
} |
| 47558 |
class Range extends ContentObject { |
| 47559 |
constructor(attributes) { |
| 47560 |
super(CONFIG_NS_ID, "range"); |
| 47561 |
} |
| 47562 |
[$finalize]() { |
| 47563 |
this[$content] = this[$content].trim().split(/\s*,\s*/, 2).map(range => range.split("-").map(x => parseInt(x.trim(), 10))).filter(range => range.every(x => !isNaN(x))).map(range => { |
| 47564 |
if (range.length === 1) { |
| 47565 |
range.push(range[0]); |
| 47566 |
} |
| 47567 |
return range; |
| 47568 |
}); |
| 47569 |
} |
| 47570 |
} |
| 47571 |
class Record extends ContentObject { |
| 47572 |
constructor(attributes) { |
| 47573 |
super(CONFIG_NS_ID, "record"); |
| 47574 |
} |
| 47575 |
[$finalize]() { |
| 47576 |
this[$content] = this[$content].trim(); |
| 47577 |
const n = parseInt(this[$content], 10); |
| 47578 |
if (!isNaN(n) && n >= 0) { |
| 47579 |
this[$content] = n; |
| 47580 |
} |
| 47581 |
} |
| 47582 |
} |
| 47583 |
class Relevant extends ContentObject { |
| 47584 |
constructor(attributes) { |
| 47585 |
super(CONFIG_NS_ID, "relevant"); |
| 47586 |
} |
| 47587 |
[$finalize]() { |
| 47588 |
this[$content] = this[$content].trim().split(/\s+/); |
| 47589 |
} |
| 47590 |
} |
| 47591 |
class Rename extends ContentObject { |
| 47592 |
constructor(attributes) { |
| 47593 |
super(CONFIG_NS_ID, "rename"); |
| 47594 |
} |
| 47595 |
[$finalize]() { |
| 47596 |
this[$content] = this[$content].trim(); |
| 47597 |
if (this[$content].toLowerCase().startsWith("xml") || new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*", "u").test(this[$content])) { |
| 47598 |
warn("XFA - Rename: invalid XFA name"); |
| 47599 |
} |
| 47600 |
} |
| 47601 |
} |
| 47602 |
class RenderPolicy extends OptionObject { |
| 47603 |
constructor(attributes) { |
| 47604 |
super(CONFIG_NS_ID, "renderPolicy", ["server", "client"]); |
| 47605 |
} |
| 47606 |
} |
| 47607 |
class RunScripts extends OptionObject { |
| 47608 |
constructor(attributes) { |
| 47609 |
super(CONFIG_NS_ID, "runScripts", ["both", "client", "none", "server"]); |
| 47610 |
} |
| 47611 |
} |
| 47612 |
class config_Script extends XFAObject { |
| 47613 |
constructor(attributes) { |
| 47614 |
super(CONFIG_NS_ID, "script", true); |
| 47615 |
this.currentPage = null; |
| 47616 |
this.exclude = null; |
| 47617 |
this.runScripts = null; |
| 47618 |
} |
| 47619 |
} |
| 47620 |
class ScriptModel extends OptionObject { |
| 47621 |
constructor(attributes) { |
| 47622 |
super(CONFIG_NS_ID, "scriptModel", ["XFA", "none"]); |
| 47623 |
} |
| 47624 |
} |
| 47625 |
class Severity extends OptionObject { |
| 47626 |
constructor(attributes) { |
| 47627 |
super(CONFIG_NS_ID, "severity", ["ignore", "error", "information", "trace", "warning"]); |
| 47628 |
} |
| 47629 |
} |
| 47630 |
class SilentPrint extends XFAObject { |
| 47631 |
constructor(attributes) { |
| 47632 |
super(CONFIG_NS_ID, "silentPrint", true); |
| 47633 |
this.addSilentPrint = null; |
| 47634 |
this.printerName = null; |
| 47635 |
} |
| 47636 |
} |
| 47637 |
class Staple extends XFAObject { |
| 47638 |
constructor(attributes) { |
| 47639 |
super(CONFIG_NS_ID, "staple"); |
| 47640 |
this.mode = getStringOption(attributes.mode, ["usePrinterSetting", "on", "off"]); |
| 47641 |
} |
| 47642 |
} |
| 47643 |
class StartNode extends StringObject { |
| 47644 |
constructor(attributes) { |
| 47645 |
super(CONFIG_NS_ID, "startNode"); |
| 47646 |
} |
| 47647 |
} |
| 47648 |
class StartPage extends IntegerObject { |
| 47649 |
constructor(attributes) { |
| 47650 |
super(CONFIG_NS_ID, "startPage", 0, n => true); |
| 47651 |
} |
| 47652 |
} |
| 47653 |
class SubmitFormat extends OptionObject { |
| 47654 |
constructor(attributes) { |
| 47655 |
super(CONFIG_NS_ID, "submitFormat", ["html", "delegate", "fdf", "xml", "pdf"]); |
| 47656 |
} |
| 47657 |
} |
| 47658 |
class SubmitUrl extends StringObject { |
| 47659 |
constructor(attributes) { |
| 47660 |
super(CONFIG_NS_ID, "submitUrl"); |
| 47661 |
} |
| 47662 |
} |
| 47663 |
class SubsetBelow extends IntegerObject { |
| 47664 |
constructor(attributes) { |
| 47665 |
super(CONFIG_NS_ID, "subsetBelow", 100, n => n >= 0 && n <= 100); |
| 47666 |
} |
| 47667 |
} |
| 47668 |
class SuppressBanner extends Option01 { |
| 47669 |
constructor(attributes) { |
| 47670 |
super(CONFIG_NS_ID, "suppressBanner"); |
| 47671 |
} |
| 47672 |
} |
| 47673 |
class Tagged extends Option01 { |
| 47674 |
constructor(attributes) { |
| 47675 |
super(CONFIG_NS_ID, "tagged"); |
| 47676 |
} |
| 47677 |
} |
| 47678 |
class config_Template extends XFAObject { |
| 47679 |
constructor(attributes) { |
| 47680 |
super(CONFIG_NS_ID, "template", true); |
| 47681 |
this.base = null; |
| 47682 |
this.relevant = null; |
| 47683 |
this.startPage = null; |
| 47684 |
this.uri = null; |
| 47685 |
this.xsl = null; |
| 47686 |
} |
| 47687 |
} |
| 47688 |
class Threshold extends OptionObject { |
| 47689 |
constructor(attributes) { |
| 47690 |
super(CONFIG_NS_ID, "threshold", ["trace", "error", "information", "warning"]); |
| 47691 |
} |
| 47692 |
} |
| 47693 |
class To extends OptionObject { |
| 47694 |
constructor(attributes) { |
| 47695 |
super(CONFIG_NS_ID, "to", ["null", "memory", "stderr", "stdout", "system", "uri"]); |
| 47696 |
} |
| 47697 |
} |
| 47698 |
class TemplateCache extends XFAObject { |
| 47699 |
constructor(attributes) { |
| 47700 |
super(CONFIG_NS_ID, "templateCache"); |
| 47701 |
this.maxEntries = getInteger({ |
| 47702 |
data: attributes.maxEntries, |
| 47703 |
defaultValue: 5, |
| 47704 |
validate: n => n >= 0 |
| 47705 |
}); |
| 47706 |
} |
| 47707 |
} |
| 47708 |
class Trace extends XFAObject { |
| 47709 |
constructor(attributes) { |
| 47710 |
super(CONFIG_NS_ID, "trace", true); |
| 47711 |
this.area = new XFAObjectArray(); |
| 47712 |
} |
| 47713 |
} |
| 47714 |
class Transform extends XFAObject { |
| 47715 |
constructor(attributes) { |
| 47716 |
super(CONFIG_NS_ID, "transform", true); |
| 47717 |
this.groupParent = null; |
| 47718 |
this.ifEmpty = null; |
| 47719 |
this.nameAttr = null; |
| 47720 |
this.picture = null; |
| 47721 |
this.presence = null; |
| 47722 |
this.rename = null; |
| 47723 |
this.whitespace = null; |
| 47724 |
} |
| 47725 |
} |
| 47726 |
class Type extends OptionObject { |
| 47727 |
constructor(attributes) { |
| 47728 |
super(CONFIG_NS_ID, "type", ["none", "ascii85", "asciiHex", "ccittfax", "flate", "lzw", "runLength", "native", "xdp", "mergedXDP"]); |
| 47729 |
} |
| 47730 |
} |
| 47731 |
class Uri extends StringObject { |
| 47732 |
constructor(attributes) { |
| 47733 |
super(CONFIG_NS_ID, "uri"); |
| 47734 |
} |
| 47735 |
} |
| 47736 |
class config_Validate extends OptionObject { |
| 47737 |
constructor(attributes) { |
| 47738 |
super(CONFIG_NS_ID, "validate", ["preSubmit", "prePrint", "preExecute", "preSave"]); |
| 47739 |
} |
| 47740 |
} |
| 47741 |
class ValidateApprovalSignatures extends ContentObject { |
| 47742 |
constructor(attributes) { |
| 47743 |
super(CONFIG_NS_ID, "validateApprovalSignatures"); |
| 47744 |
} |
| 47745 |
[$finalize]() { |
| 47746 |
this[$content] = this[$content].trim().split(/\s+/).filter(x => ["docReady", "postSign"].includes(x)); |
| 47747 |
} |
| 47748 |
} |
| 47749 |
class ValidationMessaging extends OptionObject { |
| 47750 |
constructor(attributes) { |
| 47751 |
super(CONFIG_NS_ID, "validationMessaging", ["allMessagesIndividually", "allMessagesTogether", "firstMessageOnly", "noMessages"]); |
| 47752 |
} |
| 47753 |
} |
| 47754 |
class Version extends OptionObject { |
| 47755 |
constructor(attributes) { |
| 47756 |
super(CONFIG_NS_ID, "version", ["1.7", "1.6", "1.5", "1.4", "1.3", "1.2"]); |
| 47757 |
} |
| 47758 |
} |
| 47759 |
class VersionControl extends XFAObject { |
| 47760 |
constructor(attributes) { |
| 47761 |
super(CONFIG_NS_ID, "VersionControl"); |
| 47762 |
this.outputBelow = getStringOption(attributes.outputBelow, ["warn", "error", "update"]); |
| 47763 |
this.sourceAbove = getStringOption(attributes.sourceAbove, ["warn", "error"]); |
| 47764 |
this.sourceBelow = getStringOption(attributes.sourceBelow, ["update", "maintain"]); |
| 47765 |
} |
| 47766 |
} |
| 47767 |
class ViewerPreferences extends XFAObject { |
| 47768 |
constructor(attributes) { |
| 47769 |
super(CONFIG_NS_ID, "viewerPreferences", true); |
| 47770 |
this.ADBE_JSConsole = null; |
| 47771 |
this.ADBE_JSDebugger = null; |
| 47772 |
this.addViewerPreferences = null; |
| 47773 |
this.duplexOption = null; |
| 47774 |
this.enforce = null; |
| 47775 |
this.numberOfCopies = null; |
| 47776 |
this.pageRange = null; |
| 47777 |
this.pickTrayByPDFSize = null; |
| 47778 |
this.printScaling = null; |
| 47779 |
} |
| 47780 |
} |
| 47781 |
class WebClient extends XFAObject { |
| 47782 |
constructor(attributes) { |
| 47783 |
super(CONFIG_NS_ID, "webClient", true); |
| 47784 |
this.name = attributes.name ? attributes.name.trim() : ""; |
| 47785 |
this.fontInfo = null; |
| 47786 |
this.xdc = null; |
| 47787 |
} |
| 47788 |
} |
| 47789 |
class Whitespace extends OptionObject { |
| 47790 |
constructor(attributes) { |
| 47791 |
super(CONFIG_NS_ID, "whitespace", ["preserve", "ltrim", "normalize", "rtrim", "trim"]); |
| 47792 |
} |
| 47793 |
} |
| 47794 |
class Window extends ContentObject { |
| 47795 |
constructor(attributes) { |
| 47796 |
super(CONFIG_NS_ID, "window"); |
| 47797 |
} |
| 47798 |
[$finalize]() { |
| 47799 |
const pair = this[$content].trim().split(/\s*,\s*/, 2).map(x => parseInt(x, 10)); |
| 47800 |
if (pair.some(x => isNaN(x))) { |
| 47801 |
this[$content] = [0, 0]; |
| 47802 |
return; |
| 47803 |
} |
| 47804 |
if (pair.length === 1) { |
| 47805 |
pair.push(pair[0]); |
| 47806 |
} |
| 47807 |
this[$content] = pair; |
| 47808 |
} |
| 47809 |
} |
| 47810 |
class Xdc extends XFAObject { |
| 47811 |
constructor(attributes) { |
| 47812 |
super(CONFIG_NS_ID, "xdc", true); |
| 47813 |
this.uri = new XFAObjectArray(); |
| 47814 |
this.xsl = new XFAObjectArray(); |
| 47815 |
} |
| 47816 |
} |
| 47817 |
class Xdp extends XFAObject { |
| 47818 |
constructor(attributes) { |
| 47819 |
super(CONFIG_NS_ID, "xdp", true); |
| 47820 |
this.packets = null; |
| 47821 |
} |
| 47822 |
} |
| 47823 |
class Xsl extends XFAObject { |
| 47824 |
constructor(attributes) { |
| 47825 |
super(CONFIG_NS_ID, "xsl", true); |
| 47826 |
this.debug = null; |
| 47827 |
this.uri = null; |
| 47828 |
} |
| 47829 |
} |
| 47830 |
class Zpl extends XFAObject { |
| 47831 |
constructor(attributes) { |
| 47832 |
super(CONFIG_NS_ID, "zpl", true); |
| 47833 |
this.name = attributes.name ? attributes.name.trim() : ""; |
| 47834 |
this.batchOutput = null; |
| 47835 |
this.flipLabel = null; |
| 47836 |
this.fontInfo = null; |
| 47837 |
this.xdc = null; |
| 47838 |
} |
| 47839 |
} |
| 47840 |
class ConfigNamespace { |
| 47841 |
static [$buildXFAObject](name, attributes) { |
| 47842 |
if (ConfigNamespace.hasOwnProperty(name)) { |
| 47843 |
return ConfigNamespace[name](attributes); |
| 47844 |
} |
| 47845 |
return undefined; |
| 47846 |
} |
| 47847 |
static acrobat(attrs) { |
| 47848 |
return new Acrobat(attrs); |
| 47849 |
} |
| 47850 |
static acrobat7(attrs) { |
| 47851 |
return new Acrobat7(attrs); |
| 47852 |
} |
| 47853 |
static ADBE_JSConsole(attrs) { |
| 47854 |
return new ADBE_JSConsole(attrs); |
| 47855 |
} |
| 47856 |
static ADBE_JSDebugger(attrs) { |
| 47857 |
return new ADBE_JSDebugger(attrs); |
| 47858 |
} |
| 47859 |
static addSilentPrint(attrs) { |
| 47860 |
return new AddSilentPrint(attrs); |
| 47861 |
} |
| 47862 |
static addViewerPreferences(attrs) { |
| 47863 |
return new AddViewerPreferences(attrs); |
| 47864 |
} |
| 47865 |
static adjustData(attrs) { |
| 47866 |
return new AdjustData(attrs); |
| 47867 |
} |
| 47868 |
static adobeExtensionLevel(attrs) { |
| 47869 |
return new AdobeExtensionLevel(attrs); |
| 47870 |
} |
| 47871 |
static agent(attrs) { |
| 47872 |
return new Agent(attrs); |
| 47873 |
} |
| 47874 |
static alwaysEmbed(attrs) { |
| 47875 |
return new AlwaysEmbed(attrs); |
| 47876 |
} |
| 47877 |
static amd(attrs) { |
| 47878 |
return new Amd(attrs); |
| 47879 |
} |
| 47880 |
static area(attrs) { |
| 47881 |
return new config_Area(attrs); |
| 47882 |
} |
| 47883 |
static attributes(attrs) { |
| 47884 |
return new Attributes(attrs); |
| 47885 |
} |
| 47886 |
static autoSave(attrs) { |
| 47887 |
return new AutoSave(attrs); |
| 47888 |
} |
| 47889 |
static base(attrs) { |
| 47890 |
return new Base(attrs); |
| 47891 |
} |
| 47892 |
static batchOutput(attrs) { |
| 47893 |
return new BatchOutput(attrs); |
| 47894 |
} |
| 47895 |
static behaviorOverride(attrs) { |
| 47896 |
return new BehaviorOverride(attrs); |
| 47897 |
} |
| 47898 |
static cache(attrs) { |
| 47899 |
return new Cache(attrs); |
| 47900 |
} |
| 47901 |
static change(attrs) { |
| 47902 |
return new Change(attrs); |
| 47903 |
} |
| 47904 |
static common(attrs) { |
| 47905 |
return new Common(attrs); |
| 47906 |
} |
| 47907 |
static compress(attrs) { |
| 47908 |
return new Compress(attrs); |
| 47909 |
} |
| 47910 |
static compressLogicalStructure(attrs) { |
| 47911 |
return new CompressLogicalStructure(attrs); |
| 47912 |
} |
| 47913 |
static compressObjectStream(attrs) { |
| 47914 |
return new CompressObjectStream(attrs); |
| 47915 |
} |
| 47916 |
static compression(attrs) { |
| 47917 |
return new Compression(attrs); |
| 47918 |
} |
| 47919 |
static config(attrs) { |
| 47920 |
return new Config(attrs); |
| 47921 |
} |
| 47922 |
static conformance(attrs) { |
| 47923 |
return new Conformance(attrs); |
| 47924 |
} |
| 47925 |
static contentCopy(attrs) { |
| 47926 |
return new ContentCopy(attrs); |
| 47927 |
} |
| 47928 |
static copies(attrs) { |
| 47929 |
return new Copies(attrs); |
| 47930 |
} |
| 47931 |
static creator(attrs) { |
| 47932 |
return new Creator(attrs); |
| 47933 |
} |
| 47934 |
static currentPage(attrs) { |
| 47935 |
return new CurrentPage(attrs); |
| 47936 |
} |
| 47937 |
static data(attrs) { |
| 47938 |
return new Data(attrs); |
| 47939 |
} |
| 47940 |
static debug(attrs) { |
| 47941 |
return new Debug(attrs); |
| 47942 |
} |
| 47943 |
static defaultTypeface(attrs) { |
| 47944 |
return new DefaultTypeface(attrs); |
| 47945 |
} |
| 47946 |
static destination(attrs) { |
| 47947 |
return new Destination(attrs); |
| 47948 |
} |
| 47949 |
static documentAssembly(attrs) { |
| 47950 |
return new DocumentAssembly(attrs); |
| 47951 |
} |
| 47952 |
static driver(attrs) { |
| 47953 |
return new Driver(attrs); |
| 47954 |
} |
| 47955 |
static duplexOption(attrs) { |
| 47956 |
return new DuplexOption(attrs); |
| 47957 |
} |
| 47958 |
static dynamicRender(attrs) { |
| 47959 |
return new DynamicRender(attrs); |
| 47960 |
} |
| 47961 |
static embed(attrs) { |
| 47962 |
return new Embed(attrs); |
| 47963 |
} |
| 47964 |
static encrypt(attrs) { |
| 47965 |
return new config_Encrypt(attrs); |
| 47966 |
} |
| 47967 |
static encryption(attrs) { |
| 47968 |
return new config_Encryption(attrs); |
| 47969 |
} |
| 47970 |
static encryptionLevel(attrs) { |
| 47971 |
return new EncryptionLevel(attrs); |
| 47972 |
} |
| 47973 |
static enforce(attrs) { |
| 47974 |
return new Enforce(attrs); |
| 47975 |
} |
| 47976 |
static equate(attrs) { |
| 47977 |
return new Equate(attrs); |
| 47978 |
} |
| 47979 |
static equateRange(attrs) { |
| 47980 |
return new EquateRange(attrs); |
| 47981 |
} |
| 47982 |
static exclude(attrs) { |
| 47983 |
return new Exclude(attrs); |
| 47984 |
} |
| 47985 |
static excludeNS(attrs) { |
| 47986 |
return new ExcludeNS(attrs); |
| 47987 |
} |
| 47988 |
static flipLabel(attrs) { |
| 47989 |
return new FlipLabel(attrs); |
| 47990 |
} |
| 47991 |
static fontInfo(attrs) { |
| 47992 |
return new config_FontInfo(attrs); |
| 47993 |
} |
| 47994 |
static formFieldFilling(attrs) { |
| 47995 |
return new FormFieldFilling(attrs); |
| 47996 |
} |
| 47997 |
static groupParent(attrs) { |
| 47998 |
return new GroupParent(attrs); |
| 47999 |
} |
| 48000 |
static ifEmpty(attrs) { |
| 48001 |
return new IfEmpty(attrs); |
| 48002 |
} |
| 48003 |
static includeXDPContent(attrs) { |
| 48004 |
return new IncludeXDPContent(attrs); |
| 48005 |
} |
| 48006 |
static incrementalLoad(attrs) { |
| 48007 |
return new IncrementalLoad(attrs); |
| 48008 |
} |
| 48009 |
static incrementalMerge(attrs) { |
| 48010 |
return new IncrementalMerge(attrs); |
| 48011 |
} |
| 48012 |
static interactive(attrs) { |
| 48013 |
return new Interactive(attrs); |
| 48014 |
} |
| 48015 |
static jog(attrs) { |
| 48016 |
return new Jog(attrs); |
| 48017 |
} |
| 48018 |
static labelPrinter(attrs) { |
| 48019 |
return new LabelPrinter(attrs); |
| 48020 |
} |
| 48021 |
static layout(attrs) { |
| 48022 |
return new Layout(attrs); |
| 48023 |
} |
| 48024 |
static level(attrs) { |
| 48025 |
return new Level(attrs); |
| 48026 |
} |
| 48027 |
static linearized(attrs) { |
| 48028 |
return new Linearized(attrs); |
| 48029 |
} |
| 48030 |
static locale(attrs) { |
| 48031 |
return new Locale(attrs); |
| 48032 |
} |
| 48033 |
static localeSet(attrs) { |
| 48034 |
return new LocaleSet(attrs); |
| 48035 |
} |
| 48036 |
static log(attrs) { |
| 48037 |
return new Log(attrs); |
| 48038 |
} |
| 48039 |
static map(attrs) { |
| 48040 |
return new MapElement(attrs); |
| 48041 |
} |
| 48042 |
static mediumInfo(attrs) { |
| 48043 |
return new MediumInfo(attrs); |
| 48044 |
} |
| 48045 |
static message(attrs) { |
| 48046 |
return new config_Message(attrs); |
| 48047 |
} |
| 48048 |
static messaging(attrs) { |
| 48049 |
return new Messaging(attrs); |
| 48050 |
} |
| 48051 |
static mode(attrs) { |
| 48052 |
return new Mode(attrs); |
| 48053 |
} |
| 48054 |
static modifyAnnots(attrs) { |
| 48055 |
return new ModifyAnnots(attrs); |
| 48056 |
} |
| 48057 |
static msgId(attrs) { |
| 48058 |
return new MsgId(attrs); |
| 48059 |
} |
| 48060 |
static nameAttr(attrs) { |
| 48061 |
return new NameAttr(attrs); |
| 48062 |
} |
| 48063 |
static neverEmbed(attrs) { |
| 48064 |
return new NeverEmbed(attrs); |
| 48065 |
} |
| 48066 |
static numberOfCopies(attrs) { |
| 48067 |
return new NumberOfCopies(attrs); |
| 48068 |
} |
| 48069 |
static openAction(attrs) { |
| 48070 |
return new OpenAction(attrs); |
| 48071 |
} |
| 48072 |
static output(attrs) { |
| 48073 |
return new Output(attrs); |
| 48074 |
} |
| 48075 |
static outputBin(attrs) { |
| 48076 |
return new OutputBin(attrs); |
| 48077 |
} |
| 48078 |
static outputXSL(attrs) { |
| 48079 |
return new OutputXSL(attrs); |
| 48080 |
} |
| 48081 |
static overprint(attrs) { |
| 48082 |
return new Overprint(attrs); |
| 48083 |
} |
| 48084 |
static packets(attrs) { |
| 48085 |
return new Packets(attrs); |
| 48086 |
} |
| 48087 |
static pageOffset(attrs) { |
| 48088 |
return new PageOffset(attrs); |
| 48089 |
} |
| 48090 |
static pageRange(attrs) { |
| 48091 |
return new PageRange(attrs); |
| 48092 |
} |
| 48093 |
static pagination(attrs) { |
| 48094 |
return new Pagination(attrs); |
| 48095 |
} |
| 48096 |
static paginationOverride(attrs) { |
| 48097 |
return new PaginationOverride(attrs); |
| 48098 |
} |
| 48099 |
static part(attrs) { |
| 48100 |
return new Part(attrs); |
| 48101 |
} |
| 48102 |
static pcl(attrs) { |
| 48103 |
return new Pcl(attrs); |
| 48104 |
} |
| 48105 |
static pdf(attrs) { |
| 48106 |
return new Pdf(attrs); |
| 48107 |
} |
| 48108 |
static pdfa(attrs) { |
| 48109 |
return new Pdfa(attrs); |
| 48110 |
} |
| 48111 |
static permissions(attrs) { |
| 48112 |
return new Permissions(attrs); |
| 48113 |
} |
| 48114 |
static pickTrayByPDFSize(attrs) { |
| 48115 |
return new PickTrayByPDFSize(attrs); |
| 48116 |
} |
| 48117 |
static picture(attrs) { |
| 48118 |
return new config_Picture(attrs); |
| 48119 |
} |
| 48120 |
static plaintextMetadata(attrs) { |
| 48121 |
return new PlaintextMetadata(attrs); |
| 48122 |
} |
| 48123 |
static presence(attrs) { |
| 48124 |
return new Presence(attrs); |
| 48125 |
} |
| 48126 |
static present(attrs) { |
| 48127 |
return new Present(attrs); |
| 48128 |
} |
| 48129 |
static print(attrs) { |
| 48130 |
return new Print(attrs); |
| 48131 |
} |
| 48132 |
static printHighQuality(attrs) { |
| 48133 |
return new PrintHighQuality(attrs); |
| 48134 |
} |
| 48135 |
static printScaling(attrs) { |
| 48136 |
return new PrintScaling(attrs); |
| 48137 |
} |
| 48138 |
static printerName(attrs) { |
| 48139 |
return new PrinterName(attrs); |
| 48140 |
} |
| 48141 |
static producer(attrs) { |
| 48142 |
return new Producer(attrs); |
| 48143 |
} |
| 48144 |
static ps(attrs) { |
| 48145 |
return new Ps(attrs); |
| 48146 |
} |
| 48147 |
static range(attrs) { |
| 48148 |
return new Range(attrs); |
| 48149 |
} |
| 48150 |
static record(attrs) { |
| 48151 |
return new Record(attrs); |
| 48152 |
} |
| 48153 |
static relevant(attrs) { |
| 48154 |
return new Relevant(attrs); |
| 48155 |
} |
| 48156 |
static rename(attrs) { |
| 48157 |
return new Rename(attrs); |
| 48158 |
} |
| 48159 |
static renderPolicy(attrs) { |
| 48160 |
return new RenderPolicy(attrs); |
| 48161 |
} |
| 48162 |
static runScripts(attrs) { |
| 48163 |
return new RunScripts(attrs); |
| 48164 |
} |
| 48165 |
static script(attrs) { |
| 48166 |
return new config_Script(attrs); |
| 48167 |
} |
| 48168 |
static scriptModel(attrs) { |
| 48169 |
return new ScriptModel(attrs); |
| 48170 |
} |
| 48171 |
static severity(attrs) { |
| 48172 |
return new Severity(attrs); |
| 48173 |
} |
| 48174 |
static silentPrint(attrs) { |
| 48175 |
return new SilentPrint(attrs); |
| 48176 |
} |
| 48177 |
static staple(attrs) { |
| 48178 |
return new Staple(attrs); |
| 48179 |
} |
| 48180 |
static startNode(attrs) { |
| 48181 |
return new StartNode(attrs); |
| 48182 |
} |
| 48183 |
static startPage(attrs) { |
| 48184 |
return new StartPage(attrs); |
| 48185 |
} |
| 48186 |
static submitFormat(attrs) { |
| 48187 |
return new SubmitFormat(attrs); |
| 48188 |
} |
| 48189 |
static submitUrl(attrs) { |
| 48190 |
return new SubmitUrl(attrs); |
| 48191 |
} |
| 48192 |
static subsetBelow(attrs) { |
| 48193 |
return new SubsetBelow(attrs); |
| 48194 |
} |
| 48195 |
static suppressBanner(attrs) { |
| 48196 |
return new SuppressBanner(attrs); |
| 48197 |
} |
| 48198 |
static tagged(attrs) { |
| 48199 |
return new Tagged(attrs); |
| 48200 |
} |
| 48201 |
static template(attrs) { |
| 48202 |
return new config_Template(attrs); |
| 48203 |
} |
| 48204 |
static templateCache(attrs) { |
| 48205 |
return new TemplateCache(attrs); |
| 48206 |
} |
| 48207 |
static threshold(attrs) { |
| 48208 |
return new Threshold(attrs); |
| 48209 |
} |
| 48210 |
static to(attrs) { |
| 48211 |
return new To(attrs); |
| 48212 |
} |
| 48213 |
static trace(attrs) { |
| 48214 |
return new Trace(attrs); |
| 48215 |
} |
| 48216 |
static transform(attrs) { |
| 48217 |
return new Transform(attrs); |
| 48218 |
} |
| 48219 |
static type(attrs) { |
| 48220 |
return new Type(attrs); |
| 48221 |
} |
| 48222 |
static uri(attrs) { |
| 48223 |
return new Uri(attrs); |
| 48224 |
} |
| 48225 |
static validate(attrs) { |
| 48226 |
return new config_Validate(attrs); |
| 48227 |
} |
| 48228 |
static validateApprovalSignatures(attrs) { |
| 48229 |
return new ValidateApprovalSignatures(attrs); |
| 48230 |
} |
| 48231 |
static validationMessaging(attrs) { |
| 48232 |
return new ValidationMessaging(attrs); |
| 48233 |
} |
| 48234 |
static version(attrs) { |
| 48235 |
return new Version(attrs); |
| 48236 |
} |
| 48237 |
static versionControl(attrs) { |
| 48238 |
return new VersionControl(attrs); |
| 48239 |
} |
| 48240 |
static viewerPreferences(attrs) { |
| 48241 |
return new ViewerPreferences(attrs); |
| 48242 |
} |
| 48243 |
static webClient(attrs) { |
| 48244 |
return new WebClient(attrs); |
| 48245 |
} |
| 48246 |
static whitespace(attrs) { |
| 48247 |
return new Whitespace(attrs); |
| 48248 |
} |
| 48249 |
static window(attrs) { |
| 48250 |
return new Window(attrs); |
| 48251 |
} |
| 48252 |
static xdc(attrs) { |
| 48253 |
return new Xdc(attrs); |
| 48254 |
} |
| 48255 |
static xdp(attrs) { |
| 48256 |
return new Xdp(attrs); |
| 48257 |
} |
| 48258 |
static xsl(attrs) { |
| 48259 |
return new Xsl(attrs); |
| 48260 |
} |
| 48261 |
static zpl(attrs) { |
| 48262 |
return new Zpl(attrs); |
| 48263 |
} |
| 48264 |
} |
| 48265 |
|
| 48266 |
;// ./src/core/xfa/connection_set.js |
| 48267 |
|
| 48268 |
|
| 48269 |
const CONNECTION_SET_NS_ID = NamespaceIds.connectionSet.id; |
| 48270 |
class ConnectionSet extends XFAObject { |
| 48271 |
constructor(attributes) { |
| 48272 |
super(CONNECTION_SET_NS_ID, "connectionSet", true); |
| 48273 |
this.wsdlConnection = new XFAObjectArray(); |
| 48274 |
this.xmlConnection = new XFAObjectArray(); |
| 48275 |
this.xsdConnection = new XFAObjectArray(); |
| 48276 |
} |
| 48277 |
} |
| 48278 |
class EffectiveInputPolicy extends XFAObject { |
| 48279 |
constructor(attributes) { |
| 48280 |
super(CONNECTION_SET_NS_ID, "effectiveInputPolicy"); |
| 48281 |
this.id = attributes.id || ""; |
| 48282 |
this.name = attributes.name || ""; |
| 48283 |
this.use = attributes.use || ""; |
| 48284 |
this.usehref = attributes.usehref || ""; |
| 48285 |
} |
| 48286 |
} |
| 48287 |
class EffectiveOutputPolicy extends XFAObject { |
| 48288 |
constructor(attributes) { |
| 48289 |
super(CONNECTION_SET_NS_ID, "effectiveOutputPolicy"); |
| 48290 |
this.id = attributes.id || ""; |
| 48291 |
this.name = attributes.name || ""; |
| 48292 |
this.use = attributes.use || ""; |
| 48293 |
this.usehref = attributes.usehref || ""; |
| 48294 |
} |
| 48295 |
} |
| 48296 |
class Operation extends StringObject { |
| 48297 |
constructor(attributes) { |
| 48298 |
super(CONNECTION_SET_NS_ID, "operation"); |
| 48299 |
this.id = attributes.id || ""; |
| 48300 |
this.input = attributes.input || ""; |
| 48301 |
this.name = attributes.name || ""; |
| 48302 |
this.output = attributes.output || ""; |
| 48303 |
this.use = attributes.use || ""; |
| 48304 |
this.usehref = attributes.usehref || ""; |
| 48305 |
} |
| 48306 |
} |
| 48307 |
class RootElement extends StringObject { |
| 48308 |
constructor(attributes) { |
| 48309 |
super(CONNECTION_SET_NS_ID, "rootElement"); |
| 48310 |
this.id = attributes.id || ""; |
| 48311 |
this.name = attributes.name || ""; |
| 48312 |
this.use = attributes.use || ""; |
| 48313 |
this.usehref = attributes.usehref || ""; |
| 48314 |
} |
| 48315 |
} |
| 48316 |
class SoapAction extends StringObject { |
| 48317 |
constructor(attributes) { |
| 48318 |
super(CONNECTION_SET_NS_ID, "soapAction"); |
| 48319 |
this.id = attributes.id || ""; |
| 48320 |
this.name = attributes.name || ""; |
| 48321 |
this.use = attributes.use || ""; |
| 48322 |
this.usehref = attributes.usehref || ""; |
| 48323 |
} |
| 48324 |
} |
| 48325 |
class SoapAddress extends StringObject { |
| 48326 |
constructor(attributes) { |
| 48327 |
super(CONNECTION_SET_NS_ID, "soapAddress"); |
| 48328 |
this.id = attributes.id || ""; |
| 48329 |
this.name = attributes.name || ""; |
| 48330 |
this.use = attributes.use || ""; |
| 48331 |
this.usehref = attributes.usehref || ""; |
| 48332 |
} |
| 48333 |
} |
| 48334 |
class connection_set_Uri extends StringObject { |
| 48335 |
constructor(attributes) { |
| 48336 |
super(CONNECTION_SET_NS_ID, "uri"); |
| 48337 |
this.id = attributes.id || ""; |
| 48338 |
this.name = attributes.name || ""; |
| 48339 |
this.use = attributes.use || ""; |
| 48340 |
this.usehref = attributes.usehref || ""; |
| 48341 |
} |
| 48342 |
} |
| 48343 |
class WsdlAddress extends StringObject { |
| 48344 |
constructor(attributes) { |
| 48345 |
super(CONNECTION_SET_NS_ID, "wsdlAddress"); |
| 48346 |
this.id = attributes.id || ""; |
| 48347 |
this.name = attributes.name || ""; |
| 48348 |
this.use = attributes.use || ""; |
| 48349 |
this.usehref = attributes.usehref || ""; |
| 48350 |
} |
| 48351 |
} |
| 48352 |
class WsdlConnection extends XFAObject { |
| 48353 |
constructor(attributes) { |
| 48354 |
super(CONNECTION_SET_NS_ID, "wsdlConnection", true); |
| 48355 |
this.dataDescription = attributes.dataDescription || ""; |
| 48356 |
this.name = attributes.name || ""; |
| 48357 |
this.effectiveInputPolicy = null; |
| 48358 |
this.effectiveOutputPolicy = null; |
| 48359 |
this.operation = null; |
| 48360 |
this.soapAction = null; |
| 48361 |
this.soapAddress = null; |
| 48362 |
this.wsdlAddress = null; |
| 48363 |
} |
| 48364 |
} |
| 48365 |
class XmlConnection extends XFAObject { |
| 48366 |
constructor(attributes) { |
| 48367 |
super(CONNECTION_SET_NS_ID, "xmlConnection", true); |
| 48368 |
this.dataDescription = attributes.dataDescription || ""; |
| 48369 |
this.name = attributes.name || ""; |
| 48370 |
this.uri = null; |
| 48371 |
} |
| 48372 |
} |
| 48373 |
class XsdConnection extends XFAObject { |
| 48374 |
constructor(attributes) { |
| 48375 |
super(CONNECTION_SET_NS_ID, "xsdConnection", true); |
| 48376 |
this.dataDescription = attributes.dataDescription || ""; |
| 48377 |
this.name = attributes.name || ""; |
| 48378 |
this.rootElement = null; |
| 48379 |
this.uri = null; |
| 48380 |
} |
| 48381 |
} |
| 48382 |
class ConnectionSetNamespace { |
| 48383 |
static [$buildXFAObject](name, attributes) { |
| 48384 |
if (ConnectionSetNamespace.hasOwnProperty(name)) { |
| 48385 |
return ConnectionSetNamespace[name](attributes); |
| 48386 |
} |
| 48387 |
return undefined; |
| 48388 |
} |
| 48389 |
static connectionSet(attrs) { |
| 48390 |
return new ConnectionSet(attrs); |
| 48391 |
} |
| 48392 |
static effectiveInputPolicy(attrs) { |
| 48393 |
return new EffectiveInputPolicy(attrs); |
| 48394 |
} |
| 48395 |
static effectiveOutputPolicy(attrs) { |
| 48396 |
return new EffectiveOutputPolicy(attrs); |
| 48397 |
} |
| 48398 |
static operation(attrs) { |
| 48399 |
return new Operation(attrs); |
| 48400 |
} |
| 48401 |
static rootElement(attrs) { |
| 48402 |
return new RootElement(attrs); |
| 48403 |
} |
| 48404 |
static soapAction(attrs) { |
| 48405 |
return new SoapAction(attrs); |
| 48406 |
} |
| 48407 |
static soapAddress(attrs) { |
| 48408 |
return new SoapAddress(attrs); |
| 48409 |
} |
| 48410 |
static uri(attrs) { |
| 48411 |
return new connection_set_Uri(attrs); |
| 48412 |
} |
| 48413 |
static wsdlAddress(attrs) { |
| 48414 |
return new WsdlAddress(attrs); |
| 48415 |
} |
| 48416 |
static wsdlConnection(attrs) { |
| 48417 |
return new WsdlConnection(attrs); |
| 48418 |
} |
| 48419 |
static xmlConnection(attrs) { |
| 48420 |
return new XmlConnection(attrs); |
| 48421 |
} |
| 48422 |
static xsdConnection(attrs) { |
| 48423 |
return new XsdConnection(attrs); |
| 48424 |
} |
| 48425 |
} |
| 48426 |
|
| 48427 |
;// ./src/core/xfa/datasets.js |
| 48428 |
|
| 48429 |
|
| 48430 |
|
| 48431 |
const DATASETS_NS_ID = NamespaceIds.datasets.id; |
| 48432 |
class datasets_Data extends XmlObject { |
| 48433 |
constructor(attributes) { |
| 48434 |
super(DATASETS_NS_ID, "data", attributes); |
| 48435 |
} |
| 48436 |
[$isNsAgnostic]() { |
| 48437 |
return true; |
| 48438 |
} |
| 48439 |
} |
| 48440 |
class Datasets extends XFAObject { |
| 48441 |
constructor(attributes) { |
| 48442 |
super(DATASETS_NS_ID, "datasets", true); |
| 48443 |
this.data = null; |
| 48444 |
this.Signature = null; |
| 48445 |
} |
| 48446 |
[$onChild](child) { |
| 48447 |
const name = child[$nodeName]; |
| 48448 |
if (name === "data" && child[$namespaceId] === DATASETS_NS_ID || name === "Signature" && child[$namespaceId] === NamespaceIds.signature.id) { |
| 48449 |
this[name] = child; |
| 48450 |
} |
| 48451 |
this[$appendChild](child); |
| 48452 |
} |
| 48453 |
} |
| 48454 |
class DatasetsNamespace { |
| 48455 |
static [$buildXFAObject](name, attributes) { |
| 48456 |
if (DatasetsNamespace.hasOwnProperty(name)) { |
| 48457 |
return DatasetsNamespace[name](attributes); |
| 48458 |
} |
| 48459 |
return undefined; |
| 48460 |
} |
| 48461 |
static datasets(attributes) { |
| 48462 |
return new Datasets(attributes); |
| 48463 |
} |
| 48464 |
static data(attributes) { |
| 48465 |
return new datasets_Data(attributes); |
| 48466 |
} |
| 48467 |
} |
| 48468 |
|
| 48469 |
;// ./src/core/xfa/locale_set.js |
| 48470 |
|
| 48471 |
|
| 48472 |
|
| 48473 |
const LOCALE_SET_NS_ID = NamespaceIds.localeSet.id; |
| 48474 |
class CalendarSymbols extends XFAObject { |
| 48475 |
constructor(attributes) { |
| 48476 |
super(LOCALE_SET_NS_ID, "calendarSymbols", true); |
| 48477 |
this.name = "gregorian"; |
| 48478 |
this.dayNames = new XFAObjectArray(2); |
| 48479 |
this.eraNames = null; |
| 48480 |
this.meridiemNames = null; |
| 48481 |
this.monthNames = new XFAObjectArray(2); |
| 48482 |
} |
| 48483 |
} |
| 48484 |
class CurrencySymbol extends StringObject { |
| 48485 |
constructor(attributes) { |
| 48486 |
super(LOCALE_SET_NS_ID, "currencySymbol"); |
| 48487 |
this.name = getStringOption(attributes.name, ["symbol", "isoname", "decimal"]); |
| 48488 |
} |
| 48489 |
} |
| 48490 |
class CurrencySymbols extends XFAObject { |
| 48491 |
constructor(attributes) { |
| 48492 |
super(LOCALE_SET_NS_ID, "currencySymbols", true); |
| 48493 |
this.currencySymbol = new XFAObjectArray(3); |
| 48494 |
} |
| 48495 |
} |
| 48496 |
class DatePattern extends StringObject { |
| 48497 |
constructor(attributes) { |
| 48498 |
super(LOCALE_SET_NS_ID, "datePattern"); |
| 48499 |
this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]); |
| 48500 |
} |
| 48501 |
} |
| 48502 |
class DatePatterns extends XFAObject { |
| 48503 |
constructor(attributes) { |
| 48504 |
super(LOCALE_SET_NS_ID, "datePatterns", true); |
| 48505 |
this.datePattern = new XFAObjectArray(4); |
| 48506 |
} |
| 48507 |
} |
| 48508 |
class DateTimeSymbols extends ContentObject { |
| 48509 |
constructor(attributes) { |
| 48510 |
super(LOCALE_SET_NS_ID, "dateTimeSymbols"); |
| 48511 |
} |
| 48512 |
} |
| 48513 |
class Day extends StringObject { |
| 48514 |
constructor(attributes) { |
| 48515 |
super(LOCALE_SET_NS_ID, "day"); |
| 48516 |
} |
| 48517 |
} |
| 48518 |
class DayNames extends XFAObject { |
| 48519 |
constructor(attributes) { |
| 48520 |
super(LOCALE_SET_NS_ID, "dayNames", true); |
| 48521 |
this.abbr = getInteger({ |
| 48522 |
data: attributes.abbr, |
| 48523 |
defaultValue: 0, |
| 48524 |
validate: x => x === 1 |
| 48525 |
}); |
| 48526 |
this.day = new XFAObjectArray(7); |
| 48527 |
} |
| 48528 |
} |
| 48529 |
class Era extends StringObject { |
| 48530 |
constructor(attributes) { |
| 48531 |
super(LOCALE_SET_NS_ID, "era"); |
| 48532 |
} |
| 48533 |
} |
| 48534 |
class EraNames extends XFAObject { |
| 48535 |
constructor(attributes) { |
| 48536 |
super(LOCALE_SET_NS_ID, "eraNames", true); |
| 48537 |
this.era = new XFAObjectArray(2); |
| 48538 |
} |
| 48539 |
} |
| 48540 |
class locale_set_Locale extends XFAObject { |
| 48541 |
constructor(attributes) { |
| 48542 |
super(LOCALE_SET_NS_ID, "locale", true); |
| 48543 |
this.desc = attributes.desc || ""; |
| 48544 |
this.name = "isoname"; |
| 48545 |
this.calendarSymbols = null; |
| 48546 |
this.currencySymbols = null; |
| 48547 |
this.datePatterns = null; |
| 48548 |
this.dateTimeSymbols = null; |
| 48549 |
this.numberPatterns = null; |
| 48550 |
this.numberSymbols = null; |
| 48551 |
this.timePatterns = null; |
| 48552 |
this.typeFaces = null; |
| 48553 |
} |
| 48554 |
} |
| 48555 |
class locale_set_LocaleSet extends XFAObject { |
| 48556 |
constructor(attributes) { |
| 48557 |
super(LOCALE_SET_NS_ID, "localeSet", true); |
| 48558 |
this.locale = new XFAObjectArray(); |
| 48559 |
} |
| 48560 |
} |
| 48561 |
class Meridiem extends StringObject { |
| 48562 |
constructor(attributes) { |
| 48563 |
super(LOCALE_SET_NS_ID, "meridiem"); |
| 48564 |
} |
| 48565 |
} |
| 48566 |
class MeridiemNames extends XFAObject { |
| 48567 |
constructor(attributes) { |
| 48568 |
super(LOCALE_SET_NS_ID, "meridiemNames", true); |
| 48569 |
this.meridiem = new XFAObjectArray(2); |
| 48570 |
} |
| 48571 |
} |
| 48572 |
class Month extends StringObject { |
| 48573 |
constructor(attributes) { |
| 48574 |
super(LOCALE_SET_NS_ID, "month"); |
| 48575 |
} |
| 48576 |
} |
| 48577 |
class MonthNames extends XFAObject { |
| 48578 |
constructor(attributes) { |
| 48579 |
super(LOCALE_SET_NS_ID, "monthNames", true); |
| 48580 |
this.abbr = getInteger({ |
| 48581 |
data: attributes.abbr, |
| 48582 |
defaultValue: 0, |
| 48583 |
validate: x => x === 1 |
| 48584 |
}); |
| 48585 |
this.month = new XFAObjectArray(12); |
| 48586 |
} |
| 48587 |
} |
| 48588 |
class NumberPattern extends StringObject { |
| 48589 |
constructor(attributes) { |
| 48590 |
super(LOCALE_SET_NS_ID, "numberPattern"); |
| 48591 |
this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]); |
| 48592 |
} |
| 48593 |
} |
| 48594 |
class NumberPatterns extends XFAObject { |
| 48595 |
constructor(attributes) { |
| 48596 |
super(LOCALE_SET_NS_ID, "numberPatterns", true); |
| 48597 |
this.numberPattern = new XFAObjectArray(4); |
| 48598 |
} |
| 48599 |
} |
| 48600 |
class NumberSymbol extends StringObject { |
| 48601 |
constructor(attributes) { |
| 48602 |
super(LOCALE_SET_NS_ID, "numberSymbol"); |
| 48603 |
this.name = getStringOption(attributes.name, ["decimal", "grouping", "percent", "minus", "zero"]); |
| 48604 |
} |
| 48605 |
} |
| 48606 |
class NumberSymbols extends XFAObject { |
| 48607 |
constructor(attributes) { |
| 48608 |
super(LOCALE_SET_NS_ID, "numberSymbols", true); |
| 48609 |
this.numberSymbol = new XFAObjectArray(5); |
| 48610 |
} |
| 48611 |
} |
| 48612 |
class TimePattern extends StringObject { |
| 48613 |
constructor(attributes) { |
| 48614 |
super(LOCALE_SET_NS_ID, "timePattern"); |
| 48615 |
this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]); |
| 48616 |
} |
| 48617 |
} |
| 48618 |
class TimePatterns extends XFAObject { |
| 48619 |
constructor(attributes) { |
| 48620 |
super(LOCALE_SET_NS_ID, "timePatterns", true); |
| 48621 |
this.timePattern = new XFAObjectArray(4); |
| 48622 |
} |
| 48623 |
} |
| 48624 |
class TypeFace extends XFAObject { |
| 48625 |
constructor(attributes) { |
| 48626 |
super(LOCALE_SET_NS_ID, "typeFace", true); |
| 48627 |
this.name = attributes.name | ""; |
| 48628 |
} |
| 48629 |
} |
| 48630 |
class TypeFaces extends XFAObject { |
| 48631 |
constructor(attributes) { |
| 48632 |
super(LOCALE_SET_NS_ID, "typeFaces", true); |
| 48633 |
this.typeFace = new XFAObjectArray(); |
| 48634 |
} |
| 48635 |
} |
| 48636 |
class LocaleSetNamespace { |
| 48637 |
static [$buildXFAObject](name, attributes) { |
| 48638 |
if (LocaleSetNamespace.hasOwnProperty(name)) { |
| 48639 |
return LocaleSetNamespace[name](attributes); |
| 48640 |
} |
| 48641 |
return undefined; |
| 48642 |
} |
| 48643 |
static calendarSymbols(attrs) { |
| 48644 |
return new CalendarSymbols(attrs); |
| 48645 |
} |
| 48646 |
static currencySymbol(attrs) { |
| 48647 |
return new CurrencySymbol(attrs); |
| 48648 |
} |
| 48649 |
static currencySymbols(attrs) { |
| 48650 |
return new CurrencySymbols(attrs); |
| 48651 |
} |
| 48652 |
static datePattern(attrs) { |
| 48653 |
return new DatePattern(attrs); |
| 48654 |
} |
| 48655 |
static datePatterns(attrs) { |
| 48656 |
return new DatePatterns(attrs); |
| 48657 |
} |
| 48658 |
static dateTimeSymbols(attrs) { |
| 48659 |
return new DateTimeSymbols(attrs); |
| 48660 |
} |
| 48661 |
static day(attrs) { |
| 48662 |
return new Day(attrs); |
| 48663 |
} |
| 48664 |
static dayNames(attrs) { |
| 48665 |
return new DayNames(attrs); |
| 48666 |
} |
| 48667 |
static era(attrs) { |
| 48668 |
return new Era(attrs); |
| 48669 |
} |
| 48670 |
static eraNames(attrs) { |
| 48671 |
return new EraNames(attrs); |
| 48672 |
} |
| 48673 |
static locale(attrs) { |
| 48674 |
return new locale_set_Locale(attrs); |
| 48675 |
} |
| 48676 |
static localeSet(attrs) { |
| 48677 |
return new locale_set_LocaleSet(attrs); |
| 48678 |
} |
| 48679 |
static meridiem(attrs) { |
| 48680 |
return new Meridiem(attrs); |
| 48681 |
} |
| 48682 |
static meridiemNames(attrs) { |
| 48683 |
return new MeridiemNames(attrs); |
| 48684 |
} |
| 48685 |
static month(attrs) { |
| 48686 |
return new Month(attrs); |
| 48687 |
} |
| 48688 |
static monthNames(attrs) { |
| 48689 |
return new MonthNames(attrs); |
| 48690 |
} |
| 48691 |
static numberPattern(attrs) { |
| 48692 |
return new NumberPattern(attrs); |
| 48693 |
} |
| 48694 |
static numberPatterns(attrs) { |
| 48695 |
return new NumberPatterns(attrs); |
| 48696 |
} |
| 48697 |
static numberSymbol(attrs) { |
| 48698 |
return new NumberSymbol(attrs); |
| 48699 |
} |
| 48700 |
static numberSymbols(attrs) { |
| 48701 |
return new NumberSymbols(attrs); |
| 48702 |
} |
| 48703 |
static timePattern(attrs) { |
| 48704 |
return new TimePattern(attrs); |
| 48705 |
} |
| 48706 |
static timePatterns(attrs) { |
| 48707 |
return new TimePatterns(attrs); |
| 48708 |
} |
| 48709 |
static typeFace(attrs) { |
| 48710 |
return new TypeFace(attrs); |
| 48711 |
} |
| 48712 |
static typeFaces(attrs) { |
| 48713 |
return new TypeFaces(attrs); |
| 48714 |
} |
| 48715 |
} |
| 48716 |
|
| 48717 |
;// ./src/core/xfa/signature.js |
| 48718 |
|
| 48719 |
|
| 48720 |
const SIGNATURE_NS_ID = NamespaceIds.signature.id; |
| 48721 |
class signature_Signature extends XFAObject { |
| 48722 |
constructor(attributes) { |
| 48723 |
super(SIGNATURE_NS_ID, "signature", true); |
| 48724 |
} |
| 48725 |
} |
| 48726 |
class SignatureNamespace { |
| 48727 |
static [$buildXFAObject](name, attributes) { |
| 48728 |
if (SignatureNamespace.hasOwnProperty(name)) { |
| 48729 |
return SignatureNamespace[name](attributes); |
| 48730 |
} |
| 48731 |
return undefined; |
| 48732 |
} |
| 48733 |
static signature(attributes) { |
| 48734 |
return new signature_Signature(attributes); |
| 48735 |
} |
| 48736 |
} |
| 48737 |
|
| 48738 |
;// ./src/core/xfa/stylesheet.js |
| 48739 |
|
| 48740 |
|
| 48741 |
const STYLESHEET_NS_ID = NamespaceIds.stylesheet.id; |
| 48742 |
class Stylesheet extends XFAObject { |
| 48743 |
constructor(attributes) { |
| 48744 |
super(STYLESHEET_NS_ID, "stylesheet", true); |
| 48745 |
} |
| 48746 |
} |
| 48747 |
class StylesheetNamespace { |
| 48748 |
static [$buildXFAObject](name, attributes) { |
| 48749 |
if (StylesheetNamespace.hasOwnProperty(name)) { |
| 48750 |
return StylesheetNamespace[name](attributes); |
| 48751 |
} |
| 48752 |
return undefined; |
| 48753 |
} |
| 48754 |
static stylesheet(attributes) { |
| 48755 |
return new Stylesheet(attributes); |
| 48756 |
} |
| 48757 |
} |
| 48758 |
|
| 48759 |
;// ./src/core/xfa/xdp.js |
| 48760 |
|
| 48761 |
|
| 48762 |
|
| 48763 |
const XDP_NS_ID = NamespaceIds.xdp.id; |
| 48764 |
class xdp_Xdp extends XFAObject { |
| 48765 |
constructor(attributes) { |
| 48766 |
super(XDP_NS_ID, "xdp", true); |
| 48767 |
this.uuid = attributes.uuid || ""; |
| 48768 |
this.timeStamp = attributes.timeStamp || ""; |
| 48769 |
this.config = null; |
| 48770 |
this.connectionSet = null; |
| 48771 |
this.datasets = null; |
| 48772 |
this.localeSet = null; |
| 48773 |
this.stylesheet = new XFAObjectArray(); |
| 48774 |
this.template = null; |
| 48775 |
} |
| 48776 |
[$onChildCheck](child) { |
| 48777 |
const ns = NamespaceIds[child[$nodeName]]; |
| 48778 |
return ns && child[$namespaceId] === ns.id; |
| 48779 |
} |
| 48780 |
} |
| 48781 |
class XdpNamespace { |
| 48782 |
static [$buildXFAObject](name, attributes) { |
| 48783 |
if (XdpNamespace.hasOwnProperty(name)) { |
| 48784 |
return XdpNamespace[name](attributes); |
| 48785 |
} |
| 48786 |
return undefined; |
| 48787 |
} |
| 48788 |
static xdp(attributes) { |
| 48789 |
return new xdp_Xdp(attributes); |
| 48790 |
} |
| 48791 |
} |
| 48792 |
|
| 48793 |
;// ./src/core/xfa/xhtml.js |
| 48794 |
|
| 48795 |
|
| 48796 |
|
| 48797 |
|
| 48798 |
|
| 48799 |
const XHTML_NS_ID = NamespaceIds.xhtml.id; |
| 48800 |
const $richText = Symbol(); |
| 48801 |
const VALID_STYLES = new Set(["color", "font", "font-family", "font-size", "font-stretch", "font-style", "font-weight", "margin", "margin-bottom", "margin-left", "margin-right", "margin-top", "letter-spacing", "line-height", "orphans", "page-break-after", "page-break-before", "page-break-inside", "tab-interval", "tab-stop", "text-align", "text-decoration", "text-indent", "vertical-align", "widows", "kerning-mode", "xfa-font-horizontal-scale", "xfa-font-vertical-scale", "xfa-spacerun", "xfa-tab-stops"]); |
| 48802 |
const StyleMapping = new Map([["page-break-after", "breakAfter"], ["page-break-before", "breakBefore"], ["page-break-inside", "breakInside"], ["kerning-mode", value => value === "none" ? "none" : "normal"], ["xfa-font-horizontal-scale", value => `scaleX(${Math.max(0, Math.min(parseInt(value) / 100)).toFixed(2)})`], ["xfa-font-vertical-scale", value => `scaleY(${Math.max(0, Math.min(parseInt(value) / 100)).toFixed(2)})`], ["xfa-spacerun", ""], ["xfa-tab-stops", ""], ["font-size", (value, original) => { |
| 48803 |
value = original.fontSize = getMeasurement(value); |
| 48804 |
return measureToString(0.99 * value); |
| 48805 |
}], ["letter-spacing", value => measureToString(getMeasurement(value))], ["line-height", value => measureToString(getMeasurement(value))], ["margin", value => measureToString(getMeasurement(value))], ["margin-bottom", value => measureToString(getMeasurement(value))], ["margin-left", value => measureToString(getMeasurement(value))], ["margin-right", value => measureToString(getMeasurement(value))], ["margin-top", value => measureToString(getMeasurement(value))], ["text-indent", value => measureToString(getMeasurement(value))], ["font-family", value => value], ["vertical-align", value => measureToString(getMeasurement(value))]]); |
| 48806 |
const spacesRegExp = /\s+/g; |
| 48807 |
const crlfRegExp = /[\r\n]+/g; |
| 48808 |
const crlfForRichTextRegExp = /\r\n?/g; |
| 48809 |
function mapStyle(styleStr, node, richText) { |
| 48810 |
const style = Object.create(null); |
| 48811 |
if (!styleStr) { |
| 48812 |
return style; |
| 48813 |
} |
| 48814 |
const original = Object.create(null); |
| 48815 |
for (const [key, value] of styleStr.split(";").map(s => s.split(":", 2))) { |
| 48816 |
const mapping = StyleMapping.get(key); |
| 48817 |
if (mapping === "") { |
| 48818 |
continue; |
| 48819 |
} |
| 48820 |
let newValue = value; |
| 48821 |
if (mapping) { |
| 48822 |
newValue = typeof mapping === "string" ? mapping : mapping(value, original); |
| 48823 |
} |
| 48824 |
if (key.endsWith("scale")) { |
| 48825 |
style.transform = style.transform ? `${style[key]} ${newValue}` : newValue; |
| 48826 |
} else { |
| 48827 |
style[key.replaceAll(/-([a-zA-Z])/g, (_, x) => x.toUpperCase())] = newValue; |
| 48828 |
} |
| 48829 |
} |
| 48830 |
if (style.fontFamily) { |
| 48831 |
setFontFamily({ |
| 48832 |
typeface: style.fontFamily, |
| 48833 |
weight: style.fontWeight || "normal", |
| 48834 |
posture: style.fontStyle || "normal", |
| 48835 |
size: original.fontSize || 0 |
| 48836 |
}, node, node[$globalData].fontFinder, style); |
| 48837 |
} |
| 48838 |
if (richText && style.verticalAlign && style.verticalAlign !== "0px" && style.fontSize) { |
| 48839 |
const SUB_SUPER_SCRIPT_FACTOR = 0.583; |
| 48840 |
const VERTICAL_FACTOR = 0.333; |
| 48841 |
const fontSize = getMeasurement(style.fontSize); |
| 48842 |
style.fontSize = measureToString(fontSize * SUB_SUPER_SCRIPT_FACTOR); |
| 48843 |
style.verticalAlign = measureToString(Math.sign(getMeasurement(style.verticalAlign)) * fontSize * VERTICAL_FACTOR); |
| 48844 |
} |
| 48845 |
if (richText && style.fontSize) { |
| 48846 |
style.fontSize = `calc(${style.fontSize} * var(--scale-factor))`; |
| 48847 |
} |
| 48848 |
fixTextIndent(style); |
| 48849 |
return style; |
| 48850 |
} |
| 48851 |
function checkStyle(node) { |
| 48852 |
if (!node.style) { |
| 48853 |
return ""; |
| 48854 |
} |
| 48855 |
return node.style.trim().split(/\s*;\s*/).filter(s => !!s).map(s => s.split(/\s*:\s*/, 2)).filter(([key, value]) => { |
| 48856 |
if (key === "font-family") { |
| 48857 |
node[$globalData].usedTypefaces.add(value); |
| 48858 |
} |
| 48859 |
return VALID_STYLES.has(key); |
| 48860 |
}).map(kv => kv.join(":")).join(";"); |
| 48861 |
} |
| 48862 |
const NoWhites = new Set(["body", "html"]); |
| 48863 |
class XhtmlObject extends XmlObject { |
| 48864 |
constructor(attributes, name) { |
| 48865 |
super(XHTML_NS_ID, name); |
| 48866 |
this[$richText] = false; |
| 48867 |
this.style = attributes.style || ""; |
| 48868 |
} |
| 48869 |
[$clean](builder) { |
| 48870 |
super[$clean](builder); |
| 48871 |
this.style = checkStyle(this); |
| 48872 |
} |
| 48873 |
[$acceptWhitespace]() { |
| 48874 |
return !NoWhites.has(this[$nodeName]); |
| 48875 |
} |
| 48876 |
[$onText](str, richText = false) { |
| 48877 |
if (!richText) { |
| 48878 |
str = str.replaceAll(crlfRegExp, ""); |
| 48879 |
if (!this.style.includes("xfa-spacerun:yes")) { |
| 48880 |
str = str.replaceAll(spacesRegExp, " "); |
| 48881 |
} |
| 48882 |
} else { |
| 48883 |
this[$richText] = true; |
| 48884 |
} |
| 48885 |
if (str) { |
| 48886 |
this[$content] += str; |
| 48887 |
} |
| 48888 |
} |
| 48889 |
[$pushGlyphs](measure, mustPop = true) { |
| 48890 |
const xfaFont = Object.create(null); |
| 48891 |
const margin = { |
| 48892 |
top: NaN, |
| 48893 |
bottom: NaN, |
| 48894 |
left: NaN, |
| 48895 |
right: NaN |
| 48896 |
}; |
| 48897 |
let lineHeight = null; |
| 48898 |
for (const [key, value] of this.style.split(";").map(s => s.split(":", 2))) { |
| 48899 |
switch (key) { |
| 48900 |
case "font-family": |
| 48901 |
xfaFont.typeface = stripQuotes(value); |
| 48902 |
break; |
| 48903 |
case "font-size": |
| 48904 |
xfaFont.size = getMeasurement(value); |
| 48905 |
break; |
| 48906 |
case "font-weight": |
| 48907 |
xfaFont.weight = value; |
| 48908 |
break; |
| 48909 |
case "font-style": |
| 48910 |
xfaFont.posture = value; |
| 48911 |
break; |
| 48912 |
case "letter-spacing": |
| 48913 |
xfaFont.letterSpacing = getMeasurement(value); |
| 48914 |
break; |
| 48915 |
case "margin": |
| 48916 |
const values = value.split(/ \t/).map(x => getMeasurement(x)); |
| 48917 |
switch (values.length) { |
| 48918 |
case 1: |
| 48919 |
margin.top = margin.bottom = margin.left = margin.right = values[0]; |
| 48920 |
break; |
| 48921 |
case 2: |
| 48922 |
margin.top = margin.bottom = values[0]; |
| 48923 |
margin.left = margin.right = values[1]; |
| 48924 |
break; |
| 48925 |
case 3: |
| 48926 |
margin.top = values[0]; |
| 48927 |
margin.bottom = values[2]; |
| 48928 |
margin.left = margin.right = values[1]; |
| 48929 |
break; |
| 48930 |
case 4: |
| 48931 |
margin.top = values[0]; |
| 48932 |
margin.left = values[1]; |
| 48933 |
margin.bottom = values[2]; |
| 48934 |
margin.right = values[3]; |
| 48935 |
break; |
| 48936 |
} |
| 48937 |
break; |
| 48938 |
case "margin-top": |
| 48939 |
margin.top = getMeasurement(value); |
| 48940 |
break; |
| 48941 |
case "margin-bottom": |
| 48942 |
margin.bottom = getMeasurement(value); |
| 48943 |
break; |
| 48944 |
case "margin-left": |
| 48945 |
margin.left = getMeasurement(value); |
| 48946 |
break; |
| 48947 |
case "margin-right": |
| 48948 |
margin.right = getMeasurement(value); |
| 48949 |
break; |
| 48950 |
case "line-height": |
| 48951 |
lineHeight = getMeasurement(value); |
| 48952 |
break; |
| 48953 |
} |
| 48954 |
} |
| 48955 |
measure.pushData(xfaFont, margin, lineHeight); |
| 48956 |
if (this[$content]) { |
| 48957 |
measure.addString(this[$content]); |
| 48958 |
} else { |
| 48959 |
for (const child of this[$getChildren]()) { |
| 48960 |
if (child[$nodeName] === "#text") { |
| 48961 |
measure.addString(child[$content]); |
| 48962 |
continue; |
| 48963 |
} |
| 48964 |
child[$pushGlyphs](measure); |
| 48965 |
} |
| 48966 |
} |
| 48967 |
if (mustPop) { |
| 48968 |
measure.popFont(); |
| 48969 |
} |
| 48970 |
} |
| 48971 |
[$toHTML](availableSpace) { |
| 48972 |
const children = []; |
| 48973 |
this[$extra] = { |
| 48974 |
children |
| 48975 |
}; |
| 48976 |
this[$childrenToHTML]({}); |
| 48977 |
if (children.length === 0 && !this[$content]) { |
| 48978 |
return HTMLResult.EMPTY; |
| 48979 |
} |
| 48980 |
let value; |
| 48981 |
if (this[$richText]) { |
| 48982 |
value = this[$content] ? this[$content].replaceAll(crlfForRichTextRegExp, "\n") : undefined; |
| 48983 |
} else { |
| 48984 |
value = this[$content] || undefined; |
| 48985 |
} |
| 48986 |
return HTMLResult.success({ |
| 48987 |
name: this[$nodeName], |
| 48988 |
attributes: { |
| 48989 |
href: this.href, |
| 48990 |
style: mapStyle(this.style, this, this[$richText]) |
| 48991 |
}, |
| 48992 |
children, |
| 48993 |
value |
| 48994 |
}); |
| 48995 |
} |
| 48996 |
} |
| 48997 |
class A extends XhtmlObject { |
| 48998 |
constructor(attributes) { |
| 48999 |
super(attributes, "a"); |
| 49000 |
this.href = fixURL(attributes.href) || ""; |
| 49001 |
} |
| 49002 |
} |
| 49003 |
class B extends XhtmlObject { |
| 49004 |
constructor(attributes) { |
| 49005 |
super(attributes, "b"); |
| 49006 |
} |
| 49007 |
[$pushGlyphs](measure) { |
| 49008 |
measure.pushFont({ |
| 49009 |
weight: "bold" |
| 49010 |
}); |
| 49011 |
super[$pushGlyphs](measure); |
| 49012 |
measure.popFont(); |
| 49013 |
} |
| 49014 |
} |
| 49015 |
class Body extends XhtmlObject { |
| 49016 |
constructor(attributes) { |
| 49017 |
super(attributes, "body"); |
| 49018 |
} |
| 49019 |
[$toHTML](availableSpace) { |
| 49020 |
const res = super[$toHTML](availableSpace); |
| 49021 |
const { |
| 49022 |
html |
| 49023 |
} = res; |
| 49024 |
if (!html) { |
| 49025 |
return HTMLResult.EMPTY; |
| 49026 |
} |
| 49027 |
html.name = "div"; |
| 49028 |
html.attributes.class = ["xfaRich"]; |
| 49029 |
return res; |
| 49030 |
} |
| 49031 |
} |
| 49032 |
class Br extends XhtmlObject { |
| 49033 |
constructor(attributes) { |
| 49034 |
super(attributes, "br"); |
| 49035 |
} |
| 49036 |
[$text]() { |
| 49037 |
return "\n"; |
| 49038 |
} |
| 49039 |
[$pushGlyphs](measure) { |
| 49040 |
measure.addString("\n"); |
| 49041 |
} |
| 49042 |
[$toHTML](availableSpace) { |
| 49043 |
return HTMLResult.success({ |
| 49044 |
name: "br" |
| 49045 |
}); |
| 49046 |
} |
| 49047 |
} |
| 49048 |
class Html extends XhtmlObject { |
| 49049 |
constructor(attributes) { |
| 49050 |
super(attributes, "html"); |
| 49051 |
} |
| 49052 |
[$toHTML](availableSpace) { |
| 49053 |
const children = []; |
| 49054 |
this[$extra] = { |
| 49055 |
children |
| 49056 |
}; |
| 49057 |
this[$childrenToHTML]({}); |
| 49058 |
if (children.length === 0) { |
| 49059 |
return HTMLResult.success({ |
| 49060 |
name: "div", |
| 49061 |
attributes: { |
| 49062 |
class: ["xfaRich"], |
| 49063 |
style: {} |
| 49064 |
}, |
| 49065 |
value: this[$content] || "" |
| 49066 |
}); |
| 49067 |
} |
| 49068 |
if (children.length === 1) { |
| 49069 |
const child = children[0]; |
| 49070 |
if (child.attributes?.class.includes("xfaRich")) { |
| 49071 |
return HTMLResult.success(child); |
| 49072 |
} |
| 49073 |
} |
| 49074 |
return HTMLResult.success({ |
| 49075 |
name: "div", |
| 49076 |
attributes: { |
| 49077 |
class: ["xfaRich"], |
| 49078 |
style: {} |
| 49079 |
}, |
| 49080 |
children |
| 49081 |
}); |
| 49082 |
} |
| 49083 |
} |
| 49084 |
class I extends XhtmlObject { |
| 49085 |
constructor(attributes) { |
| 49086 |
super(attributes, "i"); |
| 49087 |
} |
| 49088 |
[$pushGlyphs](measure) { |
| 49089 |
measure.pushFont({ |
| 49090 |
posture: "italic" |
| 49091 |
}); |
| 49092 |
super[$pushGlyphs](measure); |
| 49093 |
measure.popFont(); |
| 49094 |
} |
| 49095 |
} |
| 49096 |
class Li extends XhtmlObject { |
| 49097 |
constructor(attributes) { |
| 49098 |
super(attributes, "li"); |
| 49099 |
} |
| 49100 |
} |
| 49101 |
class Ol extends XhtmlObject { |
| 49102 |
constructor(attributes) { |
| 49103 |
super(attributes, "ol"); |
| 49104 |
} |
| 49105 |
} |
| 49106 |
class P extends XhtmlObject { |
| 49107 |
constructor(attributes) { |
| 49108 |
super(attributes, "p"); |
| 49109 |
} |
| 49110 |
[$pushGlyphs](measure) { |
| 49111 |
super[$pushGlyphs](measure, false); |
| 49112 |
measure.addString("\n"); |
| 49113 |
measure.addPara(); |
| 49114 |
measure.popFont(); |
| 49115 |
} |
| 49116 |
[$text]() { |
| 49117 |
const siblings = this[$getParent]()[$getChildren](); |
| 49118 |
if (siblings.at(-1) === this) { |
| 49119 |
return super[$text](); |
| 49120 |
} |
| 49121 |
return super[$text]() + "\n"; |
| 49122 |
} |
| 49123 |
} |
| 49124 |
class Span extends XhtmlObject { |
| 49125 |
constructor(attributes) { |
| 49126 |
super(attributes, "span"); |
| 49127 |
} |
| 49128 |
} |
| 49129 |
class Sub extends XhtmlObject { |
| 49130 |
constructor(attributes) { |
| 49131 |
super(attributes, "sub"); |
| 49132 |
} |
| 49133 |
} |
| 49134 |
class Sup extends XhtmlObject { |
| 49135 |
constructor(attributes) { |
| 49136 |
super(attributes, "sup"); |
| 49137 |
} |
| 49138 |
} |
| 49139 |
class Ul extends XhtmlObject { |
| 49140 |
constructor(attributes) { |
| 49141 |
super(attributes, "ul"); |
| 49142 |
} |
| 49143 |
} |
| 49144 |
class XhtmlNamespace { |
| 49145 |
static [$buildXFAObject](name, attributes) { |
| 49146 |
if (XhtmlNamespace.hasOwnProperty(name)) { |
| 49147 |
return XhtmlNamespace[name](attributes); |
| 49148 |
} |
| 49149 |
return undefined; |
| 49150 |
} |
| 49151 |
static a(attributes) { |
| 49152 |
return new A(attributes); |
| 49153 |
} |
| 49154 |
static b(attributes) { |
| 49155 |
return new B(attributes); |
| 49156 |
} |
| 49157 |
static body(attributes) { |
| 49158 |
return new Body(attributes); |
| 49159 |
} |
| 49160 |
static br(attributes) { |
| 49161 |
return new Br(attributes); |
| 49162 |
} |
| 49163 |
static html(attributes) { |
| 49164 |
return new Html(attributes); |
| 49165 |
} |
| 49166 |
static i(attributes) { |
| 49167 |
return new I(attributes); |
| 49168 |
} |
| 49169 |
static li(attributes) { |
| 49170 |
return new Li(attributes); |
| 49171 |
} |
| 49172 |
static ol(attributes) { |
| 49173 |
return new Ol(attributes); |
| 49174 |
} |
| 49175 |
static p(attributes) { |
| 49176 |
return new P(attributes); |
| 49177 |
} |
| 49178 |
static span(attributes) { |
| 49179 |
return new Span(attributes); |
| 49180 |
} |
| 49181 |
static sub(attributes) { |
| 49182 |
return new Sub(attributes); |
| 49183 |
} |
| 49184 |
static sup(attributes) { |
| 49185 |
return new Sup(attributes); |
| 49186 |
} |
| 49187 |
static ul(attributes) { |
| 49188 |
return new Ul(attributes); |
| 49189 |
} |
| 49190 |
} |
| 49191 |
|
| 49192 |
;// ./src/core/xfa/setup.js |
| 49193 |
|
| 49194 |
|
| 49195 |
|
| 49196 |
|
| 49197 |
|
| 49198 |
|
| 49199 |
|
| 49200 |
|
| 49201 |
|
| 49202 |
const NamespaceSetUp = { |
| 49203 |
config: ConfigNamespace, |
| 49204 |
connection: ConnectionSetNamespace, |
| 49205 |
datasets: DatasetsNamespace, |
| 49206 |
localeSet: LocaleSetNamespace, |
| 49207 |
signature: SignatureNamespace, |
| 49208 |
stylesheet: StylesheetNamespace, |
| 49209 |
template: TemplateNamespace, |
| 49210 |
xdp: XdpNamespace, |
| 49211 |
xhtml: XhtmlNamespace |
| 49212 |
}; |
| 49213 |
|
| 49214 |
;// ./src/core/xfa/unknown.js |
| 49215 |
|
| 49216 |
|
| 49217 |
class UnknownNamespace { |
| 49218 |
constructor(nsId) { |
| 49219 |
this.namespaceId = nsId; |
| 49220 |
} |
| 49221 |
[$buildXFAObject](name, attributes) { |
| 49222 |
return new XmlObject(this.namespaceId, name, attributes); |
| 49223 |
} |
| 49224 |
} |
| 49225 |
|
| 49226 |
;// ./src/core/xfa/builder.js |
| 49227 |
|
| 49228 |
|
| 49229 |
|
| 49230 |
|
| 49231 |
|
| 49232 |
|
| 49233 |
|
| 49234 |
class Root extends XFAObject { |
| 49235 |
constructor(ids) { |
| 49236 |
super(-1, "root", Object.create(null)); |
| 49237 |
this.element = null; |
| 49238 |
this[$ids] = ids; |
| 49239 |
} |
| 49240 |
[$onChild](child) { |
| 49241 |
this.element = child; |
| 49242 |
return true; |
| 49243 |
} |
| 49244 |
[$finalize]() { |
| 49245 |
super[$finalize](); |
| 49246 |
if (this.element.template instanceof Template) { |
| 49247 |
this[$ids].set($root, this.element); |
| 49248 |
this.element.template[$resolvePrototypes](this[$ids]); |
| 49249 |
this.element.template[$ids] = this[$ids]; |
| 49250 |
} |
| 49251 |
} |
| 49252 |
} |
| 49253 |
class Empty extends XFAObject { |
| 49254 |
constructor() { |
| 49255 |
super(-1, "", Object.create(null)); |
| 49256 |
} |
| 49257 |
[$onChild](_) { |
| 49258 |
return false; |
| 49259 |
} |
| 49260 |
} |
| 49261 |
class Builder { |
| 49262 |
constructor(rootNameSpace = null) { |
| 49263 |
this._namespaceStack = []; |
| 49264 |
this._nsAgnosticLevel = 0; |
| 49265 |
this._namespacePrefixes = new Map(); |
| 49266 |
this._namespaces = new Map(); |
| 49267 |
this._nextNsId = Math.max(...Object.values(NamespaceIds).map(({ |
| 49268 |
id |
| 49269 |
}) => id)); |
| 49270 |
this._currentNamespace = rootNameSpace || new UnknownNamespace(++this._nextNsId); |
| 49271 |
} |
| 49272 |
buildRoot(ids) { |
| 49273 |
return new Root(ids); |
| 49274 |
} |
| 49275 |
build({ |
| 49276 |
nsPrefix, |
| 49277 |
name, |
| 49278 |
attributes, |
| 49279 |
namespace, |
| 49280 |
prefixes |
| 49281 |
}) { |
| 49282 |
const hasNamespaceDef = namespace !== null; |
| 49283 |
if (hasNamespaceDef) { |
| 49284 |
this._namespaceStack.push(this._currentNamespace); |
| 49285 |
this._currentNamespace = this._searchNamespace(namespace); |
| 49286 |
} |
| 49287 |
if (prefixes) { |
| 49288 |
this._addNamespacePrefix(prefixes); |
| 49289 |
} |
| 49290 |
if (attributes.hasOwnProperty($nsAttributes)) { |
| 49291 |
const dataTemplate = NamespaceSetUp.datasets; |
| 49292 |
const nsAttrs = attributes[$nsAttributes]; |
| 49293 |
let xfaAttrs = null; |
| 49294 |
for (const [ns, attrs] of Object.entries(nsAttrs)) { |
| 49295 |
const nsToUse = this._getNamespaceToUse(ns); |
| 49296 |
if (nsToUse === dataTemplate) { |
| 49297 |
xfaAttrs = { |
| 49298 |
xfa: attrs |
| 49299 |
}; |
| 49300 |
break; |
| 49301 |
} |
| 49302 |
} |
| 49303 |
if (xfaAttrs) { |
| 49304 |
attributes[$nsAttributes] = xfaAttrs; |
| 49305 |
} else { |
| 49306 |
delete attributes[$nsAttributes]; |
| 49307 |
} |
| 49308 |
} |
| 49309 |
const namespaceToUse = this._getNamespaceToUse(nsPrefix); |
| 49310 |
const node = namespaceToUse?.[$buildXFAObject](name, attributes) || new Empty(); |
| 49311 |
if (node[$isNsAgnostic]()) { |
| 49312 |
this._nsAgnosticLevel++; |
| 49313 |
} |
| 49314 |
if (hasNamespaceDef || prefixes || node[$isNsAgnostic]()) { |
| 49315 |
node[$cleanup] = { |
| 49316 |
hasNamespace: hasNamespaceDef, |
| 49317 |
prefixes, |
| 49318 |
nsAgnostic: node[$isNsAgnostic]() |
| 49319 |
}; |
| 49320 |
} |
| 49321 |
return node; |
| 49322 |
} |
| 49323 |
isNsAgnostic() { |
| 49324 |
return this._nsAgnosticLevel > 0; |
| 49325 |
} |
| 49326 |
_searchNamespace(nsName) { |
| 49327 |
let ns = this._namespaces.get(nsName); |
| 49328 |
if (ns) { |
| 49329 |
return ns; |
| 49330 |
} |
| 49331 |
for (const [name, { |
| 49332 |
check |
| 49333 |
}] of Object.entries(NamespaceIds)) { |
| 49334 |
if (check(nsName)) { |
| 49335 |
ns = NamespaceSetUp[name]; |
| 49336 |
if (ns) { |
| 49337 |
this._namespaces.set(nsName, ns); |
| 49338 |
return ns; |
| 49339 |
} |
| 49340 |
break; |
| 49341 |
} |
| 49342 |
} |
| 49343 |
ns = new UnknownNamespace(++this._nextNsId); |
| 49344 |
this._namespaces.set(nsName, ns); |
| 49345 |
return ns; |
| 49346 |
} |
| 49347 |
_addNamespacePrefix(prefixes) { |
| 49348 |
for (const { |
| 49349 |
prefix, |
| 49350 |
value |
| 49351 |
} of prefixes) { |
| 49352 |
const namespace = this._searchNamespace(value); |
| 49353 |
let prefixStack = this._namespacePrefixes.get(prefix); |
| 49354 |
if (!prefixStack) { |
| 49355 |
prefixStack = []; |
| 49356 |
this._namespacePrefixes.set(prefix, prefixStack); |
| 49357 |
} |
| 49358 |
prefixStack.push(namespace); |
| 49359 |
} |
| 49360 |
} |
| 49361 |
_getNamespaceToUse(prefix) { |
| 49362 |
if (!prefix) { |
| 49363 |
return this._currentNamespace; |
| 49364 |
} |
| 49365 |
const prefixStack = this._namespacePrefixes.get(prefix); |
| 49366 |
if (prefixStack?.length > 0) { |
| 49367 |
return prefixStack.at(-1); |
| 49368 |
} |
| 49369 |
warn(`Unknown namespace prefix: ${prefix}.`); |
| 49370 |
return null; |
| 49371 |
} |
| 49372 |
clean(data) { |
| 49373 |
const { |
| 49374 |
hasNamespace, |
| 49375 |
prefixes, |
| 49376 |
nsAgnostic |
| 49377 |
} = data; |
| 49378 |
if (hasNamespace) { |
| 49379 |
this._currentNamespace = this._namespaceStack.pop(); |
| 49380 |
} |
| 49381 |
if (prefixes) { |
| 49382 |
prefixes.forEach(({ |
| 49383 |
prefix |
| 49384 |
}) => { |
| 49385 |
this._namespacePrefixes.get(prefix).pop(); |
| 49386 |
}); |
| 49387 |
} |
| 49388 |
if (nsAgnostic) { |
| 49389 |
this._nsAgnosticLevel--; |
| 49390 |
} |
| 49391 |
} |
| 49392 |
} |
| 49393 |
|
| 49394 |
;// ./src/core/xfa/parser.js |
| 49395 |
|
| 49396 |
|
| 49397 |
|
| 49398 |
|
| 49399 |
class XFAParser extends XMLParserBase { |
| 49400 |
constructor(rootNameSpace = null, richText = false) { |
| 49401 |
super(); |
| 49402 |
this._builder = new Builder(rootNameSpace); |
| 49403 |
this._stack = []; |
| 49404 |
this._globalData = { |
| 49405 |
usedTypefaces: new Set() |
| 49406 |
}; |
| 49407 |
this._ids = new Map(); |
| 49408 |
this._current = this._builder.buildRoot(this._ids); |
| 49409 |
this._errorCode = XMLParserErrorCode.NoError; |
| 49410 |
this._whiteRegex = /^\s+$/; |
| 49411 |
this._nbsps = /\xa0+/g; |
| 49412 |
this._richText = richText; |
| 49413 |
} |
| 49414 |
parse(data) { |
| 49415 |
this.parseXml(data); |
| 49416 |
if (this._errorCode !== XMLParserErrorCode.NoError) { |
| 49417 |
return undefined; |
| 49418 |
} |
| 49419 |
this._current[$finalize](); |
| 49420 |
return this._current.element; |
| 49421 |
} |
| 49422 |
onText(text) { |
| 49423 |
text = text.replace(this._nbsps, match => match.slice(1) + " "); |
| 49424 |
if (this._richText || this._current[$acceptWhitespace]()) { |
| 49425 |
this._current[$onText](text, this._richText); |
| 49426 |
return; |
| 49427 |
} |
| 49428 |
if (this._whiteRegex.test(text)) { |
| 49429 |
return; |
| 49430 |
} |
| 49431 |
this._current[$onText](text.trim()); |
| 49432 |
} |
| 49433 |
onCdata(text) { |
| 49434 |
this._current[$onText](text); |
| 49435 |
} |
| 49436 |
_mkAttributes(attributes, tagName) { |
| 49437 |
let namespace = null; |
| 49438 |
let prefixes = null; |
| 49439 |
const attributeObj = Object.create({}); |
| 49440 |
for (const { |
| 49441 |
name, |
| 49442 |
value |
| 49443 |
} of attributes) { |
| 49444 |
if (name === "xmlns") { |
| 49445 |
if (!namespace) { |
| 49446 |
namespace = value; |
| 49447 |
} else { |
| 49448 |
warn(`XFA - multiple namespace definition in <${tagName}>`); |
| 49449 |
} |
| 49450 |
} else if (name.startsWith("xmlns:")) { |
| 49451 |
const prefix = name.substring("xmlns:".length); |
| 49452 |
if (!prefixes) { |
| 49453 |
prefixes = []; |
| 49454 |
} |
| 49455 |
prefixes.push({ |
| 49456 |
prefix, |
| 49457 |
value |
| 49458 |
}); |
| 49459 |
} else { |
| 49460 |
const i = name.indexOf(":"); |
| 49461 |
if (i === -1) { |
| 49462 |
attributeObj[name] = value; |
| 49463 |
} else { |
| 49464 |
let nsAttrs = attributeObj[$nsAttributes]; |
| 49465 |
if (!nsAttrs) { |
| 49466 |
nsAttrs = attributeObj[$nsAttributes] = Object.create(null); |
| 49467 |
} |
| 49468 |
const [ns, attrName] = [name.slice(0, i), name.slice(i + 1)]; |
| 49469 |
const attrs = nsAttrs[ns] ||= Object.create(null); |
| 49470 |
attrs[attrName] = value; |
| 49471 |
} |
| 49472 |
} |
| 49473 |
} |
| 49474 |
return [namespace, prefixes, attributeObj]; |
| 49475 |
} |
| 49476 |
_getNameAndPrefix(name, nsAgnostic) { |
| 49477 |
const i = name.indexOf(":"); |
| 49478 |
if (i === -1) { |
| 49479 |
return [name, null]; |
| 49480 |
} |
| 49481 |
return [name.substring(i + 1), nsAgnostic ? "" : name.substring(0, i)]; |
| 49482 |
} |
| 49483 |
onBeginElement(tagName, attributes, isEmpty) { |
| 49484 |
const [namespace, prefixes, attributesObj] = this._mkAttributes(attributes, tagName); |
| 49485 |
const [name, nsPrefix] = this._getNameAndPrefix(tagName, this._builder.isNsAgnostic()); |
| 49486 |
const node = this._builder.build({ |
| 49487 |
nsPrefix, |
| 49488 |
name, |
| 49489 |
attributes: attributesObj, |
| 49490 |
namespace, |
| 49491 |
prefixes |
| 49492 |
}); |
| 49493 |
node[$globalData] = this._globalData; |
| 49494 |
if (isEmpty) { |
| 49495 |
node[$finalize](); |
| 49496 |
if (this._current[$onChild](node)) { |
| 49497 |
node[$setId](this._ids); |
| 49498 |
} |
| 49499 |
node[$clean](this._builder); |
| 49500 |
return; |
| 49501 |
} |
| 49502 |
this._stack.push(this._current); |
| 49503 |
this._current = node; |
| 49504 |
} |
| 49505 |
onEndElement(name) { |
| 49506 |
const node = this._current; |
| 49507 |
if (node[$isCDATAXml]() && typeof node[$content] === "string") { |
| 49508 |
const parser = new XFAParser(); |
| 49509 |
parser._globalData = this._globalData; |
| 49510 |
const root = parser.parse(node[$content]); |
| 49511 |
node[$content] = null; |
| 49512 |
node[$onChild](root); |
| 49513 |
} |
| 49514 |
node[$finalize](); |
| 49515 |
this._current = this._stack.pop(); |
| 49516 |
if (this._current[$onChild](node)) { |
| 49517 |
node[$setId](this._ids); |
| 49518 |
} |
| 49519 |
node[$clean](this._builder); |
| 49520 |
} |
| 49521 |
onError(code) { |
| 49522 |
this._errorCode = code; |
| 49523 |
} |
| 49524 |
} |
| 49525 |
|
| 49526 |
;// ./src/core/xfa/factory.js |
| 49527 |
|
| 49528 |
|
| 49529 |
|
| 49530 |
|
| 49531 |
|
| 49532 |
|
| 49533 |
|
| 49534 |
|
| 49535 |
class XFAFactory { |
| 49536 |
constructor(data) { |
| 49537 |
try { |
| 49538 |
this.root = new XFAParser().parse(XFAFactory._createDocument(data)); |
| 49539 |
const binder = new Binder(this.root); |
| 49540 |
this.form = binder.bind(); |
| 49541 |
this.dataHandler = new DataHandler(this.root, binder.getData()); |
| 49542 |
this.form[$globalData].template = this.form; |
| 49543 |
} catch (e) { |
| 49544 |
warn(`XFA - an error occurred during parsing and binding: ${e}`); |
| 49545 |
} |
| 49546 |
} |
| 49547 |
isValid() { |
| 49548 |
return this.root && this.form; |
| 49549 |
} |
| 49550 |
_createPagesHelper() { |
| 49551 |
const iterator = this.form[$toPages](); |
| 49552 |
return new Promise((resolve, reject) => { |
| 49553 |
const nextIteration = () => { |
| 49554 |
try { |
| 49555 |
const value = iterator.next(); |
| 49556 |
if (value.done) { |
| 49557 |
resolve(value.value); |
| 49558 |
} else { |
| 49559 |
setTimeout(nextIteration, 0); |
| 49560 |
} |
| 49561 |
} catch (e) { |
| 49562 |
reject(e); |
| 49563 |
} |
| 49564 |
}; |
| 49565 |
setTimeout(nextIteration, 0); |
| 49566 |
}); |
| 49567 |
} |
| 49568 |
async _createPages() { |
| 49569 |
try { |
| 49570 |
this.pages = await this._createPagesHelper(); |
| 49571 |
this.dims = this.pages.children.map(c => { |
| 49572 |
const { |
| 49573 |
width, |
| 49574 |
height |
| 49575 |
} = c.attributes.style; |
| 49576 |
return [0, 0, parseInt(width), parseInt(height)]; |
| 49577 |
}); |
| 49578 |
} catch (e) { |
| 49579 |
warn(`XFA - an error occurred during layout: ${e}`); |
| 49580 |
} |
| 49581 |
} |
| 49582 |
getBoundingBox(pageIndex) { |
| 49583 |
return this.dims[pageIndex]; |
| 49584 |
} |
| 49585 |
async getNumPages() { |
| 49586 |
if (!this.pages) { |
| 49587 |
await this._createPages(); |
| 49588 |
} |
| 49589 |
return this.dims.length; |
| 49590 |
} |
| 49591 |
setImages(images) { |
| 49592 |
this.form[$globalData].images = images; |
| 49593 |
} |
| 49594 |
setFonts(fonts) { |
| 49595 |
this.form[$globalData].fontFinder = new FontFinder(fonts); |
| 49596 |
const missingFonts = []; |
| 49597 |
for (let typeface of this.form[$globalData].usedTypefaces) { |
| 49598 |
typeface = stripQuotes(typeface); |
| 49599 |
const font = this.form[$globalData].fontFinder.find(typeface); |
| 49600 |
if (!font) { |
| 49601 |
missingFonts.push(typeface); |
| 49602 |
} |
| 49603 |
} |
| 49604 |
if (missingFonts.length > 0) { |
| 49605 |
return missingFonts; |
| 49606 |
} |
| 49607 |
return null; |
| 49608 |
} |
| 49609 |
appendFonts(fonts, reallyMissingFonts) { |
| 49610 |
this.form[$globalData].fontFinder.add(fonts, reallyMissingFonts); |
| 49611 |
} |
| 49612 |
async getPages() { |
| 49613 |
if (!this.pages) { |
| 49614 |
await this._createPages(); |
| 49615 |
} |
| 49616 |
const pages = this.pages; |
| 49617 |
this.pages = null; |
| 49618 |
return pages; |
| 49619 |
} |
| 49620 |
serializeData(storage) { |
| 49621 |
return this.dataHandler.serialize(storage); |
| 49622 |
} |
| 49623 |
static _createDocument(data) { |
| 49624 |
if (!data["/xdp:xdp"]) { |
| 49625 |
return data["xdp:xdp"]; |
| 49626 |
} |
| 49627 |
return Object.values(data).join(""); |
| 49628 |
} |
| 49629 |
static getRichTextAsHtml(rc) { |
| 49630 |
if (!rc || typeof rc !== "string") { |
| 49631 |
return null; |
| 49632 |
} |
| 49633 |
try { |
| 49634 |
let root = new XFAParser(XhtmlNamespace, true).parse(rc); |
| 49635 |
if (!["body", "xhtml"].includes(root[$nodeName])) { |
| 49636 |
const newRoot = XhtmlNamespace.body({}); |
| 49637 |
newRoot[$appendChild](root); |
| 49638 |
root = newRoot; |
| 49639 |
} |
| 49640 |
const result = root[$toHTML](); |
| 49641 |
if (!result.success) { |
| 49642 |
return null; |
| 49643 |
} |
| 49644 |
const { |
| 49645 |
html |
| 49646 |
} = result; |
| 49647 |
const { |
| 49648 |
attributes |
| 49649 |
} = html; |
| 49650 |
if (attributes) { |
| 49651 |
if (attributes.class) { |
| 49652 |
attributes.class = attributes.class.filter(attr => !attr.startsWith("xfa")); |
| 49653 |
} |
| 49654 |
attributes.dir = "auto"; |
| 49655 |
} |
| 49656 |
return { |
| 49657 |
html, |
| 49658 |
str: root[$text]() |
| 49659 |
}; |
| 49660 |
} catch (e) { |
| 49661 |
warn(`XFA - an error occurred during parsing of rich text: ${e}`); |
| 49662 |
} |
| 49663 |
return null; |
| 49664 |
} |
| 49665 |
} |
| 49666 |
|
| 49667 |
;// ./src/core/annotation.js |
| 49668 |
|
| 49669 |
|
| 49670 |
|
| 49671 |
|
| 49672 |
|
| 49673 |
|
| 49674 |
|
| 49675 |
|
| 49676 |
|
| 49677 |
|
| 49678 |
|
| 49679 |
|
| 49680 |
|
| 49681 |
|
| 49682 |
|
| 49683 |
class AnnotationFactory { |
| 49684 |
static createGlobals(pdfManager) { |
| 49685 |
return Promise.all([pdfManager.ensureCatalog("acroForm"), pdfManager.ensureDoc("xfaDatasets"), pdfManager.ensureCatalog("structTreeRoot"), pdfManager.ensureCatalog("baseUrl"), pdfManager.ensureCatalog("attachments")]).then(([acroForm, xfaDatasets, structTreeRoot, baseUrl, attachments]) => { |
| 49686 |
return { |
| 49687 |
pdfManager, |
| 49688 |
acroForm: acroForm instanceof Dict ? acroForm : Dict.empty, |
| 49689 |
xfaDatasets, |
| 49690 |
structTreeRoot, |
| 49691 |
baseUrl, |
| 49692 |
attachments |
| 49693 |
}; |
| 49694 |
}, reason => { |
| 49695 |
warn(`createGlobals: "${reason}".`); |
| 49696 |
return null; |
| 49697 |
}); |
| 49698 |
} |
| 49699 |
static async create(xref, ref, annotationGlobals, idFactory, collectFields, orphanFields, pageRef) { |
| 49700 |
const pageIndex = collectFields ? await this._getPageIndex(xref, ref, annotationGlobals.pdfManager) : null; |
| 49701 |
return annotationGlobals.pdfManager.ensure(this, "_create", [xref, ref, annotationGlobals, idFactory, collectFields, orphanFields, pageIndex, pageRef]); |
| 49702 |
} |
| 49703 |
static _create(xref, ref, annotationGlobals, idFactory, collectFields = false, orphanFields = null, pageIndex = null, pageRef = null) { |
| 49704 |
const dict = xref.fetchIfRef(ref); |
| 49705 |
if (!(dict instanceof Dict)) { |
| 49706 |
return undefined; |
| 49707 |
} |
| 49708 |
const { |
| 49709 |
acroForm, |
| 49710 |
pdfManager |
| 49711 |
} = annotationGlobals; |
| 49712 |
const id = ref instanceof Ref ? ref.toString() : `annot_${idFactory.createObjId()}`; |
| 49713 |
let subtype = dict.get("Subtype"); |
| 49714 |
subtype = subtype instanceof Name ? subtype.name : null; |
| 49715 |
const parameters = { |
| 49716 |
xref, |
| 49717 |
ref, |
| 49718 |
dict, |
| 49719 |
subtype, |
| 49720 |
id, |
| 49721 |
annotationGlobals, |
| 49722 |
collectFields, |
| 49723 |
orphanFields, |
| 49724 |
needAppearances: !collectFields && acroForm.get("NeedAppearances") === true, |
| 49725 |
pageIndex, |
| 49726 |
evaluatorOptions: pdfManager.evaluatorOptions, |
| 49727 |
pageRef |
| 49728 |
}; |
| 49729 |
switch (subtype) { |
| 49730 |
case "Link": |
| 49731 |
return new LinkAnnotation(parameters); |
| 49732 |
case "Text": |
| 49733 |
return new TextAnnotation(parameters); |
| 49734 |
case "Widget": |
| 49735 |
let fieldType = getInheritableProperty({ |
| 49736 |
dict, |
| 49737 |
key: "FT" |
| 49738 |
}); |
| 49739 |
fieldType = fieldType instanceof Name ? fieldType.name : null; |
| 49740 |
switch (fieldType) { |
| 49741 |
case "Tx": |
| 49742 |
return new TextWidgetAnnotation(parameters); |
| 49743 |
case "Btn": |
| 49744 |
return new ButtonWidgetAnnotation(parameters); |
| 49745 |
case "Ch": |
| 49746 |
return new ChoiceWidgetAnnotation(parameters); |
| 49747 |
case "Sig": |
| 49748 |
return new SignatureWidgetAnnotation(parameters); |
| 49749 |
} |
| 49750 |
warn(`Unimplemented widget field type "${fieldType}", ` + "falling back to base field type."); |
| 49751 |
return new WidgetAnnotation(parameters); |
| 49752 |
case "Popup": |
| 49753 |
return new PopupAnnotation(parameters); |
| 49754 |
case "FreeText": |
| 49755 |
return new FreeTextAnnotation(parameters); |
| 49756 |
case "Line": |
| 49757 |
return new LineAnnotation(parameters); |
| 49758 |
case "Square": |
| 49759 |
return new SquareAnnotation(parameters); |
| 49760 |
case "Circle": |
| 49761 |
return new CircleAnnotation(parameters); |
| 49762 |
case "PolyLine": |
| 49763 |
return new PolylineAnnotation(parameters); |
| 49764 |
case "Polygon": |
| 49765 |
return new PolygonAnnotation(parameters); |
| 49766 |
case "Caret": |
| 49767 |
return new CaretAnnotation(parameters); |
| 49768 |
case "Ink": |
| 49769 |
return new InkAnnotation(parameters); |
| 49770 |
case "Highlight": |
| 49771 |
return new HighlightAnnotation(parameters); |
| 49772 |
case "Underline": |
| 49773 |
return new UnderlineAnnotation(parameters); |
| 49774 |
case "Squiggly": |
| 49775 |
return new SquigglyAnnotation(parameters); |
| 49776 |
case "StrikeOut": |
| 49777 |
return new StrikeOutAnnotation(parameters); |
| 49778 |
case "Stamp": |
| 49779 |
return new StampAnnotation(parameters); |
| 49780 |
case "FileAttachment": |
| 49781 |
return new FileAttachmentAnnotation(parameters); |
| 49782 |
default: |
| 49783 |
if (!collectFields) { |
| 49784 |
if (!subtype) { |
| 49785 |
warn("Annotation is missing the required /Subtype."); |
| 49786 |
} else { |
| 49787 |
warn(`Unimplemented annotation type "${subtype}", ` + "falling back to base annotation."); |
| 49788 |
} |
| 49789 |
} |
| 49790 |
return new Annotation(parameters); |
| 49791 |
} |
| 49792 |
} |
| 49793 |
static async _getPageIndex(xref, ref, pdfManager) { |
| 49794 |
try { |
| 49795 |
const annotDict = await xref.fetchIfRefAsync(ref); |
| 49796 |
if (!(annotDict instanceof Dict)) { |
| 49797 |
return -1; |
| 49798 |
} |
| 49799 |
const pageRef = annotDict.getRaw("P"); |
| 49800 |
if (pageRef instanceof Ref) { |
| 49801 |
try { |
| 49802 |
const pageIndex = await pdfManager.ensureCatalog("getPageIndex", [pageRef]); |
| 49803 |
return pageIndex; |
| 49804 |
} catch (ex) { |
| 49805 |
info(`_getPageIndex -- not a valid page reference: "${ex}".`); |
| 49806 |
} |
| 49807 |
} |
| 49808 |
if (annotDict.has("Kids")) { |
| 49809 |
return -1; |
| 49810 |
} |
| 49811 |
const numPages = await pdfManager.ensureDoc("numPages"); |
| 49812 |
for (let pageIndex = 0; pageIndex < numPages; pageIndex++) { |
| 49813 |
const page = await pdfManager.getPage(pageIndex); |
| 49814 |
const annotations = await pdfManager.ensure(page, "annotations"); |
| 49815 |
for (const annotRef of annotations) { |
| 49816 |
if (annotRef instanceof Ref && isRefsEqual(annotRef, ref)) { |
| 49817 |
return pageIndex; |
| 49818 |
} |
| 49819 |
} |
| 49820 |
} |
| 49821 |
} catch (ex) { |
| 49822 |
warn(`_getPageIndex: "${ex}".`); |
| 49823 |
} |
| 49824 |
return -1; |
| 49825 |
} |
| 49826 |
static generateImages(annotations, xref, isOffscreenCanvasSupported) { |
| 49827 |
if (!isOffscreenCanvasSupported) { |
| 49828 |
warn("generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images."); |
| 49829 |
return null; |
| 49830 |
} |
| 49831 |
let imagePromises; |
| 49832 |
for (const { |
| 49833 |
bitmapId, |
| 49834 |
bitmap |
| 49835 |
} of annotations) { |
| 49836 |
if (!bitmap) { |
| 49837 |
continue; |
| 49838 |
} |
| 49839 |
imagePromises ||= new Map(); |
| 49840 |
imagePromises.set(bitmapId, StampAnnotation.createImage(bitmap, xref)); |
| 49841 |
} |
| 49842 |
return imagePromises; |
| 49843 |
} |
| 49844 |
static async saveNewAnnotations(evaluator, task, annotations, imagePromises) { |
| 49845 |
const xref = evaluator.xref; |
| 49846 |
let baseFontRef; |
| 49847 |
const dependencies = []; |
| 49848 |
const promises = []; |
| 49849 |
const { |
| 49850 |
isOffscreenCanvasSupported |
| 49851 |
} = evaluator.options; |
| 49852 |
for (const annotation of annotations) { |
| 49853 |
if (annotation.deleted) { |
| 49854 |
continue; |
| 49855 |
} |
| 49856 |
switch (annotation.annotationType) { |
| 49857 |
case AnnotationEditorType.FREETEXT: |
| 49858 |
if (!baseFontRef) { |
| 49859 |
const baseFont = new Dict(xref); |
| 49860 |
baseFont.set("BaseFont", Name.get("Helvetica")); |
| 49861 |
baseFont.set("Type", Name.get("Font")); |
| 49862 |
baseFont.set("Subtype", Name.get("Type1")); |
| 49863 |
baseFont.set("Encoding", Name.get("WinAnsiEncoding")); |
| 49864 |
const buffer = []; |
| 49865 |
baseFontRef = xref.getNewTemporaryRef(); |
| 49866 |
await writeObject(baseFontRef, baseFont, buffer, xref); |
| 49867 |
dependencies.push({ |
| 49868 |
ref: baseFontRef, |
| 49869 |
data: buffer.join("") |
| 49870 |
}); |
| 49871 |
} |
| 49872 |
promises.push(FreeTextAnnotation.createNewAnnotation(xref, annotation, dependencies, { |
| 49873 |
evaluator, |
| 49874 |
task, |
| 49875 |
baseFontRef |
| 49876 |
})); |
| 49877 |
break; |
| 49878 |
case AnnotationEditorType.HIGHLIGHT: |
| 49879 |
if (annotation.quadPoints) { |
| 49880 |
promises.push(HighlightAnnotation.createNewAnnotation(xref, annotation, dependencies)); |
| 49881 |
} else { |
| 49882 |
promises.push(InkAnnotation.createNewAnnotation(xref, annotation, dependencies)); |
| 49883 |
} |
| 49884 |
break; |
| 49885 |
case AnnotationEditorType.INK: |
| 49886 |
promises.push(InkAnnotation.createNewAnnotation(xref, annotation, dependencies)); |
| 49887 |
break; |
| 49888 |
case AnnotationEditorType.STAMP: |
| 49889 |
const image = isOffscreenCanvasSupported ? await imagePromises?.get(annotation.bitmapId) : null; |
| 49890 |
if (image?.imageStream) { |
| 49891 |
const { |
| 49892 |
imageStream, |
| 49893 |
smaskStream |
| 49894 |
} = image; |
| 49895 |
const buffer = []; |
| 49896 |
if (smaskStream) { |
| 49897 |
const smaskRef = xref.getNewTemporaryRef(); |
| 49898 |
await writeObject(smaskRef, smaskStream, buffer, xref); |
| 49899 |
dependencies.push({ |
| 49900 |
ref: smaskRef, |
| 49901 |
data: buffer.join("") |
| 49902 |
}); |
| 49903 |
imageStream.dict.set("SMask", smaskRef); |
| 49904 |
buffer.length = 0; |
| 49905 |
} |
| 49906 |
const imageRef = image.imageRef = xref.getNewTemporaryRef(); |
| 49907 |
await writeObject(imageRef, imageStream, buffer, xref); |
| 49908 |
dependencies.push({ |
| 49909 |
ref: imageRef, |
| 49910 |
data: buffer.join("") |
| 49911 |
}); |
| 49912 |
image.imageStream = image.smaskStream = null; |
| 49913 |
} |
| 49914 |
promises.push(StampAnnotation.createNewAnnotation(xref, annotation, dependencies, { |
| 49915 |
image |
| 49916 |
})); |
| 49917 |
break; |
| 49918 |
} |
| 49919 |
} |
| 49920 |
return { |
| 49921 |
annotations: await Promise.all(promises), |
| 49922 |
dependencies |
| 49923 |
}; |
| 49924 |
} |
| 49925 |
static async printNewAnnotations(annotationGlobals, evaluator, task, annotations, imagePromises) { |
| 49926 |
if (!annotations) { |
| 49927 |
return null; |
| 49928 |
} |
| 49929 |
const { |
| 49930 |
options, |
| 49931 |
xref |
| 49932 |
} = evaluator; |
| 49933 |
const promises = []; |
| 49934 |
for (const annotation of annotations) { |
| 49935 |
if (annotation.deleted) { |
| 49936 |
continue; |
| 49937 |
} |
| 49938 |
switch (annotation.annotationType) { |
| 49939 |
case AnnotationEditorType.FREETEXT: |
| 49940 |
promises.push(FreeTextAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { |
| 49941 |
evaluator, |
| 49942 |
task, |
| 49943 |
evaluatorOptions: options |
| 49944 |
})); |
| 49945 |
break; |
| 49946 |
case AnnotationEditorType.HIGHLIGHT: |
| 49947 |
if (annotation.quadPoints) { |
| 49948 |
promises.push(HighlightAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { |
| 49949 |
evaluatorOptions: options |
| 49950 |
})); |
| 49951 |
} else { |
| 49952 |
promises.push(InkAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { |
| 49953 |
evaluatorOptions: options |
| 49954 |
})); |
| 49955 |
} |
| 49956 |
break; |
| 49957 |
case AnnotationEditorType.INK: |
| 49958 |
promises.push(InkAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { |
| 49959 |
evaluatorOptions: options |
| 49960 |
})); |
| 49961 |
break; |
| 49962 |
case AnnotationEditorType.STAMP: |
| 49963 |
const image = options.isOffscreenCanvasSupported ? await imagePromises?.get(annotation.bitmapId) : null; |
| 49964 |
if (image?.imageStream) { |
| 49965 |
const { |
| 49966 |
imageStream, |
| 49967 |
smaskStream |
| 49968 |
} = image; |
| 49969 |
if (smaskStream) { |
| 49970 |
imageStream.dict.set("SMask", smaskStream); |
| 49971 |
} |
| 49972 |
image.imageRef = new JpegStream(imageStream, imageStream.length); |
| 49973 |
image.imageStream = image.smaskStream = null; |
| 49974 |
} |
| 49975 |
promises.push(StampAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { |
| 49976 |
image, |
| 49977 |
evaluatorOptions: options |
| 49978 |
})); |
| 49979 |
break; |
| 49980 |
} |
| 49981 |
} |
| 49982 |
return Promise.all(promises); |
| 49983 |
} |
| 49984 |
} |
| 49985 |
function getRgbColor(color, defaultColor = new Uint8ClampedArray(3)) { |
| 49986 |
if (!Array.isArray(color)) { |
| 49987 |
return defaultColor; |
| 49988 |
} |
| 49989 |
const rgbColor = defaultColor || new Uint8ClampedArray(3); |
| 49990 |
switch (color.length) { |
| 49991 |
case 0: |
| 49992 |
return null; |
| 49993 |
case 1: |
| 49994 |
ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0); |
| 49995 |
return rgbColor; |
| 49996 |
case 3: |
| 49997 |
ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0); |
| 49998 |
return rgbColor; |
| 49999 |
case 4: |
| 50000 |
ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0); |
| 50001 |
return rgbColor; |
| 50002 |
default: |
| 50003 |
return defaultColor; |
| 50004 |
} |
| 50005 |
} |
| 50006 |
function getPdfColorArray(color) { |
| 50007 |
return Array.from(color, c => c / 255); |
| 50008 |
} |
| 50009 |
function getQuadPoints(dict, rect) { |
| 50010 |
const quadPoints = dict.getArray("QuadPoints"); |
| 50011 |
if (!isNumberArray(quadPoints, null) || quadPoints.length === 0 || quadPoints.length % 8 > 0) { |
| 50012 |
return null; |
| 50013 |
} |
| 50014 |
const newQuadPoints = new Float32Array(quadPoints.length); |
| 50015 |
for (let i = 0, ii = quadPoints.length; i < ii; i += 8) { |
| 50016 |
const [x1, y1, x2, y2, x3, y3, x4, y4] = quadPoints.slice(i, i + 8); |
| 50017 |
const minX = Math.min(x1, x2, x3, x4); |
| 50018 |
const maxX = Math.max(x1, x2, x3, x4); |
| 50019 |
const minY = Math.min(y1, y2, y3, y4); |
| 50020 |
const maxY = Math.max(y1, y2, y3, y4); |
| 50021 |
if (rect !== null && (minX < rect[0] || maxX > rect[2] || minY < rect[1] || maxY > rect[3])) { |
| 50022 |
return null; |
| 50023 |
} |
| 50024 |
newQuadPoints.set([minX, maxY, maxX, maxY, minX, minY, maxX, minY], i); |
| 50025 |
} |
| 50026 |
return newQuadPoints; |
| 50027 |
} |
| 50028 |
function getTransformMatrix(rect, bbox, matrix) { |
| 50029 |
const [minX, minY, maxX, maxY] = Util.getAxialAlignedBoundingBox(bbox, matrix); |
| 50030 |
if (minX === maxX || minY === maxY) { |
| 50031 |
return [1, 0, 0, 1, rect[0], rect[1]]; |
| 50032 |
} |
| 50033 |
const xRatio = (rect[2] - rect[0]) / (maxX - minX); |
| 50034 |
const yRatio = (rect[3] - rect[1]) / (maxY - minY); |
| 50035 |
return [xRatio, 0, 0, yRatio, rect[0] - minX * xRatio, rect[1] - minY * yRatio]; |
| 50036 |
} |
| 50037 |
class Annotation { |
| 50038 |
constructor(params) { |
| 50039 |
const { |
| 50040 |
dict, |
| 50041 |
xref, |
| 50042 |
annotationGlobals, |
| 50043 |
ref, |
| 50044 |
orphanFields |
| 50045 |
} = params; |
| 50046 |
const parentRef = orphanFields?.get(ref); |
| 50047 |
if (parentRef) { |
| 50048 |
dict.set("Parent", parentRef); |
| 50049 |
} |
| 50050 |
this.setTitle(dict.get("T")); |
| 50051 |
this.setContents(dict.get("Contents")); |
| 50052 |
this.setModificationDate(dict.get("M")); |
| 50053 |
this.setFlags(dict.get("F")); |
| 50054 |
this.setRectangle(dict.getArray("Rect")); |
| 50055 |
this.setColor(dict.getArray("C")); |
| 50056 |
this.setBorderStyle(dict); |
| 50057 |
this.setAppearance(dict); |
| 50058 |
this.setOptionalContent(dict); |
| 50059 |
const MK = dict.get("MK"); |
| 50060 |
this.setBorderAndBackgroundColors(MK); |
| 50061 |
this.setRotation(MK, dict); |
| 50062 |
this.ref = params.ref instanceof Ref ? params.ref : null; |
| 50063 |
this._streams = []; |
| 50064 |
if (this.appearance) { |
| 50065 |
this._streams.push(this.appearance); |
| 50066 |
} |
| 50067 |
const isLocked = !!(this.flags & AnnotationFlag.LOCKED); |
| 50068 |
const isContentLocked = !!(this.flags & AnnotationFlag.LOCKEDCONTENTS); |
| 50069 |
this.data = { |
| 50070 |
annotationFlags: this.flags, |
| 50071 |
borderStyle: this.borderStyle, |
| 50072 |
color: this.color, |
| 50073 |
backgroundColor: this.backgroundColor, |
| 50074 |
borderColor: this.borderColor, |
| 50075 |
rotation: this.rotation, |
| 50076 |
contentsObj: this._contents, |
| 50077 |
hasAppearance: !!this.appearance, |
| 50078 |
id: params.id, |
| 50079 |
modificationDate: this.modificationDate, |
| 50080 |
rect: this.rectangle, |
| 50081 |
subtype: params.subtype, |
| 50082 |
hasOwnCanvas: false, |
| 50083 |
noRotate: !!(this.flags & AnnotationFlag.NOROTATE), |
| 50084 |
noHTML: isLocked && isContentLocked, |
| 50085 |
isEditable: false, |
| 50086 |
structParent: -1 |
| 50087 |
}; |
| 50088 |
if (annotationGlobals.structTreeRoot) { |
| 50089 |
let structParent = dict.get("StructParent"); |
| 50090 |
this.data.structParent = structParent = Number.isInteger(structParent) && structParent >= 0 ? structParent : -1; |
| 50091 |
annotationGlobals.structTreeRoot.addAnnotationIdToPage(params.pageRef, structParent); |
| 50092 |
} |
| 50093 |
if (params.collectFields) { |
| 50094 |
const kids = dict.get("Kids"); |
| 50095 |
if (Array.isArray(kids)) { |
| 50096 |
const kidIds = []; |
| 50097 |
for (const kid of kids) { |
| 50098 |
if (kid instanceof Ref) { |
| 50099 |
kidIds.push(kid.toString()); |
| 50100 |
} |
| 50101 |
} |
| 50102 |
if (kidIds.length !== 0) { |
| 50103 |
this.data.kidIds = kidIds; |
| 50104 |
} |
| 50105 |
} |
| 50106 |
this.data.actions = collectActions(xref, dict, AnnotationActionEventType); |
| 50107 |
this.data.fieldName = this._constructFieldName(dict); |
| 50108 |
this.data.pageIndex = params.pageIndex; |
| 50109 |
} |
| 50110 |
const it = dict.get("IT"); |
| 50111 |
if (it instanceof Name) { |
| 50112 |
this.data.it = it.name; |
| 50113 |
} |
| 50114 |
this._isOffscreenCanvasSupported = params.evaluatorOptions.isOffscreenCanvasSupported; |
| 50115 |
this._fallbackFontDict = null; |
| 50116 |
this._needAppearances = false; |
| 50117 |
} |
| 50118 |
_hasFlag(flags, flag) { |
| 50119 |
return !!(flags & flag); |
| 50120 |
} |
| 50121 |
_buildFlags(noView, noPrint) { |
| 50122 |
let { |
| 50123 |
flags |
| 50124 |
} = this; |
| 50125 |
if (noView === undefined) { |
| 50126 |
if (noPrint === undefined) { |
| 50127 |
return undefined; |
| 50128 |
} |
| 50129 |
if (noPrint) { |
| 50130 |
return flags & ~AnnotationFlag.PRINT; |
| 50131 |
} |
| 50132 |
return flags & ~AnnotationFlag.HIDDEN | AnnotationFlag.PRINT; |
| 50133 |
} |
| 50134 |
if (noView) { |
| 50135 |
flags |= AnnotationFlag.PRINT; |
| 50136 |
if (noPrint) { |
| 50137 |
return flags & ~AnnotationFlag.NOVIEW | AnnotationFlag.HIDDEN; |
| 50138 |
} |
| 50139 |
return flags & ~AnnotationFlag.HIDDEN | AnnotationFlag.NOVIEW; |
| 50140 |
} |
| 50141 |
flags &= ~(AnnotationFlag.HIDDEN | AnnotationFlag.NOVIEW); |
| 50142 |
if (noPrint) { |
| 50143 |
return flags & ~AnnotationFlag.PRINT; |
| 50144 |
} |
| 50145 |
return flags | AnnotationFlag.PRINT; |
| 50146 |
} |
| 50147 |
_isViewable(flags) { |
| 50148 |
return !this._hasFlag(flags, AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, AnnotationFlag.NOVIEW); |
| 50149 |
} |
| 50150 |
_isPrintable(flags) { |
| 50151 |
return this._hasFlag(flags, AnnotationFlag.PRINT) && !this._hasFlag(flags, AnnotationFlag.HIDDEN) && !this._hasFlag(flags, AnnotationFlag.INVISIBLE); |
| 50152 |
} |
| 50153 |
mustBeViewed(annotationStorage, _renderForms) { |
| 50154 |
const noView = annotationStorage?.get(this.data.id)?.noView; |
| 50155 |
if (noView !== undefined) { |
| 50156 |
return !noView; |
| 50157 |
} |
| 50158 |
return this.viewable && !this._hasFlag(this.flags, AnnotationFlag.HIDDEN); |
| 50159 |
} |
| 50160 |
mustBePrinted(annotationStorage) { |
| 50161 |
const noPrint = annotationStorage?.get(this.data.id)?.noPrint; |
| 50162 |
if (noPrint !== undefined) { |
| 50163 |
return !noPrint; |
| 50164 |
} |
| 50165 |
return this.printable; |
| 50166 |
} |
| 50167 |
mustBeViewedWhenEditing(isEditing, modifiedIds = null) { |
| 50168 |
return isEditing ? !this.data.isEditable : !modifiedIds?.has(this.data.id); |
| 50169 |
} |
| 50170 |
get viewable() { |
| 50171 |
if (this.data.quadPoints === null) { |
| 50172 |
return false; |
| 50173 |
} |
| 50174 |
if (this.flags === 0) { |
| 50175 |
return true; |
| 50176 |
} |
| 50177 |
return this._isViewable(this.flags); |
| 50178 |
} |
| 50179 |
get printable() { |
| 50180 |
if (this.data.quadPoints === null) { |
| 50181 |
return false; |
| 50182 |
} |
| 50183 |
if (this.flags === 0) { |
| 50184 |
return false; |
| 50185 |
} |
| 50186 |
return this._isPrintable(this.flags); |
| 50187 |
} |
| 50188 |
_parseStringHelper(data) { |
| 50189 |
const str = typeof data === "string" ? stringToPDFString(data) : ""; |
| 50190 |
const dir = str && bidi(str).dir === "rtl" ? "rtl" : "ltr"; |
| 50191 |
return { |
| 50192 |
str, |
| 50193 |
dir |
| 50194 |
}; |
| 50195 |
} |
| 50196 |
setDefaultAppearance(params) { |
| 50197 |
const { |
| 50198 |
dict, |
| 50199 |
annotationGlobals |
| 50200 |
} = params; |
| 50201 |
const defaultAppearance = getInheritableProperty({ |
| 50202 |
dict, |
| 50203 |
key: "DA" |
| 50204 |
}) || annotationGlobals.acroForm.get("DA"); |
| 50205 |
this._defaultAppearance = typeof defaultAppearance === "string" ? defaultAppearance : ""; |
| 50206 |
this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance); |
| 50207 |
} |
| 50208 |
setTitle(title) { |
| 50209 |
this._title = this._parseStringHelper(title); |
| 50210 |
} |
| 50211 |
setContents(contents) { |
| 50212 |
this._contents = this._parseStringHelper(contents); |
| 50213 |
} |
| 50214 |
setModificationDate(modificationDate) { |
| 50215 |
this.modificationDate = typeof modificationDate === "string" ? modificationDate : null; |
| 50216 |
} |
| 50217 |
setFlags(flags) { |
| 50218 |
this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0; |
| 50219 |
if (this.flags & AnnotationFlag.INVISIBLE && this.constructor.name !== "Annotation") { |
| 50220 |
this.flags ^= AnnotationFlag.INVISIBLE; |
| 50221 |
} |
| 50222 |
} |
| 50223 |
hasFlag(flag) { |
| 50224 |
return this._hasFlag(this.flags, flag); |
| 50225 |
} |
| 50226 |
setRectangle(rectangle) { |
| 50227 |
this.rectangle = lookupNormalRect(rectangle, [0, 0, 0, 0]); |
| 50228 |
} |
| 50229 |
setColor(color) { |
| 50230 |
this.color = getRgbColor(color); |
| 50231 |
} |
| 50232 |
setLineEndings(lineEndings) { |
| 50233 |
this.lineEndings = ["None", "None"]; |
| 50234 |
if (Array.isArray(lineEndings) && lineEndings.length === 2) { |
| 50235 |
for (let i = 0; i < 2; i++) { |
| 50236 |
const obj = lineEndings[i]; |
| 50237 |
if (obj instanceof Name) { |
| 50238 |
switch (obj.name) { |
| 50239 |
case "None": |
| 50240 |
continue; |
| 50241 |
case "Square": |
| 50242 |
case "Circle": |
| 50243 |
case "Diamond": |
| 50244 |
case "OpenArrow": |
| 50245 |
case "ClosedArrow": |
| 50246 |
case "Butt": |
| 50247 |
case "ROpenArrow": |
| 50248 |
case "RClosedArrow": |
| 50249 |
case "Slash": |
| 50250 |
this.lineEndings[i] = obj.name; |
| 50251 |
continue; |
| 50252 |
} |
| 50253 |
} |
| 50254 |
warn(`Ignoring invalid lineEnding: ${obj}`); |
| 50255 |
} |
| 50256 |
} |
| 50257 |
} |
| 50258 |
setRotation(mk, dict) { |
| 50259 |
this.rotation = 0; |
| 50260 |
let angle = mk instanceof Dict ? mk.get("R") || 0 : dict.get("Rotate") || 0; |
| 50261 |
if (Number.isInteger(angle) && angle !== 0) { |
| 50262 |
angle %= 360; |
| 50263 |
if (angle < 0) { |
| 50264 |
angle += 360; |
| 50265 |
} |
| 50266 |
if (angle % 90 === 0) { |
| 50267 |
this.rotation = angle; |
| 50268 |
} |
| 50269 |
} |
| 50270 |
} |
| 50271 |
setBorderAndBackgroundColors(mk) { |
| 50272 |
if (mk instanceof Dict) { |
| 50273 |
this.borderColor = getRgbColor(mk.getArray("BC"), null); |
| 50274 |
this.backgroundColor = getRgbColor(mk.getArray("BG"), null); |
| 50275 |
} else { |
| 50276 |
this.borderColor = this.backgroundColor = null; |
| 50277 |
} |
| 50278 |
} |
| 50279 |
setBorderStyle(borderStyle) { |
| 50280 |
this.borderStyle = new AnnotationBorderStyle(); |
| 50281 |
if (!(borderStyle instanceof Dict)) { |
| 50282 |
return; |
| 50283 |
} |
| 50284 |
if (borderStyle.has("BS")) { |
| 50285 |
const dict = borderStyle.get("BS"); |
| 50286 |
if (dict instanceof Dict) { |
| 50287 |
const dictType = dict.get("Type"); |
| 50288 |
if (!dictType || isName(dictType, "Border")) { |
| 50289 |
this.borderStyle.setWidth(dict.get("W"), this.rectangle); |
| 50290 |
this.borderStyle.setStyle(dict.get("S")); |
| 50291 |
this.borderStyle.setDashArray(dict.getArray("D")); |
| 50292 |
} |
| 50293 |
} |
| 50294 |
} else if (borderStyle.has("Border")) { |
| 50295 |
const array = borderStyle.getArray("Border"); |
| 50296 |
if (Array.isArray(array) && array.length >= 3) { |
| 50297 |
this.borderStyle.setHorizontalCornerRadius(array[0]); |
| 50298 |
this.borderStyle.setVerticalCornerRadius(array[1]); |
| 50299 |
this.borderStyle.setWidth(array[2], this.rectangle); |
| 50300 |
if (array.length === 4) { |
| 50301 |
this.borderStyle.setDashArray(array[3], true); |
| 50302 |
} |
| 50303 |
} |
| 50304 |
} else { |
| 50305 |
this.borderStyle.setWidth(0); |
| 50306 |
} |
| 50307 |
} |
| 50308 |
setAppearance(dict) { |
| 50309 |
this.appearance = null; |
| 50310 |
const appearanceStates = dict.get("AP"); |
| 50311 |
if (!(appearanceStates instanceof Dict)) { |
| 50312 |
return; |
| 50313 |
} |
| 50314 |
const normalAppearanceState = appearanceStates.get("N"); |
| 50315 |
if (normalAppearanceState instanceof BaseStream) { |
| 50316 |
this.appearance = normalAppearanceState; |
| 50317 |
return; |
| 50318 |
} |
| 50319 |
if (!(normalAppearanceState instanceof Dict)) { |
| 50320 |
return; |
| 50321 |
} |
| 50322 |
const as = dict.get("AS"); |
| 50323 |
if (!(as instanceof Name) || !normalAppearanceState.has(as.name)) { |
| 50324 |
return; |
| 50325 |
} |
| 50326 |
const appearance = normalAppearanceState.get(as.name); |
| 50327 |
if (appearance instanceof BaseStream) { |
| 50328 |
this.appearance = appearance; |
| 50329 |
} |
| 50330 |
} |
| 50331 |
setOptionalContent(dict) { |
| 50332 |
this.oc = null; |
| 50333 |
const oc = dict.get("OC"); |
| 50334 |
if (oc instanceof Name) { |
| 50335 |
warn("setOptionalContent: Support for /Name-entry is not implemented."); |
| 50336 |
} else if (oc instanceof Dict) { |
| 50337 |
this.oc = oc; |
| 50338 |
} |
| 50339 |
} |
| 50340 |
loadResources(keys, appearance) { |
| 50341 |
return appearance.dict.getAsync("Resources").then(resources => { |
| 50342 |
if (!resources) { |
| 50343 |
return undefined; |
| 50344 |
} |
| 50345 |
const objectLoader = new ObjectLoader(resources, keys, resources.xref); |
| 50346 |
return objectLoader.load().then(function () { |
| 50347 |
return resources; |
| 50348 |
}); |
| 50349 |
}); |
| 50350 |
} |
| 50351 |
async getOperatorList(evaluator, task, intent, annotationStorage) { |
| 50352 |
const { |
| 50353 |
hasOwnCanvas, |
| 50354 |
id, |
| 50355 |
rect |
| 50356 |
} = this.data; |
| 50357 |
let appearance = this.appearance; |
| 50358 |
const isUsingOwnCanvas = !!(hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY); |
| 50359 |
if (isUsingOwnCanvas && (rect[0] === rect[2] || rect[1] === rect[3])) { |
| 50360 |
this.data.hasOwnCanvas = false; |
| 50361 |
return { |
| 50362 |
opList: new OperatorList(), |
| 50363 |
separateForm: false, |
| 50364 |
separateCanvas: false |
| 50365 |
}; |
| 50366 |
} |
| 50367 |
if (!appearance) { |
| 50368 |
if (!isUsingOwnCanvas) { |
| 50369 |
return { |
| 50370 |
opList: new OperatorList(), |
| 50371 |
separateForm: false, |
| 50372 |
separateCanvas: false |
| 50373 |
}; |
| 50374 |
} |
| 50375 |
appearance = new StringStream(""); |
| 50376 |
appearance.dict = new Dict(); |
| 50377 |
} |
| 50378 |
const appearanceDict = appearance.dict; |
| 50379 |
const resources = await this.loadResources(["ExtGState", "ColorSpace", "Pattern", "Shading", "XObject", "Font"], appearance); |
| 50380 |
const bbox = lookupRect(appearanceDict.getArray("BBox"), [0, 0, 1, 1]); |
| 50381 |
const matrix = lookupMatrix(appearanceDict.getArray("Matrix"), IDENTITY_MATRIX); |
| 50382 |
const transform = getTransformMatrix(rect, bbox, matrix); |
| 50383 |
const opList = new OperatorList(); |
| 50384 |
let optionalContent; |
| 50385 |
if (this.oc) { |
| 50386 |
optionalContent = await evaluator.parseMarkedContentProps(this.oc, null); |
| 50387 |
} |
| 50388 |
if (optionalContent !== undefined) { |
| 50389 |
opList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); |
| 50390 |
} |
| 50391 |
opList.addOp(OPS.beginAnnotation, [id, rect, transform, matrix, isUsingOwnCanvas]); |
| 50392 |
await evaluator.getOperatorList({ |
| 50393 |
stream: appearance, |
| 50394 |
task, |
| 50395 |
resources, |
| 50396 |
operatorList: opList, |
| 50397 |
fallbackFontDict: this._fallbackFontDict |
| 50398 |
}); |
| 50399 |
opList.addOp(OPS.endAnnotation, []); |
| 50400 |
if (optionalContent !== undefined) { |
| 50401 |
opList.addOp(OPS.endMarkedContent, []); |
| 50402 |
} |
| 50403 |
this.reset(); |
| 50404 |
return { |
| 50405 |
opList, |
| 50406 |
separateForm: false, |
| 50407 |
separateCanvas: isUsingOwnCanvas |
| 50408 |
}; |
| 50409 |
} |
| 50410 |
async save(evaluator, task, annotationStorage) { |
| 50411 |
return null; |
| 50412 |
} |
| 50413 |
get hasTextContent() { |
| 50414 |
return false; |
| 50415 |
} |
| 50416 |
async extractTextContent(evaluator, task, viewBox) { |
| 50417 |
if (!this.appearance) { |
| 50418 |
return; |
| 50419 |
} |
| 50420 |
const resources = await this.loadResources(["ExtGState", "Font", "Properties", "XObject"], this.appearance); |
| 50421 |
const text = []; |
| 50422 |
const buffer = []; |
| 50423 |
let firstPosition = null; |
| 50424 |
const sink = { |
| 50425 |
desiredSize: Math.Infinity, |
| 50426 |
ready: true, |
| 50427 |
enqueue(chunk, size) { |
| 50428 |
for (const item of chunk.items) { |
| 50429 |
if (item.str === undefined) { |
| 50430 |
continue; |
| 50431 |
} |
| 50432 |
firstPosition ||= item.transform.slice(-2); |
| 50433 |
buffer.push(item.str); |
| 50434 |
if (item.hasEOL) { |
| 50435 |
text.push(buffer.join("").trimEnd()); |
| 50436 |
buffer.length = 0; |
| 50437 |
} |
| 50438 |
} |
| 50439 |
} |
| 50440 |
}; |
| 50441 |
await evaluator.getTextContent({ |
| 50442 |
stream: this.appearance, |
| 50443 |
task, |
| 50444 |
resources, |
| 50445 |
includeMarkedContent: true, |
| 50446 |
keepWhiteSpace: true, |
| 50447 |
sink, |
| 50448 |
viewBox |
| 50449 |
}); |
| 50450 |
this.reset(); |
| 50451 |
if (buffer.length) { |
| 50452 |
text.push(buffer.join("").trimEnd()); |
| 50453 |
} |
| 50454 |
if (text.length > 1 || text[0]) { |
| 50455 |
const appearanceDict = this.appearance.dict; |
| 50456 |
const bbox = lookupRect(appearanceDict.getArray("BBox"), null); |
| 50457 |
const matrix = lookupMatrix(appearanceDict.getArray("Matrix"), null); |
| 50458 |
this.data.textPosition = this._transformPoint(firstPosition, bbox, matrix); |
| 50459 |
this.data.textContent = text; |
| 50460 |
} |
| 50461 |
} |
| 50462 |
_transformPoint(coords, bbox, matrix) { |
| 50463 |
const { |
| 50464 |
rect |
| 50465 |
} = this.data; |
| 50466 |
bbox ||= [0, 0, 1, 1]; |
| 50467 |
matrix ||= [1, 0, 0, 1, 0, 0]; |
| 50468 |
const transform = getTransformMatrix(rect, bbox, matrix); |
| 50469 |
transform[4] -= rect[0]; |
| 50470 |
transform[5] -= rect[1]; |
| 50471 |
coords = Util.applyTransform(coords, transform); |
| 50472 |
return Util.applyTransform(coords, matrix); |
| 50473 |
} |
| 50474 |
getFieldObject() { |
| 50475 |
if (this.data.kidIds) { |
| 50476 |
return { |
| 50477 |
id: this.data.id, |
| 50478 |
actions: this.data.actions, |
| 50479 |
name: this.data.fieldName, |
| 50480 |
strokeColor: this.data.borderColor, |
| 50481 |
fillColor: this.data.backgroundColor, |
| 50482 |
type: "", |
| 50483 |
kidIds: this.data.kidIds, |
| 50484 |
page: this.data.pageIndex, |
| 50485 |
rotation: this.rotation |
| 50486 |
}; |
| 50487 |
} |
| 50488 |
return null; |
| 50489 |
} |
| 50490 |
reset() { |
| 50491 |
for (const stream of this._streams) { |
| 50492 |
stream.reset(); |
| 50493 |
} |
| 50494 |
} |
| 50495 |
_constructFieldName(dict) { |
| 50496 |
if (!dict.has("T") && !dict.has("Parent")) { |
| 50497 |
warn("Unknown field name, falling back to empty field name."); |
| 50498 |
return ""; |
| 50499 |
} |
| 50500 |
if (!dict.has("Parent")) { |
| 50501 |
return stringToPDFString(dict.get("T")); |
| 50502 |
} |
| 50503 |
const fieldName = []; |
| 50504 |
if (dict.has("T")) { |
| 50505 |
fieldName.unshift(stringToPDFString(dict.get("T"))); |
| 50506 |
} |
| 50507 |
let loopDict = dict; |
| 50508 |
const visited = new RefSet(); |
| 50509 |
if (dict.objId) { |
| 50510 |
visited.put(dict.objId); |
| 50511 |
} |
| 50512 |
while (loopDict.has("Parent")) { |
| 50513 |
loopDict = loopDict.get("Parent"); |
| 50514 |
if (!(loopDict instanceof Dict) || loopDict.objId && visited.has(loopDict.objId)) { |
| 50515 |
break; |
| 50516 |
} |
| 50517 |
if (loopDict.objId) { |
| 50518 |
visited.put(loopDict.objId); |
| 50519 |
} |
| 50520 |
if (loopDict.has("T")) { |
| 50521 |
fieldName.unshift(stringToPDFString(loopDict.get("T"))); |
| 50522 |
} |
| 50523 |
} |
| 50524 |
return fieldName.join("."); |
| 50525 |
} |
| 50526 |
} |
| 50527 |
class AnnotationBorderStyle { |
| 50528 |
constructor() { |
| 50529 |
this.width = 1; |
| 50530 |
this.rawWidth = 1; |
| 50531 |
this.style = AnnotationBorderStyleType.SOLID; |
| 50532 |
this.dashArray = [3]; |
| 50533 |
this.horizontalCornerRadius = 0; |
| 50534 |
this.verticalCornerRadius = 0; |
| 50535 |
} |
| 50536 |
setWidth(width, rect = [0, 0, 0, 0]) { |
| 50537 |
if (width instanceof Name) { |
| 50538 |
this.width = 0; |
| 50539 |
return; |
| 50540 |
} |
| 50541 |
if (typeof width === "number") { |
| 50542 |
if (width > 0) { |
| 50543 |
this.rawWidth = width; |
| 50544 |
const maxWidth = (rect[2] - rect[0]) / 2; |
| 50545 |
const maxHeight = (rect[3] - rect[1]) / 2; |
| 50546 |
if (maxWidth > 0 && maxHeight > 0 && (width > maxWidth || width > maxHeight)) { |
| 50547 |
warn(`AnnotationBorderStyle.setWidth - ignoring width: ${width}`); |
| 50548 |
width = 1; |
| 50549 |
} |
| 50550 |
} |
| 50551 |
this.width = width; |
| 50552 |
} |
| 50553 |
} |
| 50554 |
setStyle(style) { |
| 50555 |
if (!(style instanceof Name)) { |
| 50556 |
return; |
| 50557 |
} |
| 50558 |
switch (style.name) { |
| 50559 |
case "S": |
| 50560 |
this.style = AnnotationBorderStyleType.SOLID; |
| 50561 |
break; |
| 50562 |
case "D": |
| 50563 |
this.style = AnnotationBorderStyleType.DASHED; |
| 50564 |
break; |
| 50565 |
case "B": |
| 50566 |
this.style = AnnotationBorderStyleType.BEVELED; |
| 50567 |
break; |
| 50568 |
case "I": |
| 50569 |
this.style = AnnotationBorderStyleType.INSET; |
| 50570 |
break; |
| 50571 |
case "U": |
| 50572 |
this.style = AnnotationBorderStyleType.UNDERLINE; |
| 50573 |
break; |
| 50574 |
default: |
| 50575 |
break; |
| 50576 |
} |
| 50577 |
} |
| 50578 |
setDashArray(dashArray, forceStyle = false) { |
| 50579 |
if (Array.isArray(dashArray)) { |
| 50580 |
let isValid = true; |
| 50581 |
let allZeros = true; |
| 50582 |
for (const element of dashArray) { |
| 50583 |
const validNumber = +element >= 0; |
| 50584 |
if (!validNumber) { |
| 50585 |
isValid = false; |
| 50586 |
break; |
| 50587 |
} else if (element > 0) { |
| 50588 |
allZeros = false; |
| 50589 |
} |
| 50590 |
} |
| 50591 |
if (dashArray.length === 0 || isValid && !allZeros) { |
| 50592 |
this.dashArray = dashArray; |
| 50593 |
if (forceStyle) { |
| 50594 |
this.setStyle(Name.get("D")); |
| 50595 |
} |
| 50596 |
} else { |
| 50597 |
this.width = 0; |
| 50598 |
} |
| 50599 |
} else if (dashArray) { |
| 50600 |
this.width = 0; |
| 50601 |
} |
| 50602 |
} |
| 50603 |
setHorizontalCornerRadius(radius) { |
| 50604 |
if (Number.isInteger(radius)) { |
| 50605 |
this.horizontalCornerRadius = radius; |
| 50606 |
} |
| 50607 |
} |
| 50608 |
setVerticalCornerRadius(radius) { |
| 50609 |
if (Number.isInteger(radius)) { |
| 50610 |
this.verticalCornerRadius = radius; |
| 50611 |
} |
| 50612 |
} |
| 50613 |
} |
| 50614 |
class MarkupAnnotation extends Annotation { |
| 50615 |
constructor(params) { |
| 50616 |
super(params); |
| 50617 |
const { |
| 50618 |
dict |
| 50619 |
} = params; |
| 50620 |
if (dict.has("IRT")) { |
| 50621 |
const rawIRT = dict.getRaw("IRT"); |
| 50622 |
this.data.inReplyTo = rawIRT instanceof Ref ? rawIRT.toString() : null; |
| 50623 |
const rt = dict.get("RT"); |
| 50624 |
this.data.replyType = rt instanceof Name ? rt.name : AnnotationReplyType.REPLY; |
| 50625 |
} |
| 50626 |
let popupRef = null; |
| 50627 |
if (this.data.replyType === AnnotationReplyType.GROUP) { |
| 50628 |
const parent = dict.get("IRT"); |
| 50629 |
this.setTitle(parent.get("T")); |
| 50630 |
this.data.titleObj = this._title; |
| 50631 |
this.setContents(parent.get("Contents")); |
| 50632 |
this.data.contentsObj = this._contents; |
| 50633 |
if (!parent.has("CreationDate")) { |
| 50634 |
this.data.creationDate = null; |
| 50635 |
} else { |
| 50636 |
this.setCreationDate(parent.get("CreationDate")); |
| 50637 |
this.data.creationDate = this.creationDate; |
| 50638 |
} |
| 50639 |
if (!parent.has("M")) { |
| 50640 |
this.data.modificationDate = null; |
| 50641 |
} else { |
| 50642 |
this.setModificationDate(parent.get("M")); |
| 50643 |
this.data.modificationDate = this.modificationDate; |
| 50644 |
} |
| 50645 |
popupRef = parent.getRaw("Popup"); |
| 50646 |
if (!parent.has("C")) { |
| 50647 |
this.data.color = null; |
| 50648 |
} else { |
| 50649 |
this.setColor(parent.getArray("C")); |
| 50650 |
this.data.color = this.color; |
| 50651 |
} |
| 50652 |
} else { |
| 50653 |
this.data.titleObj = this._title; |
| 50654 |
this.setCreationDate(dict.get("CreationDate")); |
| 50655 |
this.data.creationDate = this.creationDate; |
| 50656 |
popupRef = dict.getRaw("Popup"); |
| 50657 |
if (!dict.has("C")) { |
| 50658 |
this.data.color = null; |
| 50659 |
} |
| 50660 |
} |
| 50661 |
this.data.popupRef = popupRef instanceof Ref ? popupRef.toString() : null; |
| 50662 |
if (dict.has("RC")) { |
| 50663 |
this.data.richText = XFAFactory.getRichTextAsHtml(dict.get("RC")); |
| 50664 |
} |
| 50665 |
} |
| 50666 |
setCreationDate(creationDate) { |
| 50667 |
this.creationDate = typeof creationDate === "string" ? creationDate : null; |
| 50668 |
} |
| 50669 |
_setDefaultAppearance({ |
| 50670 |
xref, |
| 50671 |
extra, |
| 50672 |
strokeColor, |
| 50673 |
fillColor, |
| 50674 |
blendMode, |
| 50675 |
strokeAlpha, |
| 50676 |
fillAlpha, |
| 50677 |
pointsCallback |
| 50678 |
}) { |
| 50679 |
let minX = Number.MAX_VALUE; |
| 50680 |
let minY = Number.MAX_VALUE; |
| 50681 |
let maxX = Number.MIN_VALUE; |
| 50682 |
let maxY = Number.MIN_VALUE; |
| 50683 |
const buffer = ["q"]; |
| 50684 |
if (extra) { |
| 50685 |
buffer.push(extra); |
| 50686 |
} |
| 50687 |
if (strokeColor) { |
| 50688 |
buffer.push(`${strokeColor[0]} ${strokeColor[1]} ${strokeColor[2]} RG`); |
| 50689 |
} |
| 50690 |
if (fillColor) { |
| 50691 |
buffer.push(`${fillColor[0]} ${fillColor[1]} ${fillColor[2]} rg`); |
| 50692 |
} |
| 50693 |
let pointsArray = this.data.quadPoints; |
| 50694 |
if (!pointsArray) { |
| 50695 |
pointsArray = Float32Array.from([this.rectangle[0], this.rectangle[3], this.rectangle[2], this.rectangle[3], this.rectangle[0], this.rectangle[1], this.rectangle[2], this.rectangle[1]]); |
| 50696 |
} |
| 50697 |
for (let i = 0, ii = pointsArray.length; i < ii; i += 8) { |
| 50698 |
const [mX, MX, mY, MY] = pointsCallback(buffer, pointsArray.subarray(i, i + 8)); |
| 50699 |
minX = Math.min(minX, mX); |
| 50700 |
maxX = Math.max(maxX, MX); |
| 50701 |
minY = Math.min(minY, mY); |
| 50702 |
maxY = Math.max(maxY, MY); |
| 50703 |
} |
| 50704 |
buffer.push("Q"); |
| 50705 |
const formDict = new Dict(xref); |
| 50706 |
const appearanceStreamDict = new Dict(xref); |
| 50707 |
appearanceStreamDict.set("Subtype", Name.get("Form")); |
| 50708 |
const appearanceStream = new StringStream(buffer.join(" ")); |
| 50709 |
appearanceStream.dict = appearanceStreamDict; |
| 50710 |
formDict.set("Fm0", appearanceStream); |
| 50711 |
const gsDict = new Dict(xref); |
| 50712 |
if (blendMode) { |
| 50713 |
gsDict.set("BM", Name.get(blendMode)); |
| 50714 |
} |
| 50715 |
if (typeof strokeAlpha === "number") { |
| 50716 |
gsDict.set("CA", strokeAlpha); |
| 50717 |
} |
| 50718 |
if (typeof fillAlpha === "number") { |
| 50719 |
gsDict.set("ca", fillAlpha); |
| 50720 |
} |
| 50721 |
const stateDict = new Dict(xref); |
| 50722 |
stateDict.set("GS0", gsDict); |
| 50723 |
const resources = new Dict(xref); |
| 50724 |
resources.set("ExtGState", stateDict); |
| 50725 |
resources.set("XObject", formDict); |
| 50726 |
const appearanceDict = new Dict(xref); |
| 50727 |
appearanceDict.set("Resources", resources); |
| 50728 |
const bbox = this.data.rect = [minX, minY, maxX, maxY]; |
| 50729 |
appearanceDict.set("BBox", bbox); |
| 50730 |
this.appearance = new StringStream("/GS0 gs /Fm0 Do"); |
| 50731 |
this.appearance.dict = appearanceDict; |
| 50732 |
this._streams.push(this.appearance, appearanceStream); |
| 50733 |
} |
| 50734 |
static async createNewAnnotation(xref, annotation, dependencies, params) { |
| 50735 |
if (!annotation.ref) { |
| 50736 |
annotation.ref = xref.getNewTemporaryRef(); |
| 50737 |
} |
| 50738 |
const annotationRef = annotation.ref; |
| 50739 |
const ap = await this.createNewAppearanceStream(annotation, xref, params); |
| 50740 |
const buffer = []; |
| 50741 |
let annotationDict; |
| 50742 |
if (ap) { |
| 50743 |
const apRef = xref.getNewTemporaryRef(); |
| 50744 |
annotationDict = this.createNewDict(annotation, xref, { |
| 50745 |
apRef |
| 50746 |
}); |
| 50747 |
await writeObject(apRef, ap, buffer, xref); |
| 50748 |
dependencies.push({ |
| 50749 |
ref: apRef, |
| 50750 |
data: buffer.join("") |
| 50751 |
}); |
| 50752 |
} else { |
| 50753 |
annotationDict = this.createNewDict(annotation, xref, {}); |
| 50754 |
} |
| 50755 |
if (Number.isInteger(annotation.parentTreeId)) { |
| 50756 |
annotationDict.set("StructParent", annotation.parentTreeId); |
| 50757 |
} |
| 50758 |
buffer.length = 0; |
| 50759 |
await writeObject(annotationRef, annotationDict, buffer, xref); |
| 50760 |
return { |
| 50761 |
ref: annotationRef, |
| 50762 |
data: buffer.join("") |
| 50763 |
}; |
| 50764 |
} |
| 50765 |
static async createNewPrintAnnotation(annotationGlobals, xref, annotation, params) { |
| 50766 |
const ap = await this.createNewAppearanceStream(annotation, xref, params); |
| 50767 |
const annotationDict = this.createNewDict(annotation, xref, ap ? { |
| 50768 |
ap |
| 50769 |
} : {}); |
| 50770 |
const newAnnotation = new this.prototype.constructor({ |
| 50771 |
dict: annotationDict, |
| 50772 |
xref, |
| 50773 |
annotationGlobals, |
| 50774 |
evaluatorOptions: params.evaluatorOptions |
| 50775 |
}); |
| 50776 |
if (annotation.ref) { |
| 50777 |
newAnnotation.ref = newAnnotation.refToReplace = annotation.ref; |
| 50778 |
} |
| 50779 |
return newAnnotation; |
| 50780 |
} |
| 50781 |
} |
| 50782 |
class WidgetAnnotation extends Annotation { |
| 50783 |
constructor(params) { |
| 50784 |
super(params); |
| 50785 |
const { |
| 50786 |
dict, |
| 50787 |
xref, |
| 50788 |
annotationGlobals |
| 50789 |
} = params; |
| 50790 |
const data = this.data; |
| 50791 |
this._needAppearances = params.needAppearances; |
| 50792 |
data.annotationType = AnnotationType.WIDGET; |
| 50793 |
if (data.fieldName === undefined) { |
| 50794 |
data.fieldName = this._constructFieldName(dict); |
| 50795 |
} |
| 50796 |
if (data.actions === undefined) { |
| 50797 |
data.actions = collectActions(xref, dict, AnnotationActionEventType); |
| 50798 |
} |
| 50799 |
let fieldValue = getInheritableProperty({ |
| 50800 |
dict, |
| 50801 |
key: "V", |
| 50802 |
getArray: true |
| 50803 |
}); |
| 50804 |
data.fieldValue = this._decodeFormValue(fieldValue); |
| 50805 |
const defaultFieldValue = getInheritableProperty({ |
| 50806 |
dict, |
| 50807 |
key: "DV", |
| 50808 |
getArray: true |
| 50809 |
}); |
| 50810 |
data.defaultFieldValue = this._decodeFormValue(defaultFieldValue); |
| 50811 |
if (fieldValue === undefined && annotationGlobals.xfaDatasets) { |
| 50812 |
const path = this._title.str; |
| 50813 |
if (path) { |
| 50814 |
this._hasValueFromXFA = true; |
| 50815 |
data.fieldValue = fieldValue = annotationGlobals.xfaDatasets.getValue(path); |
| 50816 |
} |
| 50817 |
} |
| 50818 |
if (fieldValue === undefined && data.defaultFieldValue !== null) { |
| 50819 |
data.fieldValue = data.defaultFieldValue; |
| 50820 |
} |
| 50821 |
data.alternativeText = stringToPDFString(dict.get("TU") || ""); |
| 50822 |
this.setDefaultAppearance(params); |
| 50823 |
data.hasAppearance ||= this._needAppearances && data.fieldValue !== undefined && data.fieldValue !== null; |
| 50824 |
const fieldType = getInheritableProperty({ |
| 50825 |
dict, |
| 50826 |
key: "FT" |
| 50827 |
}); |
| 50828 |
data.fieldType = fieldType instanceof Name ? fieldType.name : null; |
| 50829 |
const localResources = getInheritableProperty({ |
| 50830 |
dict, |
| 50831 |
key: "DR" |
| 50832 |
}); |
| 50833 |
const acroFormResources = annotationGlobals.acroForm.get("DR"); |
| 50834 |
const appearanceResources = this.appearance?.dict.get("Resources"); |
| 50835 |
this._fieldResources = { |
| 50836 |
localResources, |
| 50837 |
acroFormResources, |
| 50838 |
appearanceResources, |
| 50839 |
mergedResources: Dict.merge({ |
| 50840 |
xref, |
| 50841 |
dictArray: [localResources, appearanceResources, acroFormResources], |
| 50842 |
mergeSubDicts: true |
| 50843 |
}) |
| 50844 |
}; |
| 50845 |
data.fieldFlags = getInheritableProperty({ |
| 50846 |
dict, |
| 50847 |
key: "Ff" |
| 50848 |
}); |
| 50849 |
if (!Number.isInteger(data.fieldFlags) || data.fieldFlags < 0) { |
| 50850 |
data.fieldFlags = 0; |
| 50851 |
} |
| 50852 |
data.readOnly = this.hasFieldFlag(AnnotationFieldFlag.READONLY); |
| 50853 |
data.required = this.hasFieldFlag(AnnotationFieldFlag.REQUIRED); |
| 50854 |
data.hidden = this._hasFlag(data.annotationFlags, AnnotationFlag.HIDDEN) || this._hasFlag(data.annotationFlags, AnnotationFlag.NOVIEW); |
| 50855 |
} |
| 50856 |
_decodeFormValue(formValue) { |
| 50857 |
if (Array.isArray(formValue)) { |
| 50858 |
return formValue.filter(item => typeof item === "string").map(item => stringToPDFString(item)); |
| 50859 |
} else if (formValue instanceof Name) { |
| 50860 |
return stringToPDFString(formValue.name); |
| 50861 |
} else if (typeof formValue === "string") { |
| 50862 |
return stringToPDFString(formValue); |
| 50863 |
} |
| 50864 |
return null; |
| 50865 |
} |
| 50866 |
hasFieldFlag(flag) { |
| 50867 |
return !!(this.data.fieldFlags & flag); |
| 50868 |
} |
| 50869 |
_isViewable(flags) { |
| 50870 |
return true; |
| 50871 |
} |
| 50872 |
mustBeViewed(annotationStorage, renderForms) { |
| 50873 |
if (renderForms) { |
| 50874 |
return this.viewable; |
| 50875 |
} |
| 50876 |
return super.mustBeViewed(annotationStorage, renderForms) && !this._hasFlag(this.flags, AnnotationFlag.NOVIEW); |
| 50877 |
} |
| 50878 |
getRotationMatrix(annotationStorage) { |
| 50879 |
let rotation = annotationStorage?.get(this.data.id)?.rotation; |
| 50880 |
if (rotation === undefined) { |
| 50881 |
rotation = this.rotation; |
| 50882 |
} |
| 50883 |
if (rotation === 0) { |
| 50884 |
return IDENTITY_MATRIX; |
| 50885 |
} |
| 50886 |
const width = this.data.rect[2] - this.data.rect[0]; |
| 50887 |
const height = this.data.rect[3] - this.data.rect[1]; |
| 50888 |
return getRotationMatrix(rotation, width, height); |
| 50889 |
} |
| 50890 |
getBorderAndBackgroundAppearances(annotationStorage) { |
| 50891 |
let rotation = annotationStorage?.get(this.data.id)?.rotation; |
| 50892 |
if (rotation === undefined) { |
| 50893 |
rotation = this.rotation; |
| 50894 |
} |
| 50895 |
if (!this.backgroundColor && !this.borderColor) { |
| 50896 |
return ""; |
| 50897 |
} |
| 50898 |
const width = this.data.rect[2] - this.data.rect[0]; |
| 50899 |
const height = this.data.rect[3] - this.data.rect[1]; |
| 50900 |
const rect = rotation === 0 || rotation === 180 ? `0 0 ${width} ${height} re` : `0 0 ${height} ${width} re`; |
| 50901 |
let str = ""; |
| 50902 |
if (this.backgroundColor) { |
| 50903 |
str = `${getPdfColor(this.backgroundColor, true)} ${rect} f `; |
| 50904 |
} |
| 50905 |
if (this.borderColor) { |
| 50906 |
const borderWidth = this.borderStyle.width || 1; |
| 50907 |
str += `${borderWidth} w ${getPdfColor(this.borderColor, false)} ${rect} S `; |
| 50908 |
} |
| 50909 |
return str; |
| 50910 |
} |
| 50911 |
async getOperatorList(evaluator, task, intent, annotationStorage) { |
| 50912 |
if (intent & RenderingIntentFlag.ANNOTATIONS_FORMS && !(this instanceof SignatureWidgetAnnotation) && !this.data.noHTML && !this.data.hasOwnCanvas) { |
| 50913 |
return { |
| 50914 |
opList: new OperatorList(), |
| 50915 |
separateForm: true, |
| 50916 |
separateCanvas: false |
| 50917 |
}; |
| 50918 |
} |
| 50919 |
if (!this._hasText) { |
| 50920 |
return super.getOperatorList(evaluator, task, intent, annotationStorage); |
| 50921 |
} |
| 50922 |
const content = await this._getAppearance(evaluator, task, intent, annotationStorage); |
| 50923 |
if (this.appearance && content === null) { |
| 50924 |
return super.getOperatorList(evaluator, task, intent, annotationStorage); |
| 50925 |
} |
| 50926 |
const opList = new OperatorList(); |
| 50927 |
if (!this._defaultAppearance || content === null) { |
| 50928 |
return { |
| 50929 |
opList, |
| 50930 |
separateForm: false, |
| 50931 |
separateCanvas: false |
| 50932 |
}; |
| 50933 |
} |
| 50934 |
const isUsingOwnCanvas = !!(this.data.hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY); |
| 50935 |
const matrix = [1, 0, 0, 1, 0, 0]; |
| 50936 |
const bbox = [0, 0, this.data.rect[2] - this.data.rect[0], this.data.rect[3] - this.data.rect[1]]; |
| 50937 |
const transform = getTransformMatrix(this.data.rect, bbox, matrix); |
| 50938 |
let optionalContent; |
| 50939 |
if (this.oc) { |
| 50940 |
optionalContent = await evaluator.parseMarkedContentProps(this.oc, null); |
| 50941 |
} |
| 50942 |
if (optionalContent !== undefined) { |
| 50943 |
opList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); |
| 50944 |
} |
| 50945 |
opList.addOp(OPS.beginAnnotation, [this.data.id, this.data.rect, transform, this.getRotationMatrix(annotationStorage), isUsingOwnCanvas]); |
| 50946 |
const stream = new StringStream(content); |
| 50947 |
await evaluator.getOperatorList({ |
| 50948 |
stream, |
| 50949 |
task, |
| 50950 |
resources: this._fieldResources.mergedResources, |
| 50951 |
operatorList: opList |
| 50952 |
}); |
| 50953 |
opList.addOp(OPS.endAnnotation, []); |
| 50954 |
if (optionalContent !== undefined) { |
| 50955 |
opList.addOp(OPS.endMarkedContent, []); |
| 50956 |
} |
| 50957 |
return { |
| 50958 |
opList, |
| 50959 |
separateForm: false, |
| 50960 |
separateCanvas: isUsingOwnCanvas |
| 50961 |
}; |
| 50962 |
} |
| 50963 |
_getMKDict(rotation) { |
| 50964 |
const mk = new Dict(null); |
| 50965 |
if (rotation) { |
| 50966 |
mk.set("R", rotation); |
| 50967 |
} |
| 50968 |
if (this.borderColor) { |
| 50969 |
mk.set("BC", getPdfColorArray(this.borderColor)); |
| 50970 |
} |
| 50971 |
if (this.backgroundColor) { |
| 50972 |
mk.set("BG", getPdfColorArray(this.backgroundColor)); |
| 50973 |
} |
| 50974 |
return mk.size > 0 ? mk : null; |
| 50975 |
} |
| 50976 |
amendSavedDict(annotationStorage, dict) {} |
| 50977 |
async save(evaluator, task, annotationStorage) { |
| 50978 |
const storageEntry = annotationStorage?.get(this.data.id); |
| 50979 |
const flags = this._buildFlags(storageEntry?.noView, storageEntry?.noPrint); |
| 50980 |
let value = storageEntry?.value, |
| 50981 |
rotation = storageEntry?.rotation; |
| 50982 |
if (value === this.data.fieldValue || value === undefined) { |
| 50983 |
if (!this._hasValueFromXFA && rotation === undefined && flags === undefined) { |
| 50984 |
return null; |
| 50985 |
} |
| 50986 |
value ||= this.data.fieldValue; |
| 50987 |
} |
| 50988 |
if (rotation === undefined && !this._hasValueFromXFA && Array.isArray(value) && Array.isArray(this.data.fieldValue) && isArrayEqual(value, this.data.fieldValue) && flags === undefined) { |
| 50989 |
return null; |
| 50990 |
} |
| 50991 |
if (rotation === undefined) { |
| 50992 |
rotation = this.rotation; |
| 50993 |
} |
| 50994 |
let appearance = null; |
| 50995 |
if (!this._needAppearances) { |
| 50996 |
appearance = await this._getAppearance(evaluator, task, RenderingIntentFlag.SAVE, annotationStorage); |
| 50997 |
if (appearance === null && flags === undefined) { |
| 50998 |
return null; |
| 50999 |
} |
| 51000 |
} else {} |
| 51001 |
let needAppearances = false; |
| 51002 |
if (appearance?.needAppearances) { |
| 51003 |
needAppearances = true; |
| 51004 |
appearance = null; |
| 51005 |
} |
| 51006 |
const { |
| 51007 |
xref |
| 51008 |
} = evaluator; |
| 51009 |
const originalDict = xref.fetchIfRef(this.ref); |
| 51010 |
if (!(originalDict instanceof Dict)) { |
| 51011 |
return null; |
| 51012 |
} |
| 51013 |
const dict = new Dict(xref); |
| 51014 |
for (const key of originalDict.getKeys()) { |
| 51015 |
if (key !== "AP") { |
| 51016 |
dict.set(key, originalDict.getRaw(key)); |
| 51017 |
} |
| 51018 |
} |
| 51019 |
if (flags !== undefined) { |
| 51020 |
dict.set("F", flags); |
| 51021 |
if (appearance === null && !needAppearances) { |
| 51022 |
const ap = originalDict.getRaw("AP"); |
| 51023 |
if (ap) { |
| 51024 |
dict.set("AP", ap); |
| 51025 |
} |
| 51026 |
} |
| 51027 |
} |
| 51028 |
const xfa = { |
| 51029 |
path: this.data.fieldName, |
| 51030 |
value |
| 51031 |
}; |
| 51032 |
dict.set("V", Array.isArray(value) ? value.map(stringToAsciiOrUTF16BE) : stringToAsciiOrUTF16BE(value)); |
| 51033 |
this.amendSavedDict(annotationStorage, dict); |
| 51034 |
const maybeMK = this._getMKDict(rotation); |
| 51035 |
if (maybeMK) { |
| 51036 |
dict.set("MK", maybeMK); |
| 51037 |
} |
| 51038 |
const buffer = []; |
| 51039 |
const changes = [{ |
| 51040 |
ref: this.ref, |
| 51041 |
data: "", |
| 51042 |
xfa, |
| 51043 |
needAppearances |
| 51044 |
}]; |
| 51045 |
if (appearance !== null) { |
| 51046 |
const newRef = xref.getNewTemporaryRef(); |
| 51047 |
const AP = new Dict(xref); |
| 51048 |
dict.set("AP", AP); |
| 51049 |
AP.set("N", newRef); |
| 51050 |
const resources = this._getSaveFieldResources(xref); |
| 51051 |
const appearanceStream = new StringStream(appearance); |
| 51052 |
const appearanceDict = appearanceStream.dict = new Dict(xref); |
| 51053 |
appearanceDict.set("Subtype", Name.get("Form")); |
| 51054 |
appearanceDict.set("Resources", resources); |
| 51055 |
appearanceDict.set("BBox", [0, 0, this.data.rect[2] - this.data.rect[0], this.data.rect[3] - this.data.rect[1]]); |
| 51056 |
const rotationMatrix = this.getRotationMatrix(annotationStorage); |
| 51057 |
if (rotationMatrix !== IDENTITY_MATRIX) { |
| 51058 |
appearanceDict.set("Matrix", rotationMatrix); |
| 51059 |
} |
| 51060 |
await writeObject(newRef, appearanceStream, buffer, xref); |
| 51061 |
changes.push({ |
| 51062 |
ref: newRef, |
| 51063 |
data: buffer.join(""), |
| 51064 |
xfa: null, |
| 51065 |
needAppearances: false |
| 51066 |
}); |
| 51067 |
buffer.length = 0; |
| 51068 |
} |
| 51069 |
dict.set("M", `D:${getModificationDate()}`); |
| 51070 |
await writeObject(this.ref, dict, buffer, xref); |
| 51071 |
changes[0].data = buffer.join(""); |
| 51072 |
return changes; |
| 51073 |
} |
| 51074 |
async _getAppearance(evaluator, task, intent, annotationStorage) { |
| 51075 |
const isPassword = this.hasFieldFlag(AnnotationFieldFlag.PASSWORD); |
| 51076 |
if (isPassword) { |
| 51077 |
return null; |
| 51078 |
} |
| 51079 |
const storageEntry = annotationStorage?.get(this.data.id); |
| 51080 |
let value, rotation; |
| 51081 |
if (storageEntry) { |
| 51082 |
value = storageEntry.formattedValue || storageEntry.value; |
| 51083 |
rotation = storageEntry.rotation; |
| 51084 |
} |
| 51085 |
if (rotation === undefined && value === undefined && !this._needAppearances) { |
| 51086 |
if (!this._hasValueFromXFA || this.appearance) { |
| 51087 |
return null; |
| 51088 |
} |
| 51089 |
} |
| 51090 |
const colors = this.getBorderAndBackgroundAppearances(annotationStorage); |
| 51091 |
if (value === undefined) { |
| 51092 |
value = this.data.fieldValue; |
| 51093 |
if (!value) { |
| 51094 |
return `/Tx BMC q ${colors}Q EMC`; |
| 51095 |
} |
| 51096 |
} |
| 51097 |
if (Array.isArray(value) && value.length === 1) { |
| 51098 |
value = value[0]; |
| 51099 |
} |
| 51100 |
assert(typeof value === "string", "Expected `value` to be a string."); |
| 51101 |
value = value.trimEnd(); |
| 51102 |
if (this.data.combo) { |
| 51103 |
const option = this.data.options.find(({ |
| 51104 |
exportValue |
| 51105 |
}) => value === exportValue); |
| 51106 |
value = option?.displayValue || value; |
| 51107 |
} |
| 51108 |
if (value === "") { |
| 51109 |
return `/Tx BMC q ${colors}Q EMC`; |
| 51110 |
} |
| 51111 |
if (rotation === undefined) { |
| 51112 |
rotation = this.rotation; |
| 51113 |
} |
| 51114 |
let lineCount = -1; |
| 51115 |
let lines; |
| 51116 |
if (this.data.multiLine) { |
| 51117 |
lines = value.split(/\r\n?|\n/).map(line => line.normalize("NFC")); |
| 51118 |
lineCount = lines.length; |
| 51119 |
} else { |
| 51120 |
lines = [value.replace(/\r\n?|\n/, "").normalize("NFC")]; |
| 51121 |
} |
| 51122 |
const defaultPadding = 1; |
| 51123 |
const defaultHPadding = 2; |
| 51124 |
let totalHeight = this.data.rect[3] - this.data.rect[1]; |
| 51125 |
let totalWidth = this.data.rect[2] - this.data.rect[0]; |
| 51126 |
if (rotation === 90 || rotation === 270) { |
| 51127 |
[totalWidth, totalHeight] = [totalHeight, totalWidth]; |
| 51128 |
} |
| 51129 |
if (!this._defaultAppearance) { |
| 51130 |
this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance = "/Helvetica 0 Tf 0 g"); |
| 51131 |
} |
| 51132 |
let font = await WidgetAnnotation._getFontData(evaluator, task, this.data.defaultAppearanceData, this._fieldResources.mergedResources); |
| 51133 |
let defaultAppearance, fontSize, lineHeight; |
| 51134 |
const encodedLines = []; |
| 51135 |
let encodingError = false; |
| 51136 |
for (const line of lines) { |
| 51137 |
const encodedString = font.encodeString(line); |
| 51138 |
if (encodedString.length > 1) { |
| 51139 |
encodingError = true; |
| 51140 |
} |
| 51141 |
encodedLines.push(encodedString.join("")); |
| 51142 |
} |
| 51143 |
if (encodingError && intent & RenderingIntentFlag.SAVE) { |
| 51144 |
return { |
| 51145 |
needAppearances: true |
| 51146 |
}; |
| 51147 |
} |
| 51148 |
if (encodingError && this._isOffscreenCanvasSupported) { |
| 51149 |
const fontFamily = this.data.comb ? "monospace" : "sans-serif"; |
| 51150 |
const fakeUnicodeFont = new FakeUnicodeFont(evaluator.xref, fontFamily); |
| 51151 |
const resources = fakeUnicodeFont.createFontResources(lines.join("")); |
| 51152 |
const newFont = resources.getRaw("Font"); |
| 51153 |
if (this._fieldResources.mergedResources.has("Font")) { |
| 51154 |
const oldFont = this._fieldResources.mergedResources.get("Font"); |
| 51155 |
for (const key of newFont.getKeys()) { |
| 51156 |
oldFont.set(key, newFont.getRaw(key)); |
| 51157 |
} |
| 51158 |
} else { |
| 51159 |
this._fieldResources.mergedResources.set("Font", newFont); |
| 51160 |
} |
| 51161 |
const fontName = fakeUnicodeFont.fontName.name; |
| 51162 |
font = await WidgetAnnotation._getFontData(evaluator, task, { |
| 51163 |
fontName, |
| 51164 |
fontSize: 0 |
| 51165 |
}, resources); |
| 51166 |
for (let i = 0, ii = encodedLines.length; i < ii; i++) { |
| 51167 |
encodedLines[i] = stringToUTF16String(lines[i]); |
| 51168 |
} |
| 51169 |
const savedDefaultAppearance = Object.assign(Object.create(null), this.data.defaultAppearanceData); |
| 51170 |
this.data.defaultAppearanceData.fontSize = 0; |
| 51171 |
this.data.defaultAppearanceData.fontName = fontName; |
| 51172 |
[defaultAppearance, fontSize, lineHeight] = this._computeFontSize(totalHeight - 2 * defaultPadding, totalWidth - 2 * defaultHPadding, value, font, lineCount); |
| 51173 |
this.data.defaultAppearanceData = savedDefaultAppearance; |
| 51174 |
} else { |
| 51175 |
if (!this._isOffscreenCanvasSupported) { |
| 51176 |
warn("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly."); |
| 51177 |
} |
| 51178 |
[defaultAppearance, fontSize, lineHeight] = this._computeFontSize(totalHeight - 2 * defaultPadding, totalWidth - 2 * defaultHPadding, value, font, lineCount); |
| 51179 |
} |
| 51180 |
let descent = font.descent; |
| 51181 |
if (isNaN(descent)) { |
| 51182 |
descent = BASELINE_FACTOR * lineHeight; |
| 51183 |
} else { |
| 51184 |
descent = Math.max(BASELINE_FACTOR * lineHeight, Math.abs(descent) * fontSize); |
| 51185 |
} |
| 51186 |
const defaultVPadding = Math.min(Math.floor((totalHeight - fontSize) / 2), defaultPadding); |
| 51187 |
const alignment = this.data.textAlignment; |
| 51188 |
if (this.data.multiLine) { |
| 51189 |
return this._getMultilineAppearance(defaultAppearance, encodedLines, font, fontSize, totalWidth, totalHeight, alignment, defaultHPadding, defaultVPadding, descent, lineHeight, annotationStorage); |
| 51190 |
} |
| 51191 |
if (this.data.comb) { |
| 51192 |
return this._getCombAppearance(defaultAppearance, font, encodedLines[0], fontSize, totalWidth, totalHeight, defaultHPadding, defaultVPadding, descent, lineHeight, annotationStorage); |
| 51193 |
} |
| 51194 |
const bottomPadding = defaultVPadding + descent; |
| 51195 |
if (alignment === 0 || alignment > 2) { |
| 51196 |
return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 ${numberToString(defaultHPadding)} ${numberToString(bottomPadding)} Tm (${escapeString(encodedLines[0])}) Tj` + " ET Q EMC"; |
| 51197 |
} |
| 51198 |
const prevInfo = { |
| 51199 |
shift: 0 |
| 51200 |
}; |
| 51201 |
const renderedText = this._renderText(encodedLines[0], font, fontSize, totalWidth, alignment, prevInfo, defaultHPadding, bottomPadding); |
| 51202 |
return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 0 0 Tm ${renderedText}` + " ET Q EMC"; |
| 51203 |
} |
| 51204 |
static async _getFontData(evaluator, task, appearanceData, resources) { |
| 51205 |
const operatorList = new OperatorList(); |
| 51206 |
const initialState = { |
| 51207 |
font: null, |
| 51208 |
clone() { |
| 51209 |
return this; |
| 51210 |
} |
| 51211 |
}; |
| 51212 |
const { |
| 51213 |
fontName, |
| 51214 |
fontSize |
| 51215 |
} = appearanceData; |
| 51216 |
await evaluator.handleSetFont(resources, [fontName && Name.get(fontName), fontSize], null, operatorList, task, initialState, null); |
| 51217 |
return initialState.font; |
| 51218 |
} |
| 51219 |
_getTextWidth(text, font) { |
| 51220 |
return font.charsToGlyphs(text).reduce((width, glyph) => width + glyph.width, 0) / 1000; |
| 51221 |
} |
| 51222 |
_computeFontSize(height, width, text, font, lineCount) { |
| 51223 |
let { |
| 51224 |
fontSize |
| 51225 |
} = this.data.defaultAppearanceData; |
| 51226 |
let lineHeight = (fontSize || 12) * LINE_FACTOR, |
| 51227 |
numberOfLines = Math.round(height / lineHeight); |
| 51228 |
if (!fontSize) { |
| 51229 |
const roundWithTwoDigits = x => Math.floor(x * 100) / 100; |
| 51230 |
if (lineCount === -1) { |
| 51231 |
const textWidth = this._getTextWidth(text, font); |
| 51232 |
fontSize = roundWithTwoDigits(Math.min(height / LINE_FACTOR, width / textWidth)); |
| 51233 |
numberOfLines = 1; |
| 51234 |
} else { |
| 51235 |
const lines = text.split(/\r\n?|\n/); |
| 51236 |
const cachedLines = []; |
| 51237 |
for (const line of lines) { |
| 51238 |
const encoded = font.encodeString(line).join(""); |
| 51239 |
const glyphs = font.charsToGlyphs(encoded); |
| 51240 |
const positions = font.getCharPositions(encoded); |
| 51241 |
cachedLines.push({ |
| 51242 |
line: encoded, |
| 51243 |
glyphs, |
| 51244 |
positions |
| 51245 |
}); |
| 51246 |
} |
| 51247 |
const isTooBig = fsize => { |
| 51248 |
let totalHeight = 0; |
| 51249 |
for (const cache of cachedLines) { |
| 51250 |
const chunks = this._splitLine(null, font, fsize, width, cache); |
| 51251 |
totalHeight += chunks.length * fsize; |
| 51252 |
if (totalHeight > height) { |
| 51253 |
return true; |
| 51254 |
} |
| 51255 |
} |
| 51256 |
return false; |
| 51257 |
}; |
| 51258 |
numberOfLines = Math.max(numberOfLines, lineCount); |
| 51259 |
while (true) { |
| 51260 |
lineHeight = height / numberOfLines; |
| 51261 |
fontSize = roundWithTwoDigits(lineHeight / LINE_FACTOR); |
| 51262 |
if (isTooBig(fontSize)) { |
| 51263 |
numberOfLines++; |
| 51264 |
continue; |
| 51265 |
} |
| 51266 |
break; |
| 51267 |
} |
| 51268 |
} |
| 51269 |
const { |
| 51270 |
fontName, |
| 51271 |
fontColor |
| 51272 |
} = this.data.defaultAppearanceData; |
| 51273 |
this._defaultAppearance = createDefaultAppearance({ |
| 51274 |
fontSize, |
| 51275 |
fontName, |
| 51276 |
fontColor |
| 51277 |
}); |
| 51278 |
} |
| 51279 |
return [this._defaultAppearance, fontSize, height / numberOfLines]; |
| 51280 |
} |
| 51281 |
_renderText(text, font, fontSize, totalWidth, alignment, prevInfo, hPadding, vPadding) { |
| 51282 |
let shift; |
| 51283 |
if (alignment === 1) { |
| 51284 |
const width = this._getTextWidth(text, font) * fontSize; |
| 51285 |
shift = (totalWidth - width) / 2; |
| 51286 |
} else if (alignment === 2) { |
| 51287 |
const width = this._getTextWidth(text, font) * fontSize; |
| 51288 |
shift = totalWidth - width - hPadding; |
| 51289 |
} else { |
| 51290 |
shift = hPadding; |
| 51291 |
} |
| 51292 |
const shiftStr = numberToString(shift - prevInfo.shift); |
| 51293 |
prevInfo.shift = shift; |
| 51294 |
vPadding = numberToString(vPadding); |
| 51295 |
return `${shiftStr} ${vPadding} Td (${escapeString(text)}) Tj`; |
| 51296 |
} |
| 51297 |
_getSaveFieldResources(xref) { |
| 51298 |
const { |
| 51299 |
localResources, |
| 51300 |
appearanceResources, |
| 51301 |
acroFormResources |
| 51302 |
} = this._fieldResources; |
| 51303 |
const fontName = this.data.defaultAppearanceData?.fontName; |
| 51304 |
if (!fontName) { |
| 51305 |
return localResources || Dict.empty; |
| 51306 |
} |
| 51307 |
for (const resources of [localResources, appearanceResources]) { |
| 51308 |
if (resources instanceof Dict) { |
| 51309 |
const localFont = resources.get("Font"); |
| 51310 |
if (localFont instanceof Dict && localFont.has(fontName)) { |
| 51311 |
return resources; |
| 51312 |
} |
| 51313 |
} |
| 51314 |
} |
| 51315 |
if (acroFormResources instanceof Dict) { |
| 51316 |
const acroFormFont = acroFormResources.get("Font"); |
| 51317 |
if (acroFormFont instanceof Dict && acroFormFont.has(fontName)) { |
| 51318 |
const subFontDict = new Dict(xref); |
| 51319 |
subFontDict.set(fontName, acroFormFont.getRaw(fontName)); |
| 51320 |
const subResourcesDict = new Dict(xref); |
| 51321 |
subResourcesDict.set("Font", subFontDict); |
| 51322 |
return Dict.merge({ |
| 51323 |
xref, |
| 51324 |
dictArray: [subResourcesDict, localResources], |
| 51325 |
mergeSubDicts: true |
| 51326 |
}); |
| 51327 |
} |
| 51328 |
} |
| 51329 |
return localResources || Dict.empty; |
| 51330 |
} |
| 51331 |
getFieldObject() { |
| 51332 |
return null; |
| 51333 |
} |
| 51334 |
} |
| 51335 |
class TextWidgetAnnotation extends WidgetAnnotation { |
| 51336 |
constructor(params) { |
| 51337 |
super(params); |
| 51338 |
const { |
| 51339 |
dict |
| 51340 |
} = params; |
| 51341 |
if (dict.has("PMD")) { |
| 51342 |
this.flags |= AnnotationFlag.HIDDEN; |
| 51343 |
this.data.hidden = true; |
| 51344 |
warn("Barcodes are not supported"); |
| 51345 |
} |
| 51346 |
this.data.hasOwnCanvas = this.data.readOnly && !this.data.noHTML; |
| 51347 |
this._hasText = true; |
| 51348 |
if (typeof this.data.fieldValue !== "string") { |
| 51349 |
this.data.fieldValue = ""; |
| 51350 |
} |
| 51351 |
let alignment = getInheritableProperty({ |
| 51352 |
dict, |
| 51353 |
key: "Q" |
| 51354 |
}); |
| 51355 |
if (!Number.isInteger(alignment) || alignment < 0 || alignment > 2) { |
| 51356 |
alignment = null; |
| 51357 |
} |
| 51358 |
this.data.textAlignment = alignment; |
| 51359 |
let maximumLength = getInheritableProperty({ |
| 51360 |
dict, |
| 51361 |
key: "MaxLen" |
| 51362 |
}); |
| 51363 |
if (!Number.isInteger(maximumLength) || maximumLength < 0) { |
| 51364 |
maximumLength = 0; |
| 51365 |
} |
| 51366 |
this.data.maxLen = maximumLength; |
| 51367 |
this.data.multiLine = this.hasFieldFlag(AnnotationFieldFlag.MULTILINE); |
| 51368 |
this.data.comb = this.hasFieldFlag(AnnotationFieldFlag.COMB) && !this.hasFieldFlag(AnnotationFieldFlag.MULTILINE) && !this.hasFieldFlag(AnnotationFieldFlag.PASSWORD) && !this.hasFieldFlag(AnnotationFieldFlag.FILESELECT) && this.data.maxLen !== 0; |
| 51369 |
this.data.doNotScroll = this.hasFieldFlag(AnnotationFieldFlag.DONOTSCROLL); |
| 51370 |
} |
| 51371 |
get hasTextContent() { |
| 51372 |
return !!this.appearance && !this._needAppearances; |
| 51373 |
} |
| 51374 |
_getCombAppearance(defaultAppearance, font, text, fontSize, width, height, hPadding, vPadding, descent, lineHeight, annotationStorage) { |
| 51375 |
const combWidth = width / this.data.maxLen; |
| 51376 |
const colors = this.getBorderAndBackgroundAppearances(annotationStorage); |
| 51377 |
const buf = []; |
| 51378 |
const positions = font.getCharPositions(text); |
| 51379 |
for (const [start, end] of positions) { |
| 51380 |
buf.push(`(${escapeString(text.substring(start, end))}) Tj`); |
| 51381 |
} |
| 51382 |
const renderedComb = buf.join(` ${numberToString(combWidth)} 0 Td `); |
| 51383 |
return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 ${numberToString(hPadding)} ${numberToString(vPadding + descent)} Tm ${renderedComb}` + " ET Q EMC"; |
| 51384 |
} |
| 51385 |
_getMultilineAppearance(defaultAppearance, lines, font, fontSize, width, height, alignment, hPadding, vPadding, descent, lineHeight, annotationStorage) { |
| 51386 |
const buf = []; |
| 51387 |
const totalWidth = width - 2 * hPadding; |
| 51388 |
const prevInfo = { |
| 51389 |
shift: 0 |
| 51390 |
}; |
| 51391 |
for (let i = 0, ii = lines.length; i < ii; i++) { |
| 51392 |
const line = lines[i]; |
| 51393 |
const chunks = this._splitLine(line, font, fontSize, totalWidth); |
| 51394 |
for (let j = 0, jj = chunks.length; j < jj; j++) { |
| 51395 |
const chunk = chunks[j]; |
| 51396 |
const vShift = i === 0 && j === 0 ? -vPadding - (lineHeight - descent) : -lineHeight; |
| 51397 |
buf.push(this._renderText(chunk, font, fontSize, width, alignment, prevInfo, hPadding, vShift)); |
| 51398 |
} |
| 51399 |
} |
| 51400 |
const colors = this.getBorderAndBackgroundAppearances(annotationStorage); |
| 51401 |
const renderedText = buf.join("\n"); |
| 51402 |
return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 0 ${numberToString(height)} Tm ${renderedText}` + " ET Q EMC"; |
| 51403 |
} |
| 51404 |
_splitLine(line, font, fontSize, width, cache = {}) { |
| 51405 |
line = cache.line || line; |
| 51406 |
const glyphs = cache.glyphs || font.charsToGlyphs(line); |
| 51407 |
if (glyphs.length <= 1) { |
| 51408 |
return [line]; |
| 51409 |
} |
| 51410 |
const positions = cache.positions || font.getCharPositions(line); |
| 51411 |
const scale = fontSize / 1000; |
| 51412 |
const chunks = []; |
| 51413 |
let lastSpacePosInStringStart = -1, |
| 51414 |
lastSpacePosInStringEnd = -1, |
| 51415 |
lastSpacePos = -1, |
| 51416 |
startChunk = 0, |
| 51417 |
currentWidth = 0; |
| 51418 |
for (let i = 0, ii = glyphs.length; i < ii; i++) { |
| 51419 |
const [start, end] = positions[i]; |
| 51420 |
const glyph = glyphs[i]; |
| 51421 |
const glyphWidth = glyph.width * scale; |
| 51422 |
if (glyph.unicode === " ") { |
| 51423 |
if (currentWidth + glyphWidth > width) { |
| 51424 |
chunks.push(line.substring(startChunk, start)); |
| 51425 |
startChunk = start; |
| 51426 |
currentWidth = glyphWidth; |
| 51427 |
lastSpacePosInStringStart = -1; |
| 51428 |
lastSpacePos = -1; |
| 51429 |
} else { |
| 51430 |
currentWidth += glyphWidth; |
| 51431 |
lastSpacePosInStringStart = start; |
| 51432 |
lastSpacePosInStringEnd = end; |
| 51433 |
lastSpacePos = i; |
| 51434 |
} |
| 51435 |
} else if (currentWidth + glyphWidth > width) { |
| 51436 |
if (lastSpacePosInStringStart !== -1) { |
| 51437 |
chunks.push(line.substring(startChunk, lastSpacePosInStringEnd)); |
| 51438 |
startChunk = lastSpacePosInStringEnd; |
| 51439 |
i = lastSpacePos + 1; |
| 51440 |
lastSpacePosInStringStart = -1; |
| 51441 |
currentWidth = 0; |
| 51442 |
} else { |
| 51443 |
chunks.push(line.substring(startChunk, start)); |
| 51444 |
startChunk = start; |
| 51445 |
currentWidth = glyphWidth; |
| 51446 |
} |
| 51447 |
} else { |
| 51448 |
currentWidth += glyphWidth; |
| 51449 |
} |
| 51450 |
} |
| 51451 |
if (startChunk < line.length) { |
| 51452 |
chunks.push(line.substring(startChunk, line.length)); |
| 51453 |
} |
| 51454 |
return chunks; |
| 51455 |
} |
| 51456 |
async extractTextContent(evaluator, task, viewBox) { |
| 51457 |
await super.extractTextContent(evaluator, task, viewBox); |
| 51458 |
const text = this.data.textContent; |
| 51459 |
if (!text) { |
| 51460 |
return; |
| 51461 |
} |
| 51462 |
const allText = text.join("\n"); |
| 51463 |
if (allText === this.data.fieldValue) { |
| 51464 |
return; |
| 51465 |
} |
| 51466 |
const regex = allText.replaceAll(/([.*+?^${}()|[\]\\])|(\s+)/g, (_m, p1) => p1 ? `\\${p1}` : "\\s+"); |
| 51467 |
if (new RegExp(`^\\s*${regex}\\s*$`).test(this.data.fieldValue)) { |
| 51468 |
this.data.textContent = this.data.fieldValue.split("\n"); |
| 51469 |
} |
| 51470 |
} |
| 51471 |
getFieldObject() { |
| 51472 |
return { |
| 51473 |
id: this.data.id, |
| 51474 |
value: this.data.fieldValue, |
| 51475 |
defaultValue: this.data.defaultFieldValue || "", |
| 51476 |
multiline: this.data.multiLine, |
| 51477 |
password: this.hasFieldFlag(AnnotationFieldFlag.PASSWORD), |
| 51478 |
charLimit: this.data.maxLen, |
| 51479 |
comb: this.data.comb, |
| 51480 |
editable: !this.data.readOnly, |
| 51481 |
hidden: this.data.hidden, |
| 51482 |
name: this.data.fieldName, |
| 51483 |
rect: this.data.rect, |
| 51484 |
actions: this.data.actions, |
| 51485 |
page: this.data.pageIndex, |
| 51486 |
strokeColor: this.data.borderColor, |
| 51487 |
fillColor: this.data.backgroundColor, |
| 51488 |
rotation: this.rotation, |
| 51489 |
type: "text" |
| 51490 |
}; |
| 51491 |
} |
| 51492 |
} |
| 51493 |
class ButtonWidgetAnnotation extends WidgetAnnotation { |
| 51494 |
constructor(params) { |
| 51495 |
super(params); |
| 51496 |
this.checkedAppearance = null; |
| 51497 |
this.uncheckedAppearance = null; |
| 51498 |
this.data.checkBox = !this.hasFieldFlag(AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON); |
| 51499 |
this.data.radioButton = this.hasFieldFlag(AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON); |
| 51500 |
this.data.pushButton = this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON); |
| 51501 |
this.data.isTooltipOnly = false; |
| 51502 |
if (this.data.checkBox) { |
| 51503 |
this._processCheckBox(params); |
| 51504 |
} else if (this.data.radioButton) { |
| 51505 |
this._processRadioButton(params); |
| 51506 |
} else if (this.data.pushButton) { |
| 51507 |
this.data.hasOwnCanvas = true; |
| 51508 |
this.data.noHTML = false; |
| 51509 |
this._processPushButton(params); |
| 51510 |
} else { |
| 51511 |
warn("Invalid field flags for button widget annotation"); |
| 51512 |
} |
| 51513 |
} |
| 51514 |
async getOperatorList(evaluator, task, intent, annotationStorage) { |
| 51515 |
if (this.data.pushButton) { |
| 51516 |
return super.getOperatorList(evaluator, task, intent, false, annotationStorage); |
| 51517 |
} |
| 51518 |
let value = null; |
| 51519 |
let rotation = null; |
| 51520 |
if (annotationStorage) { |
| 51521 |
const storageEntry = annotationStorage.get(this.data.id); |
| 51522 |
value = storageEntry ? storageEntry.value : null; |
| 51523 |
rotation = storageEntry ? storageEntry.rotation : null; |
| 51524 |
} |
| 51525 |
if (value === null && this.appearance) { |
| 51526 |
return super.getOperatorList(evaluator, task, intent, annotationStorage); |
| 51527 |
} |
| 51528 |
if (value === null || value === undefined) { |
| 51529 |
value = this.data.checkBox ? this.data.fieldValue === this.data.exportValue : this.data.fieldValue === this.data.buttonValue; |
| 51530 |
} |
| 51531 |
const appearance = value ? this.checkedAppearance : this.uncheckedAppearance; |
| 51532 |
if (appearance) { |
| 51533 |
const savedAppearance = this.appearance; |
| 51534 |
const savedMatrix = lookupMatrix(appearance.dict.getArray("Matrix"), IDENTITY_MATRIX); |
| 51535 |
if (rotation) { |
| 51536 |
appearance.dict.set("Matrix", this.getRotationMatrix(annotationStorage)); |
| 51537 |
} |
| 51538 |
this.appearance = appearance; |
| 51539 |
const operatorList = super.getOperatorList(evaluator, task, intent, annotationStorage); |
| 51540 |
this.appearance = savedAppearance; |
| 51541 |
appearance.dict.set("Matrix", savedMatrix); |
| 51542 |
return operatorList; |
| 51543 |
} |
| 51544 |
return { |
| 51545 |
opList: new OperatorList(), |
| 51546 |
separateForm: false, |
| 51547 |
separateCanvas: false |
| 51548 |
}; |
| 51549 |
} |
| 51550 |
async save(evaluator, task, annotationStorage) { |
| 51551 |
if (this.data.checkBox) { |
| 51552 |
return this._saveCheckbox(evaluator, task, annotationStorage); |
| 51553 |
} |
| 51554 |
if (this.data.radioButton) { |
| 51555 |
return this._saveRadioButton(evaluator, task, annotationStorage); |
| 51556 |
} |
| 51557 |
return null; |
| 51558 |
} |
| 51559 |
async _saveCheckbox(evaluator, task, annotationStorage) { |
| 51560 |
if (!annotationStorage) { |
| 51561 |
return null; |
| 51562 |
} |
| 51563 |
const storageEntry = annotationStorage.get(this.data.id); |
| 51564 |
const flags = this._buildFlags(storageEntry?.noView, storageEntry?.noPrint); |
| 51565 |
let rotation = storageEntry?.rotation, |
| 51566 |
value = storageEntry?.value; |
| 51567 |
if (rotation === undefined && flags === undefined) { |
| 51568 |
if (value === undefined) { |
| 51569 |
return null; |
| 51570 |
} |
| 51571 |
const defaultValue = this.data.fieldValue === this.data.exportValue; |
| 51572 |
if (defaultValue === value) { |
| 51573 |
return null; |
| 51574 |
} |
| 51575 |
} |
| 51576 |
let dict = evaluator.xref.fetchIfRef(this.ref); |
| 51577 |
if (!(dict instanceof Dict)) { |
| 51578 |
return null; |
| 51579 |
} |
| 51580 |
dict = dict.clone(); |
| 51581 |
if (rotation === undefined) { |
| 51582 |
rotation = this.rotation; |
| 51583 |
} |
| 51584 |
if (value === undefined) { |
| 51585 |
value = this.data.fieldValue === this.data.exportValue; |
| 51586 |
} |
| 51587 |
const xfa = { |
| 51588 |
path: this.data.fieldName, |
| 51589 |
value: value ? this.data.exportValue : "" |
| 51590 |
}; |
| 51591 |
const name = Name.get(value ? this.data.exportValue : "Off"); |
| 51592 |
dict.set("V", name); |
| 51593 |
dict.set("AS", name); |
| 51594 |
dict.set("M", `D:${getModificationDate()}`); |
| 51595 |
if (flags !== undefined) { |
| 51596 |
dict.set("F", flags); |
| 51597 |
} |
| 51598 |
const maybeMK = this._getMKDict(rotation); |
| 51599 |
if (maybeMK) { |
| 51600 |
dict.set("MK", maybeMK); |
| 51601 |
} |
| 51602 |
const buffer = []; |
| 51603 |
await writeObject(this.ref, dict, buffer, evaluator.xref); |
| 51604 |
return [{ |
| 51605 |
ref: this.ref, |
| 51606 |
data: buffer.join(""), |
| 51607 |
xfa |
| 51608 |
}]; |
| 51609 |
} |
| 51610 |
async _saveRadioButton(evaluator, task, annotationStorage) { |
| 51611 |
if (!annotationStorage) { |
| 51612 |
return null; |
| 51613 |
} |
| 51614 |
const storageEntry = annotationStorage.get(this.data.id); |
| 51615 |
const flags = this._buildFlags(storageEntry?.noView, storageEntry?.noPrint); |
| 51616 |
let rotation = storageEntry?.rotation, |
| 51617 |
value = storageEntry?.value; |
| 51618 |
if (rotation === undefined && flags === undefined) { |
| 51619 |
if (value === undefined) { |
| 51620 |
return null; |
| 51621 |
} |
| 51622 |
const defaultValue = this.data.fieldValue === this.data.buttonValue; |
| 51623 |
if (defaultValue === value) { |
| 51624 |
return null; |
| 51625 |
} |
| 51626 |
} |
| 51627 |
let dict = evaluator.xref.fetchIfRef(this.ref); |
| 51628 |
if (!(dict instanceof Dict)) { |
| 51629 |
return null; |
| 51630 |
} |
| 51631 |
dict = dict.clone(); |
| 51632 |
if (value === undefined) { |
| 51633 |
value = this.data.fieldValue === this.data.buttonValue; |
| 51634 |
} |
| 51635 |
if (rotation === undefined) { |
| 51636 |
rotation = this.rotation; |
| 51637 |
} |
| 51638 |
const xfa = { |
| 51639 |
path: this.data.fieldName, |
| 51640 |
value: value ? this.data.buttonValue : "" |
| 51641 |
}; |
| 51642 |
const name = Name.get(value ? this.data.buttonValue : "Off"); |
| 51643 |
const buffer = []; |
| 51644 |
let parentData = null; |
| 51645 |
if (value) { |
| 51646 |
if (this.parent instanceof Ref) { |
| 51647 |
const parent = evaluator.xref.fetch(this.parent); |
| 51648 |
parent.set("V", name); |
| 51649 |
await writeObject(this.parent, parent, buffer, evaluator.xref); |
| 51650 |
parentData = buffer.join(""); |
| 51651 |
buffer.length = 0; |
| 51652 |
} else if (this.parent instanceof Dict) { |
| 51653 |
this.parent.set("V", name); |
| 51654 |
} |
| 51655 |
} |
| 51656 |
if (!this.parent) { |
| 51657 |
dict.set("V", name); |
| 51658 |
} |
| 51659 |
dict.set("AS", name); |
| 51660 |
dict.set("M", `D:${getModificationDate()}`); |
| 51661 |
if (flags !== undefined) { |
| 51662 |
dict.set("F", flags); |
| 51663 |
} |
| 51664 |
const maybeMK = this._getMKDict(rotation); |
| 51665 |
if (maybeMK) { |
| 51666 |
dict.set("MK", maybeMK); |
| 51667 |
} |
| 51668 |
await writeObject(this.ref, dict, buffer, evaluator.xref); |
| 51669 |
const newRefs = [{ |
| 51670 |
ref: this.ref, |
| 51671 |
data: buffer.join(""), |
| 51672 |
xfa |
| 51673 |
}]; |
| 51674 |
if (parentData) { |
| 51675 |
newRefs.push({ |
| 51676 |
ref: this.parent, |
| 51677 |
data: parentData, |
| 51678 |
xfa: null |
| 51679 |
}); |
| 51680 |
} |
| 51681 |
return newRefs; |
| 51682 |
} |
| 51683 |
_getDefaultCheckedAppearance(params, type) { |
| 51684 |
const width = this.data.rect[2] - this.data.rect[0]; |
| 51685 |
const height = this.data.rect[3] - this.data.rect[1]; |
| 51686 |
const bbox = [0, 0, width, height]; |
| 51687 |
const FONT_RATIO = 0.8; |
| 51688 |
const fontSize = Math.min(width, height) * FONT_RATIO; |
| 51689 |
let metrics, char; |
| 51690 |
if (type === "check") { |
| 51691 |
metrics = { |
| 51692 |
width: 0.755 * fontSize, |
| 51693 |
height: 0.705 * fontSize |
| 51694 |
}; |
| 51695 |
char = "\x33"; |
| 51696 |
} else if (type === "disc") { |
| 51697 |
metrics = { |
| 51698 |
width: 0.791 * fontSize, |
| 51699 |
height: 0.705 * fontSize |
| 51700 |
}; |
| 51701 |
char = "\x6C"; |
| 51702 |
} else { |
| 51703 |
unreachable(`_getDefaultCheckedAppearance - unsupported type: ${type}`); |
| 51704 |
} |
| 51705 |
const xShift = numberToString((width - metrics.width) / 2); |
| 51706 |
const yShift = numberToString((height - metrics.height) / 2); |
| 51707 |
const appearance = `q BT /PdfJsZaDb ${fontSize} Tf 0 g ${xShift} ${yShift} Td (${char}) Tj ET Q`; |
| 51708 |
const appearanceStreamDict = new Dict(params.xref); |
| 51709 |
appearanceStreamDict.set("FormType", 1); |
| 51710 |
appearanceStreamDict.set("Subtype", Name.get("Form")); |
| 51711 |
appearanceStreamDict.set("Type", Name.get("XObject")); |
| 51712 |
appearanceStreamDict.set("BBox", bbox); |
| 51713 |
appearanceStreamDict.set("Matrix", [1, 0, 0, 1, 0, 0]); |
| 51714 |
appearanceStreamDict.set("Length", appearance.length); |
| 51715 |
const resources = new Dict(params.xref); |
| 51716 |
const font = new Dict(params.xref); |
| 51717 |
font.set("PdfJsZaDb", this.fallbackFontDict); |
| 51718 |
resources.set("Font", font); |
| 51719 |
appearanceStreamDict.set("Resources", resources); |
| 51720 |
this.checkedAppearance = new StringStream(appearance); |
| 51721 |
this.checkedAppearance.dict = appearanceStreamDict; |
| 51722 |
this._streams.push(this.checkedAppearance); |
| 51723 |
} |
| 51724 |
_processCheckBox(params) { |
| 51725 |
const customAppearance = params.dict.get("AP"); |
| 51726 |
if (!(customAppearance instanceof Dict)) { |
| 51727 |
return; |
| 51728 |
} |
| 51729 |
const normalAppearance = customAppearance.get("N"); |
| 51730 |
if (!(normalAppearance instanceof Dict)) { |
| 51731 |
return; |
| 51732 |
} |
| 51733 |
const asValue = this._decodeFormValue(params.dict.get("AS")); |
| 51734 |
if (typeof asValue === "string") { |
| 51735 |
this.data.fieldValue = asValue; |
| 51736 |
} |
| 51737 |
const yes = this.data.fieldValue !== null && this.data.fieldValue !== "Off" ? this.data.fieldValue : "Yes"; |
| 51738 |
const exportValues = normalAppearance.getKeys(); |
| 51739 |
if (exportValues.length === 0) { |
| 51740 |
exportValues.push("Off", yes); |
| 51741 |
} else if (exportValues.length === 1) { |
| 51742 |
if (exportValues[0] === "Off") { |
| 51743 |
exportValues.push(yes); |
| 51744 |
} else { |
| 51745 |
exportValues.unshift("Off"); |
| 51746 |
} |
| 51747 |
} else if (exportValues.includes(yes)) { |
| 51748 |
exportValues.length = 0; |
| 51749 |
exportValues.push("Off", yes); |
| 51750 |
} else { |
| 51751 |
const otherYes = exportValues.find(v => v !== "Off"); |
| 51752 |
exportValues.length = 0; |
| 51753 |
exportValues.push("Off", otherYes); |
| 51754 |
} |
| 51755 |
if (!exportValues.includes(this.data.fieldValue)) { |
| 51756 |
this.data.fieldValue = "Off"; |
| 51757 |
} |
| 51758 |
this.data.exportValue = exportValues[1]; |
| 51759 |
const checkedAppearance = normalAppearance.get(this.data.exportValue); |
| 51760 |
this.checkedAppearance = checkedAppearance instanceof BaseStream ? checkedAppearance : null; |
| 51761 |
const uncheckedAppearance = normalAppearance.get("Off"); |
| 51762 |
this.uncheckedAppearance = uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null; |
| 51763 |
if (this.checkedAppearance) { |
| 51764 |
this._streams.push(this.checkedAppearance); |
| 51765 |
} else { |
| 51766 |
this._getDefaultCheckedAppearance(params, "check"); |
| 51767 |
} |
| 51768 |
if (this.uncheckedAppearance) { |
| 51769 |
this._streams.push(this.uncheckedAppearance); |
| 51770 |
} |
| 51771 |
this._fallbackFontDict = this.fallbackFontDict; |
| 51772 |
if (this.data.defaultFieldValue === null) { |
| 51773 |
this.data.defaultFieldValue = "Off"; |
| 51774 |
} |
| 51775 |
} |
| 51776 |
_processRadioButton(params) { |
| 51777 |
this.data.buttonValue = null; |
| 51778 |
const fieldParent = params.dict.get("Parent"); |
| 51779 |
if (fieldParent instanceof Dict) { |
| 51780 |
this.parent = params.dict.getRaw("Parent"); |
| 51781 |
const fieldParentValue = fieldParent.get("V"); |
| 51782 |
if (fieldParentValue instanceof Name) { |
| 51783 |
this.data.fieldValue = this._decodeFormValue(fieldParentValue); |
| 51784 |
} |
| 51785 |
} |
| 51786 |
const appearanceStates = params.dict.get("AP"); |
| 51787 |
if (!(appearanceStates instanceof Dict)) { |
| 51788 |
return; |
| 51789 |
} |
| 51790 |
const normalAppearance = appearanceStates.get("N"); |
| 51791 |
if (!(normalAppearance instanceof Dict)) { |
| 51792 |
return; |
| 51793 |
} |
| 51794 |
for (const key of normalAppearance.getKeys()) { |
| 51795 |
if (key !== "Off") { |
| 51796 |
this.data.buttonValue = this._decodeFormValue(key); |
| 51797 |
break; |
| 51798 |
} |
| 51799 |
} |
| 51800 |
const checkedAppearance = normalAppearance.get(this.data.buttonValue); |
| 51801 |
this.checkedAppearance = checkedAppearance instanceof BaseStream ? checkedAppearance : null; |
| 51802 |
const uncheckedAppearance = normalAppearance.get("Off"); |
| 51803 |
this.uncheckedAppearance = uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null; |
| 51804 |
if (this.checkedAppearance) { |
| 51805 |
this._streams.push(this.checkedAppearance); |
| 51806 |
} else { |
| 51807 |
this._getDefaultCheckedAppearance(params, "disc"); |
| 51808 |
} |
| 51809 |
if (this.uncheckedAppearance) { |
| 51810 |
this._streams.push(this.uncheckedAppearance); |
| 51811 |
} |
| 51812 |
this._fallbackFontDict = this.fallbackFontDict; |
| 51813 |
if (this.data.defaultFieldValue === null) { |
| 51814 |
this.data.defaultFieldValue = "Off"; |
| 51815 |
} |
| 51816 |
} |
| 51817 |
_processPushButton(params) { |
| 51818 |
const { |
| 51819 |
dict, |
| 51820 |
annotationGlobals |
| 51821 |
} = params; |
| 51822 |
if (!dict.has("A") && !dict.has("AA") && !this.data.alternativeText) { |
| 51823 |
warn("Push buttons without action dictionaries are not supported"); |
| 51824 |
return; |
| 51825 |
} |
| 51826 |
this.data.isTooltipOnly = !dict.has("A") && !dict.has("AA"); |
| 51827 |
Catalog.parseDestDictionary({ |
| 51828 |
destDict: dict, |
| 51829 |
resultObj: this.data, |
| 51830 |
docBaseUrl: annotationGlobals.baseUrl, |
| 51831 |
docAttachments: annotationGlobals.attachments |
| 51832 |
}); |
| 51833 |
} |
| 51834 |
getFieldObject() { |
| 51835 |
let type = "button"; |
| 51836 |
let exportValues; |
| 51837 |
if (this.data.checkBox) { |
| 51838 |
type = "checkbox"; |
| 51839 |
exportValues = this.data.exportValue; |
| 51840 |
} else if (this.data.radioButton) { |
| 51841 |
type = "radiobutton"; |
| 51842 |
exportValues = this.data.buttonValue; |
| 51843 |
} |
| 51844 |
return { |
| 51845 |
id: this.data.id, |
| 51846 |
value: this.data.fieldValue || "Off", |
| 51847 |
defaultValue: this.data.defaultFieldValue, |
| 51848 |
exportValues, |
| 51849 |
editable: !this.data.readOnly, |
| 51850 |
name: this.data.fieldName, |
| 51851 |
rect: this.data.rect, |
| 51852 |
hidden: this.data.hidden, |
| 51853 |
actions: this.data.actions, |
| 51854 |
page: this.data.pageIndex, |
| 51855 |
strokeColor: this.data.borderColor, |
| 51856 |
fillColor: this.data.backgroundColor, |
| 51857 |
rotation: this.rotation, |
| 51858 |
type |
| 51859 |
}; |
| 51860 |
} |
| 51861 |
get fallbackFontDict() { |
| 51862 |
const dict = new Dict(); |
| 51863 |
dict.set("BaseFont", Name.get("ZapfDingbats")); |
| 51864 |
dict.set("Type", Name.get("FallbackType")); |
| 51865 |
dict.set("Subtype", Name.get("FallbackType")); |
| 51866 |
dict.set("Encoding", Name.get("ZapfDingbatsEncoding")); |
| 51867 |
return shadow(this, "fallbackFontDict", dict); |
| 51868 |
} |
| 51869 |
} |
| 51870 |
class ChoiceWidgetAnnotation extends WidgetAnnotation { |
| 51871 |
constructor(params) { |
| 51872 |
super(params); |
| 51873 |
const { |
| 51874 |
dict, |
| 51875 |
xref |
| 51876 |
} = params; |
| 51877 |
this.indices = dict.getArray("I"); |
| 51878 |
this.hasIndices = Array.isArray(this.indices) && this.indices.length > 0; |
| 51879 |
this.data.options = []; |
| 51880 |
const options = getInheritableProperty({ |
| 51881 |
dict, |
| 51882 |
key: "Opt" |
| 51883 |
}); |
| 51884 |
if (Array.isArray(options)) { |
| 51885 |
for (let i = 0, ii = options.length; i < ii; i++) { |
| 51886 |
const option = xref.fetchIfRef(options[i]); |
| 51887 |
const isOptionArray = Array.isArray(option); |
| 51888 |
this.data.options[i] = { |
| 51889 |
exportValue: this._decodeFormValue(isOptionArray ? xref.fetchIfRef(option[0]) : option), |
| 51890 |
displayValue: this._decodeFormValue(isOptionArray ? xref.fetchIfRef(option[1]) : option) |
| 51891 |
}; |
| 51892 |
} |
| 51893 |
} |
| 51894 |
if (!this.hasIndices) { |
| 51895 |
if (typeof this.data.fieldValue === "string") { |
| 51896 |
this.data.fieldValue = [this.data.fieldValue]; |
| 51897 |
} else if (!this.data.fieldValue) { |
| 51898 |
this.data.fieldValue = []; |
| 51899 |
} |
| 51900 |
} else { |
| 51901 |
this.data.fieldValue = []; |
| 51902 |
const ii = this.data.options.length; |
| 51903 |
for (const i of this.indices) { |
| 51904 |
if (Number.isInteger(i) && i >= 0 && i < ii) { |
| 51905 |
this.data.fieldValue.push(this.data.options[i].exportValue); |
| 51906 |
} |
| 51907 |
} |
| 51908 |
} |
| 51909 |
this.data.combo = this.hasFieldFlag(AnnotationFieldFlag.COMBO); |
| 51910 |
this.data.multiSelect = this.hasFieldFlag(AnnotationFieldFlag.MULTISELECT); |
| 51911 |
this._hasText = true; |
| 51912 |
} |
| 51913 |
getFieldObject() { |
| 51914 |
const type = this.data.combo ? "combobox" : "listbox"; |
| 51915 |
const value = this.data.fieldValue.length > 0 ? this.data.fieldValue[0] : null; |
| 51916 |
return { |
| 51917 |
id: this.data.id, |
| 51918 |
value, |
| 51919 |
defaultValue: this.data.defaultFieldValue, |
| 51920 |
editable: !this.data.readOnly, |
| 51921 |
name: this.data.fieldName, |
| 51922 |
rect: this.data.rect, |
| 51923 |
numItems: this.data.fieldValue.length, |
| 51924 |
multipleSelection: this.data.multiSelect, |
| 51925 |
hidden: this.data.hidden, |
| 51926 |
actions: this.data.actions, |
| 51927 |
items: this.data.options, |
| 51928 |
page: this.data.pageIndex, |
| 51929 |
strokeColor: this.data.borderColor, |
| 51930 |
fillColor: this.data.backgroundColor, |
| 51931 |
rotation: this.rotation, |
| 51932 |
type |
| 51933 |
}; |
| 51934 |
} |
| 51935 |
amendSavedDict(annotationStorage, dict) { |
| 51936 |
if (!this.hasIndices) { |
| 51937 |
return; |
| 51938 |
} |
| 51939 |
let values = annotationStorage?.get(this.data.id)?.value; |
| 51940 |
if (!Array.isArray(values)) { |
| 51941 |
values = [values]; |
| 51942 |
} |
| 51943 |
const indices = []; |
| 51944 |
const { |
| 51945 |
options |
| 51946 |
} = this.data; |
| 51947 |
for (let i = 0, j = 0, ii = options.length; i < ii; i++) { |
| 51948 |
if (options[i].exportValue === values[j]) { |
| 51949 |
indices.push(i); |
| 51950 |
j += 1; |
| 51951 |
} |
| 51952 |
} |
| 51953 |
dict.set("I", indices); |
| 51954 |
} |
| 51955 |
async _getAppearance(evaluator, task, intent, annotationStorage) { |
| 51956 |
if (this.data.combo) { |
| 51957 |
return super._getAppearance(evaluator, task, intent, annotationStorage); |
| 51958 |
} |
| 51959 |
let exportedValue, rotation; |
| 51960 |
const storageEntry = annotationStorage?.get(this.data.id); |
| 51961 |
if (storageEntry) { |
| 51962 |
rotation = storageEntry.rotation; |
| 51963 |
exportedValue = storageEntry.value; |
| 51964 |
} |
| 51965 |
if (rotation === undefined && exportedValue === undefined && !this._needAppearances) { |
| 51966 |
return null; |
| 51967 |
} |
| 51968 |
if (exportedValue === undefined) { |
| 51969 |
exportedValue = this.data.fieldValue; |
| 51970 |
} else if (!Array.isArray(exportedValue)) { |
| 51971 |
exportedValue = [exportedValue]; |
| 51972 |
} |
| 51973 |
const defaultPadding = 1; |
| 51974 |
const defaultHPadding = 2; |
| 51975 |
let totalHeight = this.data.rect[3] - this.data.rect[1]; |
| 51976 |
let totalWidth = this.data.rect[2] - this.data.rect[0]; |
| 51977 |
if (rotation === 90 || rotation === 270) { |
| 51978 |
[totalWidth, totalHeight] = [totalHeight, totalWidth]; |
| 51979 |
} |
| 51980 |
const lineCount = this.data.options.length; |
| 51981 |
const valueIndices = []; |
| 51982 |
for (let i = 0; i < lineCount; i++) { |
| 51983 |
const { |
| 51984 |
exportValue |
| 51985 |
} = this.data.options[i]; |
| 51986 |
if (exportedValue.includes(exportValue)) { |
| 51987 |
valueIndices.push(i); |
| 51988 |
} |
| 51989 |
} |
| 51990 |
if (!this._defaultAppearance) { |
| 51991 |
this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance = "/Helvetica 0 Tf 0 g"); |
| 51992 |
} |
| 51993 |
const font = await WidgetAnnotation._getFontData(evaluator, task, this.data.defaultAppearanceData, this._fieldResources.mergedResources); |
| 51994 |
let defaultAppearance; |
| 51995 |
let { |
| 51996 |
fontSize |
| 51997 |
} = this.data.defaultAppearanceData; |
| 51998 |
if (!fontSize) { |
| 51999 |
const lineHeight = (totalHeight - defaultPadding) / lineCount; |
| 52000 |
let lineWidth = -1; |
| 52001 |
let value; |
| 52002 |
for (const { |
| 52003 |
displayValue |
| 52004 |
} of this.data.options) { |
| 52005 |
const width = this._getTextWidth(displayValue, font); |
| 52006 |
if (width > lineWidth) { |
| 52007 |
lineWidth = width; |
| 52008 |
value = displayValue; |
| 52009 |
} |
| 52010 |
} |
| 52011 |
[defaultAppearance, fontSize] = this._computeFontSize(lineHeight, totalWidth - 2 * defaultHPadding, value, font, -1); |
| 52012 |
} else { |
| 52013 |
defaultAppearance = this._defaultAppearance; |
| 52014 |
} |
| 52015 |
const lineHeight = fontSize * LINE_FACTOR; |
| 52016 |
const vPadding = (lineHeight - fontSize) / 2; |
| 52017 |
const numberOfVisibleLines = Math.floor(totalHeight / lineHeight); |
| 52018 |
let firstIndex = 0; |
| 52019 |
if (valueIndices.length > 0) { |
| 52020 |
const minIndex = Math.min(...valueIndices); |
| 52021 |
const maxIndex = Math.max(...valueIndices); |
| 52022 |
firstIndex = Math.max(0, maxIndex - numberOfVisibleLines + 1); |
| 52023 |
if (firstIndex > minIndex) { |
| 52024 |
firstIndex = minIndex; |
| 52025 |
} |
| 52026 |
} |
| 52027 |
const end = Math.min(firstIndex + numberOfVisibleLines + 1, lineCount); |
| 52028 |
const buf = ["/Tx BMC q", `1 1 ${totalWidth} ${totalHeight} re W n`]; |
| 52029 |
if (valueIndices.length) { |
| 52030 |
buf.push("0.600006 0.756866 0.854904 rg"); |
| 52031 |
for (const index of valueIndices) { |
| 52032 |
if (firstIndex <= index && index < end) { |
| 52033 |
buf.push(`1 ${totalHeight - (index - firstIndex + 1) * lineHeight} ${totalWidth} ${lineHeight} re f`); |
| 52034 |
} |
| 52035 |
} |
| 52036 |
} |
| 52037 |
buf.push("BT", defaultAppearance, `1 0 0 1 0 ${totalHeight} Tm`); |
| 52038 |
const prevInfo = { |
| 52039 |
shift: 0 |
| 52040 |
}; |
| 52041 |
for (let i = firstIndex; i < end; i++) { |
| 52042 |
const { |
| 52043 |
displayValue |
| 52044 |
} = this.data.options[i]; |
| 52045 |
const vpadding = i === firstIndex ? vPadding : 0; |
| 52046 |
buf.push(this._renderText(displayValue, font, fontSize, totalWidth, 0, prevInfo, defaultHPadding, -lineHeight + vpadding)); |
| 52047 |
} |
| 52048 |
buf.push("ET Q EMC"); |
| 52049 |
return buf.join("\n"); |
| 52050 |
} |
| 52051 |
} |
| 52052 |
class SignatureWidgetAnnotation extends WidgetAnnotation { |
| 52053 |
constructor(params) { |
| 52054 |
super(params); |
| 52055 |
this.data.fieldValue = null; |
| 52056 |
this.data.hasOwnCanvas = this.data.noRotate; |
| 52057 |
this.data.noHTML = !this.data.hasOwnCanvas; |
| 52058 |
} |
| 52059 |
getFieldObject() { |
| 52060 |
return { |
| 52061 |
id: this.data.id, |
| 52062 |
value: null, |
| 52063 |
page: this.data.pageIndex, |
| 52064 |
type: "signature" |
| 52065 |
}; |
| 52066 |
} |
| 52067 |
} |
| 52068 |
class TextAnnotation extends MarkupAnnotation { |
| 52069 |
constructor(params) { |
| 52070 |
const DEFAULT_ICON_SIZE = 22; |
| 52071 |
super(params); |
| 52072 |
this.data.noRotate = true; |
| 52073 |
this.data.hasOwnCanvas = this.data.noRotate; |
| 52074 |
this.data.noHTML = false; |
| 52075 |
const { |
| 52076 |
dict |
| 52077 |
} = params; |
| 52078 |
this.data.annotationType = AnnotationType.TEXT; |
| 52079 |
if (this.data.hasAppearance) { |
| 52080 |
this.data.name = "NoIcon"; |
| 52081 |
} else { |
| 52082 |
this.data.rect[1] = this.data.rect[3] - DEFAULT_ICON_SIZE; |
| 52083 |
this.data.rect[2] = this.data.rect[0] + DEFAULT_ICON_SIZE; |
| 52084 |
this.data.name = dict.has("Name") ? dict.get("Name").name : "Note"; |
| 52085 |
} |
| 52086 |
if (dict.has("State")) { |
| 52087 |
this.data.state = dict.get("State") || null; |
| 52088 |
this.data.stateModel = dict.get("StateModel") || null; |
| 52089 |
} else { |
| 52090 |
this.data.state = null; |
| 52091 |
this.data.stateModel = null; |
| 52092 |
} |
| 52093 |
} |
| 52094 |
} |
| 52095 |
class LinkAnnotation extends Annotation { |
| 52096 |
constructor(params) { |
| 52097 |
super(params); |
| 52098 |
const { |
| 52099 |
dict, |
| 52100 |
annotationGlobals |
| 52101 |
} = params; |
| 52102 |
this.data.annotationType = AnnotationType.LINK; |
| 52103 |
this.data.noHTML = false; |
| 52104 |
const quadPoints = getQuadPoints(dict, this.rectangle); |
| 52105 |
if (quadPoints) { |
| 52106 |
this.data.quadPoints = quadPoints; |
| 52107 |
} |
| 52108 |
this.data.borderColor ||= this.data.color; |
| 52109 |
Catalog.parseDestDictionary({ |
| 52110 |
destDict: dict, |
| 52111 |
resultObj: this.data, |
| 52112 |
docBaseUrl: annotationGlobals.baseUrl, |
| 52113 |
docAttachments: annotationGlobals.attachments |
| 52114 |
}); |
| 52115 |
} |
| 52116 |
} |
| 52117 |
class PopupAnnotation extends Annotation { |
| 52118 |
constructor(params) { |
| 52119 |
super(params); |
| 52120 |
const { |
| 52121 |
dict |
| 52122 |
} = params; |
| 52123 |
this.data.annotationType = AnnotationType.POPUP; |
| 52124 |
this.data.noHTML = false; |
| 52125 |
if (this.data.rect[0] === this.data.rect[2] || this.data.rect[1] === this.data.rect[3]) { |
| 52126 |
this.data.rect = null; |
| 52127 |
} |
| 52128 |
let parentItem = dict.get("Parent"); |
| 52129 |
if (!parentItem) { |
| 52130 |
warn("Popup annotation has a missing or invalid parent annotation."); |
| 52131 |
return; |
| 52132 |
} |
| 52133 |
this.data.parentRect = lookupNormalRect(parentItem.getArray("Rect"), null); |
| 52134 |
const rt = parentItem.get("RT"); |
| 52135 |
if (isName(rt, AnnotationReplyType.GROUP)) { |
| 52136 |
parentItem = parentItem.get("IRT"); |
| 52137 |
} |
| 52138 |
if (!parentItem.has("M")) { |
| 52139 |
this.data.modificationDate = null; |
| 52140 |
} else { |
| 52141 |
this.setModificationDate(parentItem.get("M")); |
| 52142 |
this.data.modificationDate = this.modificationDate; |
| 52143 |
} |
| 52144 |
if (!parentItem.has("C")) { |
| 52145 |
this.data.color = null; |
| 52146 |
} else { |
| 52147 |
this.setColor(parentItem.getArray("C")); |
| 52148 |
this.data.color = this.color; |
| 52149 |
} |
| 52150 |
if (!this.viewable) { |
| 52151 |
const parentFlags = parentItem.get("F"); |
| 52152 |
if (this._isViewable(parentFlags)) { |
| 52153 |
this.setFlags(parentFlags); |
| 52154 |
} |
| 52155 |
} |
| 52156 |
this.setTitle(parentItem.get("T")); |
| 52157 |
this.data.titleObj = this._title; |
| 52158 |
this.setContents(parentItem.get("Contents")); |
| 52159 |
this.data.contentsObj = this._contents; |
| 52160 |
if (parentItem.has("RC")) { |
| 52161 |
this.data.richText = XFAFactory.getRichTextAsHtml(parentItem.get("RC")); |
| 52162 |
} |
| 52163 |
this.data.open = !!dict.get("Open"); |
| 52164 |
} |
| 52165 |
} |
| 52166 |
class FreeTextAnnotation extends MarkupAnnotation { |
| 52167 |
constructor(params) { |
| 52168 |
super(params); |
| 52169 |
this.data.hasOwnCanvas = this.data.noRotate; |
| 52170 |
this.data.isEditable = !this.data.noHTML; |
| 52171 |
this.data.noHTML = false; |
| 52172 |
const { |
| 52173 |
evaluatorOptions, |
| 52174 |
xref |
| 52175 |
} = params; |
| 52176 |
this.data.annotationType = AnnotationType.FREETEXT; |
| 52177 |
this.setDefaultAppearance(params); |
| 52178 |
this._hasAppearance = !!this.appearance; |
| 52179 |
if (this._hasAppearance) { |
| 52180 |
const { |
| 52181 |
fontColor, |
| 52182 |
fontSize |
| 52183 |
} = parseAppearanceStream(this.appearance, evaluatorOptions, xref); |
| 52184 |
this.data.defaultAppearanceData.fontColor = fontColor; |
| 52185 |
this.data.defaultAppearanceData.fontSize = fontSize || 10; |
| 52186 |
} else { |
| 52187 |
this.data.defaultAppearanceData.fontSize ||= 10; |
| 52188 |
const { |
| 52189 |
fontColor, |
| 52190 |
fontSize |
| 52191 |
} = this.data.defaultAppearanceData; |
| 52192 |
if (this._contents.str) { |
| 52193 |
this.data.textContent = this._contents.str.split(/\r\n?|\n/).map(line => line.trimEnd()); |
| 52194 |
const { |
| 52195 |
coords, |
| 52196 |
bbox, |
| 52197 |
matrix |
| 52198 |
} = FakeUnicodeFont.getFirstPositionInfo(this.rectangle, this.rotation, fontSize); |
| 52199 |
this.data.textPosition = this._transformPoint(coords, bbox, matrix); |
| 52200 |
} |
| 52201 |
if (this._isOffscreenCanvasSupported) { |
| 52202 |
const strokeAlpha = params.dict.get("CA"); |
| 52203 |
const fakeUnicodeFont = new FakeUnicodeFont(xref, "sans-serif"); |
| 52204 |
this.appearance = fakeUnicodeFont.createAppearance(this._contents.str, this.rectangle, this.rotation, fontSize, fontColor, strokeAlpha); |
| 52205 |
this._streams.push(this.appearance); |
| 52206 |
} else { |
| 52207 |
warn("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly."); |
| 52208 |
} |
| 52209 |
} |
| 52210 |
} |
| 52211 |
get hasTextContent() { |
| 52212 |
return this._hasAppearance; |
| 52213 |
} |
| 52214 |
static createNewDict(annotation, xref, { |
| 52215 |
apRef, |
| 52216 |
ap |
| 52217 |
}) { |
| 52218 |
const { |
| 52219 |
color, |
| 52220 |
fontSize, |
| 52221 |
oldAnnotation, |
| 52222 |
rect, |
| 52223 |
rotation, |
| 52224 |
user, |
| 52225 |
value |
| 52226 |
} = annotation; |
| 52227 |
const freetext = oldAnnotation || new Dict(xref); |
| 52228 |
freetext.set("Type", Name.get("Annot")); |
| 52229 |
freetext.set("Subtype", Name.get("FreeText")); |
| 52230 |
if (oldAnnotation) { |
| 52231 |
freetext.set("M", `D:${getModificationDate()}`); |
| 52232 |
freetext.delete("RC"); |
| 52233 |
} else { |
| 52234 |
freetext.set("CreationDate", `D:${getModificationDate()}`); |
| 52235 |
} |
| 52236 |
freetext.set("Rect", rect); |
| 52237 |
const da = `/Helv ${fontSize} Tf ${getPdfColor(color, true)}`; |
| 52238 |
freetext.set("DA", da); |
| 52239 |
freetext.set("Contents", stringToAsciiOrUTF16BE(value)); |
| 52240 |
freetext.set("F", 4); |
| 52241 |
freetext.set("Border", [0, 0, 0]); |
| 52242 |
freetext.set("Rotate", rotation); |
| 52243 |
if (user) { |
| 52244 |
freetext.set("T", stringToAsciiOrUTF16BE(user)); |
| 52245 |
} |
| 52246 |
if (apRef || ap) { |
| 52247 |
const n = new Dict(xref); |
| 52248 |
freetext.set("AP", n); |
| 52249 |
if (apRef) { |
| 52250 |
n.set("N", apRef); |
| 52251 |
} else { |
| 52252 |
n.set("N", ap); |
| 52253 |
} |
| 52254 |
} |
| 52255 |
return freetext; |
| 52256 |
} |
| 52257 |
static async createNewAppearanceStream(annotation, xref, params) { |
| 52258 |
const { |
| 52259 |
baseFontRef, |
| 52260 |
evaluator, |
| 52261 |
task |
| 52262 |
} = params; |
| 52263 |
const { |
| 52264 |
color, |
| 52265 |
fontSize, |
| 52266 |
rect, |
| 52267 |
rotation, |
| 52268 |
value |
| 52269 |
} = annotation; |
| 52270 |
const resources = new Dict(xref); |
| 52271 |
const font = new Dict(xref); |
| 52272 |
if (baseFontRef) { |
| 52273 |
font.set("Helv", baseFontRef); |
| 52274 |
} else { |
| 52275 |
const baseFont = new Dict(xref); |
| 52276 |
baseFont.set("BaseFont", Name.get("Helvetica")); |
| 52277 |
baseFont.set("Type", Name.get("Font")); |
| 52278 |
baseFont.set("Subtype", Name.get("Type1")); |
| 52279 |
baseFont.set("Encoding", Name.get("WinAnsiEncoding")); |
| 52280 |
font.set("Helv", baseFont); |
| 52281 |
} |
| 52282 |
resources.set("Font", font); |
| 52283 |
const helv = await WidgetAnnotation._getFontData(evaluator, task, { |
| 52284 |
fontName: "Helv", |
| 52285 |
fontSize |
| 52286 |
}, resources); |
| 52287 |
const [x1, y1, x2, y2] = rect; |
| 52288 |
let w = x2 - x1; |
| 52289 |
let h = y2 - y1; |
| 52290 |
if (rotation % 180 !== 0) { |
| 52291 |
[w, h] = [h, w]; |
| 52292 |
} |
| 52293 |
const lines = value.split("\n"); |
| 52294 |
const scale = fontSize / 1000; |
| 52295 |
let totalWidth = -Infinity; |
| 52296 |
const encodedLines = []; |
| 52297 |
for (let line of lines) { |
| 52298 |
const encoded = helv.encodeString(line); |
| 52299 |
if (encoded.length > 1) { |
| 52300 |
return null; |
| 52301 |
} |
| 52302 |
line = encoded.join(""); |
| 52303 |
encodedLines.push(line); |
| 52304 |
let lineWidth = 0; |
| 52305 |
const glyphs = helv.charsToGlyphs(line); |
| 52306 |
for (const glyph of glyphs) { |
| 52307 |
lineWidth += glyph.width * scale; |
| 52308 |
} |
| 52309 |
totalWidth = Math.max(totalWidth, lineWidth); |
| 52310 |
} |
| 52311 |
let hscale = 1; |
| 52312 |
if (totalWidth > w) { |
| 52313 |
hscale = w / totalWidth; |
| 52314 |
} |
| 52315 |
let vscale = 1; |
| 52316 |
const lineHeight = LINE_FACTOR * fontSize; |
| 52317 |
const lineAscent = (LINE_FACTOR - LINE_DESCENT_FACTOR) * fontSize; |
| 52318 |
const totalHeight = lineHeight * lines.length; |
| 52319 |
if (totalHeight > h) { |
| 52320 |
vscale = h / totalHeight; |
| 52321 |
} |
| 52322 |
const fscale = Math.min(hscale, vscale); |
| 52323 |
const newFontSize = fontSize * fscale; |
| 52324 |
let firstPoint, clipBox, matrix; |
| 52325 |
switch (rotation) { |
| 52326 |
case 0: |
| 52327 |
matrix = [1, 0, 0, 1]; |
| 52328 |
clipBox = [rect[0], rect[1], w, h]; |
| 52329 |
firstPoint = [rect[0], rect[3] - lineAscent]; |
| 52330 |
break; |
| 52331 |
case 90: |
| 52332 |
matrix = [0, 1, -1, 0]; |
| 52333 |
clipBox = [rect[1], -rect[2], w, h]; |
| 52334 |
firstPoint = [rect[1], -rect[0] - lineAscent]; |
| 52335 |
break; |
| 52336 |
case 180: |
| 52337 |
matrix = [-1, 0, 0, -1]; |
| 52338 |
clipBox = [-rect[2], -rect[3], w, h]; |
| 52339 |
firstPoint = [-rect[2], -rect[1] - lineAscent]; |
| 52340 |
break; |
| 52341 |
case 270: |
| 52342 |
matrix = [0, -1, 1, 0]; |
| 52343 |
clipBox = [-rect[3], rect[0], w, h]; |
| 52344 |
firstPoint = [-rect[3], rect[2] - lineAscent]; |
| 52345 |
break; |
| 52346 |
} |
| 52347 |
const buffer = ["q", `${matrix.join(" ")} 0 0 cm`, `${clipBox.join(" ")} re W n`, `BT`, `${getPdfColor(color, true)}`, `0 Tc /Helv ${numberToString(newFontSize)} Tf`]; |
| 52348 |
buffer.push(`${firstPoint.join(" ")} Td (${escapeString(encodedLines[0])}) Tj`); |
| 52349 |
const vShift = numberToString(lineHeight); |
| 52350 |
for (let i = 1, ii = encodedLines.length; i < ii; i++) { |
| 52351 |
const line = encodedLines[i]; |
| 52352 |
buffer.push(`0 -${vShift} Td (${escapeString(line)}) Tj`); |
| 52353 |
} |
| 52354 |
buffer.push("ET", "Q"); |
| 52355 |
const appearance = buffer.join("\n"); |
| 52356 |
const appearanceStreamDict = new Dict(xref); |
| 52357 |
appearanceStreamDict.set("FormType", 1); |
| 52358 |
appearanceStreamDict.set("Subtype", Name.get("Form")); |
| 52359 |
appearanceStreamDict.set("Type", Name.get("XObject")); |
| 52360 |
appearanceStreamDict.set("BBox", rect); |
| 52361 |
appearanceStreamDict.set("Resources", resources); |
| 52362 |
appearanceStreamDict.set("Matrix", [1, 0, 0, 1, -rect[0], -rect[1]]); |
| 52363 |
const ap = new StringStream(appearance); |
| 52364 |
ap.dict = appearanceStreamDict; |
| 52365 |
return ap; |
| 52366 |
} |
| 52367 |
} |
| 52368 |
class LineAnnotation extends MarkupAnnotation { |
| 52369 |
constructor(params) { |
| 52370 |
super(params); |
| 52371 |
const { |
| 52372 |
dict, |
| 52373 |
xref |
| 52374 |
} = params; |
| 52375 |
this.data.annotationType = AnnotationType.LINE; |
| 52376 |
this.data.hasOwnCanvas = this.data.noRotate; |
| 52377 |
this.data.noHTML = false; |
| 52378 |
const lineCoordinates = lookupRect(dict.getArray("L"), [0, 0, 0, 0]); |
| 52379 |
this.data.lineCoordinates = Util.normalizeRect(lineCoordinates); |
| 52380 |
this.setLineEndings(dict.getArray("LE")); |
| 52381 |
this.data.lineEndings = this.lineEndings; |
| 52382 |
if (!this.appearance) { |
| 52383 |
const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; |
| 52384 |
const strokeAlpha = dict.get("CA"); |
| 52385 |
const interiorColor = getRgbColor(dict.getArray("IC"), null); |
| 52386 |
const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null; |
| 52387 |
const fillAlpha = fillColor ? strokeAlpha : null; |
| 52388 |
const borderWidth = this.borderStyle.width || 1, |
| 52389 |
borderAdjust = 2 * borderWidth; |
| 52390 |
const bbox = [this.data.lineCoordinates[0] - borderAdjust, this.data.lineCoordinates[1] - borderAdjust, this.data.lineCoordinates[2] + borderAdjust, this.data.lineCoordinates[3] + borderAdjust]; |
| 52391 |
if (!Util.intersect(this.rectangle, bbox)) { |
| 52392 |
this.rectangle = bbox; |
| 52393 |
} |
| 52394 |
this._setDefaultAppearance({ |
| 52395 |
xref, |
| 52396 |
extra: `${borderWidth} w`, |
| 52397 |
strokeColor, |
| 52398 |
fillColor, |
| 52399 |
strokeAlpha, |
| 52400 |
fillAlpha, |
| 52401 |
pointsCallback: (buffer, points) => { |
| 52402 |
buffer.push(`${lineCoordinates[0]} ${lineCoordinates[1]} m`, `${lineCoordinates[2]} ${lineCoordinates[3]} l`, "S"); |
| 52403 |
return [points[0] - borderWidth, points[2] + borderWidth, points[7] - borderWidth, points[3] + borderWidth]; |
| 52404 |
} |
| 52405 |
}); |
| 52406 |
} |
| 52407 |
} |
| 52408 |
} |
| 52409 |
class SquareAnnotation extends MarkupAnnotation { |
| 52410 |
constructor(params) { |
| 52411 |
super(params); |
| 52412 |
const { |
| 52413 |
dict, |
| 52414 |
xref |
| 52415 |
} = params; |
| 52416 |
this.data.annotationType = AnnotationType.SQUARE; |
| 52417 |
this.data.hasOwnCanvas = this.data.noRotate; |
| 52418 |
this.data.noHTML = false; |
| 52419 |
if (!this.appearance) { |
| 52420 |
const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; |
| 52421 |
const strokeAlpha = dict.get("CA"); |
| 52422 |
const interiorColor = getRgbColor(dict.getArray("IC"), null); |
| 52423 |
const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null; |
| 52424 |
const fillAlpha = fillColor ? strokeAlpha : null; |
| 52425 |
if (this.borderStyle.width === 0 && !fillColor) { |
| 52426 |
return; |
| 52427 |
} |
| 52428 |
this._setDefaultAppearance({ |
| 52429 |
xref, |
| 52430 |
extra: `${this.borderStyle.width} w`, |
| 52431 |
strokeColor, |
| 52432 |
fillColor, |
| 52433 |
strokeAlpha, |
| 52434 |
fillAlpha, |
| 52435 |
pointsCallback: (buffer, points) => { |
| 52436 |
const x = points[4] + this.borderStyle.width / 2; |
| 52437 |
const y = points[5] + this.borderStyle.width / 2; |
| 52438 |
const width = points[6] - points[4] - this.borderStyle.width; |
| 52439 |
const height = points[3] - points[7] - this.borderStyle.width; |
| 52440 |
buffer.push(`${x} ${y} ${width} ${height} re`); |
| 52441 |
if (fillColor) { |
| 52442 |
buffer.push("B"); |
| 52443 |
} else { |
| 52444 |
buffer.push("S"); |
| 52445 |
} |
| 52446 |
return [points[0], points[2], points[7], points[3]]; |
| 52447 |
} |
| 52448 |
}); |
| 52449 |
} |
| 52450 |
} |
| 52451 |
} |
| 52452 |
class CircleAnnotation extends MarkupAnnotation { |
| 52453 |
constructor(params) { |
| 52454 |
super(params); |
| 52455 |
const { |
| 52456 |
dict, |
| 52457 |
xref |
| 52458 |
} = params; |
| 52459 |
this.data.annotationType = AnnotationType.CIRCLE; |
| 52460 |
if (!this.appearance) { |
| 52461 |
const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; |
| 52462 |
const strokeAlpha = dict.get("CA"); |
| 52463 |
const interiorColor = getRgbColor(dict.getArray("IC"), null); |
| 52464 |
const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null; |
| 52465 |
const fillAlpha = fillColor ? strokeAlpha : null; |
| 52466 |
if (this.borderStyle.width === 0 && !fillColor) { |
| 52467 |
return; |
| 52468 |
} |
| 52469 |
const controlPointsDistance = 4 / 3 * Math.tan(Math.PI / (2 * 4)); |
| 52470 |
this._setDefaultAppearance({ |
| 52471 |
xref, |
| 52472 |
extra: `${this.borderStyle.width} w`, |
| 52473 |
strokeColor, |
| 52474 |
fillColor, |
| 52475 |
strokeAlpha, |
| 52476 |
fillAlpha, |
| 52477 |
pointsCallback: (buffer, points) => { |
| 52478 |
const x0 = points[0] + this.borderStyle.width / 2; |
| 52479 |
const y0 = points[1] - this.borderStyle.width / 2; |
| 52480 |
const x1 = points[6] - this.borderStyle.width / 2; |
| 52481 |
const y1 = points[7] + this.borderStyle.width / 2; |
| 52482 |
const xMid = x0 + (x1 - x0) / 2; |
| 52483 |
const yMid = y0 + (y1 - y0) / 2; |
| 52484 |
const xOffset = (x1 - x0) / 2 * controlPointsDistance; |
| 52485 |
const yOffset = (y1 - y0) / 2 * controlPointsDistance; |
| 52486 |
buffer.push(`${xMid} ${y1} m`, `${xMid + xOffset} ${y1} ${x1} ${yMid + yOffset} ${x1} ${yMid} c`, `${x1} ${yMid - yOffset} ${xMid + xOffset} ${y0} ${xMid} ${y0} c`, `${xMid - xOffset} ${y0} ${x0} ${yMid - yOffset} ${x0} ${yMid} c`, `${x0} ${yMid + yOffset} ${xMid - xOffset} ${y1} ${xMid} ${y1} c`, "h"); |
| 52487 |
if (fillColor) { |
| 52488 |
buffer.push("B"); |
| 52489 |
} else { |
| 52490 |
buffer.push("S"); |
| 52491 |
} |
| 52492 |
return [points[0], points[2], points[7], points[3]]; |
| 52493 |
} |
| 52494 |
}); |
| 52495 |
} |
| 52496 |
} |
| 52497 |
} |
| 52498 |
class PolylineAnnotation extends MarkupAnnotation { |
| 52499 |
constructor(params) { |
| 52500 |
super(params); |
| 52501 |
const { |
| 52502 |
dict, |
| 52503 |
xref |
| 52504 |
} = params; |
| 52505 |
this.data.annotationType = AnnotationType.POLYLINE; |
| 52506 |
this.data.hasOwnCanvas = this.data.noRotate; |
| 52507 |
this.data.noHTML = false; |
| 52508 |
this.data.vertices = null; |
| 52509 |
if (!(this instanceof PolygonAnnotation)) { |
| 52510 |
this.setLineEndings(dict.getArray("LE")); |
| 52511 |
this.data.lineEndings = this.lineEndings; |
| 52512 |
} |
| 52513 |
const rawVertices = dict.getArray("Vertices"); |
| 52514 |
if (!isNumberArray(rawVertices, null)) { |
| 52515 |
return; |
| 52516 |
} |
| 52517 |
const vertices = this.data.vertices = Float32Array.from(rawVertices); |
| 52518 |
if (!this.appearance) { |
| 52519 |
const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; |
| 52520 |
const strokeAlpha = dict.get("CA"); |
| 52521 |
const borderWidth = this.borderStyle.width || 1, |
| 52522 |
borderAdjust = 2 * borderWidth; |
| 52523 |
const bbox = [Infinity, Infinity, -Infinity, -Infinity]; |
| 52524 |
for (let i = 0, ii = vertices.length; i < ii; i += 2) { |
| 52525 |
bbox[0] = Math.min(bbox[0], vertices[i] - borderAdjust); |
| 52526 |
bbox[1] = Math.min(bbox[1], vertices[i + 1] - borderAdjust); |
| 52527 |
bbox[2] = Math.max(bbox[2], vertices[i] + borderAdjust); |
| 52528 |
bbox[3] = Math.max(bbox[3], vertices[i + 1] + borderAdjust); |
| 52529 |
} |
| 52530 |
if (!Util.intersect(this.rectangle, bbox)) { |
| 52531 |
this.rectangle = bbox; |
| 52532 |
} |
| 52533 |
this._setDefaultAppearance({ |
| 52534 |
xref, |
| 52535 |
extra: `${borderWidth} w`, |
| 52536 |
strokeColor, |
| 52537 |
strokeAlpha, |
| 52538 |
pointsCallback: (buffer, points) => { |
| 52539 |
for (let i = 0, ii = vertices.length; i < ii; i += 2) { |
| 52540 |
buffer.push(`${vertices[i]} ${vertices[i + 1]} ${i === 0 ? "m" : "l"}`); |
| 52541 |
} |
| 52542 |
buffer.push("S"); |
| 52543 |
return [points[0], points[2], points[7], points[3]]; |
| 52544 |
} |
| 52545 |
}); |
| 52546 |
} |
| 52547 |
} |
| 52548 |
} |
| 52549 |
class PolygonAnnotation extends PolylineAnnotation { |
| 52550 |
constructor(params) { |
| 52551 |
super(params); |
| 52552 |
this.data.annotationType = AnnotationType.POLYGON; |
| 52553 |
} |
| 52554 |
} |
| 52555 |
class CaretAnnotation extends MarkupAnnotation { |
| 52556 |
constructor(params) { |
| 52557 |
super(params); |
| 52558 |
this.data.annotationType = AnnotationType.CARET; |
| 52559 |
} |
| 52560 |
} |
| 52561 |
class InkAnnotation extends MarkupAnnotation { |
| 52562 |
constructor(params) { |
| 52563 |
super(params); |
| 52564 |
this.data.hasOwnCanvas = this.data.noRotate; |
| 52565 |
this.data.noHTML = false; |
| 52566 |
const { |
| 52567 |
dict, |
| 52568 |
xref |
| 52569 |
} = params; |
| 52570 |
this.data.annotationType = AnnotationType.INK; |
| 52571 |
this.data.inkLists = []; |
| 52572 |
this.data.isEditable = !this.data.noHTML && this.data.it === "InkHighlight"; |
| 52573 |
this.data.noHTML = false; |
| 52574 |
this.data.opacity = dict.get("CA") || 1; |
| 52575 |
const rawInkLists = dict.getArray("InkList"); |
| 52576 |
if (!Array.isArray(rawInkLists)) { |
| 52577 |
return; |
| 52578 |
} |
| 52579 |
for (let i = 0, ii = rawInkLists.length; i < ii; ++i) { |
| 52580 |
if (!Array.isArray(rawInkLists[i])) { |
| 52581 |
continue; |
| 52582 |
} |
| 52583 |
const inkList = new Float32Array(rawInkLists[i].length); |
| 52584 |
this.data.inkLists.push(inkList); |
| 52585 |
for (let j = 0, jj = rawInkLists[i].length; j < jj; j += 2) { |
| 52586 |
const x = xref.fetchIfRef(rawInkLists[i][j]), |
| 52587 |
y = xref.fetchIfRef(rawInkLists[i][j + 1]); |
| 52588 |
if (typeof x === "number" && typeof y === "number") { |
| 52589 |
inkList[j] = x; |
| 52590 |
inkList[j + 1] = y; |
| 52591 |
} |
| 52592 |
} |
| 52593 |
} |
| 52594 |
if (!this.appearance) { |
| 52595 |
const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; |
| 52596 |
const strokeAlpha = dict.get("CA"); |
| 52597 |
const borderWidth = this.borderStyle.width || 1, |
| 52598 |
borderAdjust = 2 * borderWidth; |
| 52599 |
const bbox = [Infinity, Infinity, -Infinity, -Infinity]; |
| 52600 |
for (const inkList of this.data.inkLists) { |
| 52601 |
for (let i = 0, ii = inkList.length; i < ii; i += 2) { |
| 52602 |
bbox[0] = Math.min(bbox[0], inkList[i] - borderAdjust); |
| 52603 |
bbox[1] = Math.min(bbox[1], inkList[i + 1] - borderAdjust); |
| 52604 |
bbox[2] = Math.max(bbox[2], inkList[i] + borderAdjust); |
| 52605 |
bbox[3] = Math.max(bbox[3], inkList[i + 1] + borderAdjust); |
| 52606 |
} |
| 52607 |
} |
| 52608 |
if (!Util.intersect(this.rectangle, bbox)) { |
| 52609 |
this.rectangle = bbox; |
| 52610 |
} |
| 52611 |
this._setDefaultAppearance({ |
| 52612 |
xref, |
| 52613 |
extra: `${borderWidth} w`, |
| 52614 |
strokeColor, |
| 52615 |
strokeAlpha, |
| 52616 |
pointsCallback: (buffer, points) => { |
| 52617 |
for (const inkList of this.data.inkLists) { |
| 52618 |
for (let i = 0, ii = inkList.length; i < ii; i += 2) { |
| 52619 |
buffer.push(`${inkList[i]} ${inkList[i + 1]} ${i === 0 ? "m" : "l"}`); |
| 52620 |
} |
| 52621 |
buffer.push("S"); |
| 52622 |
} |
| 52623 |
return [points[0], points[2], points[7], points[3]]; |
| 52624 |
} |
| 52625 |
}); |
| 52626 |
} |
| 52627 |
} |
| 52628 |
static createNewDict(annotation, xref, { |
| 52629 |
apRef, |
| 52630 |
ap |
| 52631 |
}) { |
| 52632 |
const { |
| 52633 |
color, |
| 52634 |
opacity, |
| 52635 |
paths, |
| 52636 |
outlines, |
| 52637 |
rect, |
| 52638 |
rotation, |
| 52639 |
thickness |
| 52640 |
} = annotation; |
| 52641 |
const ink = new Dict(xref); |
| 52642 |
ink.set("Type", Name.get("Annot")); |
| 52643 |
ink.set("Subtype", Name.get("Ink")); |
| 52644 |
ink.set("CreationDate", `D:${getModificationDate()}`); |
| 52645 |
ink.set("Rect", rect); |
| 52646 |
ink.set("InkList", outlines?.points || paths.map(p => p.points)); |
| 52647 |
ink.set("F", 4); |
| 52648 |
ink.set("Rotate", rotation); |
| 52649 |
if (outlines) { |
| 52650 |
ink.set("IT", Name.get("InkHighlight")); |
| 52651 |
} |
| 52652 |
const bs = new Dict(xref); |
| 52653 |
ink.set("BS", bs); |
| 52654 |
bs.set("W", thickness); |
| 52655 |
ink.set("C", Array.from(color, c => c / 255)); |
| 52656 |
ink.set("CA", opacity); |
| 52657 |
const n = new Dict(xref); |
| 52658 |
ink.set("AP", n); |
| 52659 |
if (apRef) { |
| 52660 |
n.set("N", apRef); |
| 52661 |
} else { |
| 52662 |
n.set("N", ap); |
| 52663 |
} |
| 52664 |
return ink; |
| 52665 |
} |
| 52666 |
static async createNewAppearanceStream(annotation, xref, params) { |
| 52667 |
if (annotation.outlines) { |
| 52668 |
return this.createNewAppearanceStreamForHighlight(annotation, xref, params); |
| 52669 |
} |
| 52670 |
const { |
| 52671 |
color, |
| 52672 |
rect, |
| 52673 |
paths, |
| 52674 |
thickness, |
| 52675 |
opacity |
| 52676 |
} = annotation; |
| 52677 |
const appearanceBuffer = [`${thickness} w 1 J 1 j`, `${getPdfColor(color, false)}`]; |
| 52678 |
if (opacity !== 1) { |
| 52679 |
appearanceBuffer.push("/R0 gs"); |
| 52680 |
} |
| 52681 |
const buffer = []; |
| 52682 |
for (const { |
| 52683 |
bezier |
| 52684 |
} of paths) { |
| 52685 |
buffer.length = 0; |
| 52686 |
buffer.push(`${numberToString(bezier[0])} ${numberToString(bezier[1])} m`); |
| 52687 |
if (bezier.length === 2) { |
| 52688 |
buffer.push(`${numberToString(bezier[0])} ${numberToString(bezier[1])} l S`); |
| 52689 |
} else { |
| 52690 |
for (let i = 2, ii = bezier.length; i < ii; i += 6) { |
| 52691 |
const curve = bezier.slice(i, i + 6).map(numberToString).join(" "); |
| 52692 |
buffer.push(`${curve} c`); |
| 52693 |
} |
| 52694 |
buffer.push("S"); |
| 52695 |
} |
| 52696 |
appearanceBuffer.push(buffer.join("\n")); |
| 52697 |
} |
| 52698 |
const appearance = appearanceBuffer.join("\n"); |
| 52699 |
const appearanceStreamDict = new Dict(xref); |
| 52700 |
appearanceStreamDict.set("FormType", 1); |
| 52701 |
appearanceStreamDict.set("Subtype", Name.get("Form")); |
| 52702 |
appearanceStreamDict.set("Type", Name.get("XObject")); |
| 52703 |
appearanceStreamDict.set("BBox", rect); |
| 52704 |
appearanceStreamDict.set("Length", appearance.length); |
| 52705 |
if (opacity !== 1) { |
| 52706 |
const resources = new Dict(xref); |
| 52707 |
const extGState = new Dict(xref); |
| 52708 |
const r0 = new Dict(xref); |
| 52709 |
r0.set("CA", opacity); |
| 52710 |
r0.set("Type", Name.get("ExtGState")); |
| 52711 |
extGState.set("R0", r0); |
| 52712 |
resources.set("ExtGState", extGState); |
| 52713 |
appearanceStreamDict.set("Resources", resources); |
| 52714 |
} |
| 52715 |
const ap = new StringStream(appearance); |
| 52716 |
ap.dict = appearanceStreamDict; |
| 52717 |
return ap; |
| 52718 |
} |
| 52719 |
static async createNewAppearanceStreamForHighlight(annotation, xref, params) { |
| 52720 |
const { |
| 52721 |
color, |
| 52722 |
rect, |
| 52723 |
outlines: { |
| 52724 |
outline |
| 52725 |
}, |
| 52726 |
opacity |
| 52727 |
} = annotation; |
| 52728 |
const appearanceBuffer = [`${getPdfColor(color, true)}`, "/R0 gs"]; |
| 52729 |
appearanceBuffer.push(`${numberToString(outline[4])} ${numberToString(outline[5])} m`); |
| 52730 |
for (let i = 6, ii = outline.length; i < ii; i += 6) { |
| 52731 |
if (isNaN(outline[i]) || outline[i] === null) { |
| 52732 |
appearanceBuffer.push(`${numberToString(outline[i + 4])} ${numberToString(outline[i + 5])} l`); |
| 52733 |
} else { |
| 52734 |
const curve = outline.slice(i, i + 6).map(numberToString).join(" "); |
| 52735 |
appearanceBuffer.push(`${curve} c`); |
| 52736 |
} |
| 52737 |
} |
| 52738 |
appearanceBuffer.push("h f"); |
| 52739 |
const appearance = appearanceBuffer.join("\n"); |
| 52740 |
const appearanceStreamDict = new Dict(xref); |
| 52741 |
appearanceStreamDict.set("FormType", 1); |
| 52742 |
appearanceStreamDict.set("Subtype", Name.get("Form")); |
| 52743 |
appearanceStreamDict.set("Type", Name.get("XObject")); |
| 52744 |
appearanceStreamDict.set("BBox", rect); |
| 52745 |
appearanceStreamDict.set("Length", appearance.length); |
| 52746 |
const resources = new Dict(xref); |
| 52747 |
const extGState = new Dict(xref); |
| 52748 |
resources.set("ExtGState", extGState); |
| 52749 |
appearanceStreamDict.set("Resources", resources); |
| 52750 |
const r0 = new Dict(xref); |
| 52751 |
extGState.set("R0", r0); |
| 52752 |
r0.set("BM", Name.get("Multiply")); |
| 52753 |
if (opacity !== 1) { |
| 52754 |
r0.set("ca", opacity); |
| 52755 |
r0.set("Type", Name.get("ExtGState")); |
| 52756 |
} |
| 52757 |
const ap = new StringStream(appearance); |
| 52758 |
ap.dict = appearanceStreamDict; |
| 52759 |
return ap; |
| 52760 |
} |
| 52761 |
} |
| 52762 |
class HighlightAnnotation extends MarkupAnnotation { |
| 52763 |
constructor(params) { |
| 52764 |
super(params); |
| 52765 |
const { |
| 52766 |
dict, |
| 52767 |
xref |
| 52768 |
} = params; |
| 52769 |
this.data.annotationType = AnnotationType.HIGHLIGHT; |
| 52770 |
this.data.isEditable = !this.data.noHTML; |
| 52771 |
this.data.noHTML = false; |
| 52772 |
this.data.opacity = dict.get("CA") || 1; |
| 52773 |
const quadPoints = this.data.quadPoints = getQuadPoints(dict, null); |
| 52774 |
if (quadPoints) { |
| 52775 |
const resources = this.appearance?.dict.get("Resources"); |
| 52776 |
if (!this.appearance || !resources?.has("ExtGState")) { |
| 52777 |
if (this.appearance) { |
| 52778 |
warn("HighlightAnnotation - ignoring built-in appearance stream."); |
| 52779 |
} |
| 52780 |
const fillColor = this.color ? getPdfColorArray(this.color) : [1, 1, 0]; |
| 52781 |
const fillAlpha = dict.get("CA"); |
| 52782 |
this._setDefaultAppearance({ |
| 52783 |
xref, |
| 52784 |
fillColor, |
| 52785 |
blendMode: "Multiply", |
| 52786 |
fillAlpha, |
| 52787 |
pointsCallback: (buffer, points) => { |
| 52788 |
buffer.push(`${points[0]} ${points[1]} m`, `${points[2]} ${points[3]} l`, `${points[6]} ${points[7]} l`, `${points[4]} ${points[5]} l`, "f"); |
| 52789 |
return [points[0], points[2], points[7], points[3]]; |
| 52790 |
} |
| 52791 |
}); |
| 52792 |
} |
| 52793 |
} else { |
| 52794 |
this.data.popupRef = null; |
| 52795 |
} |
| 52796 |
} |
| 52797 |
static createNewDict(annotation, xref, { |
| 52798 |
apRef, |
| 52799 |
ap |
| 52800 |
}) { |
| 52801 |
const { |
| 52802 |
color, |
| 52803 |
oldAnnotation, |
| 52804 |
opacity, |
| 52805 |
rect, |
| 52806 |
rotation, |
| 52807 |
user, |
| 52808 |
quadPoints |
| 52809 |
} = annotation; |
| 52810 |
const highlight = oldAnnotation || new Dict(xref); |
| 52811 |
highlight.set("Type", Name.get("Annot")); |
| 52812 |
highlight.set("Subtype", Name.get("Highlight")); |
| 52813 |
highlight.set(oldAnnotation ? "M" : "CreationDate", `D:${getModificationDate()}`); |
| 52814 |
highlight.set("CreationDate", `D:${getModificationDate()}`); |
| 52815 |
highlight.set("Rect", rect); |
| 52816 |
highlight.set("F", 4); |
| 52817 |
highlight.set("Border", [0, 0, 0]); |
| 52818 |
highlight.set("Rotate", rotation); |
| 52819 |
highlight.set("QuadPoints", quadPoints); |
| 52820 |
highlight.set("C", Array.from(color, c => c / 255)); |
| 52821 |
highlight.set("CA", opacity); |
| 52822 |
if (user) { |
| 52823 |
highlight.set("T", stringToAsciiOrUTF16BE(user)); |
| 52824 |
} |
| 52825 |
if (apRef || ap) { |
| 52826 |
const n = new Dict(xref); |
| 52827 |
highlight.set("AP", n); |
| 52828 |
n.set("N", apRef || ap); |
| 52829 |
} |
| 52830 |
return highlight; |
| 52831 |
} |
| 52832 |
static async createNewAppearanceStream(annotation, xref, params) { |
| 52833 |
const { |
| 52834 |
color, |
| 52835 |
rect, |
| 52836 |
outlines, |
| 52837 |
opacity |
| 52838 |
} = annotation; |
| 52839 |
const appearanceBuffer = [`${getPdfColor(color, true)}`, "/R0 gs"]; |
| 52840 |
const buffer = []; |
| 52841 |
for (const outline of outlines) { |
| 52842 |
buffer.length = 0; |
| 52843 |
buffer.push(`${numberToString(outline[0])} ${numberToString(outline[1])} m`); |
| 52844 |
for (let i = 2, ii = outline.length; i < ii; i += 2) { |
| 52845 |
buffer.push(`${numberToString(outline[i])} ${numberToString(outline[i + 1])} l`); |
| 52846 |
} |
| 52847 |
buffer.push("h"); |
| 52848 |
appearanceBuffer.push(buffer.join("\n")); |
| 52849 |
} |
| 52850 |
appearanceBuffer.push("f*"); |
| 52851 |
const appearance = appearanceBuffer.join("\n"); |
| 52852 |
const appearanceStreamDict = new Dict(xref); |
| 52853 |
appearanceStreamDict.set("FormType", 1); |
| 52854 |
appearanceStreamDict.set("Subtype", Name.get("Form")); |
| 52855 |
appearanceStreamDict.set("Type", Name.get("XObject")); |
| 52856 |
appearanceStreamDict.set("BBox", rect); |
| 52857 |
appearanceStreamDict.set("Length", appearance.length); |
| 52858 |
const resources = new Dict(xref); |
| 52859 |
const extGState = new Dict(xref); |
| 52860 |
resources.set("ExtGState", extGState); |
| 52861 |
appearanceStreamDict.set("Resources", resources); |
| 52862 |
const r0 = new Dict(xref); |
| 52863 |
extGState.set("R0", r0); |
| 52864 |
r0.set("BM", Name.get("Multiply")); |
| 52865 |
if (opacity !== 1) { |
| 52866 |
r0.set("ca", opacity); |
| 52867 |
r0.set("Type", Name.get("ExtGState")); |
| 52868 |
} |
| 52869 |
const ap = new StringStream(appearance); |
| 52870 |
ap.dict = appearanceStreamDict; |
| 52871 |
return ap; |
| 52872 |
} |
| 52873 |
} |
| 52874 |
class UnderlineAnnotation extends MarkupAnnotation { |
| 52875 |
constructor(params) { |
| 52876 |
super(params); |
| 52877 |
const { |
| 52878 |
dict, |
| 52879 |
xref |
| 52880 |
} = params; |
| 52881 |
this.data.annotationType = AnnotationType.UNDERLINE; |
| 52882 |
const quadPoints = this.data.quadPoints = getQuadPoints(dict, null); |
| 52883 |
if (quadPoints) { |
| 52884 |
if (!this.appearance) { |
| 52885 |
const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; |
| 52886 |
const strokeAlpha = dict.get("CA"); |
| 52887 |
this._setDefaultAppearance({ |
| 52888 |
xref, |
| 52889 |
extra: "[] 0 d 0.571 w", |
| 52890 |
strokeColor, |
| 52891 |
strokeAlpha, |
| 52892 |
pointsCallback: (buffer, points) => { |
| 52893 |
buffer.push(`${points[4]} ${points[5] + 1.3} m`, `${points[6]} ${points[7] + 1.3} l`, "S"); |
| 52894 |
return [points[0], points[2], points[7], points[3]]; |
| 52895 |
} |
| 52896 |
}); |
| 52897 |
} |
| 52898 |
} else { |
| 52899 |
this.data.popupRef = null; |
| 52900 |
} |
| 52901 |
} |
| 52902 |
} |
| 52903 |
class SquigglyAnnotation extends MarkupAnnotation { |
| 52904 |
constructor(params) { |
| 52905 |
super(params); |
| 52906 |
const { |
| 52907 |
dict, |
| 52908 |
xref |
| 52909 |
} = params; |
| 52910 |
this.data.annotationType = AnnotationType.SQUIGGLY; |
| 52911 |
const quadPoints = this.data.quadPoints = getQuadPoints(dict, null); |
| 52912 |
if (quadPoints) { |
| 52913 |
if (!this.appearance) { |
| 52914 |
const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; |
| 52915 |
const strokeAlpha = dict.get("CA"); |
| 52916 |
this._setDefaultAppearance({ |
| 52917 |
xref, |
| 52918 |
extra: "[] 0 d 1 w", |
| 52919 |
strokeColor, |
| 52920 |
strokeAlpha, |
| 52921 |
pointsCallback: (buffer, points) => { |
| 52922 |
const dy = (points[1] - points[5]) / 6; |
| 52923 |
let shift = dy; |
| 52924 |
let x = points[4]; |
| 52925 |
const y = points[5]; |
| 52926 |
const xEnd = points[6]; |
| 52927 |
buffer.push(`${x} ${y + shift} m`); |
| 52928 |
do { |
| 52929 |
x += 2; |
| 52930 |
shift = shift === 0 ? dy : 0; |
| 52931 |
buffer.push(`${x} ${y + shift} l`); |
| 52932 |
} while (x < xEnd); |
| 52933 |
buffer.push("S"); |
| 52934 |
return [points[4], xEnd, y - 2 * dy, y + 2 * dy]; |
| 52935 |
} |
| 52936 |
}); |
| 52937 |
} |
| 52938 |
} else { |
| 52939 |
this.data.popupRef = null; |
| 52940 |
} |
| 52941 |
} |
| 52942 |
} |
| 52943 |
class StrikeOutAnnotation extends MarkupAnnotation { |
| 52944 |
constructor(params) { |
| 52945 |
super(params); |
| 52946 |
const { |
| 52947 |
dict, |
| 52948 |
xref |
| 52949 |
} = params; |
| 52950 |
this.data.annotationType = AnnotationType.STRIKEOUT; |
| 52951 |
const quadPoints = this.data.quadPoints = getQuadPoints(dict, null); |
| 52952 |
if (quadPoints) { |
| 52953 |
if (!this.appearance) { |
| 52954 |
const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; |
| 52955 |
const strokeAlpha = dict.get("CA"); |
| 52956 |
this._setDefaultAppearance({ |
| 52957 |
xref, |
| 52958 |
extra: "[] 0 d 1 w", |
| 52959 |
strokeColor, |
| 52960 |
strokeAlpha, |
| 52961 |
pointsCallback: (buffer, points) => { |
| 52962 |
buffer.push(`${(points[0] + points[4]) / 2} ` + `${(points[1] + points[5]) / 2} m`, `${(points[2] + points[6]) / 2} ` + `${(points[3] + points[7]) / 2} l`, "S"); |
| 52963 |
return [points[0], points[2], points[7], points[3]]; |
| 52964 |
} |
| 52965 |
}); |
| 52966 |
} |
| 52967 |
} else { |
| 52968 |
this.data.popupRef = null; |
| 52969 |
} |
| 52970 |
} |
| 52971 |
} |
| 52972 |
class StampAnnotation extends MarkupAnnotation { |
| 52973 |
#savedHasOwnCanvas; |
| 52974 |
constructor(params) { |
| 52975 |
super(params); |
| 52976 |
this.data.annotationType = AnnotationType.STAMP; |
| 52977 |
this.#savedHasOwnCanvas = this.data.hasOwnCanvas = this.data.noRotate; |
| 52978 |
this.data.isEditable = !this.data.noHTML; |
| 52979 |
this.data.noHTML = false; |
| 52980 |
} |
| 52981 |
mustBeViewedWhenEditing(isEditing, modifiedIds = null) { |
| 52982 |
if (isEditing) { |
| 52983 |
if (!this.data.isEditable) { |
| 52984 |
return false; |
| 52985 |
} |
| 52986 |
this.#savedHasOwnCanvas = this.data.hasOwnCanvas; |
| 52987 |
this.data.hasOwnCanvas = true; |
| 52988 |
return true; |
| 52989 |
} |
| 52990 |
this.data.hasOwnCanvas = this.#savedHasOwnCanvas; |
| 52991 |
return !modifiedIds?.has(this.data.id); |
| 52992 |
} |
| 52993 |
static async createImage(bitmap, xref) { |
| 52994 |
const { |
| 52995 |
width, |
| 52996 |
height |
| 52997 |
} = bitmap; |
| 52998 |
const canvas = new OffscreenCanvas(width, height); |
| 52999 |
const ctx = canvas.getContext("2d", { |
| 53000 |
alpha: true |
| 53001 |
}); |
| 53002 |
ctx.drawImage(bitmap, 0, 0); |
| 53003 |
const data = ctx.getImageData(0, 0, width, height).data; |
| 53004 |
const buf32 = new Uint32Array(data.buffer); |
| 53005 |
const hasAlpha = buf32.some(FeatureTest.isLittleEndian ? x => x >>> 24 !== 0xff : x => (x & 0xff) !== 0xff); |
| 53006 |
if (hasAlpha) { |
| 53007 |
ctx.fillStyle = "white"; |
| 53008 |
ctx.fillRect(0, 0, width, height); |
| 53009 |
ctx.drawImage(bitmap, 0, 0); |
| 53010 |
} |
| 53011 |
const jpegBufferPromise = canvas.convertToBlob({ |
| 53012 |
type: "image/jpeg", |
| 53013 |
quality: 1 |
| 53014 |
}).then(blob => blob.arrayBuffer()); |
| 53015 |
const xobjectName = Name.get("XObject"); |
| 53016 |
const imageName = Name.get("Image"); |
| 53017 |
const image = new Dict(xref); |
| 53018 |
image.set("Type", xobjectName); |
| 53019 |
image.set("Subtype", imageName); |
| 53020 |
image.set("BitsPerComponent", 8); |
| 53021 |
image.set("ColorSpace", Name.get("DeviceRGB")); |
| 53022 |
image.set("Filter", Name.get("DCTDecode")); |
| 53023 |
image.set("BBox", [0, 0, width, height]); |
| 53024 |
image.set("Width", width); |
| 53025 |
image.set("Height", height); |
| 53026 |
let smaskStream = null; |
| 53027 |
if (hasAlpha) { |
| 53028 |
const alphaBuffer = new Uint8Array(buf32.length); |
| 53029 |
if (FeatureTest.isLittleEndian) { |
| 53030 |
for (let i = 0, ii = buf32.length; i < ii; i++) { |
| 53031 |
alphaBuffer[i] = buf32[i] >>> 24; |
| 53032 |
} |
| 53033 |
} else { |
| 53034 |
for (let i = 0, ii = buf32.length; i < ii; i++) { |
| 53035 |
alphaBuffer[i] = buf32[i] & 0xff; |
| 53036 |
} |
| 53037 |
} |
| 53038 |
const smask = new Dict(xref); |
| 53039 |
smask.set("Type", xobjectName); |
| 53040 |
smask.set("Subtype", imageName); |
| 53041 |
smask.set("BitsPerComponent", 8); |
| 53042 |
smask.set("ColorSpace", Name.get("DeviceGray")); |
| 53043 |
smask.set("Width", width); |
| 53044 |
smask.set("Height", height); |
| 53045 |
smaskStream = new Stream(alphaBuffer, 0, 0, smask); |
| 53046 |
} |
| 53047 |
const imageStream = new Stream(await jpegBufferPromise, 0, 0, image); |
| 53048 |
return { |
| 53049 |
imageStream, |
| 53050 |
smaskStream, |
| 53051 |
width, |
| 53052 |
height |
| 53053 |
}; |
| 53054 |
} |
| 53055 |
static createNewDict(annotation, xref, { |
| 53056 |
apRef, |
| 53057 |
ap |
| 53058 |
}) { |
| 53059 |
const { |
| 53060 |
oldAnnotation, |
| 53061 |
rect, |
| 53062 |
rotation, |
| 53063 |
user |
| 53064 |
} = annotation; |
| 53065 |
const stamp = oldAnnotation || new Dict(xref); |
| 53066 |
stamp.set("Type", Name.get("Annot")); |
| 53067 |
stamp.set("Subtype", Name.get("Stamp")); |
| 53068 |
stamp.set(oldAnnotation ? "M" : "CreationDate", `D:${getModificationDate()}`); |
| 53069 |
stamp.set("CreationDate", `D:${getModificationDate()}`); |
| 53070 |
stamp.set("Rect", rect); |
| 53071 |
stamp.set("F", 4); |
| 53072 |
stamp.set("Border", [0, 0, 0]); |
| 53073 |
stamp.set("Rotate", rotation); |
| 53074 |
if (user) { |
| 53075 |
stamp.set("T", stringToAsciiOrUTF16BE(user)); |
| 53076 |
} |
| 53077 |
if (apRef || ap) { |
| 53078 |
const n = new Dict(xref); |
| 53079 |
stamp.set("AP", n); |
| 53080 |
if (apRef) { |
| 53081 |
n.set("N", apRef); |
| 53082 |
} else { |
| 53083 |
n.set("N", ap); |
| 53084 |
} |
| 53085 |
} |
| 53086 |
return stamp; |
| 53087 |
} |
| 53088 |
static async createNewAppearanceStream(annotation, xref, params) { |
| 53089 |
if (annotation.oldAnnotation) { |
| 53090 |
return null; |
| 53091 |
} |
| 53092 |
const { |
| 53093 |
rotation |
| 53094 |
} = annotation; |
| 53095 |
const { |
| 53096 |
imageRef, |
| 53097 |
width, |
| 53098 |
height |
| 53099 |
} = params.image; |
| 53100 |
const resources = new Dict(xref); |
| 53101 |
const xobject = new Dict(xref); |
| 53102 |
resources.set("XObject", xobject); |
| 53103 |
xobject.set("Im0", imageRef); |
| 53104 |
const appearance = `q ${width} 0 0 ${height} 0 0 cm /Im0 Do Q`; |
| 53105 |
const appearanceStreamDict = new Dict(xref); |
| 53106 |
appearanceStreamDict.set("FormType", 1); |
| 53107 |
appearanceStreamDict.set("Subtype", Name.get("Form")); |
| 53108 |
appearanceStreamDict.set("Type", Name.get("XObject")); |
| 53109 |
appearanceStreamDict.set("BBox", [0, 0, width, height]); |
| 53110 |
appearanceStreamDict.set("Resources", resources); |
| 53111 |
if (rotation) { |
| 53112 |
const matrix = getRotationMatrix(rotation, width, height); |
| 53113 |
appearanceStreamDict.set("Matrix", matrix); |
| 53114 |
} |
| 53115 |
const ap = new StringStream(appearance); |
| 53116 |
ap.dict = appearanceStreamDict; |
| 53117 |
return ap; |
| 53118 |
} |
| 53119 |
} |
| 53120 |
class FileAttachmentAnnotation extends MarkupAnnotation { |
| 53121 |
constructor(params) { |
| 53122 |
super(params); |
| 53123 |
const { |
| 53124 |
dict, |
| 53125 |
xref |
| 53126 |
} = params; |
| 53127 |
const file = new FileSpec(dict.get("FS"), xref); |
| 53128 |
this.data.annotationType = AnnotationType.FILEATTACHMENT; |
| 53129 |
this.data.hasOwnCanvas = this.data.noRotate; |
| 53130 |
this.data.noHTML = false; |
| 53131 |
this.data.file = file.serializable; |
| 53132 |
const name = dict.get("Name"); |
| 53133 |
this.data.name = name instanceof Name ? stringToPDFString(name.name) : "PushPin"; |
| 53134 |
const fillAlpha = dict.get("ca"); |
| 53135 |
this.data.fillAlpha = typeof fillAlpha === "number" && fillAlpha >= 0 && fillAlpha <= 1 ? fillAlpha : null; |
| 53136 |
} |
| 53137 |
} |
| 53138 |
|
| 53139 |
;// ./src/core/dataset_reader.js |
| 53140 |
|
| 53141 |
|
| 53142 |
|
| 53143 |
function decodeString(str) { |
| 53144 |
try { |
| 53145 |
return stringToUTF8String(str); |
| 53146 |
} catch (ex) { |
| 53147 |
warn(`UTF-8 decoding failed: "${ex}".`); |
| 53148 |
return str; |
| 53149 |
} |
| 53150 |
} |
| 53151 |
class DatasetXMLParser extends SimpleXMLParser { |
| 53152 |
constructor(options) { |
| 53153 |
super(options); |
| 53154 |
this.node = null; |
| 53155 |
} |
| 53156 |
onEndElement(name) { |
| 53157 |
const node = super.onEndElement(name); |
| 53158 |
if (node && name === "xfa:datasets") { |
| 53159 |
this.node = node; |
| 53160 |
throw new Error("Aborting DatasetXMLParser."); |
| 53161 |
} |
| 53162 |
} |
| 53163 |
} |
| 53164 |
class DatasetReader { |
| 53165 |
constructor(data) { |
| 53166 |
if (data.datasets) { |
| 53167 |
this.node = new SimpleXMLParser({ |
| 53168 |
hasAttributes: true |
| 53169 |
}).parseFromString(data.datasets).documentElement; |
| 53170 |
} else { |
| 53171 |
const parser = new DatasetXMLParser({ |
| 53172 |
hasAttributes: true |
| 53173 |
}); |
| 53174 |
try { |
| 53175 |
parser.parseFromString(data["xdp:xdp"]); |
| 53176 |
} catch {} |
| 53177 |
this.node = parser.node; |
| 53178 |
} |
| 53179 |
} |
| 53180 |
getValue(path) { |
| 53181 |
if (!this.node || !path) { |
| 53182 |
return ""; |
| 53183 |
} |
| 53184 |
const node = this.node.searchNode(parseXFAPath(path), 0); |
| 53185 |
if (!node) { |
| 53186 |
return ""; |
| 53187 |
} |
| 53188 |
const first = node.firstChild; |
| 53189 |
if (first?.nodeName === "value") { |
| 53190 |
return node.children.map(child => decodeString(child.textContent)); |
| 53191 |
} |
| 53192 |
return decodeString(node.textContent); |
| 53193 |
} |
| 53194 |
} |
| 53195 |
|
| 53196 |
;// ./src/core/xref.js |
| 53197 |
|
| 53198 |
|
| 53199 |
|
| 53200 |
|
| 53201 |
|
| 53202 |
|
| 53203 |
class XRef { |
| 53204 |
#firstXRefStmPos = null; |
| 53205 |
constructor(stream, pdfManager) { |
| 53206 |
this.stream = stream; |
| 53207 |
this.pdfManager = pdfManager; |
| 53208 |
this.entries = []; |
| 53209 |
this._xrefStms = new Set(); |
| 53210 |
this._cacheMap = new Map(); |
| 53211 |
this._pendingRefs = new RefSet(); |
| 53212 |
this._newPersistentRefNum = null; |
| 53213 |
this._newTemporaryRefNum = null; |
| 53214 |
this._persistentRefsCache = null; |
| 53215 |
} |
| 53216 |
getNewPersistentRef(obj) { |
| 53217 |
if (this._newPersistentRefNum === null) { |
| 53218 |
this._newPersistentRefNum = this.entries.length || 1; |
| 53219 |
} |
| 53220 |
const num = this._newPersistentRefNum++; |
| 53221 |
this._cacheMap.set(num, obj); |
| 53222 |
return Ref.get(num, 0); |
| 53223 |
} |
| 53224 |
getNewTemporaryRef() { |
| 53225 |
if (this._newTemporaryRefNum === null) { |
| 53226 |
this._newTemporaryRefNum = this.entries.length || 1; |
| 53227 |
if (this._newPersistentRefNum) { |
| 53228 |
this._persistentRefsCache = new Map(); |
| 53229 |
for (let i = this._newTemporaryRefNum; i < this._newPersistentRefNum; i++) { |
| 53230 |
this._persistentRefsCache.set(i, this._cacheMap.get(i)); |
| 53231 |
this._cacheMap.delete(i); |
| 53232 |
} |
| 53233 |
} |
| 53234 |
} |
| 53235 |
return Ref.get(this._newTemporaryRefNum++, 0); |
| 53236 |
} |
| 53237 |
resetNewTemporaryRef() { |
| 53238 |
this._newTemporaryRefNum = null; |
| 53239 |
if (this._persistentRefsCache) { |
| 53240 |
for (const [num, obj] of this._persistentRefsCache) { |
| 53241 |
this._cacheMap.set(num, obj); |
| 53242 |
} |
| 53243 |
} |
| 53244 |
this._persistentRefsCache = null; |
| 53245 |
} |
| 53246 |
setStartXRef(startXRef) { |
| 53247 |
this.startXRefQueue = [startXRef]; |
| 53248 |
} |
| 53249 |
parse(recoveryMode = false) { |
| 53250 |
let trailerDict; |
| 53251 |
if (!recoveryMode) { |
| 53252 |
trailerDict = this.readXRef(); |
| 53253 |
} else { |
| 53254 |
warn("Indexing all PDF objects"); |
| 53255 |
trailerDict = this.indexObjects(); |
| 53256 |
} |
| 53257 |
trailerDict.assignXref(this); |
| 53258 |
this.trailer = trailerDict; |
| 53259 |
let encrypt; |
| 53260 |
try { |
| 53261 |
encrypt = trailerDict.get("Encrypt"); |
| 53262 |
} catch (ex) { |
| 53263 |
if (ex instanceof MissingDataException) { |
| 53264 |
throw ex; |
| 53265 |
} |
| 53266 |
warn(`XRef.parse - Invalid "Encrypt" reference: "${ex}".`); |
| 53267 |
} |
| 53268 |
if (encrypt instanceof Dict) { |
| 53269 |
const ids = trailerDict.get("ID"); |
| 53270 |
const fileId = ids?.length ? ids[0] : ""; |
| 53271 |
encrypt.suppressEncryption = true; |
| 53272 |
this.encrypt = new CipherTransformFactory(encrypt, fileId, this.pdfManager.password); |
| 53273 |
} |
| 53274 |
let root; |
| 53275 |
try { |
| 53276 |
root = trailerDict.get("Root"); |
| 53277 |
} catch (ex) { |
| 53278 |
if (ex instanceof MissingDataException) { |
| 53279 |
throw ex; |
| 53280 |
} |
| 53281 |
warn(`XRef.parse - Invalid "Root" reference: "${ex}".`); |
| 53282 |
} |
| 53283 |
if (root instanceof Dict) { |
| 53284 |
try { |
| 53285 |
const pages = root.get("Pages"); |
| 53286 |
if (pages instanceof Dict) { |
| 53287 |
this.root = root; |
| 53288 |
return; |
| 53289 |
} |
| 53290 |
} catch (ex) { |
| 53291 |
if (ex instanceof MissingDataException) { |
| 53292 |
throw ex; |
| 53293 |
} |
| 53294 |
warn(`XRef.parse - Invalid "Pages" reference: "${ex}".`); |
| 53295 |
} |
| 53296 |
} |
| 53297 |
if (!recoveryMode) { |
| 53298 |
throw new XRefParseException(); |
| 53299 |
} |
| 53300 |
throw new InvalidPDFException("Invalid Root reference."); |
| 53301 |
} |
| 53302 |
processXRefTable(parser) { |
| 53303 |
if (!("tableState" in this)) { |
| 53304 |
this.tableState = { |
| 53305 |
entryNum: 0, |
| 53306 |
streamPos: parser.lexer.stream.pos, |
| 53307 |
parserBuf1: parser.buf1, |
| 53308 |
parserBuf2: parser.buf2 |
| 53309 |
}; |
| 53310 |
} |
| 53311 |
const obj = this.readXRefTable(parser); |
| 53312 |
if (!isCmd(obj, "trailer")) { |
| 53313 |
throw new FormatError("Invalid XRef table: could not find trailer dictionary"); |
| 53314 |
} |
| 53315 |
let dict = parser.getObj(); |
| 53316 |
if (!(dict instanceof Dict) && dict.dict) { |
| 53317 |
dict = dict.dict; |
| 53318 |
} |
| 53319 |
if (!(dict instanceof Dict)) { |
| 53320 |
throw new FormatError("Invalid XRef table: could not parse trailer dictionary"); |
| 53321 |
} |
| 53322 |
delete this.tableState; |
| 53323 |
return dict; |
| 53324 |
} |
| 53325 |
readXRefTable(parser) { |
| 53326 |
const stream = parser.lexer.stream; |
| 53327 |
const tableState = this.tableState; |
| 53328 |
stream.pos = tableState.streamPos; |
| 53329 |
parser.buf1 = tableState.parserBuf1; |
| 53330 |
parser.buf2 = tableState.parserBuf2; |
| 53331 |
let obj; |
| 53332 |
while (true) { |
| 53333 |
if (!("firstEntryNum" in tableState) || !("entryCount" in tableState)) { |
| 53334 |
if (isCmd(obj = parser.getObj(), "trailer")) { |
| 53335 |
break; |
| 53336 |
} |
| 53337 |
tableState.firstEntryNum = obj; |
| 53338 |
tableState.entryCount = parser.getObj(); |
| 53339 |
} |
| 53340 |
let first = tableState.firstEntryNum; |
| 53341 |
const count = tableState.entryCount; |
| 53342 |
if (!Number.isInteger(first) || !Number.isInteger(count)) { |
| 53343 |
throw new FormatError("Invalid XRef table: wrong types in subsection header"); |
| 53344 |
} |
| 53345 |
for (let i = tableState.entryNum; i < count; i++) { |
| 53346 |
tableState.streamPos = stream.pos; |
| 53347 |
tableState.entryNum = i; |
| 53348 |
tableState.parserBuf1 = parser.buf1; |
| 53349 |
tableState.parserBuf2 = parser.buf2; |
| 53350 |
const entry = {}; |
| 53351 |
entry.offset = parser.getObj(); |
| 53352 |
entry.gen = parser.getObj(); |
| 53353 |
const type = parser.getObj(); |
| 53354 |
if (type instanceof Cmd) { |
| 53355 |
switch (type.cmd) { |
| 53356 |
case "f": |
| 53357 |
entry.free = true; |
| 53358 |
break; |
| 53359 |
case "n": |
| 53360 |
entry.uncompressed = true; |
| 53361 |
break; |
| 53362 |
} |
| 53363 |
} |
| 53364 |
if (!Number.isInteger(entry.offset) || !Number.isInteger(entry.gen) || !(entry.free || entry.uncompressed)) { |
| 53365 |
throw new FormatError(`Invalid entry in XRef subsection: ${first}, ${count}`); |
| 53366 |
} |
| 53367 |
if (i === 0 && entry.free && first === 1) { |
| 53368 |
first = 0; |
| 53369 |
} |
| 53370 |
if (!this.entries[i + first]) { |
| 53371 |
this.entries[i + first] = entry; |
| 53372 |
} |
| 53373 |
} |
| 53374 |
tableState.entryNum = 0; |
| 53375 |
tableState.streamPos = stream.pos; |
| 53376 |
tableState.parserBuf1 = parser.buf1; |
| 53377 |
tableState.parserBuf2 = parser.buf2; |
| 53378 |
delete tableState.firstEntryNum; |
| 53379 |
delete tableState.entryCount; |
| 53380 |
} |
| 53381 |
if (this.entries[0] && !this.entries[0].free) { |
| 53382 |
throw new FormatError("Invalid XRef table: unexpected first object"); |
| 53383 |
} |
| 53384 |
return obj; |
| 53385 |
} |
| 53386 |
processXRefStream(stream) { |
| 53387 |
if (!("streamState" in this)) { |
| 53388 |
const streamParameters = stream.dict; |
| 53389 |
const byteWidths = streamParameters.get("W"); |
| 53390 |
let range = streamParameters.get("Index"); |
| 53391 |
if (!range) { |
| 53392 |
range = [0, streamParameters.get("Size")]; |
| 53393 |
} |
| 53394 |
this.streamState = { |
| 53395 |
entryRanges: range, |
| 53396 |
byteWidths, |
| 53397 |
entryNum: 0, |
| 53398 |
streamPos: stream.pos |
| 53399 |
}; |
| 53400 |
} |
| 53401 |
this.readXRefStream(stream); |
| 53402 |
delete this.streamState; |
| 53403 |
return stream.dict; |
| 53404 |
} |
| 53405 |
readXRefStream(stream) { |
| 53406 |
const streamState = this.streamState; |
| 53407 |
stream.pos = streamState.streamPos; |
| 53408 |
const [typeFieldWidth, offsetFieldWidth, generationFieldWidth] = streamState.byteWidths; |
| 53409 |
const entryRanges = streamState.entryRanges; |
| 53410 |
while (entryRanges.length > 0) { |
| 53411 |
const [first, n] = entryRanges; |
| 53412 |
if (!Number.isInteger(first) || !Number.isInteger(n)) { |
| 53413 |
throw new FormatError(`Invalid XRef range fields: ${first}, ${n}`); |
| 53414 |
} |
| 53415 |
if (!Number.isInteger(typeFieldWidth) || !Number.isInteger(offsetFieldWidth) || !Number.isInteger(generationFieldWidth)) { |
| 53416 |
throw new FormatError(`Invalid XRef entry fields length: ${first}, ${n}`); |
| 53417 |
} |
| 53418 |
for (let i = streamState.entryNum; i < n; ++i) { |
| 53419 |
streamState.entryNum = i; |
| 53420 |
streamState.streamPos = stream.pos; |
| 53421 |
let type = 0, |
| 53422 |
offset = 0, |
| 53423 |
generation = 0; |
| 53424 |
for (let j = 0; j < typeFieldWidth; ++j) { |
| 53425 |
const typeByte = stream.getByte(); |
| 53426 |
if (typeByte === -1) { |
| 53427 |
throw new FormatError("Invalid XRef byteWidths 'type'."); |
| 53428 |
} |
| 53429 |
type = type << 8 | typeByte; |
| 53430 |
} |
| 53431 |
if (typeFieldWidth === 0) { |
| 53432 |
type = 1; |
| 53433 |
} |
| 53434 |
for (let j = 0; j < offsetFieldWidth; ++j) { |
| 53435 |
const offsetByte = stream.getByte(); |
| 53436 |
if (offsetByte === -1) { |
| 53437 |
throw new FormatError("Invalid XRef byteWidths 'offset'."); |
| 53438 |
} |
| 53439 |
offset = offset << 8 | offsetByte; |
| 53440 |
} |
| 53441 |
for (let j = 0; j < generationFieldWidth; ++j) { |
| 53442 |
const generationByte = stream.getByte(); |
| 53443 |
if (generationByte === -1) { |
| 53444 |
throw new FormatError("Invalid XRef byteWidths 'generation'."); |
| 53445 |
} |
| 53446 |
generation = generation << 8 | generationByte; |
| 53447 |
} |
| 53448 |
const entry = {}; |
| 53449 |
entry.offset = offset; |
| 53450 |
entry.gen = generation; |
| 53451 |
switch (type) { |
| 53452 |
case 0: |
| 53453 |
entry.free = true; |
| 53454 |
break; |
| 53455 |
case 1: |
| 53456 |
entry.uncompressed = true; |
| 53457 |
break; |
| 53458 |
case 2: |
| 53459 |
break; |
| 53460 |
default: |
| 53461 |
throw new FormatError(`Invalid XRef entry type: ${type}`); |
| 53462 |
} |
| 53463 |
if (!this.entries[first + i]) { |
| 53464 |
this.entries[first + i] = entry; |
| 53465 |
} |
| 53466 |
} |
| 53467 |
streamState.entryNum = 0; |
| 53468 |
streamState.streamPos = stream.pos; |
| 53469 |
entryRanges.splice(0, 2); |
| 53470 |
} |
| 53471 |
} |
| 53472 |
indexObjects() { |
| 53473 |
const TAB = 0x9, |
| 53474 |
LF = 0xa, |
| 53475 |
CR = 0xd, |
| 53476 |
SPACE = 0x20; |
| 53477 |
const PERCENT = 0x25, |
| 53478 |
LT = 0x3c; |
| 53479 |
function readToken(data, offset) { |
| 53480 |
let token = "", |
| 53481 |
ch = data[offset]; |
| 53482 |
while (ch !== LF && ch !== CR && ch !== LT) { |
| 53483 |
if (++offset >= data.length) { |
| 53484 |
break; |
| 53485 |
} |
| 53486 |
token += String.fromCharCode(ch); |
| 53487 |
ch = data[offset]; |
| 53488 |
} |
| 53489 |
return token; |
| 53490 |
} |
| 53491 |
function skipUntil(data, offset, what) { |
| 53492 |
const length = what.length, |
| 53493 |
dataLength = data.length; |
| 53494 |
let skipped = 0; |
| 53495 |
while (offset < dataLength) { |
| 53496 |
let i = 0; |
| 53497 |
while (i < length && data[offset + i] === what[i]) { |
| 53498 |
++i; |
| 53499 |
} |
| 53500 |
if (i >= length) { |
| 53501 |
break; |
| 53502 |
} |
| 53503 |
offset++; |
| 53504 |
skipped++; |
| 53505 |
} |
| 53506 |
return skipped; |
| 53507 |
} |
| 53508 |
const gEndobjRegExp = /\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g; |
| 53509 |
const gStartxrefRegExp = /\b(startxref|\d+\s+\d+\s+obj)\b/g; |
| 53510 |
const objRegExp = /^(\d+)\s+(\d+)\s+obj\b/; |
| 53511 |
const trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]); |
| 53512 |
const startxrefBytes = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]); |
| 53513 |
const xrefBytes = new Uint8Array([47, 88, 82, 101, 102]); |
| 53514 |
this.entries.length = 0; |
| 53515 |
this._cacheMap.clear(); |
| 53516 |
const stream = this.stream; |
| 53517 |
stream.pos = 0; |
| 53518 |
const buffer = stream.getBytes(), |
| 53519 |
bufferStr = bytesToString(buffer), |
| 53520 |
length = buffer.length; |
| 53521 |
let position = stream.start; |
| 53522 |
const trailers = [], |
| 53523 |
xrefStms = []; |
| 53524 |
while (position < length) { |
| 53525 |
let ch = buffer[position]; |
| 53526 |
if (ch === TAB || ch === LF || ch === CR || ch === SPACE) { |
| 53527 |
++position; |
| 53528 |
continue; |
| 53529 |
} |
| 53530 |
if (ch === PERCENT) { |
| 53531 |
do { |
| 53532 |
++position; |
| 53533 |
if (position >= length) { |
| 53534 |
break; |
| 53535 |
} |
| 53536 |
ch = buffer[position]; |
| 53537 |
} while (ch !== LF && ch !== CR); |
| 53538 |
continue; |
| 53539 |
} |
| 53540 |
const token = readToken(buffer, position); |
| 53541 |
let m; |
| 53542 |
if (token.startsWith("xref") && (token.length === 4 || /\s/.test(token[4]))) { |
| 53543 |
position += skipUntil(buffer, position, trailerBytes); |
| 53544 |
trailers.push(position); |
| 53545 |
position += skipUntil(buffer, position, startxrefBytes); |
| 53546 |
} else if (m = objRegExp.exec(token)) { |
| 53547 |
const num = m[1] | 0, |
| 53548 |
gen = m[2] | 0; |
| 53549 |
const startPos = position + token.length; |
| 53550 |
let contentLength, |
| 53551 |
updateEntries = false; |
| 53552 |
if (!this.entries[num]) { |
| 53553 |
updateEntries = true; |
| 53554 |
} else if (this.entries[num].gen === gen) { |
| 53555 |
try { |
| 53556 |
const parser = new Parser({ |
| 53557 |
lexer: new Lexer(stream.makeSubStream(startPos)) |
| 53558 |
}); |
| 53559 |
parser.getObj(); |
| 53560 |
updateEntries = true; |
| 53561 |
} catch (ex) { |
| 53562 |
if (ex instanceof ParserEOFException) { |
| 53563 |
warn(`indexObjects -- checking object (${token}): "${ex}".`); |
| 53564 |
} else { |
| 53565 |
updateEntries = true; |
| 53566 |
} |
| 53567 |
} |
| 53568 |
} |
| 53569 |
if (updateEntries) { |
| 53570 |
this.entries[num] = { |
| 53571 |
offset: position - stream.start, |
| 53572 |
gen, |
| 53573 |
uncompressed: true |
| 53574 |
}; |
| 53575 |
} |
| 53576 |
gEndobjRegExp.lastIndex = startPos; |
| 53577 |
const match = gEndobjRegExp.exec(bufferStr); |
| 53578 |
if (match) { |
| 53579 |
const endPos = gEndobjRegExp.lastIndex + 1; |
| 53580 |
contentLength = endPos - position; |
| 53581 |
if (match[1] !== "endobj") { |
| 53582 |
warn(`indexObjects: Found "${match[1]}" inside of another "obj", ` + 'caused by missing "endobj" -- trying to recover.'); |
| 53583 |
contentLength -= match[1].length + 1; |
| 53584 |
} |
| 53585 |
} else { |
| 53586 |
contentLength = length - position; |
| 53587 |
} |
| 53588 |
const content = buffer.subarray(position, position + contentLength); |
| 53589 |
const xrefTagOffset = skipUntil(content, 0, xrefBytes); |
| 53590 |
if (xrefTagOffset < contentLength && content[xrefTagOffset + 5] < 64) { |
| 53591 |
xrefStms.push(position - stream.start); |
| 53592 |
this._xrefStms.add(position - stream.start); |
| 53593 |
} |
| 53594 |
position += contentLength; |
| 53595 |
} else if (token.startsWith("trailer") && (token.length === 7 || /\s/.test(token[7]))) { |
| 53596 |
trailers.push(position); |
| 53597 |
const startPos = position + token.length; |
| 53598 |
let contentLength; |
| 53599 |
gStartxrefRegExp.lastIndex = startPos; |
| 53600 |
const match = gStartxrefRegExp.exec(bufferStr); |
| 53601 |
if (match) { |
| 53602 |
const endPos = gStartxrefRegExp.lastIndex + 1; |
| 53603 |
contentLength = endPos - position; |
| 53604 |
if (match[1] !== "startxref") { |
| 53605 |
warn(`indexObjects: Found "${match[1]}" after "trailer", ` + 'caused by missing "startxref" -- trying to recover.'); |
| 53606 |
contentLength -= match[1].length + 1; |
| 53607 |
} |
| 53608 |
} else { |
| 53609 |
contentLength = length - position; |
| 53610 |
} |
| 53611 |
position += contentLength; |
| 53612 |
} else { |
| 53613 |
position += token.length + 1; |
| 53614 |
} |
| 53615 |
} |
| 53616 |
for (const xrefStm of xrefStms) { |
| 53617 |
this.startXRefQueue.push(xrefStm); |
| 53618 |
this.readXRef(true); |
| 53619 |
} |
| 53620 |
const trailerDicts = []; |
| 53621 |
let isEncrypted = false; |
| 53622 |
for (const trailer of trailers) { |
| 53623 |
stream.pos = trailer; |
| 53624 |
const parser = new Parser({ |
| 53625 |
lexer: new Lexer(stream), |
| 53626 |
xref: this, |
| 53627 |
allowStreams: true, |
| 53628 |
recoveryMode: true |
| 53629 |
}); |
| 53630 |
const obj = parser.getObj(); |
| 53631 |
if (!isCmd(obj, "trailer")) { |
| 53632 |
continue; |
| 53633 |
} |
| 53634 |
const dict = parser.getObj(); |
| 53635 |
if (!(dict instanceof Dict)) { |
| 53636 |
continue; |
| 53637 |
} |
| 53638 |
trailerDicts.push(dict); |
| 53639 |
if (dict.has("Encrypt")) { |
| 53640 |
isEncrypted = true; |
| 53641 |
} |
| 53642 |
} |
| 53643 |
let trailerDict, trailerError; |
| 53644 |
for (const dict of [...trailerDicts, "genFallback", ...trailerDicts]) { |
| 53645 |
if (dict === "genFallback") { |
| 53646 |
if (!trailerError) { |
| 53647 |
break; |
| 53648 |
} |
| 53649 |
this._generationFallback = true; |
| 53650 |
continue; |
| 53651 |
} |
| 53652 |
let validPagesDict = false; |
| 53653 |
try { |
| 53654 |
const rootDict = dict.get("Root"); |
| 53655 |
if (!(rootDict instanceof Dict)) { |
| 53656 |
continue; |
| 53657 |
} |
| 53658 |
const pagesDict = rootDict.get("Pages"); |
| 53659 |
if (!(pagesDict instanceof Dict)) { |
| 53660 |
continue; |
| 53661 |
} |
| 53662 |
const pagesCount = pagesDict.get("Count"); |
| 53663 |
if (Number.isInteger(pagesCount)) { |
| 53664 |
validPagesDict = true; |
| 53665 |
} |
| 53666 |
} catch (ex) { |
| 53667 |
trailerError = ex; |
| 53668 |
continue; |
| 53669 |
} |
| 53670 |
if (validPagesDict && (!isEncrypted || dict.has("Encrypt")) && dict.has("ID")) { |
| 53671 |
return dict; |
| 53672 |
} |
| 53673 |
trailerDict = dict; |
| 53674 |
} |
| 53675 |
if (trailerDict) { |
| 53676 |
return trailerDict; |
| 53677 |
} |
| 53678 |
if (this.topDict) { |
| 53679 |
return this.topDict; |
| 53680 |
} |
| 53681 |
throw new InvalidPDFException("Invalid PDF structure."); |
| 53682 |
} |
| 53683 |
readXRef(recoveryMode = false) { |
| 53684 |
const stream = this.stream; |
| 53685 |
const startXRefParsedCache = new Set(); |
| 53686 |
while (this.startXRefQueue.length) { |
| 53687 |
try { |
| 53688 |
const startXRef = this.startXRefQueue[0]; |
| 53689 |
if (startXRefParsedCache.has(startXRef)) { |
| 53690 |
warn("readXRef - skipping XRef table since it was already parsed."); |
| 53691 |
this.startXRefQueue.shift(); |
| 53692 |
continue; |
| 53693 |
} |
| 53694 |
startXRefParsedCache.add(startXRef); |
| 53695 |
stream.pos = startXRef + stream.start; |
| 53696 |
const parser = new Parser({ |
| 53697 |
lexer: new Lexer(stream), |
| 53698 |
xref: this, |
| 53699 |
allowStreams: true |
| 53700 |
}); |
| 53701 |
let obj = parser.getObj(); |
| 53702 |
let dict; |
| 53703 |
if (isCmd(obj, "xref")) { |
| 53704 |
dict = this.processXRefTable(parser); |
| 53705 |
if (!this.topDict) { |
| 53706 |
this.topDict = dict; |
| 53707 |
} |
| 53708 |
obj = dict.get("XRefStm"); |
| 53709 |
if (Number.isInteger(obj) && !this._xrefStms.has(obj)) { |
| 53710 |
this._xrefStms.add(obj); |
| 53711 |
this.startXRefQueue.push(obj); |
| 53712 |
this.#firstXRefStmPos ??= obj; |
| 53713 |
} |
| 53714 |
} else if (Number.isInteger(obj)) { |
| 53715 |
if (!Number.isInteger(parser.getObj()) || !isCmd(parser.getObj(), "obj") || !((obj = parser.getObj()) instanceof BaseStream)) { |
| 53716 |
throw new FormatError("Invalid XRef stream"); |
| 53717 |
} |
| 53718 |
dict = this.processXRefStream(obj); |
| 53719 |
if (!this.topDict) { |
| 53720 |
this.topDict = dict; |
| 53721 |
} |
| 53722 |
if (!dict) { |
| 53723 |
throw new FormatError("Failed to read XRef stream"); |
| 53724 |
} |
| 53725 |
} else { |
| 53726 |
throw new FormatError("Invalid XRef stream header"); |
| 53727 |
} |
| 53728 |
obj = dict.get("Prev"); |
| 53729 |
if (Number.isInteger(obj)) { |
| 53730 |
this.startXRefQueue.push(obj); |
| 53731 |
} else if (obj instanceof Ref) { |
| 53732 |
this.startXRefQueue.push(obj.num); |
| 53733 |
} |
| 53734 |
} catch (e) { |
| 53735 |
if (e instanceof MissingDataException) { |
| 53736 |
throw e; |
| 53737 |
} |
| 53738 |
info("(while reading XRef): " + e); |
| 53739 |
} |
| 53740 |
this.startXRefQueue.shift(); |
| 53741 |
} |
| 53742 |
if (this.topDict) { |
| 53743 |
return this.topDict; |
| 53744 |
} |
| 53745 |
if (recoveryMode) { |
| 53746 |
return undefined; |
| 53747 |
} |
| 53748 |
throw new XRefParseException(); |
| 53749 |
} |
| 53750 |
get lastXRefStreamPos() { |
| 53751 |
return this.#firstXRefStmPos ?? (this._xrefStms.size > 0 ? Math.max(...this._xrefStms) : null); |
| 53752 |
} |
| 53753 |
getEntry(i) { |
| 53754 |
const xrefEntry = this.entries[i]; |
| 53755 |
if (xrefEntry && !xrefEntry.free && xrefEntry.offset) { |
| 53756 |
return xrefEntry; |
| 53757 |
} |
| 53758 |
return null; |
| 53759 |
} |
| 53760 |
fetchIfRef(obj, suppressEncryption = false) { |
| 53761 |
if (obj instanceof Ref) { |
| 53762 |
return this.fetch(obj, suppressEncryption); |
| 53763 |
} |
| 53764 |
return obj; |
| 53765 |
} |
| 53766 |
fetch(ref, suppressEncryption = false) { |
| 53767 |
if (!(ref instanceof Ref)) { |
| 53768 |
throw new Error("ref object is not a reference"); |
| 53769 |
} |
| 53770 |
const num = ref.num; |
| 53771 |
const cacheEntry = this._cacheMap.get(num); |
| 53772 |
if (cacheEntry !== undefined) { |
| 53773 |
if (cacheEntry instanceof Dict && !cacheEntry.objId) { |
| 53774 |
cacheEntry.objId = ref.toString(); |
| 53775 |
} |
| 53776 |
return cacheEntry; |
| 53777 |
} |
| 53778 |
let xrefEntry = this.getEntry(num); |
| 53779 |
if (xrefEntry === null) { |
| 53780 |
this._cacheMap.set(num, xrefEntry); |
| 53781 |
return xrefEntry; |
| 53782 |
} |
| 53783 |
if (this._pendingRefs.has(ref)) { |
| 53784 |
this._pendingRefs.remove(ref); |
| 53785 |
warn(`Ignoring circular reference: ${ref}.`); |
| 53786 |
return CIRCULAR_REF; |
| 53787 |
} |
| 53788 |
this._pendingRefs.put(ref); |
| 53789 |
try { |
| 53790 |
xrefEntry = xrefEntry.uncompressed ? this.fetchUncompressed(ref, xrefEntry, suppressEncryption) : this.fetchCompressed(ref, xrefEntry, suppressEncryption); |
| 53791 |
this._pendingRefs.remove(ref); |
| 53792 |
} catch (ex) { |
| 53793 |
this._pendingRefs.remove(ref); |
| 53794 |
throw ex; |
| 53795 |
} |
| 53796 |
if (xrefEntry instanceof Dict) { |
| 53797 |
xrefEntry.objId = ref.toString(); |
| 53798 |
} else if (xrefEntry instanceof BaseStream) { |
| 53799 |
xrefEntry.dict.objId = ref.toString(); |
| 53800 |
} |
| 53801 |
return xrefEntry; |
| 53802 |
} |
| 53803 |
fetchUncompressed(ref, xrefEntry, suppressEncryption = false) { |
| 53804 |
const gen = ref.gen; |
| 53805 |
let num = ref.num; |
| 53806 |
if (xrefEntry.gen !== gen) { |
| 53807 |
const msg = `Inconsistent generation in XRef: ${ref}`; |
| 53808 |
if (this._generationFallback && xrefEntry.gen < gen) { |
| 53809 |
warn(msg); |
| 53810 |
return this.fetchUncompressed(Ref.get(num, xrefEntry.gen), xrefEntry, suppressEncryption); |
| 53811 |
} |
| 53812 |
throw new XRefEntryException(msg); |
| 53813 |
} |
| 53814 |
const stream = this.stream.makeSubStream(xrefEntry.offset + this.stream.start); |
| 53815 |
const parser = new Parser({ |
| 53816 |
lexer: new Lexer(stream), |
| 53817 |
xref: this, |
| 53818 |
allowStreams: true |
| 53819 |
}); |
| 53820 |
const obj1 = parser.getObj(); |
| 53821 |
const obj2 = parser.getObj(); |
| 53822 |
const obj3 = parser.getObj(); |
| 53823 |
if (obj1 !== num || obj2 !== gen || !(obj3 instanceof Cmd)) { |
| 53824 |
throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`); |
| 53825 |
} |
| 53826 |
if (obj3.cmd !== "obj") { |
| 53827 |
if (obj3.cmd.startsWith("obj")) { |
| 53828 |
num = parseInt(obj3.cmd.substring(3), 10); |
| 53829 |
if (!Number.isNaN(num)) { |
| 53830 |
return num; |
| 53831 |
} |
| 53832 |
} |
| 53833 |
throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`); |
| 53834 |
} |
| 53835 |
xrefEntry = this.encrypt && !suppressEncryption ? parser.getObj(this.encrypt.createCipherTransform(num, gen)) : parser.getObj(); |
| 53836 |
if (!(xrefEntry instanceof BaseStream)) { |
| 53837 |
this._cacheMap.set(num, xrefEntry); |
| 53838 |
} |
| 53839 |
return xrefEntry; |
| 53840 |
} |
| 53841 |
fetchCompressed(ref, xrefEntry, suppressEncryption = false) { |
| 53842 |
const tableOffset = xrefEntry.offset; |
| 53843 |
const stream = this.fetch(Ref.get(tableOffset, 0)); |
| 53844 |
if (!(stream instanceof BaseStream)) { |
| 53845 |
throw new FormatError("bad ObjStm stream"); |
| 53846 |
} |
| 53847 |
const first = stream.dict.get("First"); |
| 53848 |
const n = stream.dict.get("N"); |
| 53849 |
if (!Number.isInteger(first) || !Number.isInteger(n)) { |
| 53850 |
throw new FormatError("invalid first and n parameters for ObjStm stream"); |
| 53851 |
} |
| 53852 |
let parser = new Parser({ |
| 53853 |
lexer: new Lexer(stream), |
| 53854 |
xref: this, |
| 53855 |
allowStreams: true |
| 53856 |
}); |
| 53857 |
const nums = new Array(n); |
| 53858 |
const offsets = new Array(n); |
| 53859 |
for (let i = 0; i < n; ++i) { |
| 53860 |
const num = parser.getObj(); |
| 53861 |
if (!Number.isInteger(num)) { |
| 53862 |
throw new FormatError(`invalid object number in the ObjStm stream: ${num}`); |
| 53863 |
} |
| 53864 |
const offset = parser.getObj(); |
| 53865 |
if (!Number.isInteger(offset)) { |
| 53866 |
throw new FormatError(`invalid object offset in the ObjStm stream: ${offset}`); |
| 53867 |
} |
| 53868 |
nums[i] = num; |
| 53869 |
offsets[i] = offset; |
| 53870 |
} |
| 53871 |
const start = (stream.start || 0) + first; |
| 53872 |
const entries = new Array(n); |
| 53873 |
for (let i = 0; i < n; ++i) { |
| 53874 |
const length = i < n - 1 ? offsets[i + 1] - offsets[i] : undefined; |
| 53875 |
if (length < 0) { |
| 53876 |
throw new FormatError("Invalid offset in the ObjStm stream."); |
| 53877 |
} |
| 53878 |
parser = new Parser({ |
| 53879 |
lexer: new Lexer(stream.makeSubStream(start + offsets[i], length, stream.dict)), |
| 53880 |
xref: this, |
| 53881 |
allowStreams: true |
| 53882 |
}); |
| 53883 |
const obj = parser.getObj(); |
| 53884 |
entries[i] = obj; |
| 53885 |
if (obj instanceof BaseStream) { |
| 53886 |
continue; |
| 53887 |
} |
| 53888 |
const num = nums[i], |
| 53889 |
entry = this.entries[num]; |
| 53890 |
if (entry && entry.offset === tableOffset && entry.gen === i) { |
| 53891 |
this._cacheMap.set(num, obj); |
| 53892 |
} |
| 53893 |
} |
| 53894 |
xrefEntry = entries[xrefEntry.gen]; |
| 53895 |
if (xrefEntry === undefined) { |
| 53896 |
throw new XRefEntryException(`Bad (compressed) XRef entry: ${ref}`); |
| 53897 |
} |
| 53898 |
return xrefEntry; |
| 53899 |
} |
| 53900 |
async fetchIfRefAsync(obj, suppressEncryption) { |
| 53901 |
if (obj instanceof Ref) { |
| 53902 |
return this.fetchAsync(obj, suppressEncryption); |
| 53903 |
} |
| 53904 |
return obj; |
| 53905 |
} |
| 53906 |
async fetchAsync(ref, suppressEncryption) { |
| 53907 |
try { |
| 53908 |
return this.fetch(ref, suppressEncryption); |
| 53909 |
} catch (ex) { |
| 53910 |
if (!(ex instanceof MissingDataException)) { |
| 53911 |
throw ex; |
| 53912 |
} |
| 53913 |
await this.pdfManager.requestRange(ex.begin, ex.end); |
| 53914 |
return this.fetchAsync(ref, suppressEncryption); |
| 53915 |
} |
| 53916 |
} |
| 53917 |
getCatalogObj() { |
| 53918 |
return this.root; |
| 53919 |
} |
| 53920 |
} |
| 53921 |
|
| 53922 |
;// ./src/core/document.js |
| 53923 |
|
| 53924 |
|
| 53925 |
|
| 53926 |
|
| 53927 |
|
| 53928 |
|
| 53929 |
|
| 53930 |
|
| 53931 |
|
| 53932 |
|
| 53933 |
|
| 53934 |
|
| 53935 |
|
| 53936 |
|
| 53937 |
|
| 53938 |
|
| 53939 |
|
| 53940 |
|
| 53941 |
|
| 53942 |
|
| 53943 |
const DEFAULT_USER_UNIT = 1.0; |
| 53944 |
const LETTER_SIZE_MEDIABOX = [0, 0, 612, 792]; |
| 53945 |
class Page { |
| 53946 |
constructor({ |
| 53947 |
pdfManager, |
| 53948 |
xref, |
| 53949 |
pageIndex, |
| 53950 |
pageDict, |
| 53951 |
ref, |
| 53952 |
globalIdFactory, |
| 53953 |
fontCache, |
| 53954 |
builtInCMapCache, |
| 53955 |
standardFontDataCache, |
| 53956 |
globalImageCache, |
| 53957 |
systemFontCache, |
| 53958 |
nonBlendModesSet, |
| 53959 |
xfaFactory |
| 53960 |
}) { |
| 53961 |
this.pdfManager = pdfManager; |
| 53962 |
this.pageIndex = pageIndex; |
| 53963 |
this.pageDict = pageDict; |
| 53964 |
this.xref = xref; |
| 53965 |
this.ref = ref; |
| 53966 |
this.fontCache = fontCache; |
| 53967 |
this.builtInCMapCache = builtInCMapCache; |
| 53968 |
this.standardFontDataCache = standardFontDataCache; |
| 53969 |
this.globalImageCache = globalImageCache; |
| 53970 |
this.systemFontCache = systemFontCache; |
| 53971 |
this.nonBlendModesSet = nonBlendModesSet; |
| 53972 |
this.evaluatorOptions = pdfManager.evaluatorOptions; |
| 53973 |
this.resourcesPromise = null; |
| 53974 |
this.xfaFactory = xfaFactory; |
| 53975 |
const idCounters = { |
| 53976 |
obj: 0 |
| 53977 |
}; |
| 53978 |
this._localIdFactory = class extends globalIdFactory { |
| 53979 |
static createObjId() { |
| 53980 |
return `p${pageIndex}_${++idCounters.obj}`; |
| 53981 |
} |
| 53982 |
static getPageObjId() { |
| 53983 |
return `p${ref.toString()}`; |
| 53984 |
} |
| 53985 |
}; |
| 53986 |
} |
| 53987 |
_getInheritableProperty(key, getArray = false) { |
| 53988 |
const value = getInheritableProperty({ |
| 53989 |
dict: this.pageDict, |
| 53990 |
key, |
| 53991 |
getArray, |
| 53992 |
stopWhenFound: false |
| 53993 |
}); |
| 53994 |
if (!Array.isArray(value)) { |
| 53995 |
return value; |
| 53996 |
} |
| 53997 |
if (value.length === 1 || !(value[0] instanceof Dict)) { |
| 53998 |
return value[0]; |
| 53999 |
} |
| 54000 |
return Dict.merge({ |
| 54001 |
xref: this.xref, |
| 54002 |
dictArray: value |
| 54003 |
}); |
| 54004 |
} |
| 54005 |
get content() { |
| 54006 |
return this.pageDict.getArray("Contents"); |
| 54007 |
} |
| 54008 |
get resources() { |
| 54009 |
const resources = this._getInheritableProperty("Resources"); |
| 54010 |
return shadow(this, "resources", resources instanceof Dict ? resources : Dict.empty); |
| 54011 |
} |
| 54012 |
_getBoundingBox(name) { |
| 54013 |
if (this.xfaData) { |
| 54014 |
return this.xfaData.bbox; |
| 54015 |
} |
| 54016 |
const box = lookupNormalRect(this._getInheritableProperty(name, true), null); |
| 54017 |
if (box) { |
| 54018 |
if (box[2] - box[0] > 0 && box[3] - box[1] > 0) { |
| 54019 |
return box; |
| 54020 |
} |
| 54021 |
warn(`Empty, or invalid, /${name} entry.`); |
| 54022 |
} |
| 54023 |
return null; |
| 54024 |
} |
| 54025 |
get mediaBox() { |
| 54026 |
return shadow(this, "mediaBox", this._getBoundingBox("MediaBox") || LETTER_SIZE_MEDIABOX); |
| 54027 |
} |
| 54028 |
get cropBox() { |
| 54029 |
return shadow(this, "cropBox", this._getBoundingBox("CropBox") || this.mediaBox); |
| 54030 |
} |
| 54031 |
get userUnit() { |
| 54032 |
let obj = this.pageDict.get("UserUnit"); |
| 54033 |
if (typeof obj !== "number" || obj <= 0) { |
| 54034 |
obj = DEFAULT_USER_UNIT; |
| 54035 |
} |
| 54036 |
return shadow(this, "userUnit", obj); |
| 54037 |
} |
| 54038 |
get view() { |
| 54039 |
const { |
| 54040 |
cropBox, |
| 54041 |
mediaBox |
| 54042 |
} = this; |
| 54043 |
if (cropBox !== mediaBox && !isArrayEqual(cropBox, mediaBox)) { |
| 54044 |
const box = Util.intersect(cropBox, mediaBox); |
| 54045 |
if (box && box[2] - box[0] > 0 && box[3] - box[1] > 0) { |
| 54046 |
return shadow(this, "view", box); |
| 54047 |
} |
| 54048 |
warn("Empty /CropBox and /MediaBox intersection."); |
| 54049 |
} |
| 54050 |
return shadow(this, "view", mediaBox); |
| 54051 |
} |
| 54052 |
get rotate() { |
| 54053 |
let rotate = this._getInheritableProperty("Rotate") || 0; |
| 54054 |
if (rotate % 90 !== 0) { |
| 54055 |
rotate = 0; |
| 54056 |
} else if (rotate >= 360) { |
| 54057 |
rotate %= 360; |
| 54058 |
} else if (rotate < 0) { |
| 54059 |
rotate = (rotate % 360 + 360) % 360; |
| 54060 |
} |
| 54061 |
return shadow(this, "rotate", rotate); |
| 54062 |
} |
| 54063 |
_onSubStreamError(reason, objId) { |
| 54064 |
if (this.evaluatorOptions.ignoreErrors) { |
| 54065 |
warn(`getContentStream - ignoring sub-stream (${objId}): "${reason}".`); |
| 54066 |
return; |
| 54067 |
} |
| 54068 |
throw reason; |
| 54069 |
} |
| 54070 |
getContentStream() { |
| 54071 |
return this.pdfManager.ensure(this, "content").then(content => { |
| 54072 |
if (content instanceof BaseStream) { |
| 54073 |
return content; |
| 54074 |
} |
| 54075 |
if (Array.isArray(content)) { |
| 54076 |
return new StreamsSequenceStream(content, this._onSubStreamError.bind(this)); |
| 54077 |
} |
| 54078 |
return new NullStream(); |
| 54079 |
}); |
| 54080 |
} |
| 54081 |
get xfaData() { |
| 54082 |
return shadow(this, "xfaData", this.xfaFactory ? { |
| 54083 |
bbox: this.xfaFactory.getBoundingBox(this.pageIndex) |
| 54084 |
} : null); |
| 54085 |
} |
| 54086 |
async #replaceIdByRef(annotations, deletedAnnotations, existingAnnotations) { |
| 54087 |
const promises = []; |
| 54088 |
for (const annotation of annotations) { |
| 54089 |
if (annotation.id) { |
| 54090 |
const ref = Ref.fromString(annotation.id); |
| 54091 |
if (!ref) { |
| 54092 |
warn(`A non-linked annotation cannot be modified: ${annotation.id}`); |
| 54093 |
continue; |
| 54094 |
} |
| 54095 |
if (annotation.deleted) { |
| 54096 |
deletedAnnotations.put(ref, ref); |
| 54097 |
if (annotation.popupRef) { |
| 54098 |
const popupRef = Ref.fromString(annotation.popupRef); |
| 54099 |
if (popupRef) { |
| 54100 |
deletedAnnotations.put(popupRef, popupRef); |
| 54101 |
} |
| 54102 |
} |
| 54103 |
continue; |
| 54104 |
} |
| 54105 |
existingAnnotations?.put(ref); |
| 54106 |
annotation.ref = ref; |
| 54107 |
promises.push(this.xref.fetchAsync(ref).then(obj => { |
| 54108 |
if (obj instanceof Dict) { |
| 54109 |
annotation.oldAnnotation = obj.clone(); |
| 54110 |
} |
| 54111 |
}, () => { |
| 54112 |
warn(`Cannot fetch \`oldAnnotation\` for: ${ref}.`); |
| 54113 |
})); |
| 54114 |
delete annotation.id; |
| 54115 |
} |
| 54116 |
} |
| 54117 |
await Promise.all(promises); |
| 54118 |
} |
| 54119 |
async saveNewAnnotations(handler, task, annotations, imagePromises) { |
| 54120 |
if (this.xfaFactory) { |
| 54121 |
throw new Error("XFA: Cannot save new annotations."); |
| 54122 |
} |
| 54123 |
const partialEvaluator = new PartialEvaluator({ |
| 54124 |
xref: this.xref, |
| 54125 |
handler, |
| 54126 |
pageIndex: this.pageIndex, |
| 54127 |
idFactory: this._localIdFactory, |
| 54128 |
fontCache: this.fontCache, |
| 54129 |
builtInCMapCache: this.builtInCMapCache, |
| 54130 |
standardFontDataCache: this.standardFontDataCache, |
| 54131 |
globalImageCache: this.globalImageCache, |
| 54132 |
systemFontCache: this.systemFontCache, |
| 54133 |
options: this.evaluatorOptions |
| 54134 |
}); |
| 54135 |
const deletedAnnotations = new RefSetCache(); |
| 54136 |
const existingAnnotations = new RefSet(); |
| 54137 |
await this.#replaceIdByRef(annotations, deletedAnnotations, existingAnnotations); |
| 54138 |
const pageDict = this.pageDict; |
| 54139 |
const annotationsArray = this.annotations.filter(a => !(a instanceof Ref && deletedAnnotations.has(a))); |
| 54140 |
const newData = await AnnotationFactory.saveNewAnnotations(partialEvaluator, task, annotations, imagePromises); |
| 54141 |
for (const { |
| 54142 |
ref |
| 54143 |
} of newData.annotations) { |
| 54144 |
if (ref instanceof Ref && !existingAnnotations.has(ref)) { |
| 54145 |
annotationsArray.push(ref); |
| 54146 |
} |
| 54147 |
} |
| 54148 |
const savedDict = pageDict.get("Annots"); |
| 54149 |
pageDict.set("Annots", annotationsArray); |
| 54150 |
const buffer = []; |
| 54151 |
await writeObject(this.ref, pageDict, buffer, this.xref); |
| 54152 |
if (savedDict) { |
| 54153 |
pageDict.set("Annots", savedDict); |
| 54154 |
} |
| 54155 |
const objects = newData.dependencies; |
| 54156 |
objects.push({ |
| 54157 |
ref: this.ref, |
| 54158 |
data: buffer.join("") |
| 54159 |
}, ...newData.annotations); |
| 54160 |
for (const deletedRef of deletedAnnotations) { |
| 54161 |
objects.push({ |
| 54162 |
ref: deletedRef, |
| 54163 |
data: null |
| 54164 |
}); |
| 54165 |
} |
| 54166 |
return objects; |
| 54167 |
} |
| 54168 |
save(handler, task, annotationStorage) { |
| 54169 |
const partialEvaluator = new PartialEvaluator({ |
| 54170 |
xref: this.xref, |
| 54171 |
handler, |
| 54172 |
pageIndex: this.pageIndex, |
| 54173 |
idFactory: this._localIdFactory, |
| 54174 |
fontCache: this.fontCache, |
| 54175 |
builtInCMapCache: this.builtInCMapCache, |
| 54176 |
standardFontDataCache: this.standardFontDataCache, |
| 54177 |
globalImageCache: this.globalImageCache, |
| 54178 |
systemFontCache: this.systemFontCache, |
| 54179 |
options: this.evaluatorOptions |
| 54180 |
}); |
| 54181 |
return this._parsedAnnotations.then(function (annotations) { |
| 54182 |
const newRefsPromises = []; |
| 54183 |
for (const annotation of annotations) { |
| 54184 |
newRefsPromises.push(annotation.save(partialEvaluator, task, annotationStorage).catch(function (reason) { |
| 54185 |
warn("save - ignoring annotation data during " + `"${task.name}" task: "${reason}".`); |
| 54186 |
return null; |
| 54187 |
})); |
| 54188 |
} |
| 54189 |
return Promise.all(newRefsPromises).then(function (newRefs) { |
| 54190 |
return newRefs.filter(newRef => !!newRef); |
| 54191 |
}); |
| 54192 |
}); |
| 54193 |
} |
| 54194 |
loadResources(keys) { |
| 54195 |
this.resourcesPromise ||= this.pdfManager.ensure(this, "resources"); |
| 54196 |
return this.resourcesPromise.then(() => { |
| 54197 |
const objectLoader = new ObjectLoader(this.resources, keys, this.xref); |
| 54198 |
return objectLoader.load(); |
| 54199 |
}); |
| 54200 |
} |
| 54201 |
getOperatorList({ |
| 54202 |
handler, |
| 54203 |
sink, |
| 54204 |
task, |
| 54205 |
intent, |
| 54206 |
cacheKey, |
| 54207 |
annotationStorage = null, |
| 54208 |
modifiedIds = null |
| 54209 |
}) { |
| 54210 |
const contentStreamPromise = this.getContentStream(); |
| 54211 |
const resourcesPromise = this.loadResources(["ColorSpace", "ExtGState", "Font", "Pattern", "Properties", "Shading", "XObject"]); |
| 54212 |
const partialEvaluator = new PartialEvaluator({ |
| 54213 |
xref: this.xref, |
| 54214 |
handler, |
| 54215 |
pageIndex: this.pageIndex, |
| 54216 |
idFactory: this._localIdFactory, |
| 54217 |
fontCache: this.fontCache, |
| 54218 |
builtInCMapCache: this.builtInCMapCache, |
| 54219 |
standardFontDataCache: this.standardFontDataCache, |
| 54220 |
globalImageCache: this.globalImageCache, |
| 54221 |
systemFontCache: this.systemFontCache, |
| 54222 |
options: this.evaluatorOptions |
| 54223 |
}); |
| 54224 |
const newAnnotsByPage = !this.xfaFactory ? getNewAnnotationsMap(annotationStorage) : null; |
| 54225 |
const newAnnots = newAnnotsByPage?.get(this.pageIndex); |
| 54226 |
let newAnnotationsPromise = Promise.resolve(null); |
| 54227 |
let deletedAnnotations = null; |
| 54228 |
if (newAnnots) { |
| 54229 |
const annotationGlobalsPromise = this.pdfManager.ensureDoc("annotationGlobals"); |
| 54230 |
let imagePromises; |
| 54231 |
const missingBitmaps = new Set(); |
| 54232 |
for (const { |
| 54233 |
bitmapId, |
| 54234 |
bitmap |
| 54235 |
} of newAnnots) { |
| 54236 |
if (bitmapId && !bitmap && !missingBitmaps.has(bitmapId)) { |
| 54237 |
missingBitmaps.add(bitmapId); |
| 54238 |
} |
| 54239 |
} |
| 54240 |
const { |
| 54241 |
isOffscreenCanvasSupported |
| 54242 |
} = this.evaluatorOptions; |
| 54243 |
if (missingBitmaps.size > 0) { |
| 54244 |
const annotationWithBitmaps = newAnnots.slice(); |
| 54245 |
for (const [key, annotation] of annotationStorage) { |
| 54246 |
if (!key.startsWith(AnnotationEditorPrefix)) { |
| 54247 |
continue; |
| 54248 |
} |
| 54249 |
if (annotation.bitmap && missingBitmaps.has(annotation.bitmapId)) { |
| 54250 |
annotationWithBitmaps.push(annotation); |
| 54251 |
} |
| 54252 |
} |
| 54253 |
imagePromises = AnnotationFactory.generateImages(annotationWithBitmaps, this.xref, isOffscreenCanvasSupported); |
| 54254 |
} else { |
| 54255 |
imagePromises = AnnotationFactory.generateImages(newAnnots, this.xref, isOffscreenCanvasSupported); |
| 54256 |
} |
| 54257 |
deletedAnnotations = new RefSet(); |
| 54258 |
newAnnotationsPromise = Promise.all([annotationGlobalsPromise, this.#replaceIdByRef(newAnnots, deletedAnnotations, null)]).then(([annotationGlobals]) => { |
| 54259 |
if (!annotationGlobals) { |
| 54260 |
return null; |
| 54261 |
} |
| 54262 |
return AnnotationFactory.printNewAnnotations(annotationGlobals, partialEvaluator, task, newAnnots, imagePromises); |
| 54263 |
}); |
| 54264 |
} |
| 54265 |
const pageListPromise = Promise.all([contentStreamPromise, resourcesPromise]).then(([contentStream]) => { |
| 54266 |
const opList = new OperatorList(intent, sink); |
| 54267 |
handler.send("StartRenderPage", { |
| 54268 |
transparency: partialEvaluator.hasBlendModes(this.resources, this.nonBlendModesSet), |
| 54269 |
pageIndex: this.pageIndex, |
| 54270 |
cacheKey |
| 54271 |
}); |
| 54272 |
return partialEvaluator.getOperatorList({ |
| 54273 |
stream: contentStream, |
| 54274 |
task, |
| 54275 |
resources: this.resources, |
| 54276 |
operatorList: opList |
| 54277 |
}).then(function () { |
| 54278 |
return opList; |
| 54279 |
}); |
| 54280 |
}); |
| 54281 |
return Promise.all([pageListPromise, this._parsedAnnotations, newAnnotationsPromise]).then(function ([pageOpList, annotations, newAnnotations]) { |
| 54282 |
if (newAnnotations) { |
| 54283 |
annotations = annotations.filter(a => !(a.ref && deletedAnnotations.has(a.ref))); |
| 54284 |
for (let i = 0, ii = newAnnotations.length; i < ii; i++) { |
| 54285 |
const newAnnotation = newAnnotations[i]; |
| 54286 |
if (newAnnotation.refToReplace) { |
| 54287 |
const j = annotations.findIndex(a => a.ref && isRefsEqual(a.ref, newAnnotation.refToReplace)); |
| 54288 |
if (j >= 0) { |
| 54289 |
annotations.splice(j, 1, newAnnotation); |
| 54290 |
newAnnotations.splice(i--, 1); |
| 54291 |
ii--; |
| 54292 |
} |
| 54293 |
} |
| 54294 |
} |
| 54295 |
annotations = annotations.concat(newAnnotations); |
| 54296 |
} |
| 54297 |
if (annotations.length === 0 || intent & RenderingIntentFlag.ANNOTATIONS_DISABLE) { |
| 54298 |
pageOpList.flush(true); |
| 54299 |
return { |
| 54300 |
length: pageOpList.totalLength |
| 54301 |
}; |
| 54302 |
} |
| 54303 |
const renderForms = !!(intent & RenderingIntentFlag.ANNOTATIONS_FORMS), |
| 54304 |
isEditing = !!(intent & RenderingIntentFlag.IS_EDITING), |
| 54305 |
intentAny = !!(intent & RenderingIntentFlag.ANY), |
| 54306 |
intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY), |
| 54307 |
intentPrint = !!(intent & RenderingIntentFlag.PRINT); |
| 54308 |
const opListPromises = []; |
| 54309 |
for (const annotation of annotations) { |
| 54310 |
if (intentAny || intentDisplay && annotation.mustBeViewed(annotationStorage, renderForms) && annotation.mustBeViewedWhenEditing(isEditing, modifiedIds) || intentPrint && annotation.mustBePrinted(annotationStorage)) { |
| 54311 |
opListPromises.push(annotation.getOperatorList(partialEvaluator, task, intent, annotationStorage).catch(function (reason) { |
| 54312 |
warn("getOperatorList - ignoring annotation data during " + `"${task.name}" task: "${reason}".`); |
| 54313 |
return { |
| 54314 |
opList: null, |
| 54315 |
separateForm: false, |
| 54316 |
separateCanvas: false |
| 54317 |
}; |
| 54318 |
})); |
| 54319 |
} |
| 54320 |
} |
| 54321 |
return Promise.all(opListPromises).then(function (opLists) { |
| 54322 |
let form = false, |
| 54323 |
canvas = false; |
| 54324 |
for (const { |
| 54325 |
opList, |
| 54326 |
separateForm, |
| 54327 |
separateCanvas |
| 54328 |
} of opLists) { |
| 54329 |
pageOpList.addOpList(opList); |
| 54330 |
form ||= separateForm; |
| 54331 |
canvas ||= separateCanvas; |
| 54332 |
} |
| 54333 |
pageOpList.flush(true, { |
| 54334 |
form, |
| 54335 |
canvas |
| 54336 |
}); |
| 54337 |
return { |
| 54338 |
length: pageOpList.totalLength |
| 54339 |
}; |
| 54340 |
}); |
| 54341 |
}); |
| 54342 |
} |
| 54343 |
async extractTextContent({ |
| 54344 |
handler, |
| 54345 |
task, |
| 54346 |
includeMarkedContent, |
| 54347 |
disableNormalization, |
| 54348 |
sink |
| 54349 |
}) { |
| 54350 |
const contentStreamPromise = this.getContentStream(); |
| 54351 |
const resourcesPromise = this.loadResources(["ExtGState", "Font", "Properties", "XObject"]); |
| 54352 |
const langPromise = this.pdfManager.ensureCatalog("lang"); |
| 54353 |
const [contentStream,, lang] = await Promise.all([contentStreamPromise, resourcesPromise, langPromise]); |
| 54354 |
const partialEvaluator = new PartialEvaluator({ |
| 54355 |
xref: this.xref, |
| 54356 |
handler, |
| 54357 |
pageIndex: this.pageIndex, |
| 54358 |
idFactory: this._localIdFactory, |
| 54359 |
fontCache: this.fontCache, |
| 54360 |
builtInCMapCache: this.builtInCMapCache, |
| 54361 |
standardFontDataCache: this.standardFontDataCache, |
| 54362 |
globalImageCache: this.globalImageCache, |
| 54363 |
systemFontCache: this.systemFontCache, |
| 54364 |
options: this.evaluatorOptions |
| 54365 |
}); |
| 54366 |
return partialEvaluator.getTextContent({ |
| 54367 |
stream: contentStream, |
| 54368 |
task, |
| 54369 |
resources: this.resources, |
| 54370 |
includeMarkedContent, |
| 54371 |
disableNormalization, |
| 54372 |
sink, |
| 54373 |
viewBox: this.view, |
| 54374 |
lang |
| 54375 |
}); |
| 54376 |
} |
| 54377 |
async getStructTree() { |
| 54378 |
const structTreeRoot = await this.pdfManager.ensureCatalog("structTreeRoot"); |
| 54379 |
if (!structTreeRoot) { |
| 54380 |
return null; |
| 54381 |
} |
| 54382 |
await this._parsedAnnotations; |
| 54383 |
const structTree = await this.pdfManager.ensure(this, "_parseStructTree", [structTreeRoot]); |
| 54384 |
return structTree.serializable; |
| 54385 |
} |
| 54386 |
_parseStructTree(structTreeRoot) { |
| 54387 |
const tree = new StructTreePage(structTreeRoot, this.pageDict); |
| 54388 |
tree.parse(this.ref); |
| 54389 |
return tree; |
| 54390 |
} |
| 54391 |
async getAnnotationsData(handler, task, intent) { |
| 54392 |
const annotations = await this._parsedAnnotations; |
| 54393 |
if (annotations.length === 0) { |
| 54394 |
return annotations; |
| 54395 |
} |
| 54396 |
const annotationsData = [], |
| 54397 |
textContentPromises = []; |
| 54398 |
let partialEvaluator; |
| 54399 |
const intentAny = !!(intent & RenderingIntentFlag.ANY), |
| 54400 |
intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY), |
| 54401 |
intentPrint = !!(intent & RenderingIntentFlag.PRINT); |
| 54402 |
for (const annotation of annotations) { |
| 54403 |
const isVisible = intentAny || intentDisplay && annotation.viewable; |
| 54404 |
if (isVisible || intentPrint && annotation.printable) { |
| 54405 |
annotationsData.push(annotation.data); |
| 54406 |
} |
| 54407 |
if (annotation.hasTextContent && isVisible) { |
| 54408 |
partialEvaluator ||= new PartialEvaluator({ |
| 54409 |
xref: this.xref, |
| 54410 |
handler, |
| 54411 |
pageIndex: this.pageIndex, |
| 54412 |
idFactory: this._localIdFactory, |
| 54413 |
fontCache: this.fontCache, |
| 54414 |
builtInCMapCache: this.builtInCMapCache, |
| 54415 |
standardFontDataCache: this.standardFontDataCache, |
| 54416 |
globalImageCache: this.globalImageCache, |
| 54417 |
systemFontCache: this.systemFontCache, |
| 54418 |
options: this.evaluatorOptions |
| 54419 |
}); |
| 54420 |
textContentPromises.push(annotation.extractTextContent(partialEvaluator, task, [-Infinity, -Infinity, Infinity, Infinity]).catch(function (reason) { |
| 54421 |
warn(`getAnnotationsData - ignoring textContent during "${task.name}" task: "${reason}".`); |
| 54422 |
})); |
| 54423 |
} |
| 54424 |
} |
| 54425 |
await Promise.all(textContentPromises); |
| 54426 |
return annotationsData; |
| 54427 |
} |
| 54428 |
get annotations() { |
| 54429 |
const annots = this._getInheritableProperty("Annots"); |
| 54430 |
return shadow(this, "annotations", Array.isArray(annots) ? annots : []); |
| 54431 |
} |
| 54432 |
get _parsedAnnotations() { |
| 54433 |
const promise = this.pdfManager.ensure(this, "annotations").then(async annots => { |
| 54434 |
if (annots.length === 0) { |
| 54435 |
return annots; |
| 54436 |
} |
| 54437 |
const [annotationGlobals, fieldObjects] = await Promise.all([this.pdfManager.ensureDoc("annotationGlobals"), this.pdfManager.ensureDoc("fieldObjects")]); |
| 54438 |
if (!annotationGlobals) { |
| 54439 |
return []; |
| 54440 |
} |
| 54441 |
const orphanFields = fieldObjects?.orphanFields; |
| 54442 |
const annotationPromises = []; |
| 54443 |
for (const annotationRef of annots) { |
| 54444 |
annotationPromises.push(AnnotationFactory.create(this.xref, annotationRef, annotationGlobals, this._localIdFactory, false, orphanFields, this.ref).catch(function (reason) { |
| 54445 |
warn(`_parsedAnnotations: "${reason}".`); |
| 54446 |
return null; |
| 54447 |
})); |
| 54448 |
} |
| 54449 |
const sortedAnnotations = []; |
| 54450 |
let popupAnnotations, widgetAnnotations; |
| 54451 |
for (const annotation of await Promise.all(annotationPromises)) { |
| 54452 |
if (!annotation) { |
| 54453 |
continue; |
| 54454 |
} |
| 54455 |
if (annotation instanceof WidgetAnnotation) { |
| 54456 |
(widgetAnnotations ||= []).push(annotation); |
| 54457 |
continue; |
| 54458 |
} |
| 54459 |
if (annotation instanceof PopupAnnotation) { |
| 54460 |
(popupAnnotations ||= []).push(annotation); |
| 54461 |
continue; |
| 54462 |
} |
| 54463 |
sortedAnnotations.push(annotation); |
| 54464 |
} |
| 54465 |
if (widgetAnnotations) { |
| 54466 |
sortedAnnotations.push(...widgetAnnotations); |
| 54467 |
} |
| 54468 |
if (popupAnnotations) { |
| 54469 |
sortedAnnotations.push(...popupAnnotations); |
| 54470 |
} |
| 54471 |
return sortedAnnotations; |
| 54472 |
}); |
| 54473 |
return shadow(this, "_parsedAnnotations", promise); |
| 54474 |
} |
| 54475 |
get jsActions() { |
| 54476 |
const actions = collectActions(this.xref, this.pageDict, PageActionEventType); |
| 54477 |
return shadow(this, "jsActions", actions); |
| 54478 |
} |
| 54479 |
} |
| 54480 |
const PDF_HEADER_SIGNATURE = new Uint8Array([0x25, 0x50, 0x44, 0x46, 0x2d]); |
| 54481 |
const STARTXREF_SIGNATURE = new Uint8Array([0x73, 0x74, 0x61, 0x72, 0x74, 0x78, 0x72, 0x65, 0x66]); |
| 54482 |
const ENDOBJ_SIGNATURE = new Uint8Array([0x65, 0x6e, 0x64, 0x6f, 0x62, 0x6a]); |
| 54483 |
const FINGERPRINT_FIRST_BYTES = 1024; |
| 54484 |
const EMPTY_FINGERPRINT = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; |
| 54485 |
function find(stream, signature, limit = 1024, backwards = false) { |
| 54486 |
const signatureLength = signature.length; |
| 54487 |
const scanBytes = stream.peekBytes(limit); |
| 54488 |
const scanLength = scanBytes.length - signatureLength; |
| 54489 |
if (scanLength <= 0) { |
| 54490 |
return false; |
| 54491 |
} |
| 54492 |
if (backwards) { |
| 54493 |
const signatureEnd = signatureLength - 1; |
| 54494 |
let pos = scanBytes.length - 1; |
| 54495 |
while (pos >= signatureEnd) { |
| 54496 |
let j = 0; |
| 54497 |
while (j < signatureLength && scanBytes[pos - j] === signature[signatureEnd - j]) { |
| 54498 |
j++; |
| 54499 |
} |
| 54500 |
if (j >= signatureLength) { |
| 54501 |
stream.pos += pos - signatureEnd; |
| 54502 |
return true; |
| 54503 |
} |
| 54504 |
pos--; |
| 54505 |
} |
| 54506 |
} else { |
| 54507 |
let pos = 0; |
| 54508 |
while (pos <= scanLength) { |
| 54509 |
let j = 0; |
| 54510 |
while (j < signatureLength && scanBytes[pos + j] === signature[j]) { |
| 54511 |
j++; |
| 54512 |
} |
| 54513 |
if (j >= signatureLength) { |
| 54514 |
stream.pos += pos; |
| 54515 |
return true; |
| 54516 |
} |
| 54517 |
pos++; |
| 54518 |
} |
| 54519 |
} |
| 54520 |
return false; |
| 54521 |
} |
| 54522 |
class PDFDocument { |
| 54523 |
constructor(pdfManager, stream) { |
| 54524 |
if (stream.length <= 0) { |
| 54525 |
throw new InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes."); |
| 54526 |
} |
| 54527 |
this.pdfManager = pdfManager; |
| 54528 |
this.stream = stream; |
| 54529 |
this.xref = new XRef(stream, pdfManager); |
| 54530 |
this._pagePromises = new Map(); |
| 54531 |
this._version = null; |
| 54532 |
const idCounters = { |
| 54533 |
font: 0 |
| 54534 |
}; |
| 54535 |
this._globalIdFactory = class { |
| 54536 |
static getDocId() { |
| 54537 |
return `g_${pdfManager.docId}`; |
| 54538 |
} |
| 54539 |
static createFontId() { |
| 54540 |
return `f${++idCounters.font}`; |
| 54541 |
} |
| 54542 |
static createObjId() { |
| 54543 |
unreachable("Abstract method `createObjId` called."); |
| 54544 |
} |
| 54545 |
static getPageObjId() { |
| 54546 |
unreachable("Abstract method `getPageObjId` called."); |
| 54547 |
} |
| 54548 |
}; |
| 54549 |
} |
| 54550 |
parse(recoveryMode) { |
| 54551 |
this.xref.parse(recoveryMode); |
| 54552 |
this.catalog = new Catalog(this.pdfManager, this.xref); |
| 54553 |
} |
| 54554 |
get linearization() { |
| 54555 |
let linearization = null; |
| 54556 |
try { |
| 54557 |
linearization = Linearization.create(this.stream); |
| 54558 |
} catch (err) { |
| 54559 |
if (err instanceof MissingDataException) { |
| 54560 |
throw err; |
| 54561 |
} |
| 54562 |
info(err); |
| 54563 |
} |
| 54564 |
return shadow(this, "linearization", linearization); |
| 54565 |
} |
| 54566 |
get startXRef() { |
| 54567 |
const stream = this.stream; |
| 54568 |
let startXRef = 0; |
| 54569 |
if (this.linearization) { |
| 54570 |
stream.reset(); |
| 54571 |
if (find(stream, ENDOBJ_SIGNATURE)) { |
| 54572 |
stream.skip(6); |
| 54573 |
let ch = stream.peekByte(); |
| 54574 |
while (isWhiteSpace(ch)) { |
| 54575 |
stream.pos++; |
| 54576 |
ch = stream.peekByte(); |
| 54577 |
} |
| 54578 |
startXRef = stream.pos - stream.start; |
| 54579 |
} |
| 54580 |
} else { |
| 54581 |
const step = 1024; |
| 54582 |
const startXRefLength = STARTXREF_SIGNATURE.length; |
| 54583 |
let found = false, |
| 54584 |
pos = stream.end; |
| 54585 |
while (!found && pos > 0) { |
| 54586 |
pos -= step - startXRefLength; |
| 54587 |
if (pos < 0) { |
| 54588 |
pos = 0; |
| 54589 |
} |
| 54590 |
stream.pos = pos; |
| 54591 |
found = find(stream, STARTXREF_SIGNATURE, step, true); |
| 54592 |
} |
| 54593 |
if (found) { |
| 54594 |
stream.skip(9); |
| 54595 |
let ch; |
| 54596 |
do { |
| 54597 |
ch = stream.getByte(); |
| 54598 |
} while (isWhiteSpace(ch)); |
| 54599 |
let str = ""; |
| 54600 |
while (ch >= 0x20 && ch <= 0x39) { |
| 54601 |
str += String.fromCharCode(ch); |
| 54602 |
ch = stream.getByte(); |
| 54603 |
} |
| 54604 |
startXRef = parseInt(str, 10); |
| 54605 |
if (isNaN(startXRef)) { |
| 54606 |
startXRef = 0; |
| 54607 |
} |
| 54608 |
} |
| 54609 |
} |
| 54610 |
return shadow(this, "startXRef", startXRef); |
| 54611 |
} |
| 54612 |
checkHeader() { |
| 54613 |
const stream = this.stream; |
| 54614 |
stream.reset(); |
| 54615 |
if (!find(stream, PDF_HEADER_SIGNATURE)) { |
| 54616 |
return; |
| 54617 |
} |
| 54618 |
stream.moveStart(); |
| 54619 |
stream.skip(PDF_HEADER_SIGNATURE.length); |
| 54620 |
let version = "", |
| 54621 |
ch; |
| 54622 |
while ((ch = stream.getByte()) > 0x20 && version.length < 7) { |
| 54623 |
version += String.fromCharCode(ch); |
| 54624 |
} |
| 54625 |
if (PDF_VERSION_REGEXP.test(version)) { |
| 54626 |
this._version = version; |
| 54627 |
} else { |
| 54628 |
warn(`Invalid PDF header version: ${version}`); |
| 54629 |
} |
| 54630 |
} |
| 54631 |
parseStartXRef() { |
| 54632 |
this.xref.setStartXRef(this.startXRef); |
| 54633 |
} |
| 54634 |
get numPages() { |
| 54635 |
let num = 0; |
| 54636 |
if (this.catalog.hasActualNumPages) { |
| 54637 |
num = this.catalog.numPages; |
| 54638 |
} else if (this.xfaFactory) { |
| 54639 |
num = this.xfaFactory.getNumPages(); |
| 54640 |
} else if (this.linearization) { |
| 54641 |
num = this.linearization.numPages; |
| 54642 |
} else { |
| 54643 |
num = this.catalog.numPages; |
| 54644 |
} |
| 54645 |
return shadow(this, "numPages", num); |
| 54646 |
} |
| 54647 |
_hasOnlyDocumentSignatures(fields, recursionDepth = 0) { |
| 54648 |
const RECURSION_LIMIT = 10; |
| 54649 |
if (!Array.isArray(fields)) { |
| 54650 |
return false; |
| 54651 |
} |
| 54652 |
return fields.every(field => { |
| 54653 |
field = this.xref.fetchIfRef(field); |
| 54654 |
if (!(field instanceof Dict)) { |
| 54655 |
return false; |
| 54656 |
} |
| 54657 |
if (field.has("Kids")) { |
| 54658 |
if (++recursionDepth > RECURSION_LIMIT) { |
| 54659 |
warn("_hasOnlyDocumentSignatures: maximum recursion depth reached"); |
| 54660 |
return false; |
| 54661 |
} |
| 54662 |
return this._hasOnlyDocumentSignatures(field.get("Kids"), recursionDepth); |
| 54663 |
} |
| 54664 |
const isSignature = isName(field.get("FT"), "Sig"); |
| 54665 |
const rectangle = field.get("Rect"); |
| 54666 |
const isInvisible = Array.isArray(rectangle) && rectangle.every(value => value === 0); |
| 54667 |
return isSignature && isInvisible; |
| 54668 |
}); |
| 54669 |
} |
| 54670 |
get _xfaStreams() { |
| 54671 |
const acroForm = this.catalog.acroForm; |
| 54672 |
if (!acroForm) { |
| 54673 |
return null; |
| 54674 |
} |
| 54675 |
const xfa = acroForm.get("XFA"); |
| 54676 |
const entries = { |
| 54677 |
"xdp:xdp": "", |
| 54678 |
template: "", |
| 54679 |
datasets: "", |
| 54680 |
config: "", |
| 54681 |
connectionSet: "", |
| 54682 |
localeSet: "", |
| 54683 |
stylesheet: "", |
| 54684 |
"/xdp:xdp": "" |
| 54685 |
}; |
| 54686 |
if (xfa instanceof BaseStream && !xfa.isEmpty) { |
| 54687 |
entries["xdp:xdp"] = xfa; |
| 54688 |
return entries; |
| 54689 |
} |
| 54690 |
if (!Array.isArray(xfa) || xfa.length === 0) { |
| 54691 |
return null; |
| 54692 |
} |
| 54693 |
for (let i = 0, ii = xfa.length; i < ii; i += 2) { |
| 54694 |
let name; |
| 54695 |
if (i === 0) { |
| 54696 |
name = "xdp:xdp"; |
| 54697 |
} else if (i === ii - 2) { |
| 54698 |
name = "/xdp:xdp"; |
| 54699 |
} else { |
| 54700 |
name = xfa[i]; |
| 54701 |
} |
| 54702 |
if (!entries.hasOwnProperty(name)) { |
| 54703 |
continue; |
| 54704 |
} |
| 54705 |
const data = this.xref.fetchIfRef(xfa[i + 1]); |
| 54706 |
if (!(data instanceof BaseStream) || data.isEmpty) { |
| 54707 |
continue; |
| 54708 |
} |
| 54709 |
entries[name] = data; |
| 54710 |
} |
| 54711 |
return entries; |
| 54712 |
} |
| 54713 |
get xfaDatasets() { |
| 54714 |
const streams = this._xfaStreams; |
| 54715 |
if (!streams) { |
| 54716 |
return shadow(this, "xfaDatasets", null); |
| 54717 |
} |
| 54718 |
for (const key of ["datasets", "xdp:xdp"]) { |
| 54719 |
const stream = streams[key]; |
| 54720 |
if (!stream) { |
| 54721 |
continue; |
| 54722 |
} |
| 54723 |
try { |
| 54724 |
const str = stringToUTF8String(stream.getString()); |
| 54725 |
const data = { |
| 54726 |
[key]: str |
| 54727 |
}; |
| 54728 |
return shadow(this, "xfaDatasets", new DatasetReader(data)); |
| 54729 |
} catch { |
| 54730 |
warn("XFA - Invalid utf-8 string."); |
| 54731 |
break; |
| 54732 |
} |
| 54733 |
} |
| 54734 |
return shadow(this, "xfaDatasets", null); |
| 54735 |
} |
| 54736 |
get xfaData() { |
| 54737 |
const streams = this._xfaStreams; |
| 54738 |
if (!streams) { |
| 54739 |
return null; |
| 54740 |
} |
| 54741 |
const data = Object.create(null); |
| 54742 |
for (const [key, stream] of Object.entries(streams)) { |
| 54743 |
if (!stream) { |
| 54744 |
continue; |
| 54745 |
} |
| 54746 |
try { |
| 54747 |
data[key] = stringToUTF8String(stream.getString()); |
| 54748 |
} catch { |
| 54749 |
warn("XFA - Invalid utf-8 string."); |
| 54750 |
return null; |
| 54751 |
} |
| 54752 |
} |
| 54753 |
return data; |
| 54754 |
} |
| 54755 |
get xfaFactory() { |
| 54756 |
let data; |
| 54757 |
if (this.pdfManager.enableXfa && this.catalog.needsRendering && this.formInfo.hasXfa && !this.formInfo.hasAcroForm) { |
| 54758 |
data = this.xfaData; |
| 54759 |
} |
| 54760 |
return shadow(this, "xfaFactory", data ? new XFAFactory(data) : null); |
| 54761 |
} |
| 54762 |
get isPureXfa() { |
| 54763 |
return this.xfaFactory ? this.xfaFactory.isValid() : false; |
| 54764 |
} |
| 54765 |
get htmlForXfa() { |
| 54766 |
return this.xfaFactory ? this.xfaFactory.getPages() : null; |
| 54767 |
} |
| 54768 |
async loadXfaImages() { |
| 54769 |
const xfaImagesDict = await this.pdfManager.ensureCatalog("xfaImages"); |
| 54770 |
if (!xfaImagesDict) { |
| 54771 |
return; |
| 54772 |
} |
| 54773 |
const keys = xfaImagesDict.getKeys(); |
| 54774 |
const objectLoader = new ObjectLoader(xfaImagesDict, keys, this.xref); |
| 54775 |
await objectLoader.load(); |
| 54776 |
const xfaImages = new Map(); |
| 54777 |
for (const key of keys) { |
| 54778 |
const stream = xfaImagesDict.get(key); |
| 54779 |
if (stream instanceof BaseStream) { |
| 54780 |
xfaImages.set(key, stream.getBytes()); |
| 54781 |
} |
| 54782 |
} |
| 54783 |
this.xfaFactory.setImages(xfaImages); |
| 54784 |
} |
| 54785 |
async loadXfaFonts(handler, task) { |
| 54786 |
const acroForm = await this.pdfManager.ensureCatalog("acroForm"); |
| 54787 |
if (!acroForm) { |
| 54788 |
return; |
| 54789 |
} |
| 54790 |
const resources = await acroForm.getAsync("DR"); |
| 54791 |
if (!(resources instanceof Dict)) { |
| 54792 |
return; |
| 54793 |
} |
| 54794 |
const objectLoader = new ObjectLoader(resources, ["Font"], this.xref); |
| 54795 |
await objectLoader.load(); |
| 54796 |
const fontRes = resources.get("Font"); |
| 54797 |
if (!(fontRes instanceof Dict)) { |
| 54798 |
return; |
| 54799 |
} |
| 54800 |
const options = Object.assign(Object.create(null), this.pdfManager.evaluatorOptions); |
| 54801 |
options.useSystemFonts = false; |
| 54802 |
const partialEvaluator = new PartialEvaluator({ |
| 54803 |
xref: this.xref, |
| 54804 |
handler, |
| 54805 |
pageIndex: -1, |
| 54806 |
idFactory: this._globalIdFactory, |
| 54807 |
fontCache: this.catalog.fontCache, |
| 54808 |
builtInCMapCache: this.catalog.builtInCMapCache, |
| 54809 |
standardFontDataCache: this.catalog.standardFontDataCache, |
| 54810 |
options |
| 54811 |
}); |
| 54812 |
const operatorList = new OperatorList(); |
| 54813 |
const pdfFonts = []; |
| 54814 |
const initialState = { |
| 54815 |
get font() { |
| 54816 |
return pdfFonts.at(-1); |
| 54817 |
}, |
| 54818 |
set font(font) { |
| 54819 |
pdfFonts.push(font); |
| 54820 |
}, |
| 54821 |
clone() { |
| 54822 |
return this; |
| 54823 |
} |
| 54824 |
}; |
| 54825 |
const fonts = new Map(); |
| 54826 |
fontRes.forEach((fontName, font) => { |
| 54827 |
fonts.set(fontName, font); |
| 54828 |
}); |
| 54829 |
const promises = []; |
| 54830 |
for (const [fontName, font] of fonts) { |
| 54831 |
const descriptor = font.get("FontDescriptor"); |
| 54832 |
if (!(descriptor instanceof Dict)) { |
| 54833 |
continue; |
| 54834 |
} |
| 54835 |
let fontFamily = descriptor.get("FontFamily"); |
| 54836 |
fontFamily = fontFamily.replaceAll(/[ ]+(\d)/g, "$1"); |
| 54837 |
const fontWeight = descriptor.get("FontWeight"); |
| 54838 |
const italicAngle = -descriptor.get("ItalicAngle"); |
| 54839 |
const cssFontInfo = { |
| 54840 |
fontFamily, |
| 54841 |
fontWeight, |
| 54842 |
italicAngle |
| 54843 |
}; |
| 54844 |
if (!validateCSSFont(cssFontInfo)) { |
| 54845 |
continue; |
| 54846 |
} |
| 54847 |
promises.push(partialEvaluator.handleSetFont(resources, [Name.get(fontName), 1], null, operatorList, task, initialState, null, cssFontInfo).catch(function (reason) { |
| 54848 |
warn(`loadXfaFonts: "${reason}".`); |
| 54849 |
return null; |
| 54850 |
})); |
| 54851 |
} |
| 54852 |
await Promise.all(promises); |
| 54853 |
const missingFonts = this.xfaFactory.setFonts(pdfFonts); |
| 54854 |
if (!missingFonts) { |
| 54855 |
return; |
| 54856 |
} |
| 54857 |
options.ignoreErrors = true; |
| 54858 |
promises.length = 0; |
| 54859 |
pdfFonts.length = 0; |
| 54860 |
const reallyMissingFonts = new Set(); |
| 54861 |
for (const missing of missingFonts) { |
| 54862 |
if (!getXfaFontName(`${missing}-Regular`)) { |
| 54863 |
reallyMissingFonts.add(missing); |
| 54864 |
} |
| 54865 |
} |
| 54866 |
if (reallyMissingFonts.size) { |
| 54867 |
missingFonts.push("PdfJS-Fallback"); |
| 54868 |
} |
| 54869 |
for (const missing of missingFonts) { |
| 54870 |
if (reallyMissingFonts.has(missing)) { |
| 54871 |
continue; |
| 54872 |
} |
| 54873 |
for (const fontInfo of [{ |
| 54874 |
name: "Regular", |
| 54875 |
fontWeight: 400, |
| 54876 |
italicAngle: 0 |
| 54877 |
}, { |
| 54878 |
name: "Bold", |
| 54879 |
fontWeight: 700, |
| 54880 |
italicAngle: 0 |
| 54881 |
}, { |
| 54882 |
name: "Italic", |
| 54883 |
fontWeight: 400, |
| 54884 |
italicAngle: 12 |
| 54885 |
}, { |
| 54886 |
name: "BoldItalic", |
| 54887 |
fontWeight: 700, |
| 54888 |
italicAngle: 12 |
| 54889 |
}]) { |
| 54890 |
const name = `${missing}-${fontInfo.name}`; |
| 54891 |
const dict = getXfaFontDict(name); |
| 54892 |
promises.push(partialEvaluator.handleSetFont(resources, [Name.get(name), 1], null, operatorList, task, initialState, dict, { |
| 54893 |
fontFamily: missing, |
| 54894 |
fontWeight: fontInfo.fontWeight, |
| 54895 |
italicAngle: fontInfo.italicAngle |
| 54896 |
}).catch(function (reason) { |
| 54897 |
warn(`loadXfaFonts: "${reason}".`); |
| 54898 |
return null; |
| 54899 |
})); |
| 54900 |
} |
| 54901 |
} |
| 54902 |
await Promise.all(promises); |
| 54903 |
this.xfaFactory.appendFonts(pdfFonts, reallyMissingFonts); |
| 54904 |
} |
| 54905 |
async serializeXfaData(annotationStorage) { |
| 54906 |
return this.xfaFactory ? this.xfaFactory.serializeData(annotationStorage) : null; |
| 54907 |
} |
| 54908 |
get version() { |
| 54909 |
return this.catalog.version || this._version; |
| 54910 |
} |
| 54911 |
get formInfo() { |
| 54912 |
const formInfo = { |
| 54913 |
hasFields: false, |
| 54914 |
hasAcroForm: false, |
| 54915 |
hasXfa: false, |
| 54916 |
hasSignatures: false |
| 54917 |
}; |
| 54918 |
const acroForm = this.catalog.acroForm; |
| 54919 |
if (!acroForm) { |
| 54920 |
return shadow(this, "formInfo", formInfo); |
| 54921 |
} |
| 54922 |
try { |
| 54923 |
const fields = acroForm.get("Fields"); |
| 54924 |
const hasFields = Array.isArray(fields) && fields.length > 0; |
| 54925 |
formInfo.hasFields = hasFields; |
| 54926 |
const xfa = acroForm.get("XFA"); |
| 54927 |
formInfo.hasXfa = Array.isArray(xfa) && xfa.length > 0 || xfa instanceof BaseStream && !xfa.isEmpty; |
| 54928 |
const sigFlags = acroForm.get("SigFlags"); |
| 54929 |
const hasSignatures = !!(sigFlags & 0x1); |
| 54930 |
const hasOnlyDocumentSignatures = hasSignatures && this._hasOnlyDocumentSignatures(fields); |
| 54931 |
formInfo.hasAcroForm = hasFields && !hasOnlyDocumentSignatures; |
| 54932 |
formInfo.hasSignatures = hasSignatures; |
| 54933 |
} catch (ex) { |
| 54934 |
if (ex instanceof MissingDataException) { |
| 54935 |
throw ex; |
| 54936 |
} |
| 54937 |
warn(`Cannot fetch form information: "${ex}".`); |
| 54938 |
} |
| 54939 |
return shadow(this, "formInfo", formInfo); |
| 54940 |
} |
| 54941 |
get documentInfo() { |
| 54942 |
const docInfo = { |
| 54943 |
PDFFormatVersion: this.version, |
| 54944 |
Language: this.catalog.lang, |
| 54945 |
EncryptFilterName: this.xref.encrypt ? this.xref.encrypt.filterName : null, |
| 54946 |
IsLinearized: !!this.linearization, |
| 54947 |
IsAcroFormPresent: this.formInfo.hasAcroForm, |
| 54948 |
IsXFAPresent: this.formInfo.hasXfa, |
| 54949 |
IsCollectionPresent: !!this.catalog.collection, |
| 54950 |
IsSignaturesPresent: this.formInfo.hasSignatures |
| 54951 |
}; |
| 54952 |
let infoDict; |
| 54953 |
try { |
| 54954 |
infoDict = this.xref.trailer.get("Info"); |
| 54955 |
} catch (err) { |
| 54956 |
if (err instanceof MissingDataException) { |
| 54957 |
throw err; |
| 54958 |
} |
| 54959 |
info("The document information dictionary is invalid."); |
| 54960 |
} |
| 54961 |
if (!(infoDict instanceof Dict)) { |
| 54962 |
return shadow(this, "documentInfo", docInfo); |
| 54963 |
} |
| 54964 |
for (const key of infoDict.getKeys()) { |
| 54965 |
const value = infoDict.get(key); |
| 54966 |
switch (key) { |
| 54967 |
case "Title": |
| 54968 |
case "Author": |
| 54969 |
case "Subject": |
| 54970 |
case "Keywords": |
| 54971 |
case "Creator": |
| 54972 |
case "Producer": |
| 54973 |
case "CreationDate": |
| 54974 |
case "ModDate": |
| 54975 |
if (typeof value === "string") { |
| 54976 |
docInfo[key] = stringToPDFString(value); |
| 54977 |
continue; |
| 54978 |
} |
| 54979 |
break; |
| 54980 |
case "Trapped": |
| 54981 |
if (value instanceof Name) { |
| 54982 |
docInfo[key] = value; |
| 54983 |
continue; |
| 54984 |
} |
| 54985 |
break; |
| 54986 |
default: |
| 54987 |
let customValue; |
| 54988 |
switch (typeof value) { |
| 54989 |
case "string": |
| 54990 |
customValue = stringToPDFString(value); |
| 54991 |
break; |
| 54992 |
case "number": |
| 54993 |
case "boolean": |
| 54994 |
customValue = value; |
| 54995 |
break; |
| 54996 |
default: |
| 54997 |
if (value instanceof Name) { |
| 54998 |
customValue = value; |
| 54999 |
} |
| 55000 |
break; |
| 55001 |
} |
| 55002 |
if (customValue === undefined) { |
| 55003 |
warn(`Bad value, for custom key "${key}", in Info: ${value}.`); |
| 55004 |
continue; |
| 55005 |
} |
| 55006 |
if (!docInfo.Custom) { |
| 55007 |
docInfo.Custom = Object.create(null); |
| 55008 |
} |
| 55009 |
docInfo.Custom[key] = customValue; |
| 55010 |
continue; |
| 55011 |
} |
| 55012 |
warn(`Bad value, for key "${key}", in Info: ${value}.`); |
| 55013 |
} |
| 55014 |
return shadow(this, "documentInfo", docInfo); |
| 55015 |
} |
| 55016 |
get fingerprints() { |
| 55017 |
function validate(data) { |
| 55018 |
return typeof data === "string" && data.length > 0 && data !== EMPTY_FINGERPRINT; |
| 55019 |
} |
| 55020 |
function hexString(hash) { |
| 55021 |
const buf = []; |
| 55022 |
for (const num of hash) { |
| 55023 |
const hex = num.toString(16); |
| 55024 |
buf.push(hex.padStart(2, "0")); |
| 55025 |
} |
| 55026 |
return buf.join(""); |
| 55027 |
} |
| 55028 |
const idArray = this.xref.trailer.get("ID"); |
| 55029 |
let hashOriginal, hashModified; |
| 55030 |
if (Array.isArray(idArray) && validate(idArray[0])) { |
| 55031 |
hashOriginal = stringToBytes(idArray[0]); |
| 55032 |
if (idArray[1] !== idArray[0] && validate(idArray[1])) { |
| 55033 |
hashModified = stringToBytes(idArray[1]); |
| 55034 |
} |
| 55035 |
} else { |
| 55036 |
hashOriginal = calculateMD5(this.stream.getByteRange(0, FINGERPRINT_FIRST_BYTES), 0, FINGERPRINT_FIRST_BYTES); |
| 55037 |
} |
| 55038 |
return shadow(this, "fingerprints", [hexString(hashOriginal), hashModified ? hexString(hashModified) : null]); |
| 55039 |
} |
| 55040 |
async _getLinearizationPage(pageIndex) { |
| 55041 |
const { |
| 55042 |
catalog, |
| 55043 |
linearization, |
| 55044 |
xref |
| 55045 |
} = this; |
| 55046 |
const ref = Ref.get(linearization.objectNumberFirst, 0); |
| 55047 |
try { |
| 55048 |
const obj = await xref.fetchAsync(ref); |
| 55049 |
if (obj instanceof Dict) { |
| 55050 |
let type = obj.getRaw("Type"); |
| 55051 |
if (type instanceof Ref) { |
| 55052 |
type = await xref.fetchAsync(type); |
| 55053 |
} |
| 55054 |
if (isName(type, "Page") || !obj.has("Type") && !obj.has("Kids") && obj.has("Contents")) { |
| 55055 |
if (!catalog.pageKidsCountCache.has(ref)) { |
| 55056 |
catalog.pageKidsCountCache.put(ref, 1); |
| 55057 |
} |
| 55058 |
if (!catalog.pageIndexCache.has(ref)) { |
| 55059 |
catalog.pageIndexCache.put(ref, 0); |
| 55060 |
} |
| 55061 |
return [obj, ref]; |
| 55062 |
} |
| 55063 |
} |
| 55064 |
throw new FormatError("The Linearization dictionary doesn't point to a valid Page dictionary."); |
| 55065 |
} catch (reason) { |
| 55066 |
warn(`_getLinearizationPage: "${reason.message}".`); |
| 55067 |
return catalog.getPageDict(pageIndex); |
| 55068 |
} |
| 55069 |
} |
| 55070 |
getPage(pageIndex) { |
| 55071 |
const cachedPromise = this._pagePromises.get(pageIndex); |
| 55072 |
if (cachedPromise) { |
| 55073 |
return cachedPromise; |
| 55074 |
} |
| 55075 |
const { |
| 55076 |
catalog, |
| 55077 |
linearization, |
| 55078 |
xfaFactory |
| 55079 |
} = this; |
| 55080 |
let promise; |
| 55081 |
if (xfaFactory) { |
| 55082 |
promise = Promise.resolve([Dict.empty, null]); |
| 55083 |
} else if (linearization?.pageFirst === pageIndex) { |
| 55084 |
promise = this._getLinearizationPage(pageIndex); |
| 55085 |
} else { |
| 55086 |
promise = catalog.getPageDict(pageIndex); |
| 55087 |
} |
| 55088 |
promise = promise.then(([pageDict, ref]) => { |
| 55089 |
return new Page({ |
| 55090 |
pdfManager: this.pdfManager, |
| 55091 |
xref: this.xref, |
| 55092 |
pageIndex, |
| 55093 |
pageDict, |
| 55094 |
ref, |
| 55095 |
globalIdFactory: this._globalIdFactory, |
| 55096 |
fontCache: catalog.fontCache, |
| 55097 |
builtInCMapCache: catalog.builtInCMapCache, |
| 55098 |
standardFontDataCache: catalog.standardFontDataCache, |
| 55099 |
globalImageCache: catalog.globalImageCache, |
| 55100 |
systemFontCache: catalog.systemFontCache, |
| 55101 |
nonBlendModesSet: catalog.nonBlendModesSet, |
| 55102 |
xfaFactory |
| 55103 |
}); |
| 55104 |
}); |
| 55105 |
this._pagePromises.set(pageIndex, promise); |
| 55106 |
return promise; |
| 55107 |
} |
| 55108 |
async checkFirstPage(recoveryMode = false) { |
| 55109 |
if (recoveryMode) { |
| 55110 |
return; |
| 55111 |
} |
| 55112 |
try { |
| 55113 |
await this.getPage(0); |
| 55114 |
} catch (reason) { |
| 55115 |
if (reason instanceof XRefEntryException) { |
| 55116 |
this._pagePromises.delete(0); |
| 55117 |
await this.cleanup(); |
| 55118 |
throw new XRefParseException(); |
| 55119 |
} |
| 55120 |
} |
| 55121 |
} |
| 55122 |
async checkLastPage(recoveryMode = false) { |
| 55123 |
const { |
| 55124 |
catalog, |
| 55125 |
pdfManager |
| 55126 |
} = this; |
| 55127 |
catalog.setActualNumPages(); |
| 55128 |
let numPages; |
| 55129 |
try { |
| 55130 |
await Promise.all([pdfManager.ensureDoc("xfaFactory"), pdfManager.ensureDoc("linearization"), pdfManager.ensureCatalog("numPages")]); |
| 55131 |
if (this.xfaFactory) { |
| 55132 |
return; |
| 55133 |
} else if (this.linearization) { |
| 55134 |
numPages = this.linearization.numPages; |
| 55135 |
} else { |
| 55136 |
numPages = catalog.numPages; |
| 55137 |
} |
| 55138 |
if (!Number.isInteger(numPages)) { |
| 55139 |
throw new FormatError("Page count is not an integer."); |
| 55140 |
} else if (numPages <= 1) { |
| 55141 |
return; |
| 55142 |
} |
| 55143 |
await this.getPage(numPages - 1); |
| 55144 |
} catch (reason) { |
| 55145 |
this._pagePromises.delete(numPages - 1); |
| 55146 |
await this.cleanup(); |
| 55147 |
if (reason instanceof XRefEntryException && !recoveryMode) { |
| 55148 |
throw new XRefParseException(); |
| 55149 |
} |
| 55150 |
warn(`checkLastPage - invalid /Pages tree /Count: ${numPages}.`); |
| 55151 |
let pagesTree; |
| 55152 |
try { |
| 55153 |
pagesTree = await catalog.getAllPageDicts(recoveryMode); |
| 55154 |
} catch (reasonAll) { |
| 55155 |
if (reasonAll instanceof XRefEntryException && !recoveryMode) { |
| 55156 |
throw new XRefParseException(); |
| 55157 |
} |
| 55158 |
catalog.setActualNumPages(1); |
| 55159 |
return; |
| 55160 |
} |
| 55161 |
for (const [pageIndex, [pageDict, ref]] of pagesTree) { |
| 55162 |
let promise; |
| 55163 |
if (pageDict instanceof Error) { |
| 55164 |
promise = Promise.reject(pageDict); |
| 55165 |
promise.catch(() => {}); |
| 55166 |
} else { |
| 55167 |
promise = Promise.resolve(new Page({ |
| 55168 |
pdfManager, |
| 55169 |
xref: this.xref, |
| 55170 |
pageIndex, |
| 55171 |
pageDict, |
| 55172 |
ref, |
| 55173 |
globalIdFactory: this._globalIdFactory, |
| 55174 |
fontCache: catalog.fontCache, |
| 55175 |
builtInCMapCache: catalog.builtInCMapCache, |
| 55176 |
standardFontDataCache: catalog.standardFontDataCache, |
| 55177 |
globalImageCache: catalog.globalImageCache, |
| 55178 |
systemFontCache: catalog.systemFontCache, |
| 55179 |
nonBlendModesSet: catalog.nonBlendModesSet, |
| 55180 |
xfaFactory: null |
| 55181 |
})); |
| 55182 |
} |
| 55183 |
this._pagePromises.set(pageIndex, promise); |
| 55184 |
} |
| 55185 |
catalog.setActualNumPages(pagesTree.size); |
| 55186 |
} |
| 55187 |
} |
| 55188 |
fontFallback(id, handler) { |
| 55189 |
return this.catalog.fontFallback(id, handler); |
| 55190 |
} |
| 55191 |
async cleanup(manuallyTriggered = false) { |
| 55192 |
return this.catalog ? this.catalog.cleanup(manuallyTriggered) : clearGlobalCaches(); |
| 55193 |
} |
| 55194 |
async #collectFieldObjects(name, parentRef, fieldRef, promises, annotationGlobals, visitedRefs, orphanFields) { |
| 55195 |
const { |
| 55196 |
xref |
| 55197 |
} = this; |
| 55198 |
if (!(fieldRef instanceof Ref) || visitedRefs.has(fieldRef)) { |
| 55199 |
return; |
| 55200 |
} |
| 55201 |
visitedRefs.put(fieldRef); |
| 55202 |
const field = await xref.fetchAsync(fieldRef); |
| 55203 |
if (!(field instanceof Dict)) { |
| 55204 |
return; |
| 55205 |
} |
| 55206 |
if (field.has("T")) { |
| 55207 |
const partName = stringToPDFString(await field.getAsync("T")); |
| 55208 |
name = name === "" ? partName : `${name}.${partName}`; |
| 55209 |
} else { |
| 55210 |
let obj = field; |
| 55211 |
while (true) { |
| 55212 |
obj = obj.getRaw("Parent") || parentRef; |
| 55213 |
if (obj instanceof Ref) { |
| 55214 |
if (visitedRefs.has(obj)) { |
| 55215 |
break; |
| 55216 |
} |
| 55217 |
obj = await xref.fetchAsync(obj); |
| 55218 |
} |
| 55219 |
if (!(obj instanceof Dict)) { |
| 55220 |
break; |
| 55221 |
} |
| 55222 |
if (obj.has("T")) { |
| 55223 |
const partName = stringToPDFString(await obj.getAsync("T")); |
| 55224 |
name = name === "" ? partName : `${name}.${partName}`; |
| 55225 |
break; |
| 55226 |
} |
| 55227 |
} |
| 55228 |
} |
| 55229 |
if (parentRef && !field.has("Parent") && isName(field.get("Subtype"), "Widget")) { |
| 55230 |
orphanFields.put(fieldRef, parentRef); |
| 55231 |
} |
| 55232 |
if (!promises.has(name)) { |
| 55233 |
promises.set(name, []); |
| 55234 |
} |
| 55235 |
promises.get(name).push(AnnotationFactory.create(xref, fieldRef, annotationGlobals, null, true, orphanFields, null).then(annotation => annotation?.getFieldObject()).catch(function (reason) { |
| 55236 |
warn(`#collectFieldObjects: "${reason}".`); |
| 55237 |
return null; |
| 55238 |
})); |
| 55239 |
if (!field.has("Kids")) { |
| 55240 |
return; |
| 55241 |
} |
| 55242 |
const kids = await field.getAsync("Kids"); |
| 55243 |
if (Array.isArray(kids)) { |
| 55244 |
for (const kid of kids) { |
| 55245 |
await this.#collectFieldObjects(name, fieldRef, kid, promises, annotationGlobals, visitedRefs, orphanFields); |
| 55246 |
} |
| 55247 |
} |
| 55248 |
} |
| 55249 |
get fieldObjects() { |
| 55250 |
if (!this.formInfo.hasFields) { |
| 55251 |
return shadow(this, "fieldObjects", Promise.resolve(null)); |
| 55252 |
} |
| 55253 |
const promise = Promise.all([this.pdfManager.ensureDoc("annotationGlobals"), this.pdfManager.ensureCatalog("acroForm")]).then(async ([annotationGlobals, acroForm]) => { |
| 55254 |
if (!annotationGlobals) { |
| 55255 |
return null; |
| 55256 |
} |
| 55257 |
const visitedRefs = new RefSet(); |
| 55258 |
const allFields = Object.create(null); |
| 55259 |
const fieldPromises = new Map(); |
| 55260 |
const orphanFields = new RefSetCache(); |
| 55261 |
for (const fieldRef of await acroForm.getAsync("Fields")) { |
| 55262 |
await this.#collectFieldObjects("", null, fieldRef, fieldPromises, annotationGlobals, visitedRefs, orphanFields); |
| 55263 |
} |
| 55264 |
const allPromises = []; |
| 55265 |
for (const [name, promises] of fieldPromises) { |
| 55266 |
allPromises.push(Promise.all(promises).then(fields => { |
| 55267 |
fields = fields.filter(field => !!field); |
| 55268 |
if (fields.length > 0) { |
| 55269 |
allFields[name] = fields; |
| 55270 |
} |
| 55271 |
})); |
| 55272 |
} |
| 55273 |
await Promise.all(allPromises); |
| 55274 |
return { |
| 55275 |
allFields, |
| 55276 |
orphanFields |
| 55277 |
}; |
| 55278 |
}); |
| 55279 |
return shadow(this, "fieldObjects", promise); |
| 55280 |
} |
| 55281 |
get hasJSActions() { |
| 55282 |
const promise = this.pdfManager.ensureDoc("_parseHasJSActions"); |
| 55283 |
return shadow(this, "hasJSActions", promise); |
| 55284 |
} |
| 55285 |
async _parseHasJSActions() { |
| 55286 |
const [catalogJsActions, fieldObjects] = await Promise.all([this.pdfManager.ensureCatalog("jsActions"), this.pdfManager.ensureDoc("fieldObjects")]); |
| 55287 |
if (catalogJsActions) { |
| 55288 |
return true; |
| 55289 |
} |
| 55290 |
if (fieldObjects) { |
| 55291 |
return Object.values(fieldObjects.allFields).some(fieldObject => fieldObject.some(object => object.actions !== null)); |
| 55292 |
} |
| 55293 |
return false; |
| 55294 |
} |
| 55295 |
get calculationOrderIds() { |
| 55296 |
const acroForm = this.catalog.acroForm; |
| 55297 |
if (!acroForm?.has("CO")) { |
| 55298 |
return shadow(this, "calculationOrderIds", null); |
| 55299 |
} |
| 55300 |
const calculationOrder = acroForm.get("CO"); |
| 55301 |
if (!Array.isArray(calculationOrder) || calculationOrder.length === 0) { |
| 55302 |
return shadow(this, "calculationOrderIds", null); |
| 55303 |
} |
| 55304 |
const ids = []; |
| 55305 |
for (const id of calculationOrder) { |
| 55306 |
if (id instanceof Ref) { |
| 55307 |
ids.push(id.toString()); |
| 55308 |
} |
| 55309 |
} |
| 55310 |
if (ids.length === 0) { |
| 55311 |
return shadow(this, "calculationOrderIds", null); |
| 55312 |
} |
| 55313 |
return shadow(this, "calculationOrderIds", ids); |
| 55314 |
} |
| 55315 |
get annotationGlobals() { |
| 55316 |
return shadow(this, "annotationGlobals", AnnotationFactory.createGlobals(this.pdfManager)); |
| 55317 |
} |
| 55318 |
} |
| 55319 |
|
| 55320 |
;// ./src/core/pdf_manager.js |
| 55321 |
|
| 55322 |
|
| 55323 |
|
| 55324 |
|
| 55325 |
|
| 55326 |
function parseDocBaseUrl(url) { |
| 55327 |
if (url) { |
| 55328 |
const absoluteUrl = createValidAbsoluteUrl(url); |
| 55329 |
if (absoluteUrl) { |
| 55330 |
return absoluteUrl.href; |
| 55331 |
} |
| 55332 |
warn(`Invalid absolute docBaseUrl: "${url}".`); |
| 55333 |
} |
| 55334 |
return null; |
| 55335 |
} |
| 55336 |
class BasePdfManager { |
| 55337 |
constructor(args) { |
| 55338 |
this._docBaseUrl = parseDocBaseUrl(args.docBaseUrl); |
| 55339 |
this._docId = args.docId; |
| 55340 |
this._password = args.password; |
| 55341 |
this.enableXfa = args.enableXfa; |
| 55342 |
args.evaluatorOptions.isOffscreenCanvasSupported &&= FeatureTest.isOffscreenCanvasSupported; |
| 55343 |
this.evaluatorOptions = Object.freeze(args.evaluatorOptions); |
| 55344 |
} |
| 55345 |
get docId() { |
| 55346 |
return this._docId; |
| 55347 |
} |
| 55348 |
get password() { |
| 55349 |
return this._password; |
| 55350 |
} |
| 55351 |
get docBaseUrl() { |
| 55352 |
return this._docBaseUrl; |
| 55353 |
} |
| 55354 |
get catalog() { |
| 55355 |
return this.pdfDocument.catalog; |
| 55356 |
} |
| 55357 |
ensureDoc(prop, args) { |
| 55358 |
return this.ensure(this.pdfDocument, prop, args); |
| 55359 |
} |
| 55360 |
ensureXRef(prop, args) { |
| 55361 |
return this.ensure(this.pdfDocument.xref, prop, args); |
| 55362 |
} |
| 55363 |
ensureCatalog(prop, args) { |
| 55364 |
return this.ensure(this.pdfDocument.catalog, prop, args); |
| 55365 |
} |
| 55366 |
getPage(pageIndex) { |
| 55367 |
return this.pdfDocument.getPage(pageIndex); |
| 55368 |
} |
| 55369 |
fontFallback(id, handler) { |
| 55370 |
return this.pdfDocument.fontFallback(id, handler); |
| 55371 |
} |
| 55372 |
loadXfaFonts(handler, task) { |
| 55373 |
return this.pdfDocument.loadXfaFonts(handler, task); |
| 55374 |
} |
| 55375 |
loadXfaImages() { |
| 55376 |
return this.pdfDocument.loadXfaImages(); |
| 55377 |
} |
| 55378 |
serializeXfaData(annotationStorage) { |
| 55379 |
return this.pdfDocument.serializeXfaData(annotationStorage); |
| 55380 |
} |
| 55381 |
cleanup(manuallyTriggered = false) { |
| 55382 |
return this.pdfDocument.cleanup(manuallyTriggered); |
| 55383 |
} |
| 55384 |
async ensure(obj, prop, args) { |
| 55385 |
unreachable("Abstract method `ensure` called"); |
| 55386 |
} |
| 55387 |
requestRange(begin, end) { |
| 55388 |
unreachable("Abstract method `requestRange` called"); |
| 55389 |
} |
| 55390 |
requestLoadedStream(noFetch = false) { |
| 55391 |
unreachable("Abstract method `requestLoadedStream` called"); |
| 55392 |
} |
| 55393 |
sendProgressiveData(chunk) { |
| 55394 |
unreachable("Abstract method `sendProgressiveData` called"); |
| 55395 |
} |
| 55396 |
updatePassword(password) { |
| 55397 |
this._password = password; |
| 55398 |
} |
| 55399 |
terminate(reason) { |
| 55400 |
unreachable("Abstract method `terminate` called"); |
| 55401 |
} |
| 55402 |
} |
| 55403 |
class LocalPdfManager extends BasePdfManager { |
| 55404 |
constructor(args) { |
| 55405 |
super(args); |
| 55406 |
const stream = new Stream(args.source); |
| 55407 |
this.pdfDocument = new PDFDocument(this, stream); |
| 55408 |
this._loadedStreamPromise = Promise.resolve(stream); |
| 55409 |
} |
| 55410 |
async ensure(obj, prop, args) { |
| 55411 |
const value = obj[prop]; |
| 55412 |
if (typeof value === "function") { |
| 55413 |
return value.apply(obj, args); |
| 55414 |
} |
| 55415 |
return value; |
| 55416 |
} |
| 55417 |
requestRange(begin, end) { |
| 55418 |
return Promise.resolve(); |
| 55419 |
} |
| 55420 |
requestLoadedStream(noFetch = false) { |
| 55421 |
return this._loadedStreamPromise; |
| 55422 |
} |
| 55423 |
terminate(reason) {} |
| 55424 |
} |
| 55425 |
class NetworkPdfManager extends BasePdfManager { |
| 55426 |
constructor(args) { |
| 55427 |
super(args); |
| 55428 |
this.streamManager = new ChunkedStreamManager(args.source, { |
| 55429 |
msgHandler: args.handler, |
| 55430 |
length: args.length, |
| 55431 |
disableAutoFetch: args.disableAutoFetch, |
| 55432 |
rangeChunkSize: args.rangeChunkSize |
| 55433 |
}); |
| 55434 |
this.pdfDocument = new PDFDocument(this, this.streamManager.getStream()); |
| 55435 |
} |
| 55436 |
async ensure(obj, prop, args) { |
| 55437 |
try { |
| 55438 |
const value = obj[prop]; |
| 55439 |
if (typeof value === "function") { |
| 55440 |
return value.apply(obj, args); |
| 55441 |
} |
| 55442 |
return value; |
| 55443 |
} catch (ex) { |
| 55444 |
if (!(ex instanceof MissingDataException)) { |
| 55445 |
throw ex; |
| 55446 |
} |
| 55447 |
await this.requestRange(ex.begin, ex.end); |
| 55448 |
return this.ensure(obj, prop, args); |
| 55449 |
} |
| 55450 |
} |
| 55451 |
requestRange(begin, end) { |
| 55452 |
return this.streamManager.requestRange(begin, end); |
| 55453 |
} |
| 55454 |
requestLoadedStream(noFetch = false) { |
| 55455 |
return this.streamManager.requestAllChunks(noFetch); |
| 55456 |
} |
| 55457 |
sendProgressiveData(chunk) { |
| 55458 |
this.streamManager.onReceiveData({ |
| 55459 |
chunk |
| 55460 |
}); |
| 55461 |
} |
| 55462 |
terminate(reason) { |
| 55463 |
this.streamManager.abort(reason); |
| 55464 |
} |
| 55465 |
} |
| 55466 |
|
| 55467 |
;// ./src/shared/message_handler.js |
| 55468 |
|
| 55469 |
const CallbackKind = { |
| 55470 |
UNKNOWN: 0, |
| 55471 |
DATA: 1, |
| 55472 |
ERROR: 2 |
| 55473 |
}; |
| 55474 |
const StreamKind = { |
| 55475 |
UNKNOWN: 0, |
| 55476 |
CANCEL: 1, |
| 55477 |
CANCEL_COMPLETE: 2, |
| 55478 |
CLOSE: 3, |
| 55479 |
ENQUEUE: 4, |
| 55480 |
ERROR: 5, |
| 55481 |
PULL: 6, |
| 55482 |
PULL_COMPLETE: 7, |
| 55483 |
START_COMPLETE: 8 |
| 55484 |
}; |
| 55485 |
function wrapReason(reason) { |
| 55486 |
if (!(reason instanceof Error || typeof reason === "object" && reason !== null)) { |
| 55487 |
unreachable('wrapReason: Expected "reason" to be a (possibly cloned) Error.'); |
| 55488 |
} |
| 55489 |
switch (reason.name) { |
| 55490 |
case "AbortException": |
| 55491 |
return new AbortException(reason.message); |
| 55492 |
case "MissingPDFException": |
| 55493 |
return new MissingPDFException(reason.message); |
| 55494 |
case "PasswordException": |
| 55495 |
return new PasswordException(reason.message, reason.code); |
| 55496 |
case "UnexpectedResponseException": |
| 55497 |
return new UnexpectedResponseException(reason.message, reason.status); |
| 55498 |
case "UnknownErrorException": |
| 55499 |
return new UnknownErrorException(reason.message, reason.details); |
| 55500 |
default: |
| 55501 |
return new UnknownErrorException(reason.message, reason.toString()); |
| 55502 |
} |
| 55503 |
} |
| 55504 |
class MessageHandler { |
| 55505 |
constructor(sourceName, targetName, comObj) { |
| 55506 |
this.sourceName = sourceName; |
| 55507 |
this.targetName = targetName; |
| 55508 |
this.comObj = comObj; |
| 55509 |
this.callbackId = 1; |
| 55510 |
this.streamId = 1; |
| 55511 |
this.streamSinks = Object.create(null); |
| 55512 |
this.streamControllers = Object.create(null); |
| 55513 |
this.callbackCapabilities = Object.create(null); |
| 55514 |
this.actionHandler = Object.create(null); |
| 55515 |
this._onComObjOnMessage = event => { |
| 55516 |
const data = event.data; |
| 55517 |
if (data.targetName !== this.sourceName) { |
| 55518 |
return; |
| 55519 |
} |
| 55520 |
if (data.stream) { |
| 55521 |
this.#processStreamMessage(data); |
| 55522 |
return; |
| 55523 |
} |
| 55524 |
if (data.callback) { |
| 55525 |
const callbackId = data.callbackId; |
| 55526 |
const capability = this.callbackCapabilities[callbackId]; |
| 55527 |
if (!capability) { |
| 55528 |
throw new Error(`Cannot resolve callback ${callbackId}`); |
| 55529 |
} |
| 55530 |
delete this.callbackCapabilities[callbackId]; |
| 55531 |
if (data.callback === CallbackKind.DATA) { |
| 55532 |
capability.resolve(data.data); |
| 55533 |
} else if (data.callback === CallbackKind.ERROR) { |
| 55534 |
capability.reject(wrapReason(data.reason)); |
| 55535 |
} else { |
| 55536 |
throw new Error("Unexpected callback case"); |
| 55537 |
} |
| 55538 |
return; |
| 55539 |
} |
| 55540 |
const action = this.actionHandler[data.action]; |
| 55541 |
if (!action) { |
| 55542 |
throw new Error(`Unknown action from worker: ${data.action}`); |
| 55543 |
} |
| 55544 |
if (data.callbackId) { |
| 55545 |
const cbSourceName = this.sourceName; |
| 55546 |
const cbTargetName = data.sourceName; |
| 55547 |
new Promise(function (resolve) { |
| 55548 |
resolve(action(data.data)); |
| 55549 |
}).then(function (result) { |
| 55550 |
comObj.postMessage({ |
| 55551 |
sourceName: cbSourceName, |
| 55552 |
targetName: cbTargetName, |
| 55553 |
callback: CallbackKind.DATA, |
| 55554 |
callbackId: data.callbackId, |
| 55555 |
data: result |
| 55556 |
}); |
| 55557 |
}, function (reason) { |
| 55558 |
comObj.postMessage({ |
| 55559 |
sourceName: cbSourceName, |
| 55560 |
targetName: cbTargetName, |
| 55561 |
callback: CallbackKind.ERROR, |
| 55562 |
callbackId: data.callbackId, |
| 55563 |
reason: wrapReason(reason) |
| 55564 |
}); |
| 55565 |
}); |
| 55566 |
return; |
| 55567 |
} |
| 55568 |
if (data.streamId) { |
| 55569 |
this.#createStreamSink(data); |
| 55570 |
return; |
| 55571 |
} |
| 55572 |
action(data.data); |
| 55573 |
}; |
| 55574 |
comObj.addEventListener("message", this._onComObjOnMessage); |
| 55575 |
} |
| 55576 |
on(actionName, handler) { |
| 55577 |
const ah = this.actionHandler; |
| 55578 |
if (ah[actionName]) { |
| 55579 |
throw new Error(`There is already an actionName called "${actionName}"`); |
| 55580 |
} |
| 55581 |
ah[actionName] = handler; |
| 55582 |
} |
| 55583 |
send(actionName, data, transfers) { |
| 55584 |
this.comObj.postMessage({ |
| 55585 |
sourceName: this.sourceName, |
| 55586 |
targetName: this.targetName, |
| 55587 |
action: actionName, |
| 55588 |
data |
| 55589 |
}, transfers); |
| 55590 |
} |
| 55591 |
sendWithPromise(actionName, data, transfers) { |
| 55592 |
const callbackId = this.callbackId++; |
| 55593 |
const capability = Promise.withResolvers(); |
| 55594 |
this.callbackCapabilities[callbackId] = capability; |
| 55595 |
try { |
| 55596 |
this.comObj.postMessage({ |
| 55597 |
sourceName: this.sourceName, |
| 55598 |
targetName: this.targetName, |
| 55599 |
action: actionName, |
| 55600 |
callbackId, |
| 55601 |
data |
| 55602 |
}, transfers); |
| 55603 |
} catch (ex) { |
| 55604 |
capability.reject(ex); |
| 55605 |
} |
| 55606 |
return capability.promise; |
| 55607 |
} |
| 55608 |
sendWithStream(actionName, data, queueingStrategy, transfers) { |
| 55609 |
const streamId = this.streamId++, |
| 55610 |
sourceName = this.sourceName, |
| 55611 |
targetName = this.targetName, |
| 55612 |
comObj = this.comObj; |
| 55613 |
return new ReadableStream({ |
| 55614 |
start: controller => { |
| 55615 |
const startCapability = Promise.withResolvers(); |
| 55616 |
this.streamControllers[streamId] = { |
| 55617 |
controller, |
| 55618 |
startCall: startCapability, |
| 55619 |
pullCall: null, |
| 55620 |
cancelCall: null, |
| 55621 |
isClosed: false |
| 55622 |
}; |
| 55623 |
comObj.postMessage({ |
| 55624 |
sourceName, |
| 55625 |
targetName, |
| 55626 |
action: actionName, |
| 55627 |
streamId, |
| 55628 |
data, |
| 55629 |
desiredSize: controller.desiredSize |
| 55630 |
}, transfers); |
| 55631 |
return startCapability.promise; |
| 55632 |
}, |
| 55633 |
pull: controller => { |
| 55634 |
const pullCapability = Promise.withResolvers(); |
| 55635 |
this.streamControllers[streamId].pullCall = pullCapability; |
| 55636 |
comObj.postMessage({ |
| 55637 |
sourceName, |
| 55638 |
targetName, |
| 55639 |
stream: StreamKind.PULL, |
| 55640 |
streamId, |
| 55641 |
desiredSize: controller.desiredSize |
| 55642 |
}); |
| 55643 |
return pullCapability.promise; |
| 55644 |
}, |
| 55645 |
cancel: reason => { |
| 55646 |
assert(reason instanceof Error, "cancel must have a valid reason"); |
| 55647 |
const cancelCapability = Promise.withResolvers(); |
| 55648 |
this.streamControllers[streamId].cancelCall = cancelCapability; |
| 55649 |
this.streamControllers[streamId].isClosed = true; |
| 55650 |
comObj.postMessage({ |
| 55651 |
sourceName, |
| 55652 |
targetName, |
| 55653 |
stream: StreamKind.CANCEL, |
| 55654 |
streamId, |
| 55655 |
reason: wrapReason(reason) |
| 55656 |
}); |
| 55657 |
return cancelCapability.promise; |
| 55658 |
} |
| 55659 |
}, queueingStrategy); |
| 55660 |
} |
| 55661 |
#createStreamSink(data) { |
| 55662 |
const streamId = data.streamId, |
| 55663 |
sourceName = this.sourceName, |
| 55664 |
targetName = data.sourceName, |
| 55665 |
comObj = this.comObj; |
| 55666 |
const self = this, |
| 55667 |
action = this.actionHandler[data.action]; |
| 55668 |
const streamSink = { |
| 55669 |
enqueue(chunk, size = 1, transfers) { |
| 55670 |
if (this.isCancelled) { |
| 55671 |
return; |
| 55672 |
} |
| 55673 |
const lastDesiredSize = this.desiredSize; |
| 55674 |
this.desiredSize -= size; |
| 55675 |
if (lastDesiredSize > 0 && this.desiredSize <= 0) { |
| 55676 |
this.sinkCapability = Promise.withResolvers(); |
| 55677 |
this.ready = this.sinkCapability.promise; |
| 55678 |
} |
| 55679 |
comObj.postMessage({ |
| 55680 |
sourceName, |
| 55681 |
targetName, |
| 55682 |
stream: StreamKind.ENQUEUE, |
| 55683 |
streamId, |
| 55684 |
chunk |
| 55685 |
}, transfers); |
| 55686 |
}, |
| 55687 |
close() { |
| 55688 |
if (this.isCancelled) { |
| 55689 |
return; |
| 55690 |
} |
| 55691 |
this.isCancelled = true; |
| 55692 |
comObj.postMessage({ |
| 55693 |
sourceName, |
| 55694 |
targetName, |
| 55695 |
stream: StreamKind.CLOSE, |
| 55696 |
streamId |
| 55697 |
}); |
| 55698 |
delete self.streamSinks[streamId]; |
| 55699 |
}, |
| 55700 |
error(reason) { |
| 55701 |
assert(reason instanceof Error, "error must have a valid reason"); |
| 55702 |
if (this.isCancelled) { |
| 55703 |
return; |
| 55704 |
} |
| 55705 |
this.isCancelled = true; |
| 55706 |
comObj.postMessage({ |
| 55707 |
sourceName, |
| 55708 |
targetName, |
| 55709 |
stream: StreamKind.ERROR, |
| 55710 |
streamId, |
| 55711 |
reason: wrapReason(reason) |
| 55712 |
}); |
| 55713 |
}, |
| 55714 |
sinkCapability: Promise.withResolvers(), |
| 55715 |
onPull: null, |
| 55716 |
onCancel: null, |
| 55717 |
isCancelled: false, |
| 55718 |
desiredSize: data.desiredSize, |
| 55719 |
ready: null |
| 55720 |
}; |
| 55721 |
streamSink.sinkCapability.resolve(); |
| 55722 |
streamSink.ready = streamSink.sinkCapability.promise; |
| 55723 |
this.streamSinks[streamId] = streamSink; |
| 55724 |
new Promise(function (resolve) { |
| 55725 |
resolve(action(data.data, streamSink)); |
| 55726 |
}).then(function () { |
| 55727 |
comObj.postMessage({ |
| 55728 |
sourceName, |
| 55729 |
targetName, |
| 55730 |
stream: StreamKind.START_COMPLETE, |
| 55731 |
streamId, |
| 55732 |
success: true |
| 55733 |
}); |
| 55734 |
}, function (reason) { |
| 55735 |
comObj.postMessage({ |
| 55736 |
sourceName, |
| 55737 |
targetName, |
| 55738 |
stream: StreamKind.START_COMPLETE, |
| 55739 |
streamId, |
| 55740 |
reason: wrapReason(reason) |
| 55741 |
}); |
| 55742 |
}); |
| 55743 |
} |
| 55744 |
#processStreamMessage(data) { |
| 55745 |
const streamId = data.streamId, |
| 55746 |
sourceName = this.sourceName, |
| 55747 |
targetName = data.sourceName, |
| 55748 |
comObj = this.comObj; |
| 55749 |
const streamController = this.streamControllers[streamId], |
| 55750 |
streamSink = this.streamSinks[streamId]; |
| 55751 |
switch (data.stream) { |
| 55752 |
case StreamKind.START_COMPLETE: |
| 55753 |
if (data.success) { |
| 55754 |
streamController.startCall.resolve(); |
| 55755 |
} else { |
| 55756 |
streamController.startCall.reject(wrapReason(data.reason)); |
| 55757 |
} |
| 55758 |
break; |
| 55759 |
case StreamKind.PULL_COMPLETE: |
| 55760 |
if (data.success) { |
| 55761 |
streamController.pullCall.resolve(); |
| 55762 |
} else { |
| 55763 |
streamController.pullCall.reject(wrapReason(data.reason)); |
| 55764 |
} |
| 55765 |
break; |
| 55766 |
case StreamKind.PULL: |
| 55767 |
if (!streamSink) { |
| 55768 |
comObj.postMessage({ |
| 55769 |
sourceName, |
| 55770 |
targetName, |
| 55771 |
stream: StreamKind.PULL_COMPLETE, |
| 55772 |
streamId, |
| 55773 |
success: true |
| 55774 |
}); |
| 55775 |
break; |
| 55776 |
} |
| 55777 |
if (streamSink.desiredSize <= 0 && data.desiredSize > 0) { |
| 55778 |
streamSink.sinkCapability.resolve(); |
| 55779 |
} |
| 55780 |
streamSink.desiredSize = data.desiredSize; |
| 55781 |
new Promise(function (resolve) { |
| 55782 |
resolve(streamSink.onPull?.()); |
| 55783 |
}).then(function () { |
| 55784 |
comObj.postMessage({ |
| 55785 |
sourceName, |
| 55786 |
targetName, |
| 55787 |
stream: StreamKind.PULL_COMPLETE, |
| 55788 |
streamId, |
| 55789 |
success: true |
| 55790 |
}); |
| 55791 |
}, function (reason) { |
| 55792 |
comObj.postMessage({ |
| 55793 |
sourceName, |
| 55794 |
targetName, |
| 55795 |
stream: StreamKind.PULL_COMPLETE, |
| 55796 |
streamId, |
| 55797 |
reason: wrapReason(reason) |
| 55798 |
}); |
| 55799 |
}); |
| 55800 |
break; |
| 55801 |
case StreamKind.ENQUEUE: |
| 55802 |
assert(streamController, "enqueue should have stream controller"); |
| 55803 |
if (streamController.isClosed) { |
| 55804 |
break; |
| 55805 |
} |
| 55806 |
streamController.controller.enqueue(data.chunk); |
| 55807 |
break; |
| 55808 |
case StreamKind.CLOSE: |
| 55809 |
assert(streamController, "close should have stream controller"); |
| 55810 |
if (streamController.isClosed) { |
| 55811 |
break; |
| 55812 |
} |
| 55813 |
streamController.isClosed = true; |
| 55814 |
streamController.controller.close(); |
| 55815 |
this.#deleteStreamController(streamController, streamId); |
| 55816 |
break; |
| 55817 |
case StreamKind.ERROR: |
| 55818 |
assert(streamController, "error should have stream controller"); |
| 55819 |
streamController.controller.error(wrapReason(data.reason)); |
| 55820 |
this.#deleteStreamController(streamController, streamId); |
| 55821 |
break; |
| 55822 |
case StreamKind.CANCEL_COMPLETE: |
| 55823 |
if (data.success) { |
| 55824 |
streamController.cancelCall.resolve(); |
| 55825 |
} else { |
| 55826 |
streamController.cancelCall.reject(wrapReason(data.reason)); |
| 55827 |
} |
| 55828 |
this.#deleteStreamController(streamController, streamId); |
| 55829 |
break; |
| 55830 |
case StreamKind.CANCEL: |
| 55831 |
if (!streamSink) { |
| 55832 |
break; |
| 55833 |
} |
| 55834 |
new Promise(function (resolve) { |
| 55835 |
resolve(streamSink.onCancel?.(wrapReason(data.reason))); |
| 55836 |
}).then(function () { |
| 55837 |
comObj.postMessage({ |
| 55838 |
sourceName, |
| 55839 |
targetName, |
| 55840 |
stream: StreamKind.CANCEL_COMPLETE, |
| 55841 |
streamId, |
| 55842 |
success: true |
| 55843 |
}); |
| 55844 |
}, function (reason) { |
| 55845 |
comObj.postMessage({ |
| 55846 |
sourceName, |
| 55847 |
targetName, |
| 55848 |
stream: StreamKind.CANCEL_COMPLETE, |
| 55849 |
streamId, |
| 55850 |
reason: wrapReason(reason) |
| 55851 |
}); |
| 55852 |
}); |
| 55853 |
streamSink.sinkCapability.reject(wrapReason(data.reason)); |
| 55854 |
streamSink.isCancelled = true; |
| 55855 |
delete this.streamSinks[streamId]; |
| 55856 |
break; |
| 55857 |
default: |
| 55858 |
throw new Error("Unexpected stream case"); |
| 55859 |
} |
| 55860 |
} |
| 55861 |
async #deleteStreamController(streamController, streamId) { |
| 55862 |
await Promise.allSettled([streamController.startCall?.promise, streamController.pullCall?.promise, streamController.cancelCall?.promise]); |
| 55863 |
delete this.streamControllers[streamId]; |
| 55864 |
} |
| 55865 |
destroy() { |
| 55866 |
this.comObj.removeEventListener("message", this._onComObjOnMessage); |
| 55867 |
} |
| 55868 |
} |
| 55869 |
|
| 55870 |
;// ./src/core/worker_stream.js |
| 55871 |
|
| 55872 |
class PDFWorkerStream { |
| 55873 |
constructor(msgHandler) { |
| 55874 |
this._msgHandler = msgHandler; |
| 55875 |
this._contentLength = null; |
| 55876 |
this._fullRequestReader = null; |
| 55877 |
this._rangeRequestReaders = []; |
| 55878 |
} |
| 55879 |
getFullReader() { |
| 55880 |
assert(!this._fullRequestReader, "PDFWorkerStream.getFullReader can only be called once."); |
| 55881 |
this._fullRequestReader = new PDFWorkerStreamReader(this._msgHandler); |
| 55882 |
return this._fullRequestReader; |
| 55883 |
} |
| 55884 |
getRangeReader(begin, end) { |
| 55885 |
const reader = new PDFWorkerStreamRangeReader(begin, end, this._msgHandler); |
| 55886 |
this._rangeRequestReaders.push(reader); |
| 55887 |
return reader; |
| 55888 |
} |
| 55889 |
cancelAllRequests(reason) { |
| 55890 |
this._fullRequestReader?.cancel(reason); |
| 55891 |
for (const reader of this._rangeRequestReaders.slice(0)) { |
| 55892 |
reader.cancel(reason); |
| 55893 |
} |
| 55894 |
} |
| 55895 |
} |
| 55896 |
class PDFWorkerStreamReader { |
| 55897 |
constructor(msgHandler) { |
| 55898 |
this._msgHandler = msgHandler; |
| 55899 |
this.onProgress = null; |
| 55900 |
this._contentLength = null; |
| 55901 |
this._isRangeSupported = false; |
| 55902 |
this._isStreamingSupported = false; |
| 55903 |
const readableStream = this._msgHandler.sendWithStream("GetReader"); |
| 55904 |
this._reader = readableStream.getReader(); |
| 55905 |
this._headersReady = this._msgHandler.sendWithPromise("ReaderHeadersReady").then(data => { |
| 55906 |
this._isStreamingSupported = data.isStreamingSupported; |
| 55907 |
this._isRangeSupported = data.isRangeSupported; |
| 55908 |
this._contentLength = data.contentLength; |
| 55909 |
}); |
| 55910 |
} |
| 55911 |
get headersReady() { |
| 55912 |
return this._headersReady; |
| 55913 |
} |
| 55914 |
get contentLength() { |
| 55915 |
return this._contentLength; |
| 55916 |
} |
| 55917 |
get isStreamingSupported() { |
| 55918 |
return this._isStreamingSupported; |
| 55919 |
} |
| 55920 |
get isRangeSupported() { |
| 55921 |
return this._isRangeSupported; |
| 55922 |
} |
| 55923 |
async read() { |
| 55924 |
const { |
| 55925 |
value, |
| 55926 |
done |
| 55927 |
} = await this._reader.read(); |
| 55928 |
if (done) { |
| 55929 |
return { |
| 55930 |
value: undefined, |
| 55931 |
done: true |
| 55932 |
}; |
| 55933 |
} |
| 55934 |
return { |
| 55935 |
value: value.buffer, |
| 55936 |
done: false |
| 55937 |
}; |
| 55938 |
} |
| 55939 |
cancel(reason) { |
| 55940 |
this._reader.cancel(reason); |
| 55941 |
} |
| 55942 |
} |
| 55943 |
class PDFWorkerStreamRangeReader { |
| 55944 |
constructor(begin, end, msgHandler) { |
| 55945 |
this._msgHandler = msgHandler; |
| 55946 |
this.onProgress = null; |
| 55947 |
const readableStream = this._msgHandler.sendWithStream("GetRangeReader", { |
| 55948 |
begin, |
| 55949 |
end |
| 55950 |
}); |
| 55951 |
this._reader = readableStream.getReader(); |
| 55952 |
} |
| 55953 |
get isStreamingSupported() { |
| 55954 |
return false; |
| 55955 |
} |
| 55956 |
async read() { |
| 55957 |
const { |
| 55958 |
value, |
| 55959 |
done |
| 55960 |
} = await this._reader.read(); |
| 55961 |
if (done) { |
| 55962 |
return { |
| 55963 |
value: undefined, |
| 55964 |
done: true |
| 55965 |
}; |
| 55966 |
} |
| 55967 |
return { |
| 55968 |
value: value.buffer, |
| 55969 |
done: false |
| 55970 |
}; |
| 55971 |
} |
| 55972 |
cancel(reason) { |
| 55973 |
this._reader.cancel(reason); |
| 55974 |
} |
| 55975 |
} |
| 55976 |
|
| 55977 |
;// ./src/core/worker.js |
| 55978 |
|
| 55979 |
|
| 55980 |
|
| 55981 |
|
| 55982 |
|
| 55983 |
|
| 55984 |
|
| 55985 |
|
| 55986 |
|
| 55987 |
|
| 55988 |
class WorkerTask { |
| 55989 |
constructor(name) { |
| 55990 |
this.name = name; |
| 55991 |
this.terminated = false; |
| 55992 |
this._capability = Promise.withResolvers(); |
| 55993 |
} |
| 55994 |
get finished() { |
| 55995 |
return this._capability.promise; |
| 55996 |
} |
| 55997 |
finish() { |
| 55998 |
this._capability.resolve(); |
| 55999 |
} |
| 56000 |
terminate() { |
| 56001 |
this.terminated = true; |
| 56002 |
} |
| 56003 |
ensureNotTerminated() { |
| 56004 |
if (this.terminated) { |
| 56005 |
throw new Error("Worker task was terminated"); |
| 56006 |
} |
| 56007 |
} |
| 56008 |
} |
| 56009 |
class WorkerMessageHandler { |
| 56010 |
static setup(handler, port) { |
| 56011 |
let testMessageProcessed = false; |
| 56012 |
handler.on("test", function (data) { |
| 56013 |
if (testMessageProcessed) { |
| 56014 |
return; |
| 56015 |
} |
| 56016 |
testMessageProcessed = true; |
| 56017 |
handler.send("test", data instanceof Uint8Array); |
| 56018 |
}); |
| 56019 |
handler.on("configure", function (data) { |
| 56020 |
setVerbosityLevel(data.verbosity); |
| 56021 |
}); |
| 56022 |
handler.on("GetDocRequest", function (data) { |
| 56023 |
return WorkerMessageHandler.createDocumentHandler(data, port); |
| 56024 |
}); |
| 56025 |
} |
| 56026 |
static createDocumentHandler(docParams, port) { |
| 56027 |
let pdfManager; |
| 56028 |
let terminated = false; |
| 56029 |
let cancelXHRs = null; |
| 56030 |
const WorkerTasks = new Set(); |
| 56031 |
const verbosity = getVerbosityLevel(); |
| 56032 |
const { |
| 56033 |
docId, |
| 56034 |
apiVersion |
| 56035 |
} = docParams; |
| 56036 |
const workerVersion = "4.7.76"; |
| 56037 |
if (apiVersion !== workerVersion) { |
| 56038 |
throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`); |
| 56039 |
} |
| 56040 |
const enumerableProperties = []; |
| 56041 |
for (const property in []) { |
| 56042 |
enumerableProperties.push(property); |
| 56043 |
} |
| 56044 |
if (enumerableProperties.length) { |
| 56045 |
throw new Error("The `Array.prototype` contains unexpected enumerable properties: " + enumerableProperties.join(", ") + "; thus breaking e.g. `for...in` iteration of `Array`s."); |
| 56046 |
} |
| 56047 |
const workerHandlerName = docId + "_worker"; |
| 56048 |
let handler = new MessageHandler(workerHandlerName, docId, port); |
| 56049 |
function ensureNotTerminated() { |
| 56050 |
if (terminated) { |
| 56051 |
throw new Error("Worker was terminated"); |
| 56052 |
} |
| 56053 |
} |
| 56054 |
function startWorkerTask(task) { |
| 56055 |
WorkerTasks.add(task); |
| 56056 |
} |
| 56057 |
function finishWorkerTask(task) { |
| 56058 |
task.finish(); |
| 56059 |
WorkerTasks.delete(task); |
| 56060 |
} |
| 56061 |
async function loadDocument(recoveryMode) { |
| 56062 |
await pdfManager.ensureDoc("checkHeader"); |
| 56063 |
await pdfManager.ensureDoc("parseStartXRef"); |
| 56064 |
await pdfManager.ensureDoc("parse", [recoveryMode]); |
| 56065 |
await pdfManager.ensureDoc("checkFirstPage", [recoveryMode]); |
| 56066 |
await pdfManager.ensureDoc("checkLastPage", [recoveryMode]); |
| 56067 |
const isPureXfa = await pdfManager.ensureDoc("isPureXfa"); |
| 56068 |
if (isPureXfa) { |
| 56069 |
const task = new WorkerTask("loadXfaFonts"); |
| 56070 |
startWorkerTask(task); |
| 56071 |
await Promise.all([pdfManager.loadXfaFonts(handler, task).catch(reason => {}).then(() => finishWorkerTask(task)), pdfManager.loadXfaImages()]); |
| 56072 |
} |
| 56073 |
const [numPages, fingerprints] = await Promise.all([pdfManager.ensureDoc("numPages"), pdfManager.ensureDoc("fingerprints")]); |
| 56074 |
const htmlForXfa = isPureXfa ? await pdfManager.ensureDoc("htmlForXfa") : null; |
| 56075 |
return { |
| 56076 |
numPages, |
| 56077 |
fingerprints, |
| 56078 |
htmlForXfa |
| 56079 |
}; |
| 56080 |
} |
| 56081 |
function getPdfManager({ |
| 56082 |
data, |
| 56083 |
password, |
| 56084 |
disableAutoFetch, |
| 56085 |
rangeChunkSize, |
| 56086 |
length, |
| 56087 |
docBaseUrl, |
| 56088 |
enableXfa, |
| 56089 |
evaluatorOptions |
| 56090 |
}) { |
| 56091 |
const pdfManagerArgs = { |
| 56092 |
source: null, |
| 56093 |
disableAutoFetch, |
| 56094 |
docBaseUrl, |
| 56095 |
docId, |
| 56096 |
enableXfa, |
| 56097 |
evaluatorOptions, |
| 56098 |
handler, |
| 56099 |
length, |
| 56100 |
password, |
| 56101 |
rangeChunkSize |
| 56102 |
}; |
| 56103 |
const pdfManagerCapability = Promise.withResolvers(); |
| 56104 |
let newPdfManager; |
| 56105 |
if (data) { |
| 56106 |
try { |
| 56107 |
pdfManagerArgs.source = data; |
| 56108 |
newPdfManager = new LocalPdfManager(pdfManagerArgs); |
| 56109 |
pdfManagerCapability.resolve(newPdfManager); |
| 56110 |
} catch (ex) { |
| 56111 |
pdfManagerCapability.reject(ex); |
| 56112 |
} |
| 56113 |
return pdfManagerCapability.promise; |
| 56114 |
} |
| 56115 |
let pdfStream, |
| 56116 |
cachedChunks = []; |
| 56117 |
try { |
| 56118 |
pdfStream = new PDFWorkerStream(handler); |
| 56119 |
} catch (ex) { |
| 56120 |
pdfManagerCapability.reject(ex); |
| 56121 |
return pdfManagerCapability.promise; |
| 56122 |
} |
| 56123 |
const fullRequest = pdfStream.getFullReader(); |
| 56124 |
fullRequest.headersReady.then(function () { |
| 56125 |
if (!fullRequest.isRangeSupported) { |
| 56126 |
return; |
| 56127 |
} |
| 56128 |
pdfManagerArgs.source = pdfStream; |
| 56129 |
pdfManagerArgs.length = fullRequest.contentLength; |
| 56130 |
pdfManagerArgs.disableAutoFetch ||= fullRequest.isStreamingSupported; |
| 56131 |
newPdfManager = new NetworkPdfManager(pdfManagerArgs); |
| 56132 |
for (const chunk of cachedChunks) { |
| 56133 |
newPdfManager.sendProgressiveData(chunk); |
| 56134 |
} |
| 56135 |
cachedChunks = []; |
| 56136 |
pdfManagerCapability.resolve(newPdfManager); |
| 56137 |
cancelXHRs = null; |
| 56138 |
}).catch(function (reason) { |
| 56139 |
pdfManagerCapability.reject(reason); |
| 56140 |
cancelXHRs = null; |
| 56141 |
}); |
| 56142 |
let loaded = 0; |
| 56143 |
const flushChunks = function () { |
| 56144 |
const pdfFile = arrayBuffersToBytes(cachedChunks); |
| 56145 |
if (length && pdfFile.length !== length) { |
| 56146 |
warn("reported HTTP length is different from actual"); |
| 56147 |
} |
| 56148 |
try { |
| 56149 |
pdfManagerArgs.source = pdfFile; |
| 56150 |
newPdfManager = new LocalPdfManager(pdfManagerArgs); |
| 56151 |
pdfManagerCapability.resolve(newPdfManager); |
| 56152 |
} catch (ex) { |
| 56153 |
pdfManagerCapability.reject(ex); |
| 56154 |
} |
| 56155 |
cachedChunks = []; |
| 56156 |
}; |
| 56157 |
new Promise(function (resolve, reject) { |
| 56158 |
const readChunk = function ({ |
| 56159 |
value, |
| 56160 |
done |
| 56161 |
}) { |
| 56162 |
try { |
| 56163 |
ensureNotTerminated(); |
| 56164 |
if (done) { |
| 56165 |
if (!newPdfManager) { |
| 56166 |
flushChunks(); |
| 56167 |
} |
| 56168 |
cancelXHRs = null; |
| 56169 |
return; |
| 56170 |
} |
| 56171 |
loaded += value.byteLength; |
| 56172 |
if (!fullRequest.isStreamingSupported) { |
| 56173 |
handler.send("DocProgress", { |
| 56174 |
loaded, |
| 56175 |
total: Math.max(loaded, fullRequest.contentLength || 0) |
| 56176 |
}); |
| 56177 |
} |
| 56178 |
if (newPdfManager) { |
| 56179 |
newPdfManager.sendProgressiveData(value); |
| 56180 |
} else { |
| 56181 |
cachedChunks.push(value); |
| 56182 |
} |
| 56183 |
fullRequest.read().then(readChunk, reject); |
| 56184 |
} catch (e) { |
| 56185 |
reject(e); |
| 56186 |
} |
| 56187 |
}; |
| 56188 |
fullRequest.read().then(readChunk, reject); |
| 56189 |
}).catch(function (e) { |
| 56190 |
pdfManagerCapability.reject(e); |
| 56191 |
cancelXHRs = null; |
| 56192 |
}); |
| 56193 |
cancelXHRs = function (reason) { |
| 56194 |
pdfStream.cancelAllRequests(reason); |
| 56195 |
}; |
| 56196 |
return pdfManagerCapability.promise; |
| 56197 |
} |
| 56198 |
function setupDoc(data) { |
| 56199 |
function onSuccess(doc) { |
| 56200 |
ensureNotTerminated(); |
| 56201 |
handler.send("GetDoc", { |
| 56202 |
pdfInfo: doc |
| 56203 |
}); |
| 56204 |
} |
| 56205 |
function onFailure(ex) { |
| 56206 |
ensureNotTerminated(); |
| 56207 |
if (ex instanceof PasswordException) { |
| 56208 |
const task = new WorkerTask(`PasswordException: response ${ex.code}`); |
| 56209 |
startWorkerTask(task); |
| 56210 |
handler.sendWithPromise("PasswordRequest", ex).then(function ({ |
| 56211 |
password |
| 56212 |
}) { |
| 56213 |
finishWorkerTask(task); |
| 56214 |
pdfManager.updatePassword(password); |
| 56215 |
pdfManagerReady(); |
| 56216 |
}).catch(function () { |
| 56217 |
finishWorkerTask(task); |
| 56218 |
handler.send("DocException", ex); |
| 56219 |
}); |
| 56220 |
} else if (ex instanceof InvalidPDFException || ex instanceof MissingPDFException || ex instanceof UnexpectedResponseException || ex instanceof UnknownErrorException) { |
| 56221 |
handler.send("DocException", ex); |
| 56222 |
} else { |
| 56223 |
handler.send("DocException", new UnknownErrorException(ex.message, ex.toString())); |
| 56224 |
} |
| 56225 |
} |
| 56226 |
function pdfManagerReady() { |
| 56227 |
ensureNotTerminated(); |
| 56228 |
loadDocument(false).then(onSuccess, function (reason) { |
| 56229 |
ensureNotTerminated(); |
| 56230 |
if (!(reason instanceof XRefParseException)) { |
| 56231 |
onFailure(reason); |
| 56232 |
return; |
| 56233 |
} |
| 56234 |
pdfManager.requestLoadedStream().then(function () { |
| 56235 |
ensureNotTerminated(); |
| 56236 |
loadDocument(true).then(onSuccess, onFailure); |
| 56237 |
}); |
| 56238 |
}); |
| 56239 |
} |
| 56240 |
ensureNotTerminated(); |
| 56241 |
getPdfManager(data).then(function (newPdfManager) { |
| 56242 |
if (terminated) { |
| 56243 |
newPdfManager.terminate(new AbortException("Worker was terminated.")); |
| 56244 |
throw new Error("Worker was terminated"); |
| 56245 |
} |
| 56246 |
pdfManager = newPdfManager; |
| 56247 |
pdfManager.requestLoadedStream(true).then(stream => { |
| 56248 |
handler.send("DataLoaded", { |
| 56249 |
length: stream.bytes.byteLength |
| 56250 |
}); |
| 56251 |
}); |
| 56252 |
}).then(pdfManagerReady, onFailure); |
| 56253 |
} |
| 56254 |
handler.on("GetPage", function (data) { |
| 56255 |
return pdfManager.getPage(data.pageIndex).then(function (page) { |
| 56256 |
return Promise.all([pdfManager.ensure(page, "rotate"), pdfManager.ensure(page, "ref"), pdfManager.ensure(page, "userUnit"), pdfManager.ensure(page, "view")]).then(function ([rotate, ref, userUnit, view]) { |
| 56257 |
return { |
| 56258 |
rotate, |
| 56259 |
ref, |
| 56260 |
refStr: ref?.toString() ?? null, |
| 56261 |
userUnit, |
| 56262 |
view |
| 56263 |
}; |
| 56264 |
}); |
| 56265 |
}); |
| 56266 |
}); |
| 56267 |
handler.on("GetPageIndex", function (data) { |
| 56268 |
const pageRef = Ref.get(data.num, data.gen); |
| 56269 |
return pdfManager.ensureCatalog("getPageIndex", [pageRef]); |
| 56270 |
}); |
| 56271 |
handler.on("GetDestinations", function (data) { |
| 56272 |
return pdfManager.ensureCatalog("destinations"); |
| 56273 |
}); |
| 56274 |
handler.on("GetDestination", function (data) { |
| 56275 |
return pdfManager.ensureCatalog("getDestination", [data.id]); |
| 56276 |
}); |
| 56277 |
handler.on("GetPageLabels", function (data) { |
| 56278 |
return pdfManager.ensureCatalog("pageLabels"); |
| 56279 |
}); |
| 56280 |
handler.on("GetPageLayout", function (data) { |
| 56281 |
return pdfManager.ensureCatalog("pageLayout"); |
| 56282 |
}); |
| 56283 |
handler.on("GetPageMode", function (data) { |
| 56284 |
return pdfManager.ensureCatalog("pageMode"); |
| 56285 |
}); |
| 56286 |
handler.on("GetViewerPreferences", function (data) { |
| 56287 |
return pdfManager.ensureCatalog("viewerPreferences"); |
| 56288 |
}); |
| 56289 |
handler.on("GetOpenAction", function (data) { |
| 56290 |
return pdfManager.ensureCatalog("openAction"); |
| 56291 |
}); |
| 56292 |
handler.on("GetAttachments", function (data) { |
| 56293 |
return pdfManager.ensureCatalog("attachments"); |
| 56294 |
}); |
| 56295 |
handler.on("GetDocJSActions", function (data) { |
| 56296 |
return pdfManager.ensureCatalog("jsActions"); |
| 56297 |
}); |
| 56298 |
handler.on("GetPageJSActions", function ({ |
| 56299 |
pageIndex |
| 56300 |
}) { |
| 56301 |
return pdfManager.getPage(pageIndex).then(function (page) { |
| 56302 |
return pdfManager.ensure(page, "jsActions"); |
| 56303 |
}); |
| 56304 |
}); |
| 56305 |
handler.on("GetOutline", function (data) { |
| 56306 |
return pdfManager.ensureCatalog("documentOutline"); |
| 56307 |
}); |
| 56308 |
handler.on("GetOptionalContentConfig", function (data) { |
| 56309 |
return pdfManager.ensureCatalog("optionalContentConfig"); |
| 56310 |
}); |
| 56311 |
handler.on("GetPermissions", function (data) { |
| 56312 |
return pdfManager.ensureCatalog("permissions"); |
| 56313 |
}); |
| 56314 |
handler.on("GetMetadata", function (data) { |
| 56315 |
return Promise.all([pdfManager.ensureDoc("documentInfo"), pdfManager.ensureCatalog("metadata")]); |
| 56316 |
}); |
| 56317 |
handler.on("GetMarkInfo", function (data) { |
| 56318 |
return pdfManager.ensureCatalog("markInfo"); |
| 56319 |
}); |
| 56320 |
handler.on("GetData", function (data) { |
| 56321 |
return pdfManager.requestLoadedStream().then(function (stream) { |
| 56322 |
return stream.bytes; |
| 56323 |
}); |
| 56324 |
}); |
| 56325 |
handler.on("GetAnnotations", function ({ |
| 56326 |
pageIndex, |
| 56327 |
intent |
| 56328 |
}) { |
| 56329 |
return pdfManager.getPage(pageIndex).then(function (page) { |
| 56330 |
const task = new WorkerTask(`GetAnnotations: page ${pageIndex}`); |
| 56331 |
startWorkerTask(task); |
| 56332 |
return page.getAnnotationsData(handler, task, intent).then(data => { |
| 56333 |
finishWorkerTask(task); |
| 56334 |
return data; |
| 56335 |
}, reason => { |
| 56336 |
finishWorkerTask(task); |
| 56337 |
throw reason; |
| 56338 |
}); |
| 56339 |
}); |
| 56340 |
}); |
| 56341 |
handler.on("GetFieldObjects", function (data) { |
| 56342 |
return pdfManager.ensureDoc("fieldObjects").then(fieldObjects => fieldObjects?.allFields || null); |
| 56343 |
}); |
| 56344 |
handler.on("HasJSActions", function (data) { |
| 56345 |
return pdfManager.ensureDoc("hasJSActions"); |
| 56346 |
}); |
| 56347 |
handler.on("GetCalculationOrderIds", function (data) { |
| 56348 |
return pdfManager.ensureDoc("calculationOrderIds"); |
| 56349 |
}); |
| 56350 |
handler.on("SaveDocument", async function ({ |
| 56351 |
isPureXfa, |
| 56352 |
numPages, |
| 56353 |
annotationStorage, |
| 56354 |
filename |
| 56355 |
}) { |
| 56356 |
const globalPromises = [pdfManager.requestLoadedStream(), pdfManager.ensureCatalog("acroForm"), pdfManager.ensureCatalog("acroFormRef"), pdfManager.ensureDoc("startXRef"), pdfManager.ensureDoc("xref"), pdfManager.ensureDoc("linearization"), pdfManager.ensureCatalog("structTreeRoot")]; |
| 56357 |
const promises = []; |
| 56358 |
const newAnnotationsByPage = !isPureXfa ? getNewAnnotationsMap(annotationStorage) : null; |
| 56359 |
const [stream, acroForm, acroFormRef, startXRef, xref, linearization, _structTreeRoot] = await Promise.all(globalPromises); |
| 56360 |
const catalogRef = xref.trailer.getRaw("Root") || null; |
| 56361 |
let structTreeRoot; |
| 56362 |
if (newAnnotationsByPage) { |
| 56363 |
if (!_structTreeRoot) { |
| 56364 |
if (await StructTreeRoot.canCreateStructureTree({ |
| 56365 |
catalogRef, |
| 56366 |
pdfManager, |
| 56367 |
newAnnotationsByPage |
| 56368 |
})) { |
| 56369 |
structTreeRoot = null; |
| 56370 |
} |
| 56371 |
} else if (await _structTreeRoot.canUpdateStructTree({ |
| 56372 |
pdfManager, |
| 56373 |
xref, |
| 56374 |
newAnnotationsByPage |
| 56375 |
})) { |
| 56376 |
structTreeRoot = _structTreeRoot; |
| 56377 |
} |
| 56378 |
const imagePromises = AnnotationFactory.generateImages(annotationStorage.values(), xref, pdfManager.evaluatorOptions.isOffscreenCanvasSupported); |
| 56379 |
const newAnnotationPromises = structTreeRoot === undefined ? promises : []; |
| 56380 |
for (const [pageIndex, annotations] of newAnnotationsByPage) { |
| 56381 |
newAnnotationPromises.push(pdfManager.getPage(pageIndex).then(page => { |
| 56382 |
const task = new WorkerTask(`Save (editor): page ${pageIndex}`); |
| 56383 |
return page.saveNewAnnotations(handler, task, annotations, imagePromises).finally(function () { |
| 56384 |
finishWorkerTask(task); |
| 56385 |
}); |
| 56386 |
})); |
| 56387 |
} |
| 56388 |
if (structTreeRoot === null) { |
| 56389 |
promises.push(Promise.all(newAnnotationPromises).then(async newRefs => { |
| 56390 |
await StructTreeRoot.createStructureTree({ |
| 56391 |
newAnnotationsByPage, |
| 56392 |
xref, |
| 56393 |
catalogRef, |
| 56394 |
pdfManager, |
| 56395 |
newRefs |
| 56396 |
}); |
| 56397 |
return newRefs; |
| 56398 |
})); |
| 56399 |
} else if (structTreeRoot) { |
| 56400 |
promises.push(Promise.all(newAnnotationPromises).then(async newRefs => { |
| 56401 |
await structTreeRoot.updateStructureTree({ |
| 56402 |
newAnnotationsByPage, |
| 56403 |
pdfManager, |
| 56404 |
newRefs |
| 56405 |
}); |
| 56406 |
return newRefs; |
| 56407 |
})); |
| 56408 |
} |
| 56409 |
} |
| 56410 |
if (isPureXfa) { |
| 56411 |
promises.push(pdfManager.serializeXfaData(annotationStorage)); |
| 56412 |
} else { |
| 56413 |
for (let pageIndex = 0; pageIndex < numPages; pageIndex++) { |
| 56414 |
promises.push(pdfManager.getPage(pageIndex).then(function (page) { |
| 56415 |
const task = new WorkerTask(`Save: page ${pageIndex}`); |
| 56416 |
return page.save(handler, task, annotationStorage).finally(function () { |
| 56417 |
finishWorkerTask(task); |
| 56418 |
}); |
| 56419 |
})); |
| 56420 |
} |
| 56421 |
} |
| 56422 |
const refs = await Promise.all(promises); |
| 56423 |
let newRefs = []; |
| 56424 |
let xfaData = null; |
| 56425 |
if (isPureXfa) { |
| 56426 |
xfaData = refs[0]; |
| 56427 |
if (!xfaData) { |
| 56428 |
return stream.bytes; |
| 56429 |
} |
| 56430 |
} else { |
| 56431 |
newRefs = refs.flat(2); |
| 56432 |
if (newRefs.length === 0) { |
| 56433 |
return stream.bytes; |
| 56434 |
} |
| 56435 |
} |
| 56436 |
const needAppearances = acroFormRef && acroForm instanceof Dict && newRefs.some(ref => ref.needAppearances); |
| 56437 |
const xfa = acroForm instanceof Dict && acroForm.get("XFA") || null; |
| 56438 |
let xfaDatasetsRef = null; |
| 56439 |
let hasXfaDatasetsEntry = false; |
| 56440 |
if (Array.isArray(xfa)) { |
| 56441 |
for (let i = 0, ii = xfa.length; i < ii; i += 2) { |
| 56442 |
if (xfa[i] === "datasets") { |
| 56443 |
xfaDatasetsRef = xfa[i + 1]; |
| 56444 |
hasXfaDatasetsEntry = true; |
| 56445 |
} |
| 56446 |
} |
| 56447 |
if (xfaDatasetsRef === null) { |
| 56448 |
xfaDatasetsRef = xref.getNewTemporaryRef(); |
| 56449 |
} |
| 56450 |
} else if (xfa) { |
| 56451 |
warn("Unsupported XFA type."); |
| 56452 |
} |
| 56453 |
let newXrefInfo = Object.create(null); |
| 56454 |
if (xref.trailer) { |
| 56455 |
const infoObj = Object.create(null); |
| 56456 |
const xrefInfo = xref.trailer.get("Info") || null; |
| 56457 |
if (xrefInfo instanceof Dict) { |
| 56458 |
xrefInfo.forEach((key, value) => { |
| 56459 |
if (typeof value === "string") { |
| 56460 |
infoObj[key] = stringToPDFString(value); |
| 56461 |
} |
| 56462 |
}); |
| 56463 |
} |
| 56464 |
newXrefInfo = { |
| 56465 |
rootRef: catalogRef, |
| 56466 |
encryptRef: xref.trailer.getRaw("Encrypt") || null, |
| 56467 |
newRef: xref.getNewTemporaryRef(), |
| 56468 |
infoRef: xref.trailer.getRaw("Info") || null, |
| 56469 |
info: infoObj, |
| 56470 |
fileIds: xref.trailer.get("ID") || null, |
| 56471 |
startXRef: linearization ? startXRef : xref.lastXRefStreamPos ?? startXRef, |
| 56472 |
filename |
| 56473 |
}; |
| 56474 |
} |
| 56475 |
return incrementalUpdate({ |
| 56476 |
originalData: stream.bytes, |
| 56477 |
xrefInfo: newXrefInfo, |
| 56478 |
newRefs, |
| 56479 |
xref, |
| 56480 |
hasXfa: !!xfa, |
| 56481 |
xfaDatasetsRef, |
| 56482 |
hasXfaDatasetsEntry, |
| 56483 |
needAppearances, |
| 56484 |
acroFormRef, |
| 56485 |
acroForm, |
| 56486 |
xfaData, |
| 56487 |
useXrefStream: isDict(xref.topDict, "XRef") |
| 56488 |
}).finally(() => { |
| 56489 |
xref.resetNewTemporaryRef(); |
| 56490 |
}); |
| 56491 |
}); |
| 56492 |
handler.on("GetOperatorList", function (data, sink) { |
| 56493 |
const pageIndex = data.pageIndex; |
| 56494 |
pdfManager.getPage(pageIndex).then(function (page) { |
| 56495 |
const task = new WorkerTask(`GetOperatorList: page ${pageIndex}`); |
| 56496 |
startWorkerTask(task); |
| 56497 |
const start = verbosity >= VerbosityLevel.INFOS ? Date.now() : 0; |
| 56498 |
page.getOperatorList({ |
| 56499 |
handler, |
| 56500 |
sink, |
| 56501 |
task, |
| 56502 |
intent: data.intent, |
| 56503 |
cacheKey: data.cacheKey, |
| 56504 |
annotationStorage: data.annotationStorage, |
| 56505 |
modifiedIds: data.modifiedIds |
| 56506 |
}).then(function (operatorListInfo) { |
| 56507 |
finishWorkerTask(task); |
| 56508 |
if (start) { |
| 56509 |
info(`page=${pageIndex + 1} - getOperatorList: time=` + `${Date.now() - start}ms, len=${operatorListInfo.length}`); |
| 56510 |
} |
| 56511 |
sink.close(); |
| 56512 |
}, function (reason) { |
| 56513 |
finishWorkerTask(task); |
| 56514 |
if (task.terminated) { |
| 56515 |
return; |
| 56516 |
} |
| 56517 |
sink.error(reason); |
| 56518 |
}); |
| 56519 |
}); |
| 56520 |
}); |
| 56521 |
handler.on("GetTextContent", function (data, sink) { |
| 56522 |
const { |
| 56523 |
pageIndex, |
| 56524 |
includeMarkedContent, |
| 56525 |
disableNormalization |
| 56526 |
} = data; |
| 56527 |
pdfManager.getPage(pageIndex).then(function (page) { |
| 56528 |
const task = new WorkerTask("GetTextContent: page " + pageIndex); |
| 56529 |
startWorkerTask(task); |
| 56530 |
const start = verbosity >= VerbosityLevel.INFOS ? Date.now() : 0; |
| 56531 |
page.extractTextContent({ |
| 56532 |
handler, |
| 56533 |
task, |
| 56534 |
sink, |
| 56535 |
includeMarkedContent, |
| 56536 |
disableNormalization |
| 56537 |
}).then(function () { |
| 56538 |
finishWorkerTask(task); |
| 56539 |
if (start) { |
| 56540 |
info(`page=${pageIndex + 1} - getTextContent: time=` + `${Date.now() - start}ms`); |
| 56541 |
} |
| 56542 |
sink.close(); |
| 56543 |
}, function (reason) { |
| 56544 |
finishWorkerTask(task); |
| 56545 |
if (task.terminated) { |
| 56546 |
return; |
| 56547 |
} |
| 56548 |
sink.error(reason); |
| 56549 |
}); |
| 56550 |
}); |
| 56551 |
}); |
| 56552 |
handler.on("GetStructTree", function (data) { |
| 56553 |
return pdfManager.getPage(data.pageIndex).then(function (page) { |
| 56554 |
return pdfManager.ensure(page, "getStructTree"); |
| 56555 |
}); |
| 56556 |
}); |
| 56557 |
handler.on("FontFallback", function (data) { |
| 56558 |
return pdfManager.fontFallback(data.id, handler); |
| 56559 |
}); |
| 56560 |
handler.on("Cleanup", function (data) { |
| 56561 |
return pdfManager.cleanup(true); |
| 56562 |
}); |
| 56563 |
handler.on("Terminate", function (data) { |
| 56564 |
terminated = true; |
| 56565 |
const waitOn = []; |
| 56566 |
if (pdfManager) { |
| 56567 |
pdfManager.terminate(new AbortException("Worker was terminated.")); |
| 56568 |
const cleanupPromise = pdfManager.cleanup(); |
| 56569 |
waitOn.push(cleanupPromise); |
| 56570 |
pdfManager = null; |
| 56571 |
} else { |
| 56572 |
clearGlobalCaches(); |
| 56573 |
} |
| 56574 |
if (cancelXHRs) { |
| 56575 |
cancelXHRs(new AbortException("Worker was terminated.")); |
| 56576 |
} |
| 56577 |
for (const task of WorkerTasks) { |
| 56578 |
waitOn.push(task.finished); |
| 56579 |
task.terminate(); |
| 56580 |
} |
| 56581 |
return Promise.all(waitOn).then(function () { |
| 56582 |
handler.destroy(); |
| 56583 |
handler = null; |
| 56584 |
}); |
| 56585 |
}); |
| 56586 |
handler.on("Ready", function (data) { |
| 56587 |
setupDoc(docParams); |
| 56588 |
docParams = null; |
| 56589 |
}); |
| 56590 |
return workerHandlerName; |
| 56591 |
} |
| 56592 |
static initializeFromPort(port) { |
| 56593 |
const handler = new MessageHandler("worker", "main", port); |
| 56594 |
WorkerMessageHandler.setup(handler, port); |
| 56595 |
handler.send("ready", null); |
| 56596 |
} |
| 56597 |
} |
| 56598 |
function isMessagePort(maybePort) { |
| 56599 |
return typeof maybePort.postMessage === "function" && "onmessage" in maybePort; |
| 56600 |
} |
| 56601 |
if (typeof window === "undefined" && !isNodeJS && typeof self !== "undefined" && isMessagePort(self)) { |
| 56602 |
WorkerMessageHandler.initializeFromPort(self); |
| 56603 |
} |
| 56604 |
|
| 56605 |
;// ./src/pdf.worker.js |
| 56606 |
|
| 56607 |
const pdfjsVersion = "4.7.76"; |
| 56608 |
const pdfjsBuild = "8b73b828b"; |
| 56609 |
|
| 56610 |
var __webpack_exports__WorkerMessageHandler = __webpack_exports__.WorkerMessageHandler; |
| 56611 |
export { __webpack_exports__WorkerMessageHandler as WorkerMessageHandler }; |
| 56612 |
|
| 56613 |
//# sourceMappingURL=pdf.worker.mjs.map |