[util] Simplify shape-consumer by removing buffer arg
This commit is contained in:
parent
e014c6fa2d
commit
fc0339eef0
|
@ -48,13 +48,12 @@ struct shape_closure_consumer_t
|
||||||
this);
|
this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void init (hb_buffer_t *buffer_,
|
void init (const font_options_t *font_opts)
|
||||||
const font_options_t *font_opts)
|
|
||||||
{
|
{
|
||||||
glyphs = hb_set_create ();
|
glyphs = hb_set_create ();
|
||||||
font = hb_font_reference (font_opts->get_font ());
|
font = hb_font_reference (font_opts->get_font ());
|
||||||
failed = false;
|
failed = false;
|
||||||
buffer = hb_buffer_reference (buffer_);
|
buffer = hb_buffer_create ();
|
||||||
}
|
}
|
||||||
void consume_line (const char *text,
|
void consume_line (const char *text,
|
||||||
unsigned int text_len,
|
unsigned int text_len,
|
||||||
|
|
|
@ -42,8 +42,7 @@ struct subset_consumer_t
|
||||||
subset_options.add_options (parser);
|
subset_options.add_options (parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
void init (hb_buffer_t *buffer_,
|
void init (const font_options_t *font_opts)
|
||||||
const font_options_t *font_opts)
|
|
||||||
{
|
{
|
||||||
face = hb_face_reference (hb_font_get_face (font_opts->get_font ()));
|
face = hb_face_reference (hb_font_get_face (font_opts->get_font ()));
|
||||||
input = hb_subset_input_reference (subset_options.get_input ());
|
input = hb_subset_input_reference (subset_options.get_input ());
|
||||||
|
|
|
@ -78,9 +78,7 @@ struct main_font_text_t
|
||||||
if (!input.text && !input.text_file)
|
if (!input.text && !input.text_file)
|
||||||
input.text_file = g_strdup ("-");
|
input.text_file = g_strdup ("-");
|
||||||
|
|
||||||
hb_buffer_t *buffer = hb_buffer_create ();
|
consumer.init (&font_opts);
|
||||||
consumer.init (buffer, &font_opts);
|
|
||||||
hb_buffer_destroy (buffer);
|
|
||||||
|
|
||||||
unsigned int text_len;
|
unsigned int text_len;
|
||||||
const char *text;
|
const char *text;
|
||||||
|
|
|
@ -40,12 +40,11 @@ struct shape_consumer_t
|
||||||
output.add_options (parser);
|
output.add_options (parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
void init (hb_buffer_t *buffer_,
|
void init (const font_options_t *font_opts)
|
||||||
const font_options_t *font_opts)
|
|
||||||
{
|
{
|
||||||
font = hb_font_reference (font_opts->get_font ());
|
font = hb_font_reference (font_opts->get_font ());
|
||||||
failed = false;
|
failed = false;
|
||||||
buffer = hb_buffer_reference (buffer_);
|
buffer = hb_buffer_create ();
|
||||||
|
|
||||||
output.init (buffer, font_opts);
|
output.init (buffer, font_opts);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue