Simplify style handling.

This commit is contained in:
Michael Drake 2014-08-01 12:26:57 +01:00
parent 6b7e073c58
commit ac067e3238
1 changed files with 8 additions and 15 deletions

View File

@ -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