updated for version 7.3.1220
Problem: MS-Windows: When using wide font italic and bold are not included.
Solution: Support wide-bold, wide-italic and wide-bold-italic. (Ken Takata,
Taro Muraoka)
This commit is contained in:
37
src/gui.c
37
src/gui.c
@ -410,6 +410,14 @@ gui_init_check()
|
|||||||
gui.fontset = NOFONTSET;
|
gui.fontset = NOFONTSET;
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef FEAT_MBYTE
|
||||||
|
gui.wide_font = NOFONT;
|
||||||
|
# ifndef FEAT_GUI_GTK
|
||||||
|
gui.wide_bold_font = NOFONT;
|
||||||
|
gui.wide_ital_font = NOFONT;
|
||||||
|
gui.wide_boldital_font = NOFONT;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_MENU
|
#ifdef FEAT_MENU
|
||||||
# ifndef FEAT_GUI_GTK
|
# ifndef FEAT_GUI_GTK
|
||||||
@ -1012,6 +1020,11 @@ gui_get_wide_font()
|
|||||||
gui.wide_font = font;
|
gui.wide_font = font;
|
||||||
# ifdef FEAT_GUI_MSWIN
|
# ifdef FEAT_GUI_MSWIN
|
||||||
gui_mch_wide_font_changed();
|
gui_mch_wide_font_changed();
|
||||||
|
# else
|
||||||
|
/*
|
||||||
|
* TODO: setup wide_bold_font, wide_ital_font and wide_boldital_font to
|
||||||
|
* support those fonts for 'guifontwide'.
|
||||||
|
*/
|
||||||
# endif
|
# endif
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@ -2180,6 +2193,9 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
|
|||||||
guicolor_T sp_color;
|
guicolor_T sp_color;
|
||||||
#if !defined(MSWIN16_FASTTEXT) && !defined(FEAT_GUI_GTK)
|
#if !defined(MSWIN16_FASTTEXT) && !defined(FEAT_GUI_GTK)
|
||||||
GuiFont font = NOFONT;
|
GuiFont font = NOFONT;
|
||||||
|
# ifdef FEAT_MBYTE
|
||||||
|
GuiFont wide_font = NOFONT;
|
||||||
|
# endif
|
||||||
# ifdef FEAT_XFONTSET
|
# ifdef FEAT_XFONTSET
|
||||||
GuiFontset fontset = NOFONTSET;
|
GuiFontset fontset = NOFONTSET;
|
||||||
# endif
|
# endif
|
||||||
@ -2269,6 +2285,23 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
font = gui.norm_font;
|
font = gui.norm_font;
|
||||||
|
|
||||||
|
# ifdef FEAT_MBYTE
|
||||||
|
/*
|
||||||
|
* Choose correct wide_font by font. wide_font should be set with font
|
||||||
|
* at same time in above block. But it will make many "ifdef" nasty
|
||||||
|
* blocks. So we do it here.
|
||||||
|
*/
|
||||||
|
if (font == gui.boldital_font && gui.wide_boldital_font)
|
||||||
|
wide_font = gui.wide_boldital_font;
|
||||||
|
else if (font == gui.bold_font && gui.wide_bold_font)
|
||||||
|
wide_font = gui.wide_bold_font;
|
||||||
|
else if (font == gui.ital_font && gui.wide_ital_font)
|
||||||
|
wide_font = gui.wide_ital_font;
|
||||||
|
else if (font == gui.norm_font && gui.wide_font)
|
||||||
|
wide_font = gui.wide_font;
|
||||||
|
# endif
|
||||||
|
|
||||||
}
|
}
|
||||||
# ifdef FEAT_XFONTSET
|
# ifdef FEAT_XFONTSET
|
||||||
if (fontset != NOFONTSET)
|
if (fontset != NOFONTSET)
|
||||||
@ -2407,7 +2440,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
|
|||||||
# ifdef FEAT_XFONTSET
|
# ifdef FEAT_XFONTSET
|
||||||
&& fontset == NOFONTSET
|
&& fontset == NOFONTSET
|
||||||
# endif
|
# endif
|
||||||
&& gui.wide_font != NOFONT)
|
&& wide_font != NOFONT)
|
||||||
curr_wide = TRUE;
|
curr_wide = TRUE;
|
||||||
else
|
else
|
||||||
curr_wide = FALSE;
|
curr_wide = FALSE;
|
||||||
@ -2441,7 +2474,7 @@ gui_outstr_nowrap(s, len, flags, fg, bg, back)
|
|||||||
if (thislen > 0)
|
if (thislen > 0)
|
||||||
{
|
{
|
||||||
if (prev_wide)
|
if (prev_wide)
|
||||||
gui_mch_set_font(gui.wide_font);
|
gui_mch_set_font(wide_font);
|
||||||
gui_mch_draw_string(gui.row, scol, s + start, thislen,
|
gui_mch_draw_string(gui.row, scol, s + start, thislen,
|
||||||
draw_flags);
|
draw_flags);
|
||||||
if (prev_wide)
|
if (prev_wide)
|
||||||
|
|||||||
@ -311,7 +311,12 @@ typedef struct Gui
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_MBYTE
|
#ifdef FEAT_MBYTE
|
||||||
GuiFont wide_font; /* 'guifontwide' font */
|
GuiFont wide_font; /* Normal 'guifontwide' font */
|
||||||
|
# ifndef FEAT_GUI_GTK
|
||||||
|
GuiFont wide_bold_font; /* Bold 'guifontwide' font */
|
||||||
|
GuiFont wide_ital_font; /* Italic 'guifontwide' font */
|
||||||
|
GuiFont wide_boldital_font; /* Bold-Italic 'guifontwide' font */
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_XFONTSET
|
#ifdef FEAT_XFONTSET
|
||||||
GuiFontset fontset; /* set of fonts for multi-byte chars */
|
GuiFontset fontset; /* set of fonts for multi-byte chars */
|
||||||
|
|||||||
@ -3123,9 +3123,43 @@ update_im_font()
|
|||||||
void
|
void
|
||||||
gui_mch_wide_font_changed()
|
gui_mch_wide_font_changed()
|
||||||
{
|
{
|
||||||
|
# ifndef MSWIN16_FASTTEXT
|
||||||
|
LOGFONT lf;
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifdef FEAT_MBYTE_IME
|
# ifdef FEAT_MBYTE_IME
|
||||||
update_im_font();
|
update_im_font();
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifndef MSWIN16_FASTTEXT
|
||||||
|
gui_mch_free_font(gui.wide_ital_font);
|
||||||
|
gui.wide_ital_font = NOFONT;
|
||||||
|
gui_mch_free_font(gui.wide_bold_font);
|
||||||
|
gui.wide_bold_font = NOFONT;
|
||||||
|
gui_mch_free_font(gui.wide_boldital_font);
|
||||||
|
gui.wide_boldital_font = NOFONT;
|
||||||
|
|
||||||
|
if (gui.wide_font
|
||||||
|
&& GetObject((HFONT)gui.wide_font, sizeof(lf), &lf))
|
||||||
|
{
|
||||||
|
if (!lf.lfItalic)
|
||||||
|
{
|
||||||
|
lf.lfItalic = TRUE;
|
||||||
|
gui.wide_ital_font = get_font_handle(&lf);
|
||||||
|
lf.lfItalic = FALSE;
|
||||||
|
}
|
||||||
|
if (lf.lfWeight < FW_BOLD)
|
||||||
|
{
|
||||||
|
lf.lfWeight = FW_BOLD;
|
||||||
|
gui.wide_bold_font = get_font_handle(&lf);
|
||||||
|
if (!lf.lfItalic)
|
||||||
|
{
|
||||||
|
lf.lfItalic = TRUE;
|
||||||
|
gui.wide_boldital_font = get_font_handle(&lf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -728,6 +728,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1220,
|
||||||
/**/
|
/**/
|
||||||
1219,
|
1219,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user