From ec46c4c2e6a1ee55ddbf2ad8a1241be6903890f9 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Wed, 27 Mar 2024 18:11:26 +0000 Subject: [PATCH] [subset] Update subset test suite to match some changes made to fonttools. FontTools has added pruning functionality for code pages which we don't yet have in harfbuzz. Update our test runner to disable that for now. Also match fonttools and always recalc usFirst/LastCharIndex even if no prune unicode ranges is set. --- src/hb-ot-os2-table.hh | 6 +++--- ...r-new.no-prune-unicode-ranges.61,62,63.ttf | Bin 7036 -> 7036 bytes ...ular-new.no-prune-unicode-ranges.61,63.ttf | Bin 6668 -> 6668 bytes ...Regular-new.no-prune-unicode-ranges.61.ttf | Bin 6300 -> 6300 bytes ...Regular-new.no-prune-unicode-ranges.62.ttf | Bin 6172 -> 6172 bytes ...Regular-new.no-prune-unicode-ranges.63.ttf | Bin 6228 -> 6228 bytes ...ubset.no-prune-unicode-ranges.61,62,63.ttf | Bin 4128 -> 4128 bytes ...r-subset.no-prune-unicode-ranges.61,63.ttf | Bin 3580 -> 3580 bytes ...ular-subset.no-prune-unicode-ranges.61.ttf | Bin 3156 -> 3156 bytes ...ular-subset.no-prune-unicode-ranges.62.ttf | Bin 3180 -> 3180 bytes ...ular-subset.no-prune-unicode-ranges.63.ttf | Bin 3048 -> 3048 bytes ...Regular.abc.no-prune-unicode-ranges.61.ttf | Bin 1988 -> 1988 bytes ...Regular.abc.no-prune-unicode-ranges.62.ttf | Bin 1856 -> 1856 bytes ...Regular.abc.no-prune-unicode-ranges.63.ttf | Bin 1912 -> 1912 bytes test/subset/generate-expected-outputs.py | 2 ++ 15 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-os2-table.hh b/src/hb-ot-os2-table.hh index 8c2e696f5..272661378 100644 --- a/src/hb-ot-os2-table.hh +++ b/src/hb-ot-os2-table.hh @@ -284,12 +284,12 @@ struct OS2 os2_prime->usWidthClass = width_class; } - if (c->plan->flags & HB_SUBSET_FLAGS_NO_PRUNE_UNICODE_RANGES) - return_trace (true); - os2_prime->usFirstCharIndex = hb_min (0xFFFFu, c->plan->unicodes.get_min ()); os2_prime->usLastCharIndex = hb_min (0xFFFFu, c->plan->unicodes.get_max ()); + if (c->plan->flags & HB_SUBSET_FLAGS_NO_PRUNE_UNICODE_RANGES) + return_trace (true); + _update_unicode_ranges (&c->plan->unicodes, os2_prime->ulUnicodeRange); return_trace (true); diff --git a/test/subset/data/expected/basics/Comfortaa-Regular-new.no-prune-unicode-ranges.61,62,63.ttf b/test/subset/data/expected/basics/Comfortaa-Regular-new.no-prune-unicode-ranges.61,62,63.ttf index dbbca2bebfcac61fb738a92ee1ff6ca0ead51c77..4f18103689a614439a3ef69ca622b5c116493504 100644 GIT binary patch delta 32 ocmexk_Qz~OAoGKuwv8b*Oe_<>%@&`0h3O!3B17`#8O%?_0rl1m`v3p{ delta 32 qcmV+*0N?-oHvBe_Q3HTYC9za|0tAw_rP-6z0>J|S`vS9=1LPO%84ddY diff --git a/test/subset/data/expected/basics/Comfortaa-Regular-new.no-prune-unicode-ranges.61,63.ttf b/test/subset/data/expected/basics/Comfortaa-Regular-new.no-prune-unicode-ranges.61,63.ttf index c16773eac85d3852361d8be60f01aeeb41dc7114..281827347e1c70baf885df4c07273313c73f853d 100644 GIT binary patch delta 32 ocmeA%=`ooQ$owFvZDWW76U&9HIS(e!VEW0N$dJ5w3Uh@R0NQ~J;{X5v delta 32 ocmeA%=`ooQ$lTzox-rCoiRGf!@9!~g&Q delta 32 ocmbPZILB~8AajGS>c)^9CYIK%&C4erVcN;e@SACK1G9`M0LjD)#Q*>R diff --git a/test/subset/data/expected/basics/Comfortaa-Regular-new.no-prune-unicode-ranges.62.ttf b/test/subset/data/expected/basics/Comfortaa-Regular-new.no-prune-unicode-ranges.62.ttf index b63a3ea3f026ee0c49af1c742035dc4360f240b8..abff0ec1b9e82eb142d532b763333edbc02890f4 100644 GIT binary patch delta 32 ocmbPZFvnm*AoIhZ){P-OOe`V4tSu)$VcN-@#E`Uk0dtKA0M?!iZ2$lO delta 32 ocmbPZFvnm*AajGS>c)^BCYI1Wu0JO~VcN;e@SAD#0_GYK0Lc)^9CKhdBo!ZGqn07KV{ASwRzwE0)jUw|I88s(wVO-9byg7#H2rmHJzYGTe delta 42 ycmZ3Wus}hCfsuiMfsdhqftew}KUm)=>w6sAMv?i9jKY(*FfM1z+Z@AmgcktG(hCRx diff --git a/test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.no-prune-unicode-ranges.61,63.ttf b/test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.no-prune-unicode-ranges.61,63.ttf index c33b4cb88dd6cf9523d004f310833a937747dc7b..d2a94ddab22b4b0a5dce563c67d5fda87c6bef3d 100644 GIT binary patch delta 42 ycmew({YP4afsuiMfsdhqftew}KUm)=>wE0)jUvg6jMFDqFg|8X-Ww6sAMv-Jj#>UANjE@=fHpeh6;06HZoD0GL diff --git a/test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.no-prune-unicode-ranges.61.ttf b/test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.no-prune-unicode-ranges.61.ttf index fefbfafa6d3eaed5c2676e641af51ee8c70dda79..e5f08c79e0b7e48f1d9e57a326ec7ea944eb613a 100644 GIT binary patch delta 42 ycmca2aYaIefsuiMfsdhqftew}KUm)=>wE0ajUtm7881&>!ML0;adQ9@3l{+H&w6sAMv=*kj5{Zf}`g$n@O;|m`E diff --git a/test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.no-prune-unicode-ranges.62.ttf b/test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.no-prune-unicode-ranges.62.ttf index a951a4c16d8e3253f0e7e238cb25fe81edcc76aa..6637064ed7bb39046ac0dab6e165d43fd8f4843e 100644 GIT binary patch delta 46 zcmaDO@kT;~fsuiMfsdhqftew}KUm)=>qqRbjUp2nnJ04IpS*%`DRUA-(&hjr87=@S CHVttA delta 46 zcmaDO@kT;~fsuiMfsdhqftew}KUm)=>w6sAMv;k(%#%5fPhP>elsSN?t CO$>4X diff --git a/test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.no-prune-unicode-ranges.63.ttf b/test/subset/data/expected/basics/NanumMyeongjo-Regular-subset.no-prune-unicode-ranges.63.ttf index 349899de3f8a7590309263af0a5692607e68c3fc..8efd69ba24647785343f8052e900f2154f767550 100644 GIT binary patch delta 46 zcmaDM{z6=YfsuiMfsdhqftew}KUm)=>u2omjUp2nnU(K7oxFl^DRVMI^5y`h8Jqww Cm=03_ delta 46 zcmaDM{z6=YfsuiMfsdhqftew}KUm)=>w6sAMv;k(%elsSg@ss0L; delta 31 ncmX@WcYtq#BXdR*-$oZnCgyUzW0Mn@eljOAByWyke!>g@ss0L; diff --git a/test/subset/data/expected/basics/Roboto-Regular.abc.no-prune-unicode-ranges.63.ttf b/test/subset/data/expected/basics/Roboto-Regular.abc.no-prune-unicode-ranges.63.ttf index 7247d8c91cd2ed7b4b8c67092f945030336d6c56..44317149205ce04d103534e10e46d0f2636f5f54 100644 GIT binary patch delta 25 hcmeyt_k(YOBV*P^r{9c>g_G@=elsR-wqmwp0RV+{2@U`N delta 25 hcmeyt_k(YOBV)!!r{9c>rIYQLelsR+wqmwp0RV+{2@U`N diff --git a/test/subset/generate-expected-outputs.py b/test/subset/generate-expected-outputs.py index 828d042cc..78e1c13da 100755 --- a/test/subset/generate-expected-outputs.py +++ b/test/subset/generate-expected-outputs.py @@ -56,6 +56,8 @@ def generate_expected_output(input_file, unicodes, profile_flags, instance_flags # --gid-map is unsupported in fonttools so don't send it. Tests using # it are crafted to work without fonttools knowing about the flag. args.extend([f for f in profile_flags if not f.startswith("--gid-map")]) + # Harfbuzz doesn't support pruning codepage ranges, so disable it in fonttools. + args.extend(["--no-prune-codepage-ranges"]) if not no_fonttools: check_call(args)