- BC_FontEntry *font;
- font = TitleMain::get_font(font_name, BC_FONT_ITALIC);
- strcmp(font_name, font->displayname) ? italic->disable() : italic->enable();
- font = TitleMain::get_font(font_name, BC_FONT_BOLD);
- strcmp(font_name, font->displayname) ? bold->disable() : bold->enable();
+ BC_FontEntry *font_nrm = TitleMain::get_font(font_name, 0);
+ BC_FontEntry *font_itl = TitleMain::get_font(font_name, BC_FONT_ITALIC);
+ BC_FontEntry *font_bld = TitleMain::get_font(font_name, BC_FONT_BOLD);
+ BC_FontEntry *font_bit = TitleMain::get_font(font_name, BC_FONT_ITALIC | BC_FONT_BOLD);
+ int has_norm = font_nrm != 0 ? 1 : 0;
+ int has_ital = font_itl != 0 || font_bit != 0 ? 1 : 0;
+ int has_bold = font_bld != 0 || font_bit != 0 ? 1 : 0;
+ if( bold->get_value() ) {
+ if( !has_bold ) bold->update(0);
+ }
+ else {
+ if( !has_norm && has_bold ) bold->update(1);
+ }
+ if( italic->get_value() ) {
+ if( !has_ital ) italic->update(0);
+ }
+ else {
+ if( !has_norm && has_ital ) italic->update(1);
+ }
+ if( has_norm && has_bold ) bold->enable(); else bold->disable();
+ if( has_norm && has_ital ) italic->enable(); else italic->disable();
+ if( update ) {
+ int style = 0;
+ if( bold->get_value() ) style |= BC_FONT_BOLD;
+ if( italic->get_value() ) style |= BC_FONT_ITALIC;
+ client->config.style = style;
+ }