예제 #1
0
파일: xfont.c 프로젝트: JJJollyjim/remacs
static bool
xfont_chars_supported (Lisp_Object chars, XFontStruct *xfont,
		       struct charset *encoding, struct charset *repertory)
{
  struct charset *charset = repertory ? repertory : encoding;

  if (CONSP (chars))
    {
      for (; CONSP (chars); chars = XCDR (chars))
	{
	  int c = XINT (XCAR (chars));
	  unsigned code = ENCODE_CHAR (charset, c);
	  XChar2b char2b;

	  if (code == CHARSET_INVALID_CODE (charset))
	    break;
	  if (! xfont)
	    continue;
	  if (code >= 0x10000)
	    break;
	  char2b.byte1 = code >> 8;
	  char2b.byte2 = code & 0xFF;
	  if (! xfont_get_pcm (xfont, &char2b))
	    break;
	}
      return (NILP (chars));
    }
  else if (VECTORP (chars))
예제 #2
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);
}