mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-23 16:35:47 +02:00
Merge pull request #21491 from Snuffleupagus/readCmapTable-sort-last
Sort the mappings *last* in the `readCmapTable` function (PR 19321 follow-up)
This commit is contained in:
commit
813d1949ba
@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user