]> code.delx.au - gnu-emacs/blobdiff - src/fontset.c
Make tty-menu-open-use-tmm a defcustom, update tmm docs accordingly.
[gnu-emacs] / src / fontset.c
index 0bf716bf1b267d2afeb77aa12532be9d7cd8fb71..15fdf9f41a071771c62336c05003ad306d5cebae 100644 (file)
@@ -39,17 +39,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "intervals.h"
 #include "fontset.h"
 #include "window.h"
-#ifdef HAVE_X_WINDOWS
-#include "xterm.h"
-#endif
-#ifdef HAVE_NTGUI
-#include "w32term.h"
-#endif
-#ifdef HAVE_NS
-#include "nsterm.h"
-#endif
+#ifdef HAVE_WINDOW_SYSTEM
+#include TERM_HEADER
+#endif /* HAVE_WINDOW_SYSTEM */
 #include "termhooks.h"
-
 #include "font.h"
 
 /* FONTSET
@@ -460,7 +453,7 @@ reorder_font_vector (Lisp_Object font_group, struct font *font)
     }
 
   if (score_changed)
-    qsort (XVECTOR (vec)->contents, size, word_size,
+    qsort (XVECTOR (vec)->u.contents, size, word_size,
           fontset_compare_rfontdef);
   XSETCAR (font_group, make_number (charset_ordered_list_tick));
 }
@@ -944,6 +937,19 @@ face_for_char (struct frame *f, struct face *face, int c, int pos, Lisp_Object o
   if (ASCII_CHAR_P (c) || face->fontset < 0)
     return face->ascii_face->id;
 
+#ifdef HAVE_NS
+  if (face->font)
+    {
+      /* Fonts often have characters in other scripts, like symbol, even if they
+         don't match script: symbol.  So check if the character is present
+         in the current face first.  Only enable for NS for now, but should
+         perhaps be general?  */
+      Lisp_Object font_object;
+      XSETFONT (font_object, face->font);
+      if (font_has_char (f, font_object, c)) return face->id;
+    }
+#endif
+
   eassert (fontset_id_valid_p (face->fontset));
   fontset = FONTSET_FROM_ID (face->fontset);
   eassert (!BASE_FONTSET_P (fontset));