Skip to content

Commit 49c8493

Browse files
committed
[test] Build with HB_MINI
Also add CONFIG.md instructions for building configs with meson. Fixes harfbuzz#4760
1 parent 106e406 commit 49c8493

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

CONFIG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ The pre-defined configurations are:
130130
disabling thread-safety and debugging, and use even more size-optimized data
131131
tables.
132132

133+
To setup the build with these options use something like:
134+
```
135+
$ meson setup build -Dcpp_args=-DHB_MINI -Dc_args=-DHB_MINI
136+
```
133137

134138
## Tailoring configuration
135139

@@ -155,4 +159,4 @@ Note that the config option `HB_NO_CFF`, which is enabled by `HB_LEAN` and
155159
`HB_TINY` does *not* mean that the resulting library won't work with CFF fonts.
156160
The library can shape valid CFF fonts just fine, with or without this option.
157161
This option disables (among other things) the code to calculate glyph extents
158-
for CFF fonts, which many clients might not need.
162+
for CFF fonts or draw them, which many clients might not need.

src/hb-subset-plan.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ _collect_base_variation_indices (hb_subset_plan_t* plan)
491491
base->collect_variation_indices (plan, varidx_set);
492492
const OT::ItemVariationStore &var_store = base->get_var_store ();
493493
unsigned subtable_count = var_store.get_sub_table_count ();
494-
494+
495495

496496
_remap_variation_indices (var_store, varidx_set,
497497
plan->normalized_coords,
@@ -731,7 +731,7 @@ _populate_unicodes_to_retain (const hb_set_t *unicodes,
731731
plan->codepoint_to_glyph->alloc (unicodes->get_population () + glyphs->get_population ());
732732

733733
auto &gid_to_unicodes = plan->accelerator->gid_to_unicodes;
734-
734+
735735
for (hb_codepoint_t gid : *glyphs)
736736
{
737737
auto unicodes = gid_to_unicodes.get (gid);

test/api/test-aat-layout.c

+6
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
static hb_face_t *face;
3434
static hb_face_t *sbix;
3535

36+
#ifndef HB_NO_AAT
37+
3638
static void
3739
test_aat_get_feature_types (void)
3840
{
@@ -114,15 +116,19 @@ test_aat_has (void)
114116
hb_face_destroy (trak);
115117
}
116118

119+
#endif
120+
117121
int
118122
main (int argc, char **argv)
119123
{
120124
unsigned int status;
121125
hb_test_init (&argc, &argv);
122126

127+
#ifndef HB_NO_AAT
123128
hb_test_add (test_aat_get_feature_types);
124129
hb_test_add (test_aat_get_feature_selectors);
125130
hb_test_add (test_aat_has);
131+
#endif
126132

127133
face = hb_test_open_font_file ("fonts/aat-feat.ttf");
128134
sbix = hb_test_open_font_file ("fonts/chromacheck-sbix.ttf");

test/api/test-ot-face.c

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ test_font (hb_font_t *font, hb_codepoint_t cp)
7676
hb_ot_color_has_png (face);
7777
hb_blob_destroy (hb_ot_color_glyph_reference_png (font, cp));
7878

79+
#ifndef HB_NO_AAT
7980
{
8081
hb_aat_layout_feature_type_t feature = HB_AAT_LAYOUT_FEATURE_TYPE_ALL_TYPOGRAPHIC;
8182
unsigned count = 1;
@@ -87,6 +88,7 @@ test_font (hb_font_t *font, hb_codepoint_t cp)
8788
hb_aat_layout_feature_type_get_selector_infos (face, HB_AAT_LAYOUT_FEATURE_TYPE_DESIGN_COMPLEXITY_TYPE, 0, &count, &setting, &default_index);
8889
result += count + feature + setting.disable + setting.disable + setting.name_id + setting.reserved + default_index;
8990
}
91+
#endif
9092

9193
hb_set_t *lookup_indexes = hb_set_create ();
9294
hb_set_add (lookup_indexes, 0);

test/fuzzing/hb-fuzzer.hh

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <hb-config.hh>
2+
13
#include <hb.h>
24
#include <stddef.h>
35

0 commit comments

Comments
 (0)