From ac067e3238a42ecae96f5bdb712e80f754f21044 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 1 Aug 2014 12:26:57 +0100 Subject: Simplify style handling. --- framebuffer/font_internal.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'framebuffer') diff --git a/framebuffer/font_internal.c b/framebuffer/font_internal.c index 23ef42191..bc17ea595 100644 --- a/framebuffer/font_internal.c +++ b/framebuffer/font_internal.c @@ -197,21 +197,14 @@ bool fb_font_finalise(void) enum fb_font_style fb_get_font_style(const plot_font_style_t *fstyle) { - if (fstyle->weight >= 700) { - if ((fstyle->flags & FONTF_ITALIC) || - (fstyle->flags & FONTF_OBLIQUE)) { - return FB_BOLD_ITALIC; - } else { - return FB_BOLD; - } - } else { - if ((fstyle->flags & FONTF_ITALIC) || - (fstyle->flags & FONTF_OBLIQUE)) { - return FB_ITALIC; - } else { - return FB_REGULAR; - } - } + enum fb_font_style style = FB_REGULAR; + + if (fstyle->weight >= 700) + style |= FB_BOLD; + if ((fstyle->flags & FONTF_ITALIC) || (fstyle->flags & FONTF_OBLIQUE)) + style |= FB_ITALIC; + + return style; } int -- cgit v1.2.3