From: nerdopolis Date: Sat, 17 Jun 2023 03:18:07 +0000 (-0400) Subject: label-freetype: Fix Uncrustify X-Git-Tag: 23.51.283~25^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fmerge-requests%2F239%2Fhead;p=thirdparty%2Fplymouth.git label-freetype: Fix Uncrustify --- diff --git a/src/plugins/controls/label-freetype/plugin.c b/src/plugins/controls/label-freetype/plugin.c index 79c55d81..0fbf0945 100644 --- a/src/plugins/controls/label-freetype/plugin.c +++ b/src/plugins/controls/label-freetype/plugin.c @@ -156,21 +156,23 @@ static FT_Int width_of_line (ply_label_plugin_control_t *label, const char *text) { + FT_Error error; FT_Int width = 0; FT_Int left_bearing = 0; while (*text != '\0' && *text != '\n') { - if(FT_Load_Char (label->face, *text, FT_LOAD_RENDER | FT_LOAD_TARGET_LIGHT)) - continue; + error = FT_Load_Char (label->face, *text, FT_LOAD_RENDER | FT_LOAD_TARGET_LIGHT); - width += label->face->glyph->advance.x >> 6; - left_bearing = label->face->glyph->bitmap_left; - /* We don't "go back" when drawing, so when left bearing is - * negative (like for 'j'), we simply add to the width. */ - if (left_bearing < 0) - width += -left_bearing; + if (!error) { + width += label->face->glyph->advance.x >> 6; + left_bearing = label->face->glyph->bitmap_left; + /* We don't "go back" when drawing, so when left bearing is + * negative (like for 'j'), we simply add to the width. */ + if (left_bearing < 0) + width += -left_bearing; - ++text; + ++text; + } } return width;