Skip to content

Commit

Permalink
Modify the format0 length limit to address the issue where the format…
Browse files Browse the repository at this point in the history
…0 length occasionally reaches 256.
  • Loading branch information
lwang1997 committed Aug 8, 2024
1 parent 899ea11 commit 9aeec71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/font/cmap_build_subtables.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = function cmap_split(all_codepoints) {
let prev_dist = (j - 1 >= 0) ? min_paths[j - 1].dist : 0;
let s;

if (all_codepoints[i] - all_codepoints[j] < 256) {
if (all_codepoints[i] - all_codepoints[j] < 255) {
s = estimate_format0_size(all_codepoints[j], all_codepoints[i]);

/* eslint-disable max-depth */
Expand All @@ -61,7 +61,7 @@ module.exports = function cmap_split(all_codepoints) {
}
}

if (all_codepoints[i] - all_codepoints[j] < 256 && all_codepoints[i] - i === all_codepoints[j] - j) {
if (all_codepoints[i] - all_codepoints[j] < 255 && all_codepoints[i] - i === all_codepoints[j] - j) {
s = estimate_format0_tiny_size(all_codepoints[j], all_codepoints[i]);

/* eslint-disable max-depth */
Expand Down

0 comments on commit 9aeec71

Please sign in to comment.