From e157b50345214d804023cb744a2daaa5584278df Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 2 Feb 2022 16:16:57 -0600 Subject: [PATCH] [draw] Remove return value of hb_font_draw_glyph() --- src/hb-draw-glyph.cc | 15 +++++++-------- src/hb-font.h | 8 +++++--- src/main.cc | 6 ++---- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/hb-draw-glyph.cc b/src/hb-draw-glyph.cc index 12141e2e5..5d5136147 100644 --- a/src/hb-draw-glyph.cc +++ b/src/hb-draw-glyph.cc @@ -42,23 +42,22 @@ * Returns: Whether the font had the glyph and the operation completed successfully. * Since: REPLACEME **/ -hb_bool_t -hb_font_draw_glyph (hb_font_t *font, hb_codepoint_t glyph, +void +hb_font_draw_glyph (hb_font_t *font, + hb_codepoint_t glyph, const hb_draw_funcs_t *funcs, void *user_data) { if (unlikely (funcs == &Null (hb_draw_funcs_t) || glyph >= font->face->get_num_glyphs ())) - return false; + return; draw_helper_t draw_helper (funcs, user_data); - if (font->face->table.glyf->get_path (font, glyph, draw_helper)) return true; + if (font->face->table.glyf->get_path (font, glyph, draw_helper)) return; #ifndef HB_NO_CFF - if (font->face->table.cff1->get_path (font, glyph, draw_helper)) return true; - if (font->face->table.cff2->get_path (font, glyph, draw_helper)) return true; + if (font->face->table.cff1->get_path (font, glyph, draw_helper)) return; + if (font->face->table.cff2->get_path (font, glyph, draw_helper)) return; #endif - - return false; } #endif diff --git a/src/hb-font.h b/src/hb-font.h index 99fa5c5af..865ebcc88 100644 --- a/src/hb-font.h +++ b/src/hb-font.h @@ -1056,9 +1056,11 @@ HB_EXTERN void hb_font_set_var_named_instance (hb_font_t *font, unsigned instance_index); -HB_EXTERN hb_bool_t -hb_font_draw_glyph (hb_font_t *font, hb_codepoint_t glyph, - const hb_draw_funcs_t *funcs, void *user_data); +HB_EXTERN void +hb_font_draw_glyph (hb_font_t *font, + hb_codepoint_t glyph, + const hb_draw_funcs_t *funcs, + void *user_data); HB_END_DECLS diff --git a/src/main.cc b/src/main.cc index 67986c8a7..c708a970e 100644 --- a/src/main.cc +++ b/src/main.cc @@ -232,8 +232,7 @@ layered_glyph_dump (hb_font_t *font, hb_draw_funcs_t *funcs, unsigned face_index if (hb_color_get_alpha (color) != 255) fprintf (f, "fill-opacity=\"%.3f\"", (double) hb_color_get_alpha (color) / 255.); fprintf (f, "d=\""); - if (!hb_font_draw_glyph (font, layers[layer].glyph, funcs, &user_data)) - printf ("Failed to decompose layer %d while %d\n", layers[layer].glyph, gid); + hb_font_draw_glyph (font, layers[layer].glyph, funcs, &user_data); fprintf (f, "\"/>\n"); } @@ -272,8 +271,7 @@ dump_glyphs (hb_font_t *font, hb_draw_funcs_t *funcs, unsigned face_index) user_data_t user_data; user_data.ascender = font_extents.ascender; user_data.f = f; - if (!hb_font_draw_glyph (font, gid, funcs, &user_data)) - printf ("Failed to decompose gid: %d\n", gid); + hb_font_draw_glyph (font, gid, funcs, &user_data); fprintf (f, "\"/>"); fclose (f); }