Skip to content

Commit 753ee6b

Browse files
committed
Merge branch 'vim73-kaoriya-win64-20121206' into kaoriya
2 parents a3233d3 + 871c5b3 commit 753ee6b

File tree

4 files changed

+45
-1
lines changed

4 files changed

+45
-1
lines changed

src/gui.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,9 @@ gui_get_wide_font()
10021002
else
10031003
#endif
10041004
gui.wide_font = font;
1005+
#ifdef FEAT_GUI_MSWIN
1006+
gui_mch_wide_font_changed();
1007+
#endif
10051008
return OK;
10061009
}
10071010
#endif

src/gui_w48.c

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,15 @@ static void TrackUserActivity __ARGS((UINT uMsg));
324324

325325
/*
326326
* For control IME.
327+
*
328+
* These LOGFONT used for IME.
327329
*/
328330
#ifdef FEAT_MBYTE
329331
# ifdef USE_IM_CONTROL
332+
/* holds LOGFONT for 'guifontwide' if available, otherwise 'guifont' */
330333
static LOGFONT norm_logfont;
334+
/* holds LOGFONT for 'guifont' always. */
335+
static LOGFONT sub_logfont;
331336
# endif
332337
#endif
333338

@@ -3084,6 +3089,39 @@ logfont2name(LOGFONT lf)
30843089
return res;
30853090
}
30863091

3092+
3093+
#ifdef FEAT_MBYTE_IME
3094+
/*
3095+
* Set correct LOGFONT to IME. Use 'guifontwide' if available, otherwise use
3096+
* 'guifont'
3097+
*/
3098+
static void
3099+
update_im_font()
3100+
{
3101+
LOGFONT lf_wide;
3102+
3103+
if (p_guifontwide != NULL && *p_guifontwide != NUL
3104+
&& get_logfont(&lf_wide, p_guifontwide, NULL, TRUE) == OK)
3105+
norm_logfont = lf_wide;
3106+
else
3107+
norm_logfont = sub_logfont;
3108+
im_set_font(&norm_logfont);
3109+
}
3110+
#endif
3111+
3112+
#ifdef FEAT_MBYTE
3113+
/*
3114+
* Handler of gui.wide_font (p_guifontwide) changed notification.
3115+
*/
3116+
void
3117+
gui_mch_wide_font_changed()
3118+
{
3119+
#ifdef FEAT_MBYTE_IME
3120+
update_im_font();
3121+
#endif
3122+
}
3123+
#endif
3124+
30873125
/*
30883126
* Initialise vim to use the font with the given name.
30893127
* Return FAIL if the font could not be loaded, OK otherwise.
@@ -3106,9 +3144,10 @@ gui_mch_init_font(char_u *font_name, int fontset)
31063144
font_name = lf.lfFaceName;
31073145
#if defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME)
31083146
norm_logfont = lf;
3147+
sub_logfont = lf;
31093148
#endif
31103149
#ifdef FEAT_MBYTE_IME
3111-
im_set_font(&lf);
3150+
update_im_font();
31123151
#endif
31133152
gui_mch_free_font(gui.norm_font);
31143153
gui.norm_font = font;

src/proto/gui_w16.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ void gui_mch_delete_lines __ARGS((int row, int num_lines));
5050
void gui_mch_insert_lines __ARGS((int row, int num_lines));
5151
void gui_mch_exit __ARGS((int rc));
5252
int gui_mch_init_font __ARGS((char_u *font_name, int fontset));
53+
void gui_mch_wide_font_changed __ARGS((void));
5354
int gui_mch_maximized __ARGS((void));
5455
void gui_mch_newfont __ARGS((void));
5556
void gui_mch_settitle __ARGS((char_u *title, char_u *icon));

src/proto/gui_w32.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ void gui_mch_delete_lines __ARGS((int row, int num_lines));
5050
void gui_mch_insert_lines __ARGS((int row, int num_lines));
5151
void gui_mch_exit __ARGS((int rc));
5252
int gui_mch_init_font __ARGS((char_u *font_name, int fontset));
53+
void gui_mch_wide_font_changed __ARGS((void));
5354
int gui_mch_maximized __ARGS((void));
5455
void gui_mch_newfont __ARGS((void));
5556
void gui_mch_settitle __ARGS((char_u *title, char_u *icon));

0 commit comments

Comments
 (0)