Compare commits

...

4 Commits

Author SHA1 Message Date
Jonas Jenwald
813d1949ba
Merge pull request #21491 from Snuffleupagus/readCmapTable-sort-last
Sort the mappings *last* in the `readCmapTable` function (PR 19321 follow-up)
2026-06-23 16:01:09 +02:00
Jonas Jenwald
a1acf4fc9f
Merge pull request #21489 from Snuffleupagus/editor-tools-rm-testing-reset
Remove the `AnnotationEditorUIManager` and `IdManager` test-only `reset` methods (PR 19809 follow-up)
2026-06-23 14:03:46 +02:00
Jonas Jenwald
9ca13c9a23 Sort the mappings *last* in the readCmapTable function (PR 19321 follow-up)
This improves performance of `issue19319.pdf` even more, and locally the rendering time of the second page goes from ~300 ms to ~250 ms, since we avoid sorting a bunch of duplicate entries.
2026-06-23 13:51:37 +02:00
Jonas Jenwald
09c9f7f2fe Remove the AnnotationEditorUIManager and IdManager test-only reset methods (PR 19809 follow-up)
These test-only methods became unused in PR 19809.
2026-06-23 12:09:12 +02:00
2 changed files with 1 additions and 12 deletions

View File

@ -1860,7 +1860,6 @@ class Font {
}
// removing duplicate entries
mappings.sort((a, b) => a.charCode - b.charCode);
const finalMappings = [],
seenCharCodes = new Set();
for (const map of mappings) {
@ -1876,7 +1875,7 @@ class Font {
return {
platformId: potentialTable.platformId,
encodingId: potentialTable.encodingId,
mappings: finalMappings,
mappings: finalMappings.sort((a, b) => a.charCode - b.charCode),
hasShortCmap,
};
}

View File

@ -134,9 +134,6 @@ class IdManager {
constructor() {
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING")) {
Object.defineProperty(this, "reset", {
value: () => (this.#id = 0),
});
Object.defineProperty(this, "getNextId", {
value: () => this.#id,
});
@ -1067,13 +1064,6 @@ class AnnotationEditorUIManager {
commentManager?.setSidebarUiManager(this);
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING")) {
Object.defineProperty(this, "reset", {
value: () => {
this.selectAll();
this.delete();
this.#idManager.reset();
},
});
Object.defineProperty(this, "getNextEditorId", {
value: () => this.#idManager.getNextId(),
});