From 9aeec7148047e5ef3827faebc15bfbb51929ea40 Mon Sep 17 00:00:00 2001 From: "Wang.Luo" <1593775941@qq.com> Date: Fri, 9 Aug 2024 00:15:15 +0800 Subject: [PATCH] Modify the format0 length limit to address the issue where the format0 length occasionally reaches 256. --- lib/font/cmap_build_subtables.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/font/cmap_build_subtables.js b/lib/font/cmap_build_subtables.js index c80a219..2e72a2f 100644 --- a/lib/font/cmap_build_subtables.js +++ b/lib/font/cmap_build_subtables.js @@ -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 */ @@ -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 */