1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00
pdf.js/src/core
Jonas Jenwald 4cc6797f17 Re-factor the idFactory functionality, used in the core/-code, and move the fontID generation into it
Note how the `getFontID`-method in `src/core/fonts.js` is *completely* global, rather than properly tied to the current document. This means that if you repeatedly open and parse/render, and then close, even the *same* PDF document the `fontID`s will still be incremented continuously.

For comparison the `createObjId` method, on `idFactory`, will always create a *consistent* id, assuming of course that the document and its pages are parsed/rendered in the same order.

In order to address this inconsistency, it thus seems reasonable to add a new `createFontId` method on the `idFactory` and use that when obtaining `fontID`s. (When the current `getFontID` method was added the `idFactory` didn't actually exist yet, which explains why the code looks the way it does.)
*Please note:* Since the document id is (still) part of the `loadedName`, it's thus not possible for different documents to have identical font names.
2020-07-07 16:33:31 +02:00
..
.eslintrc Reduce usage of SystemJS, in the development viewer, even further 2020-05-20 13:36:52 +02:00
annotation.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
arithmetic_decoder.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
bidi.js Enable the no-nested-ternary ESLint rule (PR 11488 follow-up) 2020-01-14 17:49:39 +01:00
ccitt.js Enable the dot-notation ESLint rule 2020-04-17 12:24:46 +02:00
ccitt_stream.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
cff_parser.js Convert the code in src/core/cff_parser.js to use ES6 classes 2020-06-16 12:33:21 +02:00
charsets.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
chunked_stream.js Tweak the loop in ChunkedStreamManager.abort to clarify what's being iterated (PR 11985 follow-up) 2020-06-21 11:29:05 +02:00
cmap.js Avoid hanging the worker-thread for CMap data with ridiculously large ranges (issue 11922) 2020-05-22 15:23:17 +02:00
colorspace.js Add local caching of Functions, by reference, in the PDFFunctionFactory (issue 2541) 2020-07-04 00:55:18 +02:00
core_utils.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
crypto.js Whitelist closure related cases to address the remaining no-shadow linting errors 2020-03-25 11:57:12 +01:00
document.js Re-factor the idFactory functionality, used in the core/-code, and move the fontID generation into it 2020-07-07 16:33:31 +02:00
encodings.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
evaluator.js Re-factor the idFactory functionality, used in the core/-code, and move the fontID generation into it 2020-07-07 16:33:31 +02:00
font_renderer.js Remove variable shadowing from the JavaScript files in the src/core/ folder 2020-03-23 18:28:30 +01:00
fonts.js Re-factor the idFactory functionality, used in the core/-code, and move the fontID generation into it 2020-07-07 16:33:31 +02:00
function.js Add local caching of Functions, by reference, in the PDFFunctionFactory (issue 2541) 2020-07-04 00:55:18 +02:00
glyphlist.js Enable the dot-notation ESLint rule 2020-04-17 12:24:46 +02:00
image.js Convert the code in src/core/image.js to use ES6 classes 2020-07-05 09:34:14 +02:00
image_utils.js Allow BaseLocalCache to, optionally, only allocate storage for caching of references (PR 12034 follow-up) 2020-07-04 15:01:32 +02:00
jbig2.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
jbig2_stream.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
jpeg_stream.js [api-minor] Decode all JPEG images with the built-in PDF.js decoder in src/core/jpg.js 2020-05-22 00:22:48 +02:00
jpg.js Jpeg encoded with RGB -instead of YCbCr- write the components index as "RGB" in ASCII to say it so 2020-06-04 15:08:47 +02:00
jpx.js Enable the dot-notation ESLint rule 2020-04-17 12:24:46 +02:00
jpx_stream.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
metrics.js Enable the dot-notation ESLint rule 2020-04-17 12:24:46 +02:00
murmurhash3.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
obj.js Allow GlobalImageCache.clear to, optionally, only remove the actual data (PR 11912 follow-up) 2020-05-23 11:30:24 +02:00
operator_list.js Tweak the QueueOptimizer to recognize OPS.paintImageMaskXObject operators as *repeated* when the "skew" transformation matrix elements are non-zero (issue 8078) 2020-06-20 12:18:48 +02:00
parser.js Attempt to detect inline images which contain "EI" sequence in the actual image data (issue 11124) 2020-06-26 13:15:06 +02:00
pattern.js Add local caching of Functions, by reference, in the PDFFunctionFactory (issue 2541) 2020-07-04 00:55:18 +02:00
pdf_manager.js Allow GlobalImageCache.clear to, optionally, only remove the actual data (PR 11912 follow-up) 2020-05-23 11:30:24 +02:00
primitives.js Convert the RefSet primitive to a proper class and use a Set internally 2020-06-07 19:01:29 +02:00
ps_parser.js Whitelist closure related cases to address the remaining no-shadow linting errors 2020-03-25 11:57:12 +01:00
standard_fonts.js Enable the dot-notation ESLint rule 2020-04-17 12:24:46 +02:00
stream.js Whitelist closure related cases to address the remaining no-shadow linting errors 2020-03-25 11:57:12 +01:00
type1_parser.js Enable the dot-notation ESLint rule 2020-04-17 12:24:46 +02:00
unicode.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
worker.js Convert the code in src/core/worker.js to use ES6 classes 2020-06-16 11:54:59 +02:00
worker_stream.js Use the ESLint no-restricted-syntax rule to ensure that assert is always called with two arguments 2020-05-05 13:40:05 +02:00