emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106300: * src/w32font.c (font_matche


From: Jason Rumney
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106300: * src/w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
Date: Sun, 06 Nov 2011 02:50:59 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106300
fixes bug(s): http://debbugs.gnu.org/6029
committer: Jason Rumney <address@hidden>
branch nick: trunk
timestamp: Sun 2011-11-06 02:50:59 +0800
message:
  * src/w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
  (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
  fonts.
  (add_font_entity_to_list): Fix logic errors in mixed boolean and
  bitwise arithmetic preventing use of unicode-sip and non-truetype
  opentype fonts.
modified:
  src/ChangeLog
  src/w32font.c
  src/w32term.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-11-05 16:30:13 +0000
+++ b/src/ChangeLog     2011-11-05 18:50:59 +0000
@@ -1,3 +1,12 @@
+2011-11-05  Jason Rumney  <address@hidden>
+
+       * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
+       (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
+       fonts (Bug#6029).
+       (add_font_entity_to_list): Fix logic errors in mixed boolean and
+       bitwise arithmetic preventing use of unicode-sip and non-truetype
+       opentype fonts.
+
 2011-11-05  Eli Zaretskii  <address@hidden>
 
        * s/ms-w32.h (fstat, stat, utime): Move redirections to
@@ -2812,6 +2821,9 @@
 
 2011-07-08  Jason Rumney  <address@hidden>
 
+       * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
+       SH_SHOW for hidden windows (Bug#5482).
+
        * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
        frame struct members of non-existent frames (Bug#6284).
 

=== modified file 'src/w32font.c'
--- a/src/w32font.c     2011-10-28 10:59:24 +0000
+++ b/src/w32font.c     2011-11-05 18:50:59 +0000
@@ -1292,6 +1292,15 @@
                     = font_supported_scripts (&font->ntmFontSig);
                   if (! memq_no_quit (val, support))
                     return 0;
+
+                 /* Avoid using non-Japanese fonts for Japanese, even
+                    if they claim they are capable, due to known
+                    breakage in Vista and Windows 7 fonts
+                    (bug#6029).  */
+                 if (EQ (val, Qkana)
+                     && (font->ntmTm.tmCharSet != SHIFTJIS_CHARSET
+                         || !(font->ntmFontSig.fsCsb[0] & CSB_JAPANESE)))
+                   return 0;
                 }
               else
                 {
@@ -1507,7 +1516,7 @@
   /* For uniscribe backend, consider only truetype or opentype fonts
      that have some unicode coverage.  */
   if (match_data->opentype_only
-      && ((!physical_font->ntmTm.ntmFlags & NTMFLAGS_OPENTYPE
+      && ((!(physical_font->ntmTm.ntmFlags & NTMFLAGS_OPENTYPE)
           && !(font_type & TRUETYPE_FONTTYPE))
          || !is_unicode))
     return 1;
@@ -1568,8 +1577,8 @@
         the bits for CJK ranges that include those characters.  */
       else if (EQ (spec_charset, Qunicode_sip))
        {
-         if (!physical_font->ntmFontSig.fsUsb[1] & 0x02000000
-             || !physical_font->ntmFontSig.fsUsb[1] & 0x28000000)
+         if (!(physical_font->ntmFontSig.fsUsb[1] & 0x02000000)
+             || !(physical_font->ntmFontSig.fsUsb[1] & 0x28000000))
            return 1;
        }
 
@@ -1577,8 +1586,16 @@
 
       /* If registry was specified, ensure it is reported as the same.  */
       if (!NILP (spec_charset))
-       ASET (entity, FONT_REGISTRY_INDEX, spec_charset);
-
+       {
+         /* Avoid using non-Japanese fonts for Japanese, even if they
+            claim they are capable, due to known breakage in Vista
+            and Windows 7 fonts (bug#6029).  */
+         if (logical_font->elfLogFont.lfCharSet == SHIFTJIS_CHARSET
+             && !(physical_font->ntmFontSig.fsCsb[0] & CSB_JAPANESE))
+           return 1;
+         else
+           ASET (entity, FONT_REGISTRY_INDEX, spec_charset);
+       }
       /* Otherwise if using the uniscribe backend, report ANSI and DEFAULT
         fonts as unicode and skip other charsets.  */
       else if (match_data->opentype_only)

=== modified file 'src/w32term.c'
--- a/src/w32term.c     2011-09-15 16:22:58 +0000
+++ b/src/w32term.c     2011-11-05 18:50:59 +0000
@@ -5690,15 +5690,15 @@
 
       f->output_data.w32->asked_for_visible = 1;
 
-      /* The first of these seems to give more expected behavior, but
-         was added as a commented out line in Sept 1997, with the
-         second version remaining uncommented. There may have been
-         some problem with it that led to it not being enabled,
-         so the old version remains commented out below in case we
-         decide we need to go back to it [23.0.60 2008-06-09].  */
+      /* According to a report in emacs-devel 2008-06-03, SW_SHOWNORMAL
+        causes unexpected behaviour when unminimizing frames that were
+        previously maximised.  But only SW_SHOWNORMAL works properly for
+        frames that were truely hidden (using make-frame-invisible), so
+        we need it to avoid Bug#5482.  It seems that async_iconified
+        is only set for minimised windows that are still visible, so
+         use that to determine the appropriate flag to pass ShowWindow.  */
       my_show_window (f, FRAME_W32_WINDOW (f),
-                      f->async_iconified ? SW_RESTORE : SW_SHOW);
-      /* my_show_window (f, FRAME_W32_WINDOW (f), SW_SHOWNORMAL);  */
+                      f->async_iconified ? SW_RESTORE : SW_SHOWNORMAL);
     }
 
   /* Synchronize to ensure Emacs knows the frame is visible


reply via email to

[Prev in Thread] Current Thread [Next in Thread]