changeset 90183:274d87a536dc

(x_font_name_to_mac_font_name): Sync with trunk for the case that does not require code conversion.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Sun, 22 May 2005 08:23:06 +0000
parents f042e7c0fe20
children 9e5e2f01c7ab
files src/macterm.c
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/macterm.c	Fri May 20 04:22:05 2005 +0000
+++ b/src/macterm.c	Sun May 22 08:23:06 2005 +0000
@@ -6329,15 +6329,23 @@
   else
     sprintf (mf_decoded, "%s-%s-%s", foundry, family, cs);
 
+  for (p = mf_decoded; *p; p++)
+    if (!isascii (*p) || iscntrl (*p))
+      break;
+
+  if (*p == '\0'
+      || NILP (coding_system) || NILP (Fcoding_system_p (coding_system)))
+    strcpy (mf, mf_decoded);
 #if 0
   /* MAC_TODO: Fix coding system to use objects */
-  if (!NILP (coding_system))
+  else
     {
       setup_coding_system (coding_system, &coding);
       coding.src_multibyte = 1;
       coding.dst_multibyte = 1;
       coding.mode |= CODING_MODE_LAST_BLOCK;
-      encode_coding (&coding, family, mf, strlen (family), sizeof (Str32) - 1);
+      encode_coding (&coding, mf_decoded, mf,
+		     strlen (mf_decoded), sizeof (Str32) - 1);
       mf[coding.produced] = '\0';
     }
 #endif