예제 #1
0
static int
xftfont_has_char (Lisp_Object font, int c)
{
  struct xftfont_info *xftfont_info;
  struct charset *cs = NULL;

  if (EQ (AREF (font, FONT_ADSTYLE_INDEX), Qja)
      && charset_jisx0208 >= 0)
    cs = CHARSET_FROM_ID (charset_jisx0208);
  else if (EQ (AREF (font, FONT_ADSTYLE_INDEX), Qko)
      && charset_ksc5601 >= 0)
    cs = CHARSET_FROM_ID (charset_ksc5601);
  if (cs)
    return (ENCODE_CHAR (cs, c) != CHARSET_INVALID_CODE (cs));

  if (FONT_ENTITY_P (font))
    return ftfont_driver.has_char (font, c);
  xftfont_info = (struct xftfont_info *) XFONT_OBJECT (font);
  return (XftCharExists (xftfont_info->display, xftfont_info->xftfont,
			 (FcChar32) c) == FcTrue);
}
예제 #2
0
$FreeBSD$

--- src/coding.c.orig
+++ src/coding.c
@@ -3717,8 +3717,20 @@
 	      else
 		charset = CHARSET_FROM_ID (charset_id_2);
 	      ONE_MORE_BYTE (c1);
-	      if (c1 < 0x20 || (c1 >= 0x80 && c1 < 0xA0))
-		goto invalid_code;
+	      /*
+	       * <ESC>N sequence is recognized as SS2 in some ISO2022
+	       * encodings.  As a workaround, mark invalid only if
+	       * <ESC>N + GR in a 7-bit encoding or <ESC>N + GL in an 8-bit
+	       * encoding.
+	       */
+	      if (CODING_ISO_FLAGS (coding) & CODING_ISO_FLAG_SEVEN_BITS) {
+		if (c1 < 0x20 || c1 >= 0x80)
+		  goto invalid_code;
+	      }
+	      else {
+		if (c1 < 0xA0)
+		  goto invalid_code;
+	      }
 	      break;
 
 	    case 'O':		/* invocation of single-shift-3 */
@@ -3731,8 +3743,20 @@
 	      else
 		charset = CHARSET_FROM_ID (charset_id_3);