input->unicodes = hb_set_create ();
input->glyphs = hb_set_create ();
- input->drop_ot_layout = true;
+ input->drop_layout = true;
return input;
}
return subset_input->glyphs;
}
-/**
- * hb_subset_input_drop_hints:
- * @subset_input: a subset_input.
- *
- * Since: 1.8.0
- **/
-HB_EXTERN hb_bool_t *
-hb_subset_input_drop_hints (hb_subset_input_t *subset_input)
+HB_EXTERN void
+hb_subset_input_set_drop_hints (hb_subset_input_t *subset_input,
+ hb_bool_t drop_hints)
{
- return &subset_input->drop_hints;
+ subset_input->drop_hints = drop_hints;
}
-/**
- * hb_subset_input_drop_ot_layout:
- * @subset_input: a subset_input.
- *
- * If enabled ot layout tables will be dropped as part of
- * the subsetting operation. Currently this defaults to
- * true.
- *
- * Since: REPLACEME
- **/
-HB_EXTERN hb_bool_t *
-hb_subset_input_drop_ot_layout (hb_subset_input_t *subset_input)
+HB_EXTERN hb_bool_t
+hb_subset_input_get_drop_hints (hb_subset_input_t *subset_input)
+{
+ return subset_input->drop_hints;
+}
+
+HB_EXTERN void
+hb_subset_input_set_drop_layout (hb_subset_input_t *subset_input,
+ hb_bool_t drop_layout)
+{
+ subset_input->drop_layout = drop_layout;
+}
+
+HB_EXTERN hb_bool_t
+hb_subset_input_get_drop_layout (hb_subset_input_t *subset_input)
{
- return &subset_input->drop_ot_layout;
+ return subset_input->drop_layout;
}
hb_subset_plan_t *plan = hb_object_create<hb_subset_plan_t> ();
plan->drop_hints = input->drop_hints;
- plan->drop_ot_layout = input->drop_ot_layout;
+ plan->drop_layout = input->drop_layout;
plan->unicodes = hb_set_create();
plan->glyphs.init();
plan->source = hb_face_reference (face);
_populate_gids_to_retain (face,
input->unicodes,
- !plan->drop_ot_layout,
+ !plan->drop_layout,
plan->unicodes,
plan->codepoint_to_glyph,
&plan->glyphs);
hb_object_header_t header;
ASSERT_POD ();
- hb_bool_t drop_hints;
- hb_bool_t drop_ot_layout;
+ bool drop_hints : 1;
+ bool drop_layout : 1;
// For each cp that we'd like to retain maps to the corresponding gid.
hb_set_t *unicodes;
hb_face_t *source;
hb_face_t *dest;
- inline hb_bool_t
+ inline bool
new_gid_for_codepoint (hb_codepoint_t codepoint,
hb_codepoint_t *new_gid) const
{
return new_gid_for_old_gid (old_gid, new_gid);
}
- inline hb_bool_t
+ inline bool
new_gid_for_old_gid (hb_codepoint_t old_gid,
hb_codepoint_t *new_gid) const
{
return true;
}
- inline hb_bool_t
+ inline bool
add_table (hb_tag_t tag,
hb_blob_t *contents)
{
case HB_TAG ('G', 'D', 'E', 'F'): /* temporary */
case HB_TAG ('G', 'P', 'O', 'S'): /* temporary */
case HB_TAG ('G', 'S', 'U', 'B'): /* temporary */
- return plan->drop_ot_layout;
+ return plan->drop_layout;
// Drop these tables below by default, list pulled
// from fontTools:
case HB_TAG ('B', 'A', 'S', 'E'):
HB_EXTERN hb_set_t *
hb_subset_input_glyph_set (hb_subset_input_t *subset_input);
-HB_EXTERN hb_bool_t *
-hb_subset_input_drop_hints (hb_subset_input_t *subset_input);
+HB_EXTERN void
+hb_subset_input_set_drop_hints (hb_subset_input_t *subset_input,
+ hb_bool_t drop_hints);
+HB_EXTERN hb_bool_t
+hb_subset_input_get_drop_hints (hb_subset_input_t *subset_input);
-HB_EXTERN hb_bool_t *
-hb_subset_input_drop_ot_layout (hb_subset_input_t *subset_input);
+HB_EXTERN void
+hb_subset_input_set_drop_layout (hb_subset_input_t *subset_input,
+ hb_bool_t drop_layout);
+HB_EXTERN hb_bool_t
+hb_subset_input_get_drop_layout (hb_subset_input_t *subset_input);
/* hb_subset() */
hb_set_t *unicodes;
hb_set_t *glyphs;
- hb_bool_t drop_hints;
- hb_bool_t drop_ot_layout;
+ bool drop_hints : 1;
+ bool drop_layout : 1;
/* TODO
*
* features
hb_subset_input_t *input = hb_subset_test_create_input (codepoints);
hb_set_destroy (codepoints);
- *hb_subset_input_drop_ot_layout (input) = false;
+ hb_subset_input_set_drop_layout (input, false);
hb_face_t *face_subset = hb_subset_test_create_subset (face_fil, input);
hb_subset_input_t *input = hb_subset_test_create_input (codepoints);
hb_set_destroy (codepoints);
- *hb_subset_input_drop_ot_layout (input) = true;
+ hb_subset_input_set_drop_layout (input, true);
hb_face_t *face_subset = hb_subset_test_create_subset (face_fil, input);
hb_set_add (codepoints, 'a');
hb_set_add (codepoints, 'c');
input = hb_subset_test_create_input (codepoints);
- *hb_subset_input_drop_hints(input) = true;
+ hb_subset_input_set_drop_hints (input, true);
face_abc_subset = hb_subset_test_create_subset (face_abc, input);
hb_set_destroy (codepoints);
hb_face_t *face_generated_subset;
hb_set_add (codepoints, 0x1fc);
input = hb_subset_test_create_input (codepoints);
- *hb_subset_input_drop_hints(input) = true;
+ hb_subset_input_set_drop_hints (input, true);
face_generated_subset = hb_subset_test_create_subset (face_components, input);
hb_set_destroy (codepoints);
}
hb_subset_input_t *input = hb_subset_test_create_input (codepoints);
- *hb_subset_input_drop_hints(input) = true;
+ hb_subset_input_set_drop_hints (input, true);
hb_set_destroy (codepoints);
hb_face_t *face_subset = hb_subset_test_create_subset (face, input);
const hb_codepoint_t text[],
int text_length,
bool drop_hints,
- bool drop_ot_layout)
+ bool drop_layout)
{
hb_subset_input_t *input = hb_subset_input_create_or_fail ();
- *hb_subset_input_drop_hints (input) = drop_hints;
- *hb_subset_input_drop_ot_layout (input) = drop_ot_layout;
+ hb_subset_input_set_drop_hints (input, drop_hints);
+ hb_subset_input_set_drop_layout (input, drop_layout);
hb_set_t *codepoints = hb_subset_input_unicode_set (input);
for (int i = 0; i < text_length; i++)
{
for (unsigned int drop_hints = 0; drop_hints < 2; drop_hints++)
{
- for (unsigned int drop_ot_layout = 0; drop_ot_layout < 2; drop_ot_layout++)
+ for (unsigned int drop_layout = 0; drop_layout < 2; drop_layout++)
{
trySubset (face, text, text_length,
- (bool) drop_hints, (bool) drop_ot_layout);
+ (bool) drop_hints, (bool) drop_layout);
}
}
}
#include "main-font-text.hh"
#include "hb-subset.h"
-#include "hb-subset.hh" /* XXX */
/*
* Command line interface to the harfbuzz font subsetter.
void finish (const font_options_t *font_opts)
{
- input->drop_hints = subset_options.drop_hints;
+ hb_subset_input_set_drop_hints (input, subset_options.drop_hints);
hb_face_t *face = hb_font_get_face (font);