From 1a5c749581a9d7d19ab94250599c6e2700660fee Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 4 Dec 2022 15:20:51 -0700 Subject: [PATCH] [config] Flesh out HB_NO_SHAPER a bit more --- src/hb-face.cc | 2 ++ src/hb-face.hh | 2 ++ src/hb-shape-plan.cc | 5 +++++ src/hb-shape.cc | 5 +++++ 4 files changed, 14 insertions(+) diff --git a/src/hb-face.cc b/src/hb-face.cc index bb7237da9..8b4b635c7 100644 --- a/src/hb-face.cc +++ b/src/hb-face.cc @@ -288,6 +288,7 @@ hb_face_destroy (hb_face_t *face) { if (!hb_object_destroy (face)) return; +#ifndef HB_NO_SHAPER for (hb_face_t::plan_node_t *node = face->shape_plans; node; ) { hb_face_t::plan_node_t *next = node->next; @@ -295,6 +296,7 @@ hb_face_destroy (hb_face_t *face) hb_free (node); node = next; } +#endif face->data.fini (); face->table.fini (); diff --git a/src/hb-face.hh b/src/hb-face.hh index 12e10d01e..1bf0606e5 100644 --- a/src/hb-face.hh +++ b/src/hb-face.hh @@ -65,7 +65,9 @@ struct hb_face_t hb_shape_plan_t *shape_plan; plan_node_t *next; }; +#ifndef HB_NO_SHAPER hb_atomic_ptr_t shape_plans; +#endif hb_blob_t *reference_table (hb_tag_t tag) const { diff --git a/src/hb-shape-plan.cc b/src/hb-shape-plan.cc index dda10254a..cabcbd4e7 100644 --- a/src/hb-shape-plan.cc +++ b/src/hb-shape-plan.cc @@ -31,6 +31,8 @@ #include "hb-buffer.hh" +#ifndef HB_NO_SHAPER + /** * SECTION:hb-shape-plan * @title: hb-shape-plan @@ -574,3 +576,6 @@ retry: return hb_shape_plan_reference (shape_plan); } + + +#endif diff --git a/src/hb-shape.cc b/src/hb-shape.cc index 547d0afc4..7b5bf2c5e 100644 --- a/src/hb-shape.cc +++ b/src/hb-shape.cc @@ -35,6 +35,8 @@ #include "hb-machinery.hh" +#ifndef HB_NO_SHAPER + /** * SECTION:hb-shape * @title: hb-shape @@ -192,3 +194,6 @@ hb_shape (hb_font_t *font, { hb_shape_full (font, buffer, features, num_features, nullptr); } + + +#endif