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 / 5.7.011 < prev    next >
Encoding:
Internet Message Format  |  2000-10-06  |  3.2 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 5.7.011 (extra)
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. Patch 5.7.011 (extra)
  8. Problem:    Win32 GUI on NT 5 and Win98: Displaying Hebrew is reversed.
  9. Solution:   Output each character separately, to avoid that Windows reverses
  10.         the text for some fonts. (Ron Aaron)
  11. Files:        src/gui_w32.c
  12.  
  13.  
  14. *** ../vim-5.7.10/src/gui_w32.c    Tue Apr 18 10:36:37 2000
  15. --- src/gui_w32.c    Sat Oct  7 13:38:08 2000
  16. ***************
  17. *** 3401,3406 ****
  18. --- 3401,3456 ----
  19.   
  20.   #define UNIBUFSIZE 2000        /* a big buffer */
  21.   
  22. + #ifdef FEAT_RIGHTLEFT
  23. + /*
  24. +  * What is this for?  In the case where you are using Win98 or Win2K or later,
  25. +  * and you are using a Hebrew font (or Arabic!), Windows does you a favor and
  26. +  * reverses the string sent to the TextOut... family.  This sucks, because we
  27. +  * go to a lot of effort to do the right thing, and there doesn't seem to be a
  28. +  * way to tell Windblows not to do this!
  29. +  *
  30. +  * The short of it is that this 'RevOut' only gets called if you are running
  31. +  * one of the new, "improved" MS OSes, and only if you are running in
  32. +  * 'rightleft' mode.  It makes display take *slightly* longer, but not
  33. +  * noticeably so.
  34. +  */
  35. +     static void
  36. + RevOut( HDC s_hdc,
  37. +     int col,
  38. +     int row,
  39. +     UINT foptions,
  40. +     CONST RECT *pcliprect,
  41. +     LPCTSTR text,
  42. +     UINT len,
  43. +     CONST INT *padding)
  44. + {
  45. +     int        ix;
  46. +     static int    special = -1;
  47. +     if (special == -1)
  48. +     {
  49. +     /* Check windows version: special treatment is needed if it is NT 5 or
  50. +      * Win98 or higher. */
  51. +     if  ((os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
  52. +             && os_version.dwMajorVersion >= 5)
  53. +         || (os_version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS
  54. +             && (os_version.dwMajorVersion > 4
  55. +             || (os_version.dwMajorVersion == 4
  56. +                 && os_version.dwMinorVersion > 0))))
  57. +         special = 1;
  58. +     else
  59. +         special = 0;
  60. +     }
  61. +     if (special)
  62. +     for (ix = 0; ix < len; ++ix)
  63. +         ExtTextOut(s_hdc, col + TEXT_X(ix), row, foptions,
  64. +                         pcliprect, text + ix, 1, padding);
  65. +     else
  66. +     ExtTextOut(s_hdc, col, row, foptions, pcliprect, text, len, padding);
  67. + }
  68. + #endif
  69.       void
  70.   gui_mch_draw_string(
  71.       int        row,
  72. ***************
  73. *** 3542,3549 ****
  74.       }
  75.       else
  76.   #endif
  77. !         ExtTextOut(s_hdc, TEXT_X(col), TEXT_Y(row),
  78.                   foptions, pcliprect, (char *)s, len, padding);
  79.       }
  80.   
  81.       if (flags & DRAW_UNDERL)
  82. --- 3592,3608 ----
  83.       }
  84.       else
  85.   #endif
  86. !     {
  87. ! #ifdef FEAT_RIGHTLEFT
  88. !         /* ron: fixed Hebrew on Win98/Win2000 */
  89. !         if (curwin->w_p_rl)
  90. !         RevOut(s_hdc, TEXT_X(col), TEXT_Y(row),
  91. !                 foptions, pcliprect, (char *)s, len, padding);
  92. !         else
  93. ! #endif
  94. !         ExtTextOut(s_hdc, TEXT_X(col), TEXT_Y(row),
  95.                   foptions, pcliprect, (char *)s, len, padding);
  96. +     }
  97.       }
  98.   
  99.       if (flags & DRAW_UNDERL)
  100. *** ../vim-5.7.10/src/version.c    Sat Oct  7 13:42:12 2000
  101. --- src/version.c    Sat Oct  7 13:38:27 2000
  102. ***************
  103. *** 439,440 ****
  104. --- 439,442 ----
  105.   {   /* Add new patch number below this line */
  106. + /**/
  107. +     11,
  108.   /**/
  109.  
  110. -- 
  111. hundred-and-one symptoms of being an internet addict:
  112. 202. You're amazed to find out Spam is a food.
  113.  
  114. ///  Bram Moolenaar     Bram@moolenaar.net     http://www.moolenaar.net  \\\
  115. \\\  Vim: http://www.vim.org      ICCF Holland: http://iccf-holland.org  ///
  116.