@@ -410,6 +410,14 @@ gui_init_check()
410410 gui .fontset = NOFONTSET ;
411411# endif
412412#endif
413+ #ifdef FEAT_MBYTE
414+ gui .wide_font = NOFONT ;
415+ # ifndef FEAT_GUI_GTK
416+ gui .wide_bold_font = NOFONT ;
417+ gui .wide_ital_font = NOFONT ;
418+ gui .wide_boldital_font = NOFONT ;
419+ # endif
420+ #endif
413421
414422#ifdef FEAT_MENU
415423# ifndef FEAT_GUI_GTK
@@ -1012,6 +1020,11 @@ gui_get_wide_font()
10121020 gui .wide_font = font ;
10131021# ifdef FEAT_GUI_MSWIN
10141022 gui_mch_wide_font_changed ();
1023+ # else
1024+ /*
1025+ * TODO: setup wide_bold_font, wide_ital_font and wide_boldital_font to
1026+ * support those fonts for 'guifontwide'.
1027+ */
10151028# endif
10161029 return OK ;
10171030}
@@ -2180,6 +2193,9 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
21802193 guicolor_T sp_color ;
21812194#if !defined(MSWIN16_FASTTEXT ) && !defined(FEAT_GUI_GTK )
21822195 GuiFont font = NOFONT ;
2196+ # ifdef FEAT_MBYTE
2197+ GuiFont wide_font = NOFONT ;
2198+ # endif
21832199# ifdef FEAT_XFONTSET
21842200 GuiFontset fontset = NOFONTSET ;
21852201# endif
@@ -2269,6 +2285,23 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
22692285 }
22702286 else
22712287 font = gui .norm_font ;
2288+
2289+ # ifdef FEAT_MBYTE
2290+ /*
2291+ * Choose correct wide_font by font. wide_font should be set with font
2292+ * at same time in above block. But it will make many "ifdef" nasty
2293+ * blocks. So we do it here.
2294+ */
2295+ if (font == gui .boldital_font && gui .wide_boldital_font )
2296+ wide_font = gui .wide_boldital_font ;
2297+ else if (font == gui .bold_font && gui .wide_bold_font )
2298+ wide_font = gui .wide_bold_font ;
2299+ else if (font == gui .ital_font && gui .wide_ital_font )
2300+ wide_font = gui .wide_ital_font ;
2301+ else if (font == gui .norm_font && gui .wide_font )
2302+ wide_font = gui .wide_font ;
2303+ # endif
2304+
22722305 }
22732306# ifdef FEAT_XFONTSET
22742307 if (fontset != NOFONTSET )
@@ -2407,7 +2440,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
24072440# ifdef FEAT_XFONTSET
24082441 && fontset == NOFONTSET
24092442# endif
2410- && gui . wide_font != NOFONT )
2443+ && wide_font != NOFONT )
24112444 curr_wide = TRUE;
24122445 else
24132446 curr_wide = FALSE;
@@ -2441,7 +2474,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
24412474 if (thislen > 0 )
24422475 {
24432476 if (prev_wide )
2444- gui_mch_set_font (gui . wide_font );
2477+ gui_mch_set_font (wide_font );
24452478 gui_mch_draw_string (gui .row , scol , s + start , thislen ,
24462479 draw_flags );
24472480 if (prev_wide )
0 commit comments