From 3d3df5575c5be0e3c69b99ca1d8df2cea1672aaf Mon Sep 17 00:00:00 2001 From: Michiharu Ariza Date: Mon, 22 Oct 2018 15:23:39 -0700 Subject: [PATCH] fix build attempt --- src/hb-ot-cff-common.hh | 5 ++++- test/api/test-ot-extents-cff.c | 11 +++++------ test/api/test-subset-cff1.c | 19 +++++++++---------- test/api/test-subset-cff2.c | 11 +++++------ 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/hb-ot-cff-common.hh b/src/hb-ot-cff-common.hh index a7ff197..8599de5 100644 --- a/src/hb-ot-cff-common.hh +++ b/src/hb-ot-cff-common.hh @@ -380,8 +380,11 @@ struct Remap : hb_vector_t return true; } + inline bool includes (hb_codepoint_t id) const + { return (id < len) && ((*this)[id] != CFF_UNDEF_CODE); } + inline bool excludes (hb_codepoint_t id) const - { return (id < len) && ((*this)[id] == CFF_UNDEF_CODE); } + { return !includes (i); } inline hb_codepoint_t operator[] (hb_codepoint_t i) const { diff --git a/test/api/test-ot-extents-cff.c b/test/api/test-ot-extents-cff.c index 1c1cb84..e2f8b5a 100644 --- a/test/api/test-ot-extents-cff.c +++ b/test/api/test-ot-extents-cff.c @@ -25,7 +25,6 @@ */ #include "hb-test.h" -#include "hb-subset-test.h" // for hb_subset_test_open_font #include /* Unit tests for CFF/CFF2 glyph extents */ @@ -51,7 +50,7 @@ test_extents_cff1 (void) hb_font_destroy (font); - hb_face_t *face_j = hb_subset_test_open_font ("fonts/SourceHanSans-Regular.41,3041,4C2E.otf"); + hb_face_t *face_j = hb_test_open_font_file ("fonts/SourceHanSans-Regular.41,3041,4C2E.otf"); g_assert (face_j); hb_font_t *font_j = hb_font_create (face_j); hb_face_destroy (face_j); @@ -72,7 +71,7 @@ test_extents_cff1 (void) static void test_extents_cff1_legacyops (void) { - hb_face_t *face = hb_subset_test_open_font ("fonts/cff1_legacyops.otf"); + hb_face_t *face = hb_test_open_font_file ("fonts/cff1_legacyops.otf"); g_assert (face); hb_font_t *font = hb_font_create (face); hb_face_destroy (face); @@ -94,7 +93,7 @@ test_extents_cff1_legacyops (void) static void test_extents_cff1_flex (void) { - hb_face_t *face = hb_subset_test_open_font ("fonts/cff1_flex.otf"); + hb_face_t *face = hb_test_open_font_file ("fonts/cff1_flex.otf"); g_assert (face); hb_font_t *font = hb_font_create (face); hb_face_destroy (face); @@ -116,7 +115,7 @@ test_extents_cff1_flex (void) static void test_extents_cff2 (void) { - hb_face_t *face = hb_subset_test_open_font ("fonts/AdobeVFPrototype.abc.otf"); + hb_face_t *face = hb_test_open_font_file ("fonts/AdobeVFPrototype.abc.otf"); g_assert (face); hb_font_t *font = hb_font_create (face); hb_face_destroy (face); @@ -148,7 +147,7 @@ test_extents_cff2 (void) static void test_extents_cff2_vsindex (void) { - hb_face_t *face = hb_subset_test_open_font ("fonts/AdobeVFPrototype_vsindex.otf"); + hb_face_t *face = hb_test_open_font_file ("fonts/AdobeVFPrototype_vsindex.otf"); g_assert (face); hb_font_t *font = hb_font_create (face); hb_face_destroy (face); diff --git a/test/api/test-subset-cff1.c b/test/api/test-subset-cff1.c index 712e389..2089d30 100644 --- a/test/api/test-subset-cff1.c +++ b/test/api/test-subset-cff1.c @@ -25,14 +25,13 @@ */ #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_face_t *face_abc = hb_test_open_font_file("fonts/SourceSansPro-Regular.abc.otf"); hb_set_t *codepoints = hb_set_create (); hb_face_t *face_abc_subset; @@ -51,8 +50,8 @@ test_subset_cff1_noop (void) 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_face_t *face_abc = hb_test_open_font_file ("fonts/SourceSansPro-Regular.abc.otf"); + hb_face_t *face_ac = hb_test_open_font_file ("fonts/SourceSansPro-Regular.ac.otf"); hb_set_t *codepoints = hb_set_create (); hb_face_t *face_abc_subset; @@ -71,8 +70,8 @@ test_subset_cff1 (void) static void test_subset_cff1_strip_hints (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.nohints.otf"); + hb_face_t *face_abc = hb_test_open_font_file ("fonts/SourceSansPro-Regular.abc.otf"); + hb_face_t *face_ac = hb_test_open_font_file ("fonts/SourceSansPro-Regular.ac.nohints.otf"); hb_set_t *codepoints = hb_set_create (); hb_subset_input_t *input; @@ -94,8 +93,8 @@ test_subset_cff1_strip_hints (void) static void test_subset_cff1_j (void) { - hb_face_t *face_41_3041_4c2e = hb_subset_test_open_font ("fonts/SourceHanSans-Regular.41,3041,4C2E.otf"); - hb_face_t *face_41_4c2e = hb_subset_test_open_font ("fonts/SourceHanSans-Regular.41,4C2E.otf"); + hb_face_t *face_41_3041_4c2e = hb_test_open_font_file ("fonts/SourceHanSans-Regular.41,3041,4C2E.otf"); + hb_face_t *face_41_4c2e = hb_test_open_font_file ("fonts/SourceHanSans-Regular.41,4C2E.otf"); hb_set_t *codepoints = hb_set_create (); hb_face_t *face_41_3041_4c2e_subset; @@ -114,8 +113,8 @@ test_subset_cff1_j (void) static void test_subset_cff1_expert (void) { - hb_face_t *face = hb_subset_test_open_font ("fonts/cff1_expert.otf"); - hb_face_t *face_subset = hb_subset_test_open_font ("fonts/cff1_expert.2D,F6E9,FB00.otf"); + hb_face_t *face = hb_test_open_font_file ("fonts/cff1_expert.otf"); + hb_face_t *face_subset = hb_test_open_font_file ("fonts/cff1_expert.2D,F6E9,FB00.otf"); hb_set_t *codepoints = hb_set_create (); hb_set_add (codepoints, 0x2D); diff --git a/test/api/test-subset-cff2.c b/test/api/test-subset-cff2.c index bfb9f09..a909b73 100644 --- a/test/api/test-subset-cff2.c +++ b/test/api/test-subset-cff2.c @@ -25,14 +25,13 @@ */ #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_face_t *face_abc = hb_test_open_font_file("fonts/AdobeVFPrototype.abc.otf"); hb_set_t *codepoints = hb_set_create (); hb_face_t *face_abc_subset; @@ -51,8 +50,8 @@ test_subset_cff2_noop (void) 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_face_t *face_abc = hb_test_open_font_file ("fonts/AdobeVFPrototype.abc.otf"); + hb_face_t *face_ac = hb_test_open_font_file ("fonts/AdobeVFPrototype.ac.otf"); hb_set_t *codepoints = hb_set_create (); hb_face_t *face_abc_subset; @@ -71,8 +70,8 @@ test_subset_cff2 (void) static void test_subset_cff2_strip_hints (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.nohints.otf"); + hb_face_t *face_abc = hb_test_open_font_file ("fonts/AdobeVFPrototype.abc.otf"); + hb_face_t *face_ac = hb_test_open_font_file ("fonts/AdobeVFPrototype.ac.nohints.otf"); hb_set_t *codepoints = hb_set_create (); hb_subset_input_t *input; -- 2.7.4