Karsten Hopp 1c29ce
To: vim_dev@googlegroups.com
Karsten Hopp 1c29ce
Subject: Patch 7.3.782
Karsten Hopp 1c29ce
Fcc: outbox
Karsten Hopp 1c29ce
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 1c29ce
Mime-Version: 1.0
Karsten Hopp 1c29ce
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 1c29ce
Content-Transfer-Encoding: 8bit
Karsten Hopp 1c29ce
------------
Karsten Hopp 1c29ce
Karsten Hopp 1c29ce
Patch 7.3.782
Karsten Hopp 1c29ce
Problem:    Windows: IME composition may use a wrong font.
Karsten Hopp 1c29ce
Solution:   Use 'guifontwide' for IME when it is set. (Taro Muraoka)
Karsten Hopp 1c29ce
Files:	    runtime/doc/options.txt, src/gui.c, src/gui_w48.c,
Karsten Hopp 1c29ce
	    src/proto/gui_w16.pro, src/proto/gui_w32.pro
Karsten Hopp 1c29ce
Karsten Hopp 1c29ce
Karsten Hopp 1c29ce
*** ../vim-7.3.781/runtime/doc/options.txt	2012-08-15 16:20:59.000000000 +0200
Karsten Hopp 1c29ce
--- runtime/doc/options.txt	2013-01-23 18:24:48.000000000 +0100
Karsten Hopp 1c29ce
***************
Karsten Hopp 1c29ce
*** 3518,3523 ****
Karsten Hopp 1c29ce
--- 3560,3569 ----
Karsten Hopp 1c29ce
  	to set 'guifontwide' at all unless you want to override the choice
Karsten Hopp 1c29ce
  	made by Pango/Xft.
Karsten Hopp 1c29ce
  
Karsten Hopp 1c29ce
+ 	Windows +multibyte only:		*guifontwide_win_mbyte*
Karsten Hopp 1c29ce
+ 
Karsten Hopp 1c29ce
+ 	If set and vaild, 'guifontwide' is used for IME instead of 'guifont'.
Karsten Hopp 1c29ce
+ 
Karsten Hopp 1c29ce
  						*'guiheadroom'* *'ghr'*
Karsten Hopp 1c29ce
  'guiheadroom' 'ghr'	number	(default 50)
Karsten Hopp 1c29ce
  			global
Karsten Hopp 1c29ce
*** ../vim-7.3.781/src/gui.c	2013-01-23 17:43:52.000000000 +0100
Karsten Hopp 1c29ce
--- src/gui.c	2013-01-23 18:24:48.000000000 +0100
Karsten Hopp 1c29ce
***************
Karsten Hopp 1c29ce
*** 1002,1007 ****
Karsten Hopp 1c29ce
--- 1002,1010 ----
Karsten Hopp 1c29ce
      else
Karsten Hopp 1c29ce
  #endif
Karsten Hopp 1c29ce
  	gui.wide_font = font;
Karsten Hopp 1c29ce
+ #ifdef FEAT_GUI_MSWIN
Karsten Hopp 1c29ce
+     gui_mch_wide_font_changed();
Karsten Hopp 1c29ce
+ #endif
Karsten Hopp 1c29ce
      return OK;
Karsten Hopp 1c29ce
  }
Karsten Hopp 1c29ce
  #endif
Karsten Hopp 1c29ce
*** ../vim-7.3.781/src/gui_w48.c	2012-12-16 12:50:33.000000000 +0100
Karsten Hopp 1c29ce
--- src/gui_w48.c	2013-01-23 18:32:45.000000000 +0100
Karsten Hopp 1c29ce
***************
Karsten Hopp 1c29ce
*** 323,332 ****
Karsten Hopp 1c29ce
--- 323,337 ----
Karsten Hopp 1c29ce
  
Karsten Hopp 1c29ce
  /*
Karsten Hopp 1c29ce
   * For control IME.
Karsten Hopp 1c29ce
+  *
Karsten Hopp 1c29ce
+  * These LOGFONT used for IME.
Karsten Hopp 1c29ce
   */
Karsten Hopp 1c29ce
  #ifdef FEAT_MBYTE
Karsten Hopp 1c29ce
  # ifdef USE_IM_CONTROL
Karsten Hopp 1c29ce
+ /* holds LOGFONT for 'guifontwide' if available, otherwise 'guifont' */
Karsten Hopp 1c29ce
  static LOGFONT norm_logfont;
Karsten Hopp 1c29ce
+ /* holds LOGFONT for 'guifont' always. */
Karsten Hopp 1c29ce
+ static LOGFONT sub_logfont;
Karsten Hopp 1c29ce
  # endif
Karsten Hopp 1c29ce
  #endif
Karsten Hopp 1c29ce
  
Karsten Hopp 1c29ce
***************
Karsten Hopp 1c29ce
*** 3090,3095 ****
Karsten Hopp 1c29ce
--- 3095,3133 ----
Karsten Hopp 1c29ce
      return res;
Karsten Hopp 1c29ce
  }
Karsten Hopp 1c29ce
  
Karsten Hopp 1c29ce
+ 
Karsten Hopp 1c29ce
+ #ifdef FEAT_MBYTE_IME
Karsten Hopp 1c29ce
+ /*
Karsten Hopp 1c29ce
+  * Set correct LOGFONT to IME.  Use 'guifontwide' if available, otherwise use
Karsten Hopp 1c29ce
+  * 'guifont'
Karsten Hopp 1c29ce
+  */
Karsten Hopp 1c29ce
+     static void
Karsten Hopp 1c29ce
+ update_im_font()
Karsten Hopp 1c29ce
+ {
Karsten Hopp 1c29ce
+     LOGFONT	lf_wide;
Karsten Hopp 1c29ce
+ 
Karsten Hopp 1c29ce
+     if (p_guifontwide != NULL && *p_guifontwide != NUL
Karsten Hopp 1c29ce
+ 	    && get_logfont(&lf_wide, p_guifontwide, NULL, TRUE) == OK)
Karsten Hopp 1c29ce
+ 	norm_logfont = lf_wide;
Karsten Hopp 1c29ce
+     else
Karsten Hopp 1c29ce
+ 	norm_logfont = sub_logfont;
Karsten Hopp 1c29ce
+     im_set_font(&norm_logfont);
Karsten Hopp 1c29ce
+ }
Karsten Hopp 1c29ce
+ #endif
Karsten Hopp 1c29ce
+ 
Karsten Hopp 1c29ce
+ #ifdef FEAT_MBYTE
Karsten Hopp 1c29ce
+ /*
Karsten Hopp 1c29ce
+  * Handler of gui.wide_font (p_guifontwide) changed notification.
Karsten Hopp 1c29ce
+  */
Karsten Hopp 1c29ce
+     void
Karsten Hopp 1c29ce
+ gui_mch_wide_font_changed()
Karsten Hopp 1c29ce
+ {
Karsten Hopp 1c29ce
+ # ifdef FEAT_MBYTE_IME
Karsten Hopp 1c29ce
+     update_im_font();
Karsten Hopp 1c29ce
+ # endif
Karsten Hopp 1c29ce
+ }
Karsten Hopp 1c29ce
+ #endif
Karsten Hopp 1c29ce
+ 
Karsten Hopp 1c29ce
  /*
Karsten Hopp 1c29ce
   * Initialise vim to use the font with the given name.
Karsten Hopp 1c29ce
   * Return FAIL if the font could not be loaded, OK otherwise.
Karsten Hopp 1c29ce
***************
Karsten Hopp 1c29ce
*** 3112,3120 ****
Karsten Hopp 1c29ce
  	font_name = lf.lfFaceName;
Karsten Hopp 1c29ce
  #if defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME)
Karsten Hopp 1c29ce
      norm_logfont = lf;
Karsten Hopp 1c29ce
  #endif
Karsten Hopp 1c29ce
  #ifdef FEAT_MBYTE_IME
Karsten Hopp 1c29ce
!     im_set_font(&lf);
Karsten Hopp 1c29ce
  #endif
Karsten Hopp 1c29ce
      gui_mch_free_font(gui.norm_font);
Karsten Hopp 1c29ce
      gui.norm_font = font;
Karsten Hopp 1c29ce
--- 3150,3159 ----
Karsten Hopp 1c29ce
  	font_name = lf.lfFaceName;
Karsten Hopp 1c29ce
  #if defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME)
Karsten Hopp 1c29ce
      norm_logfont = lf;
Karsten Hopp 1c29ce
+     sub_logfont = lf;
Karsten Hopp 1c29ce
  #endif
Karsten Hopp 1c29ce
  #ifdef FEAT_MBYTE_IME
Karsten Hopp 1c29ce
!     update_im_font();
Karsten Hopp 1c29ce
  #endif
Karsten Hopp 1c29ce
      gui_mch_free_font(gui.norm_font);
Karsten Hopp 1c29ce
      gui.norm_font = font;
Karsten Hopp 1c29ce
*** ../vim-7.3.781/src/proto/gui_w16.pro	2011-01-17 20:08:03.000000000 +0100
Karsten Hopp 1c29ce
--- src/proto/gui_w16.pro	2013-01-23 18:24:48.000000000 +0100
Karsten Hopp 1c29ce
***************
Karsten Hopp 1c29ce
*** 50,55 ****
Karsten Hopp 1c29ce
--- 50,56 ----
Karsten Hopp 1c29ce
  void gui_mch_insert_lines __ARGS((int row, int num_lines));
Karsten Hopp 1c29ce
  void gui_mch_exit __ARGS((int rc));
Karsten Hopp 1c29ce
  int gui_mch_init_font __ARGS((char_u *font_name, int fontset));
Karsten Hopp 1c29ce
+ void gui_mch_wide_font_changed __ARGS((void));
Karsten Hopp 1c29ce
  int gui_mch_maximized __ARGS((void));
Karsten Hopp 1c29ce
  void gui_mch_newfont __ARGS((void));
Karsten Hopp 1c29ce
  void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
Karsten Hopp 1c29ce
*** ../vim-7.3.781/src/proto/gui_w32.pro	2011-01-17 20:08:03.000000000 +0100
Karsten Hopp 1c29ce
--- src/proto/gui_w32.pro	2013-01-23 18:24:48.000000000 +0100
Karsten Hopp 1c29ce
***************
Karsten Hopp 1c29ce
*** 50,55 ****
Karsten Hopp 1c29ce
--- 50,56 ----
Karsten Hopp 1c29ce
  void gui_mch_insert_lines __ARGS((int row, int num_lines));
Karsten Hopp 1c29ce
  void gui_mch_exit __ARGS((int rc));
Karsten Hopp 1c29ce
  int gui_mch_init_font __ARGS((char_u *font_name, int fontset));
Karsten Hopp 1c29ce
+ void gui_mch_wide_font_changed __ARGS((void));
Karsten Hopp 1c29ce
  int gui_mch_maximized __ARGS((void));
Karsten Hopp 1c29ce
  void gui_mch_newfont __ARGS((void));
Karsten Hopp 1c29ce
  void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
Karsten Hopp 1c29ce
*** ../vim-7.3.781/src/version.c	2013-01-23 17:43:52.000000000 +0100
Karsten Hopp 1c29ce
--- src/version.c	2013-01-23 18:25:33.000000000 +0100
Karsten Hopp 1c29ce
***************
Karsten Hopp 1c29ce
*** 727,728 ****
Karsten Hopp 1c29ce
--- 727,730 ----
Karsten Hopp 1c29ce
  {   /* Add new patch number below this line */
Karsten Hopp 1c29ce
+ /**/
Karsten Hopp 1c29ce
+     782,
Karsten Hopp 1c29ce
  /**/
Karsten Hopp 1c29ce
Karsten Hopp 1c29ce
-- 
Karsten Hopp 1c29ce
"A mouse can be just as dangerous as a bullet or a bomb."
Karsten Hopp 1c29ce
             (US Representative Lamar Smith, R-Texas)
Karsten Hopp 1c29ce
Karsten Hopp 1c29ce
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 1c29ce
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 1c29ce
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 1c29ce
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///