mirror of
https://github.com/foliojs/pdfkit.git
synced 2025-12-08 20:15:54 +00:00
* fix: use dynamic count for beginbfrange declaration Fixes garbled text copying in Chrome/Edge for PDFs with >256 unique characters * Add changelog line Addressed an issue with garbled text copying in Chrome/Edge for PDFs containing more than 256 unique characters. * test: add tests for beginbfrange count declaration Add test cases to verify that the beginbfrange count declaration in ToUnicode CMap matches the actual number of bfrange entries. - Test for fonts with >256 characters (multiple ranges) - Test for fonts with <=256 characters (single range) These tests ensure the fix for the beginbfrange count bug is correct and prevent regression. Related to #1659 * Revert "test: add tests for beginbfrange count declaration" This reverts commit dda6f4a762acbaa09f5986502c494c97959c7643. * Rewrite tests for beginbfrange count declaraton. Fix code style issue. * fix(tests): remove unused variables in font.spec.js Replace for loops with unused match variables with spread operator to directly get array length, fixing ESLint no-unused-vars errors. - Replace loop counting with [...rangeMatches].length - Fixes ESLint errors at lines 152 and 197 in tests/unit/font.spec.js - All tests pass successfully --------- Co-authored-by: zhang_xiaoning <zxn@winning.com.cn>