From 258b456566abd266657725b3fc4e70f18b370d5d Mon Sep 17 00:00:00 2001 From: Michiharu Ariza Date: Mon, 24 Sep 2018 16:50:47 -0700 Subject: [PATCH] Added CFF1 & CFF2 api tests --- test/api/Makefile.am | 4 + test/api/fonts/AdobeVFPrototype.abc.otf | Bin 0 -> 7800 bytes .../api/fonts/AdobeVFPrototype.ac.nohints.otf | Bin 0 -> 7152 bytes test/api/fonts/AdobeVFPrototype.ac.otf | Bin 0 -> 7336 bytes test/api/fonts/SourceSansPro-Regular.abc.otf | Bin 0 -> 3412 bytes .../SourceSansPro-Regular.ac.nohints.otf | Bin 0 -> 3228 bytes test/api/fonts/SourceSansPro-Regular.ac.otf | Bin 0 -> 3332 bytes test/api/test-subset-cff1.c | 104 ++++++++++++++++++ test/api/test-subset-cff2.c | 104 ++++++++++++++++++ 9 files changed, 212 insertions(+) create mode 100644 test/api/fonts/AdobeVFPrototype.abc.otf create mode 100644 test/api/fonts/AdobeVFPrototype.ac.nohints.otf create mode 100644 test/api/fonts/AdobeVFPrototype.ac.otf create mode 100644 test/api/fonts/SourceSansPro-Regular.abc.otf create mode 100644 test/api/fonts/SourceSansPro-Regular.ac.nohints.otf create mode 100644 test/api/fonts/SourceSansPro-Regular.ac.otf create mode 100644 test/api/test-subset-cff1.c create mode 100644 test/api/test-subset-cff2.c diff --git a/test/api/Makefile.am b/test/api/Makefile.am index a2033449..9bf6d1dd 100644 --- a/test/api/Makefile.am +++ b/test/api/Makefile.am @@ -42,6 +42,8 @@ TEST_PROGS = \ test-subset-os2 \ test-subset-post \ test-subset-vmtx \ + test-subset-cff1 \ + test-subset-cff2 \ test-unicode \ test-version \ $(NULL) @@ -55,6 +57,8 @@ test_subset_hmtx_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la test_subset_os2_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la test_subset_post_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la test_subset_vmtx_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la +test_subset_cff1_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la +test_subset_cff2_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la test_unicode_CPPFLAGS = \ $(AM_CPPFLAGS) \ diff --git a/test/api/fonts/AdobeVFPrototype.abc.otf b/test/api/fonts/AdobeVFPrototype.abc.otf new file mode 100644 index 0000000000000000000000000000000000000000..a2d2150b066190d507e132091322fa13f2407827 GIT binary patch literal 7800 zcmb_g3v^UPn*ML6lXOA|%}YQLT11FEVu%n?bTok=m_TC^dCVZ%Bn^os=}gi|ClK=N z^yAj;N8X(d1dIrH03YMoJ>k~5kF&c+cXV|fXWgB*I>8A}@Ap^V5J2{* zyHicR``2H8{q?`9Ze6S;C00tOHcFt!*KgdI{r0;%@`>n|M5fi7w&xZlZ$ADVqLiIP z#+ohYpZ@YxInmS$km;}%-;w>j=Nbj9gm#WwyKgXitl9ACV&$ot;ATwqo`rOo|U(JLw`O#ntJPE-!Rx?W>{k zes8yM^s~0v7vCJabm`6UOXBbCLWs9qfWj96`A3BanUk%%#B=TFo&>P8^NVb0p=Q41 z{4!gb1RH-iW)uSrLijqhpa)`WFWBC`aQ5WuuLpZIU$^LB4ZI4*P zUEc2QjxAk-0Z+X@+-F|+?BI_^UheZ8Q^TG9o0sx`WUkMCQ89rsv&F zy*)@l@~)1;CR;N!Va(?P^t3U+E^!ERgfA{Xe&ctm_7rQ+J7C9Q7^^n4X#Sw;_Jw^1 z;ZoRq#0zGhquSy*%k1jpjz76Iu3Y*2adVbfKP?=@7Ro8f3z{}YpXw9MTpaGF0qs#J zZ}}Tg9w>xE&wNl?DLTIoMw1gTREj`{+uV_mIWhXev%yg@;sHC@2k7qtNc)}+Nab&w zth-$d@oJG~fY-;mBV6JO#~V9>m3;@{+_OR)@naNYoPx28_WqAVxVF$8X0n$1?Bw_?8DBvfue|IMn6o?QB2N+tMxkUHxv+50eiaR)f6PWF}P63aYQ) z(Gd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n^-ZHPL<2qCw@0=Q}%6o@xtHhIi+>ae+MTHe!a~e+Wuj`*jg_!Nat(Bu) z0UN83`}mt=2Y3_j6n@LZ_pJ@9I#C6UKt6xClH>24uUl#5b!UB>`QJwN>NgA55NB*J z{HTPdUvKNRGxEOi%n8XnSzDzzrM`Z(N!dxta#dD%w_TlsZ=?0f{9dc)$`vPa|NmQU VLd&%)@fRst>`nQt8}D3!{{vtI#LoZ# literal 0 HcmV?d00001 diff --git a/test/api/fonts/AdobeVFPrototype.ac.nohints.otf b/test/api/fonts/AdobeVFPrototype.ac.nohints.otf new file mode 100644 index 0000000000000000000000000000000000000000..188a87051929decd23b849d383320c0961e5ed20 GIT binary patch literal 7152 zcmb_f3viTGmOg(!l1>OoC%grrWe_5e5F)fFK1d)Drb8N&7+?mGPSQzd=%iz(^O6{1 z9^L7_-AU&GdEiEj2v`d0&eWE(HP%|LwX(aVt6MW$Th6YtT8^{s&SPiP2@Y|3zjOb; z2_RG8?%b~a{&UYg_q^`8_rJfrtjtcS)Jb|ew7sw}_vIJej}g%?iHzer%kxSScb&SQ zDB*P?L&I+LU-;^*i)c;`WV-C78*;yUzV#{ee}Mj>(z3j=3(G$qAxfE#{(m`|9p067 ztBw%OMVB%w>l_W_*S(8=Ci?DbjQ{icwe{#@4xM#59aX8tz6W8i4}Gf(jKp%?d7{*N z(O>1N^R*^a(DUdYLO-R>(b_=zJs?xvfP{KSo%0XB==@Lgeb9NJ!PDrAy+^r3OJS2N zIx^C{TS0}=8J8_)d^}|pkmvv@z!Zr^#G+c;M%(Ch{AL?-)E4KfoGTIItU)0iGHYN; zQIeMt!K86K1AV;?gYW6bjQXDr2oV?zn-{*-?s|H{8#X6g-124a(D|00F)`F8M8s^g zPn>UQKZTK*EnnsKxSk&B5Iuh(M=tuhg&01H*)y1=4qZFxA||Qov`Lo@&1`vXz;!Gz zC_Kkl+k%VlOwY``b7@BWgHs6cUJIb;6+pq$LJXJ_?fb>~C(%6vU}@i%xzfY1dB*ou zu5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bT2iF!=h2k>m#4T|1I@4GrK8ZGw zn;NN|ny8lclZ!lL!OfCKYsdbhhuT}nXaU;aF<;t1$7`vTvuUMr5Qf!L@tJcYNi=n+i+O-2CZczN+4((1V z#s7Y4fh5mb16_Ie-GMKG0^D7NWS3NY)e0)cF@3d;97sB;1{zq8N1JQM>>{ebNE5uR zl{Q$eSYZbuqH^*v$0e=ecr@Uxf%#Tg!~g4OEynAi{{XbH?KR-mL1!f*&EqV$4!^r# z`%J`d%-R`w3p8?GoOpU*4_j`*sunysN<7Nh;~r=g%6o@xtHYCh+>ae+M}?JKbsEm>uWO%2 zC79icw^ojJEo`hu?$w)QCwTEYg>M;k-#W0W2UXApfq`1ZM}L%;SJA>OBTx7s=_IC{nchfGwWe&cM*30vIwVumY cjOYIUw_04w)hnsrR}_0we*5y5)D`W20m_BadH?_b literal 0 HcmV?d00001 diff --git a/test/api/fonts/SourceSansPro-Regular.abc.otf b/test/api/fonts/SourceSansPro-Regular.abc.otf new file mode 100644 index 0000000000000000000000000000000000000000..1f1af4aa404c8c9b02a783c074633695092d9de2 GIT binary patch literal 3412 zcmbVO3v5%@8UC-Yubnp~nNhZ6@tImEAaIPEFePCUNlMy?G*06rCDK!|K6J> zMC?&~b2E~db=Yr9X=)`LrkCo1|}PS2ZjzoH0Hc?0A^BCnSuNm>!pM~%1^Q?vOVLto#k zB}ezD21^=hr7u&h^cAUAdbSM2bModg`Sy;&>DnUwpSzS#5=rgLcz$eoEo}zjIax_w zNm8`8ZbU+nu;W;y^FkG-p(eD9YK#bdShObeAx*?4^QM-`i_UCZH*&h6np#4nv%*Yi zqCcDFUCaa%=GjEOZU`L`L&WvbtZAgRe5hT|O&aNB$`q0ChVVL`Blg_z-%ePaGR<6b zef{|Ocu3_yLUBD)zh<2nPn#*xtK~Ig3`ck9SyObQhT>r-kB38UK3pk*QXz3_^N`nr zbqAf5f>PqI2QJJW|G9MIP3z{2d}GCI?t|60b3Ti1-wM2CRiFF2@>Sp2hkjkCRtf>@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Imq+%Gp~>$7;*1KXr z)`?=)$%uZVVAx}D-EEnU=tB*~HGUq~XhA+)DS=XPl{e5vQY5MG>92qOe#PnhnTE6Z zuuEr8MLu<_kN>JZ5`J^#C#7n&6mh?a?EI<6tx(;A;hs{(t&M7_t8^rCdZ^63v~)mq zbEW-}(sFmdyWBmXR&93&4@RbrAARXq{lnqMwy7VwZ-m_?JHISd+;CIY+*5b7Up@TN z8;4KSe03;(bA2i4LPt0c`fkJ7T~oEneePi7 zhK4yQN8#l!1M$#!MpPCNC&==A&LDC@>kbaOK z$0Fc|efcj?=vm-(F?bs>3JqApSS7>*OViWXd+YSm(}!mLRf0>NEUz579=se;GI(W{ zSH3v+3+CwwF9Z|KkI*^rUDfVoaJ(XeS(+aJo z6#*TZC!=C!uMhZPijc`!h898lZMrL9y~v_zMM&jhqg zE6SDxv;z9-fDX~}vbF{D72HHIEgFk8{-B9TC~=dmbPmzXpD}KK)Iu|93AJv&DH1LaRv5)XTj&ib~x+h z${pi~w`0fs^ZS(mlUx#VN&L}iFwk&iD$oXRMwiVvEvjUye@ZB6( z{qGobfb2XX7(hOL&E_!26&*&5MXzq0tuHZx71%@kj8?`e=fV}{+-541z?Af2ANTAt zKISa`fNs=w8&>X2JJ$27Q$Q}< zg*;BV4~*v#tlYIUx)+Cj?}A9?GWok2rC^0`47NOk`ph82pA?=@p5#v8n{Sf@=2&2+ zc#oZTFYEv{fR4t2u>qX!z-d38PTU0pINRju#=#NP1*tw@fHitNn(cDrjPgF(iFFH3 zSca=@AgVbu^7Q2qDdUiF>*FMdN3o{ihvQ^q+K7W|Idjj40zAGo8Lf=l znOlG(`Zwfj7loOGms0_{{*>(ZBC^mo|4zyxF2*9~(TSHa!V&v72;=oa+%)uAjw|Qe T?cx6x{{Ie|{s5Qg1%7`4(E5r* literal 0 HcmV?d00001 diff --git a/test/api/fonts/SourceSansPro-Regular.ac.otf b/test/api/fonts/SourceSansPro-Regular.ac.otf new file mode 100644 index 0000000000000000000000000000000000000000..40b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mbCsTha?Y z<@;xREPL*~$phbl)mUP@@DM8^yZPLuXmsF9hd;*m2xg9R`A#tcx>4H)v2tfRu-;sq zGIHTAl(5TvU_6gu<*wz>y%g+wS4Fa%$$zR*7GC(pV9z6{&k{m{o5DAgZ*nK_&96xs z_gLUgF%Qmv7ajsNh>oU!u|e!Ugxvvrop=idvA4&!O+g~43tD}^09*9MwxZGhJT?n?=kV0>o%{L`Sgx}Uzo0yql1F4>lSRAk_N z6e9z#+&>c)AIF-*IUFY=(?%Rz%cXZ_`DU>VN6EQxZ-aM;_j5Rn-%uMK`M%~Ln}&>E zO-3u@cIg%1i2fJywcEl>+Rv#B+u)WQ^&_&-x8O}GATGut=h2D57~zP67liS8D`^h) XtjCoL{PysFi{O6;EzaW+y~Xd}D8IiO literal 0 HcmV?d00001 diff --git a/test/api/test-subset-cff1.c b/test/api/test-subset-cff1.c new file mode 100644 index 00000000..62ce8028 --- /dev/null +++ b/test/api/test-subset-cff1.c @@ -0,0 +1,104 @@ +/* + * Copyright © 2018 Adobe Systems Incorporated. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Adobe Author(s): Michiharu Ariza + */ + +#include "hb-test.h" +#include "hb-subset-test.h" + +/* Unit tests for CFF subsetting */ + +static void +test_subset_cff1_noop (void) +{ + hb_face_t *face_abc = hb_subset_test_open_font("fonts/SourceSansPro-Regular.abc.otf"); + + hb_set_t *codepoints = hb_set_create (); + hb_face_t *face_abc_subset; + hb_set_add (codepoints, 'a'); + hb_set_add (codepoints, 'b'); + hb_set_add (codepoints, 'c'); + face_abc_subset = hb_subset_test_create_subset (face_abc, hb_subset_test_create_input (codepoints)); + hb_set_destroy (codepoints); + + hb_subset_test_check (face_abc, face_abc_subset, HB_TAG ('C','F','F',' ')); + + hb_face_destroy (face_abc_subset); + hb_face_destroy (face_abc); +} + +static void +test_subset_cff1 (void) +{ + hb_face_t *face_abc = hb_subset_test_open_font ("fonts/SourceSansPro-Regular.abc.otf"); + hb_face_t *face_ac = hb_subset_test_open_font ("fonts/SourceSansPro-Regular.ac.otf"); + + hb_set_t *codepoints = hb_set_create (); + hb_face_t *face_abc_subset; + hb_set_add (codepoints, 'a'); + hb_set_add (codepoints, 'c'); + face_abc_subset = hb_subset_test_create_subset (face_abc, hb_subset_test_create_input (codepoints)); + hb_set_destroy (codepoints); + + hb_subset_test_check (face_ac, face_abc_subset, HB_TAG ('C','F','F',' ')); + + hb_face_destroy (face_abc_subset); + hb_face_destroy (face_abc); + hb_face_destroy (face_ac); +} + +static void +test_subset_cff1_strip_hints (void) +{ + hb_face_t *face_abc = hb_subset_test_open_font ("fonts/SourceSansPro-Regular.abc.ttf"); + hb_face_t *face_ac = hb_subset_test_open_font ("fonts/SourceSansPro-Regular.ac.nohints.ttf"); + + hb_set_t *codepoints = hb_set_create (); + hb_subset_input_t *input; + hb_face_t *face_abc_subset; + hb_set_add (codepoints, 'a'); + hb_set_add (codepoints, 'c'); + input = hb_subset_test_create_input (codepoints); + hb_subset_input_set_drop_hints (input, true); + face_abc_subset = hb_subset_test_create_subset (face_abc, input); + hb_set_destroy (codepoints); + + hb_subset_test_check (face_ac, face_abc_subset, HB_TAG ('C', 'F', 'F', ' ')); + + hb_face_destroy (face_abc_subset); + hb_face_destroy (face_abc); + hb_face_destroy (face_ac); +} + +int +main (int argc, char **argv) +{ + hb_test_init (&argc, &argv); + + hb_test_add (test_subset_cff1_noop); + hb_test_add (test_subset_cff1); + hb_test_add (test_subset_cff1_strip_hints); + + return hb_test_run (); +} diff --git a/test/api/test-subset-cff2.c b/test/api/test-subset-cff2.c new file mode 100644 index 00000000..17ee7b73 --- /dev/null +++ b/test/api/test-subset-cff2.c @@ -0,0 +1,104 @@ +/* + * Copyright © 2018 Adobe Systems Incorporated. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Adobe Author(s): Michiharu Ariza + */ + +#include "hb-test.h" +#include "hb-subset-test.h" + +/* Unit tests for CFF2 subsetting */ + +static void +test_subset_cff2_noop (void) +{ + hb_face_t *face_abc = hb_subset_test_open_font("fonts/AdobeVFPrototype.abc.otf"); + + hb_set_t *codepoints = hb_set_create (); + hb_face_t *face_abc_subset; + hb_set_add (codepoints, 'a'); + hb_set_add (codepoints, 'b'); + hb_set_add (codepoints, 'c'); + face_abc_subset = hb_subset_test_create_subset (face_abc, hb_subset_test_create_input (codepoints)); + hb_set_destroy (codepoints); + + hb_subset_test_check (face_abc, face_abc_subset, HB_TAG ('C','F','F','2')); + + hb_face_destroy (face_abc_subset); + hb_face_destroy (face_abc); +} + +static void +test_subset_cff2 (void) +{ + hb_face_t *face_abc = hb_subset_test_open_font ("fonts/AdobeVFPrototype.abc.otf"); + hb_face_t *face_ac = hb_subset_test_open_font ("fonts/AdobeVFPrototype.ac.otf"); + + hb_set_t *codepoints = hb_set_create (); + hb_face_t *face_abc_subset; + hb_set_add (codepoints, 'a'); + hb_set_add (codepoints, 'c'); + face_abc_subset = hb_subset_test_create_subset (face_abc, hb_subset_test_create_input (codepoints)); + hb_set_destroy (codepoints); + + hb_subset_test_check (face_ac, face_abc_subset, HB_TAG ('C','F','F','2')); + + hb_face_destroy (face_abc_subset); + hb_face_destroy (face_abc); + hb_face_destroy (face_ac); +} + +static void +test_subset_cff2_strip_hints (void) +{ + hb_face_t *face_abc = hb_subset_test_open_font ("fonts/AdobeVFPrototype.abc.ttf"); + hb_face_t *face_ac = hb_subset_test_open_font ("fonts/AdobeVFPrototype.ac.nohints.ttf"); + + hb_set_t *codepoints = hb_set_create (); + hb_subset_input_t *input; + hb_face_t *face_abc_subset; + hb_set_add (codepoints, 'a'); + hb_set_add (codepoints, 'c'); + input = hb_subset_test_create_input (codepoints); + hb_subset_input_set_drop_hints (input, true); + face_abc_subset = hb_subset_test_create_subset (face_abc, input); + hb_set_destroy (codepoints); + + hb_subset_test_check (face_ac, face_abc_subset, HB_TAG ('C', 'F', 'F', ' ')); + + hb_face_destroy (face_abc_subset); + hb_face_destroy (face_abc); + hb_face_destroy (face_ac); +} + +int +main (int argc, char **argv) +{ + hb_test_init (&argc, &argv); + + hb_test_add (test_subset_cff2_noop); + hb_test_add (test_subset_cff2); + hb_test_add (test_subset_cff2_strip_hints); + + return hb_test_run (); +} -- GitLab