Scroll to navigation

XDrawText(3X11) XLIB FUNCTIONS XDrawText(3X11)

̾Á°

XDrawText, XDrawText16, XTextItem, XTextItem16 - Ê£¹ç¥Æ¥­¥¹¥È¤ÎÉÁ²è¤È¥Æ¥­¥¹¥ÈÉÁ²è¹½Â¤ÂÎ

½ñ¼°

XDrawText(display, d, gc, x, y, items, nitems)
Display *display;
Drawable d;
GC gc;
int x, y;
XTextItem *items;
int nitems;

XDrawText16(display, d, gc, x, y, items, nitems)
Display *display;
Drawable d;
GC gc;
int x, y;
XTextItem16 *items;
int nitems;

°ú¤­¿ô

¥É¥í¥¦¥¢¥Ö¥ë¤ò»ØÄꤹ¤ë¡£
X ¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤ò»ØÄꤹ¤ë¡£
GC ¤ò»ØÄꤹ¤ë¡£
¥Æ¥­¥¹¥È¥¢¥¤¥Æ¥à¤ÎÇÛÎó¤ò»ØÄꤹ¤ë¡£
ÇÛÎóÆâ¤Î¥Æ¥­¥¹¥È¥¢¥¤¥Æ¥à¿ô¤ò»ØÄꤹ¤ë¡£

x, y ºÂɸ¤ò»ØÄꤹ¤ë¡£¤³¤ì¤Ï»ØÄꤷ¤¿¥É¥í¥¦¥¢¥Ö¥ë¤Î¸¶ÅÀ¤«¤é¤ÎÁêÂкÂɸ¤Ç¤¢¤ê¡¢ºÇ½é¤Îʸ»ú¤Î¸¶ÅÀ¤òÄêµÁ¤¹¤ë¡£

ÀâÌÀ

´Ø¿ô XDrawText16 ¤Ï2¥Ð¥¤¥È¤¢¤ë¤¤¤Ï16¥Ó¥Ã¥È¤Îʸ»ú¤òÍѤ¤¤ëÅÀ¤ò½ü¤¤¤Æ XDrawText ¤ÈƱÍͤδؿô¤Ç¤¢¤ë¡£ ¤¤¤º¤ì¤Î´Ø¿ô¤âÎóµó¤µ¤ì¤¿Ê¸»úÎó´Ö¤Ç¤ÎÊ£»¨¤Ê¥¹¥Ú¡¼¥·¥ó¥°¤È¥Õ¥©¥ó¥ÈÁ«°Ü¤¬²Äǽ¤Ç¤¢¤ë¡£

³Æ¥Æ¥­¥¹¥È¥¢¥¤¥Æ¥à¤Ï½çÈ֤˽èÍý¤µ¤ì¤ë¡£ ¥¢¥¤¥Æ¥àÆâ¤Ë None °Ê³°¤Î font ¥á¥ó¥Ð¤¬¤¢¤ë¾ì¹ç¡¢¤½¤Î¥Õ¥©¥ó¥È¤Ï GC ¤Ë³ÊǼ¤µ¤ì¡¢¤³¤ì¤Ë³¤¯¥Æ¥­¥¹¥È¤ËÂФ·¤Æ»ÈÍѤµ¤ì¤ë¡£ ¥Æ¥­¥¹¥ÈÍ×ÁÇ delta ¤Ïʸ»úÎó¤¬ÉÁ²è¤µ¤ì¤ëÁ°¤Î x ¼´¤Ë±è¤Ã¤Æ¤Î°ÌÃÖ¤ÎÄɲÃŪ ¤ÊÊѰ̤ò»ØÄꤹ¤ë¡£ delta ¤Ï¾ï¤Ëʸ»ú¤Î¸¶ÅÀ¤ËÄɲ䵤졢¥Õ¥©¥ó¥È¤Î¤¤¤«¤Ê¤ëÆÃÀ­¤Ë¤â°Í¸¤·¤Ê¤¤¡£ ³Æʸ»ú¤Î¥¤¥á¡¼¥¸¤Ï¡¢GC Æâ¤Î¥Õ¥©¥ó¥È¤ÇÄêµÁ¤µ¤ì¤ë¤Î¤Ç¡¢¥É¥í¥¦¥¢¥Ö¥ë¤Î fill Áàºî¤Ø¤ÎÄɲåޥ¹¥¯¤È¤·¤Æ°·¤ï¤ì¤ë¡£ ¥É¥í¥¦¥¢¥Ö¥ë¤Ï¥Õ¥©¥ó¥È¤Îʸ»ú¤¬1¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¥Ó¥Ã¥È¤ò»ý¤ÄÅÀ¤Ç¤Î¤ß Êѹ¹¤µ¤ì¤ë¡£ ¥Æ¥­¥¹¥È¥¢¥¤¥Æ¥à¤¬ BadFont ¥¨¥é¡¼¤òµ¯¤³¤·¤¿¾ì¹ç¤â¡¢¤½¤ÎÁ°¤Î¥Æ¥­¥¹¥È¥¢¥¤¥Æ¥à¤Ï¤ª¤½¤é¤¯´û¤ËÉÁ²è¤µ¤ì ¤Æ¤¤¤ë¡£

2¥Ð¥¤¥È¤Î¹ÔÎó·Á¼°¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¤Ê¤¯Àþ·Á¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÇÄêµÁ¤µ¤ì¤¿¥Õ¥© ¥ó¥È¤ËÂФ·¤Æ¤Ï¡¢³Æ XChar2b ¹½Â¤ÂΤϺǾå°Ì¥Ð¥¤¥È¤¬ byte1 ¤Ç¤¢¤ë16¥Ó¥Ã¥È¤Î¿ô¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£

¤É¤Á¤é¤Î´Ø¿ô¤â°Ê²¼¤Î GC ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤ò»ÈÍѤ¹¤ë¡£ function, plane-mask, fill-style, font, subwindow-mode, clip-x-origin, clip-y-origin, clip-mask¡£ ¤Þ¤¿¡¢°Ê²¼¤Î GC ¥â¡¼¥É°Í¸¥³¥ó¥Ý¡¼¥Í¥ó¥È¤â»ÈÍѤ¹¤ë¡£ foreground, background, tile, stipple, tile-stipple-x-origin, tile-stipple-y-origin¡£

XDrawText ¤È XDrawText16 ¤Ï¥¨¥é¡¼ BadDrawable, BadFont, BadGC, BadMatch ¤òµ¯¤³¤¹¤³¤È¤¬¤¢¤ë¡£

¹½Â¤ÂÎ

¹½Â¤ÂÎ XTextItem ¤È XTextItem16 ¤ÎÆâÍƤò°Ê²¼¤Ë¼¨¤¹¡£

typedef struct {
	char *chars;	
	int nchars;	
	int delta;	
	Font font;	
} XTextItem;


typedef struct {
	XChar2b *chars;	
	int nchars;	
	int delta;	
	Font font;	
} XTextItem16;


font ¥á¥ó¥Ð¤¬ None ¤Ç¤Ê¤¤¾ì¹ç¡¢É½¼¨Á°¤Ë¥Õ¥©¥ó¥È¤ÏÀÚÂؤ¨¤é¤ì¡¢¿·¤¿¤Ê¥Õ¥©¥ó¥È¤¬ GC ¤Ë³ÊǼ¤µ ¤ì¤ë¡£ ¥Æ¥­¥¹¥ÈÉÁ²èÃæ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤â¡¢¤½¤ì¤è¤êÁ°¤Î¥Æ¥­¥¹¥È¥¢¥¤¥Æ¥à¤Ï ɽ¼¨¤µ¤ì¤ë¡£ ʸ»ú¤Î¥Ù¡¼¥¹¥é¥¤¥ó¤Ï¥Æ¥­¥¹¥ÈÉÁ²è´Ø¿ô¤Ç»ØÄꤷ¤¿ x, y ºÂɸ¤òµ¯ÅÀ¤ËÉÁ²è¤µ ¤ì¤ë¡£

Îã¤È¤·¤Æ¡¢ XDrawImageString ¤Ë¤è¤Ã¤ÆÉÁ²è¤µ¤ì¤ëÇØ·Ê¿§¤ÎĹÊý·Á¤ò¹Í¤¨¤ë¡£ ÇطʤÎĹÊý·Á¤Îº¸¾å¶ù¤ò¥Ô¥¯¥»¥ëºÂɸ (x, y) ¤È¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢¥Æ¥­¥¹¥È´Ø ¿ô¤Ø¤Ï (x, y + ascent) ¤ò¥Ù¡¼¥¹¥é¥¤¥ó¸¶ÅÀ¤ÎºÂɸ¤È¤·¤ÆÅϤ¹¡£ ¤³¤³¤Ç¡¢ascent ¤Ï¥Õ¥©¥ó¥È¤Î ascent ÃͤǤ¢¤ê¡¢ XFontStruct ¹½Â¤ÂΤÇÍ¿¤¨¤é¤ì¤ë¡£ ÇطʤÎĹÊý·Á¤Îº¸²¼¶ù¤ò¥Ô¥¯¥»¥ëºÂɸ (x, y) ¤Ë¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢¥Æ¥­¥¹¥È´Ø ¿ô¤Ø¤Ï (x, y, - descent + 1) ¤ò¥Ù¡¼¥¹¥é¥¤¥ó¸¶ÅÀ¤ÎºÂɸ¤È¤·¤ÆÅϤ¹¡£ descent ¤Ï XFontStruct ¹½Â¤ÂΤÇÍ¿¤¨¤é¤ì¤ë¡¢¥Õ¥©¥ó¥È¤Î descent ÃͤǤ¢¤ë¡£

ÊÖ¤êÃÍ

°ú¤­¿ô Drawable ¤ÎÃͤ¬¡¢ÄêµÁ¤µ¤ì¤Æ¤¤¤ë Window ¤¢¤ë¤¤¤Ï Pixmap ¤ò¼¨¤·¤Æ¤¤ ¤Ê¤¤¡£
°ú¤­¿ô Font ¤¢¤ë¤¤¤Ï GContext ¤ÎÃͤ¬¡¢ÄêµÁ¤µ¤ì¤Æ¤¤¤ë Font ¤Ç¤Ê¤¤¡£
°ú¤­¿ô GContext ¤ÎÃͤ¬¡¢ÄêµÁ¤µ¤ì¤Æ¤¤¤ë GContext ¤Ç¤Ê¤¤¡£
InputOnly (ÆþÎÏÀìÍÑ)¤Î¥¦¥£¥ó¥É¥¦¤¬ Drawable ¤È¤·¤ÆÍѤ¤¤é¤ì¤¿¡£

´ØÏ¢¹àÌÜ

XDrawImageString(3X11), XDrawString(3X11), XLoadFont(3X11)
Xlib - C Language X Interface

Release 6.5 X Version 11