home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.3 / 7.3.1220 < prev    next >
Encoding:
Internet Message Format  |  2013-06-16  |  5.6 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.1220
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.1220
  11. Problem:    MS-Windows: When using wide font italic and bold are not included.
  12. Solution:   Support wide-bold, wide-italic and wide-bold-italic. (Ken Takata,
  13.         Taro Muraoka)
  14. Files:        src/gui.c, src/gui.h, src/gui_w48.c
  15.  
  16.  
  17. *** ../vim-7.3.1219/src/gui.c    2013-06-12 20:35:46.000000000 +0200
  18. --- src/gui.c    2013-06-17 22:22:49.000000000 +0200
  19. ***************
  20. *** 410,415 ****
  21. --- 410,423 ----
  22.       gui.fontset = NOFONTSET;
  23.   # endif
  24.   #endif
  25. + #ifdef FEAT_MBYTE
  26. +     gui.wide_font = NOFONT;
  27. + # ifndef FEAT_GUI_GTK
  28. +     gui.wide_bold_font = NOFONT;
  29. +     gui.wide_ital_font = NOFONT;
  30. +     gui.wide_boldital_font = NOFONT;
  31. + # endif
  32. + #endif
  33.   
  34.   #ifdef FEAT_MENU
  35.   # ifndef FEAT_GUI_GTK
  36. ***************
  37. *** 1012,1017 ****
  38. --- 1020,1030 ----
  39.       gui.wide_font = font;
  40.   # ifdef FEAT_GUI_MSWIN
  41.       gui_mch_wide_font_changed();
  42. + # else
  43. +     /*
  44. +      * TODO: setup wide_bold_font, wide_ital_font and wide_boldital_font to
  45. +      * support those fonts for 'guifontwide'.
  46. +      */
  47.   # endif
  48.       return OK;
  49.   }
  50. ***************
  51. *** 2180,2185 ****
  52. --- 2193,2201 ----
  53.       guicolor_T    sp_color;
  54.   #if !defined(MSWIN16_FASTTEXT) && !defined(FEAT_GUI_GTK)
  55.       GuiFont    font = NOFONT;
  56. + # ifdef FEAT_MBYTE
  57. +     GuiFont    wide_font = NOFONT;
  58. + # endif
  59.   # ifdef FEAT_XFONTSET
  60.       GuiFontset    fontset = NOFONTSET;
  61.   # endif
  62. ***************
  63. *** 2269,2274 ****
  64. --- 2285,2307 ----
  65.       }
  66.       else
  67.           font = gui.norm_font;
  68. + # ifdef FEAT_MBYTE
  69. +     /*
  70. +      * Choose correct wide_font by font.  wide_font should be set with font
  71. +      * at same time in above block.  But it will make many "ifdef" nasty
  72. +      * blocks.  So we do it here.
  73. +      */
  74. +     if (font == gui.boldital_font && gui.wide_boldital_font)
  75. +         wide_font = gui.wide_boldital_font;
  76. +     else if (font == gui.bold_font && gui.wide_bold_font)
  77. +         wide_font = gui.wide_bold_font;
  78. +     else if (font == gui.ital_font && gui.wide_ital_font)
  79. +         wide_font = gui.wide_ital_font;
  80. +     else if (font == gui.norm_font && gui.wide_font)
  81. +         wide_font = gui.wide_font;
  82. + # endif
  83.       }
  84.   # ifdef FEAT_XFONTSET
  85.       if (fontset != NOFONTSET)
  86. ***************
  87. *** 2407,2413 ****
  88.   #  ifdef FEAT_XFONTSET
  89.               && fontset == NOFONTSET
  90.   #  endif
  91. !             && gui.wide_font != NOFONT)
  92.           curr_wide = TRUE;
  93.           else
  94.           curr_wide = FALSE;
  95. --- 2440,2446 ----
  96.   #  ifdef FEAT_XFONTSET
  97.               && fontset == NOFONTSET
  98.   #  endif
  99. !             && wide_font != NOFONT)
  100.           curr_wide = TRUE;
  101.           else
  102.           curr_wide = FALSE;
  103. ***************
  104. *** 2441,2447 ****
  105.           if (thislen > 0)
  106.           {
  107.               if (prev_wide)
  108. !             gui_mch_set_font(gui.wide_font);
  109.               gui_mch_draw_string(gui.row, scol, s + start, thislen,
  110.                                     draw_flags);
  111.               if (prev_wide)
  112. --- 2474,2480 ----
  113.           if (thislen > 0)
  114.           {
  115.               if (prev_wide)
  116. !             gui_mch_set_font(wide_font);
  117.               gui_mch_draw_string(gui.row, scol, s + start, thislen,
  118.                                     draw_flags);
  119.               if (prev_wide)
  120. *** ../vim-7.3.1219/src/gui.h    2013-01-23 13:40:54.000000000 +0100
  121. --- src/gui.h    2013-06-17 22:22:49.000000000 +0200
  122. ***************
  123. *** 311,317 ****
  124.   # endif
  125.   #endif
  126.   #ifdef FEAT_MBYTE
  127. !     GuiFont    wide_font;        /* 'guifontwide' font */
  128.   #endif
  129.   #ifdef FEAT_XFONTSET
  130.       GuiFontset    fontset;        /* set of fonts for multi-byte chars */
  131. --- 311,322 ----
  132.   # endif
  133.   #endif
  134.   #ifdef FEAT_MBYTE
  135. !     GuiFont    wide_font;        /* Normal 'guifontwide' font */
  136. ! # ifndef FEAT_GUI_GTK
  137. !     GuiFont    wide_bold_font;        /* Bold 'guifontwide' font */
  138. !     GuiFont    wide_ital_font;        /* Italic 'guifontwide' font */
  139. !     GuiFont    wide_boldital_font; /* Bold-Italic 'guifontwide' font */
  140. ! # endif
  141.   #endif
  142.   #ifdef FEAT_XFONTSET
  143.       GuiFontset    fontset;        /* set of fonts for multi-byte chars */
  144. *** ../vim-7.3.1219/src/gui_w48.c    2013-05-06 04:21:35.000000000 +0200
  145. --- src/gui_w48.c    2013-06-17 22:22:49.000000000 +0200
  146. ***************
  147. *** 3123,3131 ****
  148. --- 3123,3165 ----
  149.       void
  150.   gui_mch_wide_font_changed()
  151.   {
  152. + # ifndef MSWIN16_FASTTEXT
  153. +     LOGFONT lf;
  154. + # endif
  155.   # ifdef FEAT_MBYTE_IME
  156.       update_im_font();
  157.   # endif
  158. + # ifndef MSWIN16_FASTTEXT
  159. +     gui_mch_free_font(gui.wide_ital_font);
  160. +     gui.wide_ital_font = NOFONT;
  161. +     gui_mch_free_font(gui.wide_bold_font);
  162. +     gui.wide_bold_font = NOFONT;
  163. +     gui_mch_free_font(gui.wide_boldital_font);
  164. +     gui.wide_boldital_font = NOFONT;
  165. +     if (gui.wide_font
  166. +     && GetObject((HFONT)gui.wide_font, sizeof(lf), &lf))
  167. +     {
  168. +     if (!lf.lfItalic)
  169. +     {
  170. +         lf.lfItalic = TRUE;
  171. +         gui.wide_ital_font = get_font_handle(&lf);
  172. +         lf.lfItalic = FALSE;
  173. +     }
  174. +     if (lf.lfWeight < FW_BOLD)
  175. +     {
  176. +         lf.lfWeight = FW_BOLD;
  177. +         gui.wide_bold_font = get_font_handle(&lf);
  178. +         if (!lf.lfItalic)
  179. +         {
  180. +         lf.lfItalic = TRUE;
  181. +         gui.wide_boldital_font = get_font_handle(&lf);
  182. +         }
  183. +     }
  184. +     }
  185. + # endif
  186.   }
  187.   #endif
  188.   
  189. *** ../vim-7.3.1219/src/version.c    2013-06-17 22:04:34.000000000 +0200
  190. --- src/version.c    2013-06-17 22:24:18.000000000 +0200
  191. ***************
  192. *** 730,731 ****
  193. --- 730,733 ----
  194.   {   /* Add new patch number below this line */
  195. + /**/
  196. +     1220,
  197.   /**/
  198.  
  199. -- 
  200. hundred-and-one symptoms of being an internet addict:
  201. 243. You unsuccessfully try to download a pizza from www.dominos.com.
  202.  
  203.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  204. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  205. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  206.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  207.