From 975bd39b158e454a84b7b947d156561a21aaf24f Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Wed, 27 Mar 2024 19:28:53 +0000 Subject: [PATCH] [subset] Match hb rounding to fonttools for avg char width. Update Muli and Roboto input test fonts to recalc class values. FontTools recalcs class values during instancing while harfbuzz does not (like the ft subsetter). --- src/hb-ot-os2-table.hh | 2 +- ....default.retain-all-codepoint.wght=300.ttf | Bin 131708 -> 131708 bytes ....default.retain-all-codepoint.wght=300.ttf | Bin 5788 -> 5788 bytes ....default.retain-all-codepoint.wght=700.ttf | Bin 5784 -> 5784 bytes ....retain-all-codepoint.wght=150,wdth=80.ttf | Bin 114196 -> 114196 bytes ....retain-all-codepoint.wght=150,wdth=80.ttf | Bin 114196 -> 114196 bytes ....retain-all-codepoint.wght=200,wdth=90.ttf | Bin 6736 -> 6736 bytes ....retain-all-codepoint.wght=650,wdth=85.ttf | Bin 6688 -> 6688 bytes ...-all-codepoint.wght=150,wdth=80,CTGR=0.ttf | Bin 1396 -> 1396 bytes ...-all-codepoint.wght=300,wdth=90,CTGR=0.ttf | Bin 1432 -> 1432 bytes ...tain-all-codepoint.wght=400,wdth=100.0.ttf | Bin 6780 -> 6780 bytes ...etain-all-codepoint.wght=drop,wdth=100.ttf | Bin 6780 -> 6780 bytes test/subset/data/fonts/Muli-ABC.ttf | Bin 6996 -> 6988 bytes .../subset/data/fonts/Roboto-Variable.ABC.ttf | Bin 13480 -> 13448 bytes 14 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-ot-os2-table.hh b/src/hb-ot-os2-table.hh index 272661378..43b58d9bb 100644 --- a/src/hb-ot-os2-table.hh +++ b/src/hb-ot-os2-table.hh @@ -223,7 +223,7 @@ struct OS2 } } - return num ? (unsigned) roundf (total_width / num) : 0; + return num ? (unsigned) roundf ((double) total_width / (double) num) : 0; } bool subset (hb_subset_context_t *c) const diff --git a/test/subset/data/expected/apply_cvar_delta/Comfortaa-Regular-new.default.retain-all-codepoint.wght=300.ttf b/test/subset/data/expected/apply_cvar_delta/Comfortaa-Regular-new.default.retain-all-codepoint.wght=300.ttf index 35ad91f9517cb5542398c9795cfa35655d88cda4..18b352e45e1320aa5019bca0a85ef9e4cec4d407 100644 GIT binary patch delta 31 ncmeyFM#k@xFEHveRyHxUF)>bKVyXcE#B~a; delta 31 ncmeybKVyXcE#B~a; diff --git a/test/subset/data/expected/apply_cvar_delta/Muli-ABC.default.retain-all-codepoint.wght=300.ttf b/test/subset/data/expected/apply_cvar_delta/Muli-ABC.default.retain-all-codepoint.wght=300.ttf index f79fdd859454d511b0aaf4803c76eec3e71f1f59..add22aff700e24be1ec42f246d2b6bfa9621e3bc 100644 GIT binary patch delta 155 zcmbQEJ4bhdqVhGB8U_Yt76t}}2KV4lryYNGykcNrJOkuw_y_A7CG4$9pXidqBB3T{ zvvEreqfBsX`|@~xo39M)%rAh77_M;4T@9iiX({_m_F;-X^jB`!~f?%{2e6q m|Ly;;42%rSK+FUtA#4U94&q4s`-6@R# delta 155 zcmbQEJ4bhdqVisqDGUtEEDQ_`4er6APCNeWc*VfLcm~MV@DJ8EO4wVIHqj-Ag)b?R zZR3_2MwxVb!Kd;3HeVUonO^`EFS&q0F!zy5y< oroS^VGB5)%6PN_CnSkPqU=b!Dn{o0)W~s>wn7KEvWd1A!0P%$>jsO4v diff --git a/test/subset/data/expected/apply_cvar_delta/Muli-ABC.default.retain-all-codepoint.wght=700.ttf b/test/subset/data/expected/apply_cvar_delta/Muli-ABC.default.retain-all-codepoint.wght=700.ttf index 569032eb75f7fd6544c418df3dfcddcb32bb223d..3c8b74499cc4d5ebbadda473cf8e2b50b1377068 100644 GIT binary patch delta 155 zcmbQCJ41JZqVgS;CI$v(76t}}2KV4lryYNGykcNrJOkuw_y_A7CHdAAOmxX%k+6}o z*|?>KQRc#v`lIpuHeVUonO^`EFSKvNhP{(t)a p8BG6WU}RthVkR&NVlx578Nnh>FK@85w_1Ucs2p$lff$v|WOU@y~7mzw-+= diff --git a/test/subset/data/expected/full_instance/Roboto-Variable.no-prune-unicode-ranges.retain-all-codepoint.wght=150,wdth=80.ttf b/test/subset/data/expected/full_instance/Roboto-Variable.no-prune-unicode-ranges.retain-all-codepoint.wght=150,wdth=80.ttf index 757611f922e41fe68cbf71a23bfe06adb678f4de..2d92644a015952b53c466c712a2cada2c82b99bf 100644 GIT binary patch delta 31 ncmbR8hi%Fqwh7LR92;Gd85w_0Ucs2p$k8mpv|WOU@y~7mzw-+= delta 31 ncmbR8hi%Fqwh7LR>>FK@85w_1Ucs2p$lff$v|WOU@y~7mzw-+= diff --git a/test/subset/data/expected/instantiate_glyf/Roboto-Variable.ABC.default.retain-all-codepoint.wght=200,wdth=90.ttf b/test/subset/data/expected/instantiate_glyf/Roboto-Variable.ABC.default.retain-all-codepoint.wght=200,wdth=90.ttf index 7a6eed8eb731cb87ad012d588270f4888de41324..e1c5e0e98057240410be99c96239a660587f1db2 100644 GIT binary patch delta 119 zcmca$a=~PRqVl)5+ZY&_RTvl;dfbCUohI`(F)=VOUI6k<{Dbw4iW?iZO?1g&;d)zt zY2%h2Mj4gBD_i6FZN4%{a{$#aFdX?Hs0X4SX(@f29K)2&m_PXh(+-Fn!~d_7JD3&O P85x)ufOzu;<^^H^&8;J2 delta 119 zcmca$a=~PRqVk)!2N)QbRTvl;dfbCUohI`(F)=VOUI6k<{Dbw4iW?iZPISp(VOgfb zxN%Dlqm03q8rOJ!o39Mg96&V;3`af)>VfFnkIpMhj$z7X%$t0IX$QyuuOLANhRGew QitJ1bAjr6R1M>ng0EC|+WdHyG diff --git a/test/subset/data/expected/instantiate_glyf/Roboto-Variable.ABC.default.retain-all-codepoint.wght=650,wdth=85.ttf b/test/subset/data/expected/instantiate_glyf/Roboto-Variable.ABC.default.retain-all-codepoint.wght=650,wdth=85.ttf index abda0115a6bc1fbf46986b2c14b63e81d780627c..dbc663c74c8c250f04214e6a3c1134bc5b767b63 100644 GIT binary patch delta 82 zcmZ2rvcP15BJ;Pm>n5u7uyFgT delta 82 zc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N?Yh`NZ5_>cSxvW(}E delta 1333 zcmZ8fZD?C%6n@_K-h5iqtoF9a(3x53s;rxYE{N8$)^3?Hx6;IYQ8zDXngo+H>*B01 zmMTMJD5zIlaq|Nl;@E!7eZclZ$REM6GB%wsM27flh+|+UbsBno-kWQGcrN$6&vVXs z&pGdT-?_x~L=6H!CzXy$a(Kf=`}@T>AnUa5NRDhx_4XdW26#4+A5W%U9J4_<$PbYROXhS%WLqB~|C~HlHcQ!o zzxM8>i}~c4%H+PP{TVn>QCI%TRJO8excolg{fhiDo)r+b4R%P0Gx4_!y^FZKi8grx zJLD-0I9H@24KKF92Z_hA9q%%JHe~SHG;5@zYbCVXwwH5TYp+{0JppHrlhjqZbtux? z6+|~bIlOUm8f`_hT1Lq6>q@f^ij|jr%~v6#A0N*4kMC*i{}Vp#mU3SAe{xc-Hzsy> zu+SY(KwnSlWm8QN(AZ>C2Dr32jXdb+7Wz08{-P0B^vDLSvW_|pzl~4)y)NWHVYYuMhs$a``I0vkpd+ znl9H_4KZfDv8>zra@ij1cIPqc$BvL{>p;d!+xvF~EozQfyc#lGjJ5)>@Evv6@@j#S%fz!>J{-rTn#k(0L(GxegEfeCW*}FW*PZ#XfHCaIv3Qy%sht z0z|-bEN-HR0x}rIBuZpu4AElJ@(MO!nh{fEL-ZCgzO<&o$TGaJWY}!oG#2{2I;p4df`bZHx&4c?M`bkhFCWt2M*si- diff --git a/test/subset/data/fonts/Roboto-Variable.ABC.ttf b/test/subset/data/fonts/Roboto-Variable.ABC.ttf index 6cf001fc854c4f501f2a4bf4dfcb66a28f8aeafe..a70db42b2a5a8e4ed1ef0c5aae5de60341a18886 100644 GIT binary patch delta 913 zcmb7CO-NKx6#nk}n`b_pv@vobo1Ae5q*O+;AQu{H22#;XQ6T7Z8fVNI8)ha^NXJB? zRaj3F!i9?#F5JYBByA)LqM%KSgdiwLiWX&Nl$Eb@-@{#-&VzT)`OdlD`Odv}uJ3x^ zq$hWA_3b^NVisW9vCx^L{?C17fOj6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