mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-21 06:51:01 +01:00
[util] Simplify shape-consumer by removing buffer arg
This commit is contained in:
1 parent
e014c6fa2d
commit
fc0339eef0
4 files changed
+6
-11
No files matched your search
@@ -48,13 +48,12 @@ struct shape_closure_consumer_t
|
||||
this);
|
||||
}
|
||||
|
||||
void init (hb_buffer_t *buffer_,
|
||||
const font_options_t *font_opts)
|
||||
void init (const font_options_t *font_opts)
|
||||
{
|
||||
glyphs = hb_set_create ();
|
||||
font = hb_font_reference (font_opts->get_font ());
|
||||
failed = false;
|
||||
buffer = hb_buffer_reference (buffer_);
|
||||
buffer = hb_buffer_create ();
|
||||
}
|
||||
void consume_line (const char *text,
|
||||
unsigned int text_len,
|
||||
|
||||
+1
-2
@@ -42,8 +42,7 @@ struct subset_consumer_t
|
||||
subset_options.add_options (parser);
|
||||
}
|
||||
|
||||
void init (hb_buffer_t *buffer_,
|
||||
const font_options_t *font_opts)
|
||||
void init (const font_options_t *font_opts)
|
||||
{
|
||||
face = hb_face_reference (hb_font_get_face (font_opts->get_font ()));
|
||||
input = hb_subset_input_reference (subset_options.get_input ());
|
||||
|
||||
@@ -78,9 +78,7 @@ struct main_font_text_t
|
||||
if (!input.text && !input.text_file)
|
||||
input.text_file = g_strdup ("-");
|
||||
|
||||
hb_buffer_t *buffer = hb_buffer_create ();
|
||||
consumer.init (buffer, &font_opts);
|
||||
hb_buffer_destroy (buffer);
|
||||
consumer.init (&font_opts);
|
||||
|
||||
unsigned int text_len;
|
||||
const char *text;
|
||||
|
||||
@@ -40,12 +40,11 @@ struct shape_consumer_t
|
||||
output.add_options (parser);
|
||||
}
|
||||
|
||||
void init (hb_buffer_t *buffer_,
|
||||
const font_options_t *font_opts)
|
||||
void init (const font_options_t *font_opts)
|
||||
{
|
||||
font = hb_font_reference (font_opts->get_font ());
|
||||
failed = false;
|
||||
buffer = hb_buffer_reference (buffer_);
|
||||
buffer = hb_buffer_create ();
|
||||
|
||||
output.init (buffer, font_opts);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user