From: nisikimi Date: Wed, 1 Feb 2006 06:07:13 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: XML-base~42 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b275f6d77b7c8e37e3a8056f82b4b8dbdd09abe3;p=m17n%2Fm17n-docs.git *** empty log message *** --- diff --git a/data/dbformat.txt b/data/dbformat.txt new file mode 100644 index 0000000..230da94 --- /dev/null +++ b/data/dbformat.txt @@ -0,0 +1,2499 @@ +/* -*- coding: euc-jp; -*- */ +/***en @page m17nDBFormat Data format of the m17n database + +This section describes formats of these data supplied by the m17n +database. + + +*/ +/***ja @page m17nDBFormat M17N ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Ç¡¼¥¿¡¦¥Õ¥©¡¼¥Þ¥Ã¥È + +¤³¤³¤Ç¤Ï¡¢M17N ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÇÄ󶡤µ¤ì¤ë³Æ¥Ç¡¼¥¿¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò²òÀ⤹ +¤ë¡£ + + +*/ +/***ja + +@section mdbGeneral °ìÈÌŪ¤Ê¥Õ¥©¡¼¥Þ¥Ã¥È + +@subsection general-description ÀâÌÀ + +´Ø¿ô mdatabase_load () ¤Ï¡¢Âè°ì¥¿¥°¤¬ @c Mchartable ¤« @c Mcharset ¤Ç +¤Ê¤¤¸Â¤ê¡¢¥¿¥°¤Ç»ØÄꤵ¤ì¤¿¥Ç¡¼¥¿¤ò¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤Î·Á¤ÇÊÖ¤¹¡£ÊÖ¤µ¤ì¤ë +¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤Î¥­¡¼¤ÏMinteger, Msymbol, +Mtext, Mplist ¤Ë¸Â¤ë¡£Ãͤη¿¤Ï¥­¡¼¤Ë¤è¤Ã¤ÆÛ£ËæÀ­¤Ê¤¯ +·èÄꤵ¤ì¤ë¡£¥­¡¼¤¬ Minteger ¤Ê¤é¤ÐÃͤÏÀ°¿ôÃͤǤ¢¤ê¡¢¥­¡¼¤¬ +Msymbol ¤Ê¤éÃͤϥ·¥ó¥Ü¥ë¡¢Mtext ¤Ê¤é¤Ð M-text¡¢ +Mplist ¤Ê¤é¤Ð¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤Ç¤¢¤ë¡£ + +¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤ò¼¨¤¹¤¿¤á¤Ë¤Ï¤µ¤Þ¤¶¤Þ¤Êɽ¸½·Á¼°¤¬²Äǽ¤Ç¤¢¤ë¡£¤¿¤È¤¨¤Ð +(K1:V1, K2:V2, ..., Kn:Vn) ¤È¤¤¤¦·Á¤Ç¡¢ºÇ½é¤ÎK1 ¤È V1¡¢Æó¤ÄÌÜ +¤Î¥­¡¼¤ÈÃͤ¬K2 ¤È V2 ¤È¤¤¤Ã¤¿¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤òɽ¸½¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£ +¤·¤«¤·¡¢m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÇÍѤ¤¤é¤ì¤ë¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤Î¥¿¥¤¥×¤Ï¤«¤Ê¤ê +¸ÂÄꤵ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢¤â¤Ã¤Èñ½ã¤Êɽ¸½·Á¼°¤òÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ + +¤³¤ì°Ê¹ß¡¢¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤Î¼¨¤¹¤¿¤á¤Ë¤Ï S ¼°¤ËÎà»÷¤·¤¿É½¸½¤òÍѤ¤¤ë¡£ +(¼ÂºÝ m17n ¥é¥¤¥Ö¥é¥ê¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥í¡¼¥À¤Ï¤³¤Îɽ¸½¤Ç½ñ¤« +¤ì¤¿¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤òÆɤà¤è¤¦¤ËÀ߷פµ¤ì¤Æ¤¤¤ë¡£) + +¤³¤Îɽ¸½·Á¼°¤Ï 1 ¤Ê¤¤¤·¤½¤ì°Ê¾å¤Î Í×ÁÇ (element) ¤«¤é¤Ê¤ë¡£¸Ä¡¹ +¤ÎÍ×ÁǤϥץí¥Ñ¥Æ¥£¤¹¤Ê¤ï¤Á¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤Î°ì¤Ä¤ÎÍ×ÁǤòɽ¤¹¡£ + +Í×ÁÇ´Ö¤Ï 1 ¤Ê¤¤¤·¤½¤ì°Ê¾å¤Î ¶õÇò (whitespace) ¤¹¤Ê¤ï¤Á¥¹¥Ú¡¼¥¹ +(code 32)¡¢¥¿¥Ö (code 9)¡¢²þ¹Ô (code 10) ¤Î¤¤¤º¤ì¤«¤Ç¶èÀÚ¤é¤ì¤ë¡£¥»¥ß +¥³¥í¥ó(;) ¤Ç»Ï¤Þ¤ë¹Ô¤Ï¥³¥á¥ó¥È¤Ç¤¢¤ë¡£ + +³Æ¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤ÈÃͤϡ¢Í×ÁǤΥ¿¥¤¥×¤Ë´ð¤Å¤¤¤Æ°Ê²¼¤Î¤è¤¦¤Ë·èÄꤵ¤ì¤ë¡£ + + + +@subsection general-syntax ʸˡ¤Îɽµ­ + +¥Ç¡¼¥¿¤Î¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¥Õ¥©¡¼¥Þ¥Ã¥È¤ÎÀâÌÀ¤Ç¤Ï¡¢BNFÉ÷¤Îµ­Ë¡¤¬ÍѤ¤¤é¤ì +¤ë¡£¤³¤Îµ­Ë¡¤Ç¤Ï¡¢Èó½ªÃ¼¤ÏÂçʸ»ú¡Ê´Ö¤Ë'-'¤¬Æþ¤Ã¤Æ¤â¤è¤¤¡Ë ¤Ç¡¢½ªÃ¼¤Ï " +¤Ç°Ï¤Ã¤Æɽ¤µ¤ì¤ë¡£ÆÃÊ̤ÊÈó½ªÃ¼ INTEGER, SYMBOL, +MTEXT, PLIST ¤Ï¤½¤ì¤¾¤ìÂбþ¤¹¤ë¥×¥í¥Ñ¥Æ¥£¤ò°ÕÌ£¤¹¤ë¡£ + +@subsection general-example Îã + +¼¡¤Îñ½ã¤Ê·Á¼°¤Î¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤ËÆɤ߹þ¤Þ¤ì¤ë¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Ç¡¼¥¿¤Î +°ìÎã¤ò¼¨¤¹¡§ + +@verbatim +DATA-FORMAT ::= + [ INTEGER | SYMBOL | MTEXT | FUNC ] * + +FUNC ::= + '(' FUNC-NAME FUNC-ARG * ')' + +FUNC-NAME ::= + SYMBOL + +FUNC-ARG ::= + INTEGER | SYMBOL | MTEXT | '(' FUNC-ARG ')' +@endverbatim + +¤¿¤È¤¨¤Ð¡¢¼¡¤Î¥Æ¥­¥¹¥È¤ò´Þ¤à¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤Ï¾å¤Îʸˡ¤Ë¹çÃפ¹¤ë¡§ + +@verbatim +abc 123 (pqr 0xff) "m\"text" (_\\_ ("string" xyz) -456) +@endverbatim + +¤½¤·¤Æ¼¡¤Î¤è¤¦¤Ê¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤È¤·¤ÆÆɤ߹þ¤Þ¤ì¤ë¡§ + +@verbatim +Â裱Í×ÁÇ: ¥­¡¼: Msymbol, ÃÍ: abc +Â裲Í×ÁÇ: ¥­¡¼: Minteger, ÃÍ: 123 +Â裳Í×ÁÇ: ¥­¡¼: Mplist, ÃÍ: ¼¡¤ÎÍ×ÁǤ«¤é¤Ê¤ë¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È + Â裱Í×ÁÇ: ¥­¡¼ Msymbol, ÃÍ: pgr + Â裲Í×ÁÇ: ¥­¡¼ Minteger, ÃÍ: 255 +Â裴Í×ÁÇ: ¥­¡¼: Mtext, ÃÍ: m"text +Â裵Í×ÁÇ: ¥­¡¼: Mplist, ÃÍ: ¼¡¤ÎÍ×ÁǤ«¤é¤Ê¤ë¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È + Â裱Í×ÁÇ: ¥­¡¼: Msymbol, ÃÍ: _\_ + Â裲Í×ÁÇ: ¥­¡¼: Mplist, ÃÍ: ¼¡¤ÎÍ×ÁǤ«¤é¤Ê¤ë¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È + Â裱Í×ÁÇ: ¥­¡¼: Mtext, ÃÍ: string + Â裲Í×ÁÇ: ¥­¡¼: Msymbol, ÃÍ: xyz + Â裳Í×ÁÇ: ¥­¡¼: Minteger, ÃÍ: -456 +@endverbatim +*/ +/***en + +@section mdbGeneral General Format + +@subsection general-description DESCRIPTION + +The mdatabase_load () function returns the data specified by tags in +the form of plist if the first tag is not @c Mchartable nor @c +Mcharset. The keys of the returned plist are limited to +Minteger, Msymbol, Mtext, and +Mplist. The type of the value is unambiguously determined by +the corresponding key. If the key is Minteger, the value is +an integer. If the key is Msymbol, the value is a symbol. +And so on. + +A number of expressions are possible to represent a plist. For +instance, we can use the form (K1:V1, K2:V2, ..., Kn:Vn) to +represent a plist whose first property key and value are K1 and V1, +second key and value are K2 and V2, and so on. However, we can use a +simpler expression here because the types of plists used in the m17n +database are fairly restricted. + +Hereafter, we use an expression, which is similar to S-expression, to +represent a plist. (Actually, the default database loader of the m17n +library is designed to read data files written in this expression.) + +The expression consists of one or more elements. Each element +represents a property, i.e. a single element of a plist. + +Elements are separated by one or more whitespaces, i.e. a space +(code 32), a tab (code 9), or a newline (code 10). Comments begin +with a semicolon (;) and extend to the end of the line. + +The key and the value of each property are determined based on the +type of the element as explained below. + + + +@subsection general-syntax SYNTAX NOTATION + +In an explanation of a plist format of data, a BNF-like notation is +used. In the notation, non-terminals are represented by a string of +uppercase letters (including '-' in the middle), terminals are +represented by a string surrounded by '"'. Special non-terminals +INTEGER, SYMBOL, MTEXT and PLIST represents property integer, symbol, +M-text, or plist respectively. + +@subsection general-example EXAMPLE + +Here is an example of database data that is read into a plist of this +simple format: + +@verbatim +DATA-FORMAT ::= + [ INTEGER | SYMBOL | MTEXT | FUNC ] * + +FUNC ::= + '(' FUNC-NAME FUNC-ARG * ')' + +FUNC-NAME ::= + SYMBOL + +FUNC-ARG ::= + INTEGER | SYMBOL | MTEXT | '(' FUNC-ARG ')' +@endverbatim + +For instance, a data file that contains this text matches the above +syntax: + +@verbatim +abc 123 (pqr 0xff) "m\"text" (_\\_ ("string" xyz) -456) +@endverbatim + +and is read into this plist: + +@verbatim +1st element: key: Msymbol, value: abc +2nd element: key: Minteger, value: 123 +3rd element: key: Mplist, value: a plist of these elements: + 1st element: key Msymbol, value: pgr + 2nd element: key Minteger, value: 255 +4th element: key: Mtext, value: m"text +5th element: key: Mplist, value: a plist of these elements: + 1st element: key: Msymbol, value: _\_ + 2nd element: key: Mplist, value: a plist of these elements: + 1st element: key: Mtext, value: string + 2nd element: key: Msymbol, value: xyz + 3rd element: key: Minteger, value: -456 +@endverbatim +*/ +/***ja + +@section mdbCharsetList ʸ»ú¥»¥Ã¥ÈÄêµÁ¤Î¥ê¥¹¥È + +@subsection cslist-description ÀâÌÀ + +m17n ¥é¥¤¥Ö¥é¥ê¤Ï¡¢¥¿¥° \ ¤ò»ý¤Ä¥Ç¡¼¥¿¤«¤éʸ»ú¥»¥Ã¥ÈÄêµÁ +¤Î¥ê¥¹¥È¤ò¥í¡¼¥É¤¹¤ë¡£¥Ç¡¼¥¿¤Ï°Ê²¼¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤È¤· +¤Æ¥í¡¼¥É¤µ¤ì¤ë¡£ + +@verbatim +CHARSET-LIST ::= DEFINITION * + +DEFINITION ::= '(' NAME ( KEY VALUE ) * ')' + +NAME ::= SYMBOL + +KEY ::= SYMBOL + +VALUE ::= SYMBOL | INTEGER | MTEXT | PLIST +@endverbatim + +@c NAME ¤ÏÄêµÁ¤¹¤ëʸ»ú¥»¥Ã¥È¤Î̾Á°¤Ç¤¢¤ë¡£ + +@c KEY ¤È @c VALUE ¤Î¥Ú¥¢¤Ï¡¢´Ø¿ô mchar_define_charset () ¤ËÂ裲°ú¿ô +$PLIST ¤ÎÍ×ÁǤȤ·¤ÆÍ¿¤¨¤é¤ì¤ë¥×¥í¥Ñ¥Æ¥£¤Ç¤¢¤ë¡£ + +@subsection cslist-seealso SEE ALSO + +@ref mdbGeneral "mdbGeneral(5)", mchar_define_charset () +*/ +/***en + +@section mdbCharsetList List of character set definitions + +@subsection cslist-description DESCRIPTION + +The m17n library loads a list of charset definitions from the data of +tag \. The data is loaded as a plist of this format. + +@verbatim +CHARSET-LIST ::= DEFINITION * + +DEFINITION ::= '(' NAME ( KEY VALUE ) * ')' + +NAME ::= SYMBOL + +KEY ::= SYMBOL + +VALUE ::= SYMBOL | INTEGER | MTEXT | PLIST +@endverbatim + +@c NAME is a name of a charset to define. + +@c KEY and @c VALUE pair is a property given to the function +mchar_define_charset () as an element of the second argument $PLIST. + +@subsection cslist-seealso SEE ALSO + +@ref mdbGeneral "mdbGeneral(5)", mchar_define_charset () +*/ +/***ja + +@section mdbCodingList ¥³¡¼¥É·ÏÄêµÁ¤Î¥ê¥¹¥È + +@subsection coding-list-description ÀâÌÀ + +m17n ¥é¥¤¥Ö¥é¥ê¤Ï¡¢½é´ü²½¤ÎºÝ m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¿¥° \ +¤Î¤Ä¤¤¤¿¥Ç¡¼¥¿¤«¤é¥³¡¼¥É·ÏÄêµÁ¤Î¥ê¥¹¥È¤ò¥í¡¼¥É¤¹¤ë¡£¤³¤Î¥Ç¡¼¥¿¤Ï°Ê²¼¤Î +¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤È¤·¤Æ¥í¡¼¥É¤µ¤ì¤ë¡£ + +@verbatim +CODING-LIST ::= DEFINITION * + +DEFINITION ::= '(' NAME ( KEY VALUE ) * ')' +NAME ::= SYMBOL + +KEY ::= SYMBOL + +VALUE ::= SYMBOL | INTEGER | MTEXT | PLIST +@endverbatim + +@c NAME ¤ÏÄêµÁ¤¹¤ë¥³¡¼¥É·Ï¤Î̾Á°¤Ç¤¢¤ë¡£ + +@c KEY ¤È @c VALUE ¤Î¥Ú¥¢¤Ï¡¢´Ø¿ô mchar_define_coding () ¤Ë£²ÈÖÌܤΰú +¿ô¤È¤·¤ÆÍ¿¤¨¤é¤ì¤ë¥×¥í¥Ñ¥Æ¥£¤Ç¤¢¤ë¡£ + +@subsection coding-list-seealso »²¾È + +@ref mdbGeneral "mdbGeneral(5)", mconv_define_coding () +*/ +/***en + +@section mdbCodingList List of coding system definitions + +@subsection coding-list-description DESCRIPTION + +The m17n library loads a list of coding system definitions from the +m17n database by the tags \ at initialization time. The +data is loaded as a plist of this format. + +@verbatim +CODING-LIST ::= DEFINITION * + +DEFINITION ::= '(' NAME ( KEY VALUE ) * ')' +NAME ::= SYMBOL + +KEY ::= SYMBOL + +VALUE ::= SYMBOL | INTEGER | MTEXT | PLIST +@endverbatim + +@c NAME is a name of a coding system to define. + +@c KEY and @c VALUE pair is a property given to the function +mconv_define_coding () as the second argument. + +@subsection coding-list-seealso SEE ALSO + +@ref mdbGeneral "mdbGeneral(5)", mconv_define_coding () +*/ +/***ja + +@section mdbDir ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥êÃæ¤Î¥Ç¡¼¥¿¤Î¥ê¥¹¥È + +@subsection dir-description ÀâÌÀ + +m17n ¥é¥¤¥Ö¥é¥ê¤Ï½é´ü²½¤ÎºÝ¡¢m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹Ãæ¤Î¥Ç¡¼¥¿ÄêµÁ¤Î¥ê¥¹¥È¤ò +³Æ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥êÃæ¤Î "mdb.dir" ¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤«¤é¥í¡¼ +¥É¤¹¤ë¡£¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤ª¤±¤ë¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï°Ê²¼¤Ç¤¢¤ë¡£ + +@verbatim +MDB-DIR ::= DEFINITION * + +DEFINITION ::= '(' TAG [ TAG [ TAG [ TAG ] ] ] FILE ')' + +TAG ::= SYMBOL + +FILE ::= MTEXT +@endverbatim +*/ +/***en + +@section mdbDir List of data in a database directory. + +@subsection dir-description DESCRIPTION + +The m17n library loads a list of definitions of data of the m17n +database from files of name "mdb.dir" in each database directory at +initialization time. The plist format of this file is as follows: + +@verbatim +MDB-DIR ::= DEFINITION * + +DEFINITION ::= '(' TAG [ TAG [ TAG [ TAG ] ] ] FILE ')' + +TAG ::= SYMBOL + +FILE ::= MTEXT +@endverbatim +*/ +/***ja + +@section mdbFLT ¥Õ¥©¥ó¥È¥ì¥¤¥¢¥¦¥È¥Æ¡¼¥Ö¥ë + +@subsection flt-description ÀâÌÀ + +ñ½ã¤Ê¥¹¥¯¥ê¥×¥È¤Î¾ì¹ç¡¢É½¼¨¥¨¥ó¥¸¥ó¤ÏÁªÂò¤·¤¿¥Õ¥©¥ó¥È¤Î¥¨¥ó¥³¡¼¥Ç¥£¥ó +¥°¤Ë±þ¤¸¤Æʸ»ú¥³¡¼¥É¤ò¥°¥ê¥Õ¥³¡¼¥É¤Ë°ìʸ»ú¤º¤ÄÊÑ´¹¤¹¤ë¡£¤·¤«¤·¡¢Ê£»¨¤Ê +¥ì¥¤¥¢¥¦¥È¤òÍ׵᤹¤ëʸ½ñ¡¢¤¿¤È¤¨¤Ð¥¿¥¤¤ä¥¤¥ó¥É·Ï¤Î¥¹¥¯¥ê¥×¥È¤Ê¤É¤Î¾ì¹ç¡¢ +£±ÂУ±¤ÎÊÑ´¹¤Ç¤ÏÉÔ½½Ê¬¤Ç¤¢¤ë¡£Ê£¿ô¤Îʸ»ú¤¬°ì¤Ä¤Î¥ê¥¬¥Á¥ã¤È¤·¤ÆÉÁ¤«¤ì¤¿¤ê¡¢ +£²¼¡¸µÅª¤Ë¤º¤é¤·¤¿°ÌÃÖ¤ËÉÁ¤«¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¥°¥ê¥Õ¤¬¤¢¤Ã¤¿¤ê¤¹¤ë¡£ + +¤³¤Î¤è¤¦¤ÊÊ£»¨¤Ê¥¹¥¯¥ê¥×¥È¤ò½èÍý¤¹¤ë¤¿¤á¡¢m17n ¥é¥¤¥Ö¥é¥ê¤Ï¥Õ¥©¥ó¥È¥ì +¥¤¥¢¥¦¥È¥Æ¡¼¥Ö¥ë (û½Ì¤·¤Æ FLT ¤È¸Æ¤Ö¤³¤È¤Ë¤¹¤ë) ¤òÍѤ¤¤ë¡£FLT ¥É¥é¥¤ +¥Ð¤Ï FLT ¤ò²ò¼á¤·¡¢Ê¸»úÎó¤òɽ¼¨¥¨¥ó¥¸¥ó¤ËÅϤ¹¤³¤È¤Î¤Ç¤­¤ë¥°¥ê¥ÕÎó¤ËÊÑ +´¹¤¹¤ë¡£ + +FLT ¤Ï OpenType Layout Table ¤Ë¸«¤é¤ì¤ë¾ðÊó (CMAP, GSUB, and GPOS) ¤Ë +²Ã¤¨¤Æ¡¢Ê¸»úÎ󤫤é½ñµ­ÁÇ (grapheme) ¥¯¥é¥¹¥¿¤òÃê½Ð¤·¤¿¤ê¡¢¥¯¥é¥¹¥¿Æâ¤Ç +ʸ»ú¤òʤÙÊѤ¨¤¿¤ê¤¹¤ë¤¿¤á¤Î¾ðÊó¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë¡£ + +FLT ¤Ï 1 ¤Ä°Ê¾å¤ÎÊÑ´¹¥¹¥Æ¡¼¥¸¤¬Â³¤¤¤¿¤â¤Î¤Ç¤¢¤ë¡£³Æ¥¹¥Æ¡¼¥¸¤Ç¥³¡¼¥ÉÎó +¤ÏÊ̤Τâ¤Î¤ËÊÑ´¹¤µ¤ì¡¢¼¡¤Î¥¹¥Æ¡¼¥¸¤ËÆɤޤì¤ë¡£Îó¤ÎŤµ¤Ï¥¹¥Æ¡¼¥¸Ëè¤Ë°Û +¤Ê¤ë¤³¤È¤¬¤¢¤ë¡£¥³¡¼¥ÉÎó¤Î³ÆÍ×ÁǤϰʲ¼¤ÎÀ°¿ôÃͤΰÀ­¤ò»ý¤Ä¡£ + +
    +
  • ¥³¡¼¥É + +ÊÑ´¹¤ÎºÇ½é¤Î¥¹¥Æ¡¼¥¸¤Ç¤Ï¡¢¸µ¤Îʸ»úÎó¤Îʸ»ú¥³¡¼¥É¡£ºÇ¸å¤Î¥¹¥Æ¡¼¥¸¤Ç¤Ï¡¢ +ɽ¼¨¥¨¥ó¥¸¥ó¤ËÅϤµ¤ì¤ë¥°¥ê¥Õ¥³¡¼¥É¡£¤½¤ì°Ê³°¤Ç¤ÏÃæ´ÖŪ¤Ê¥°¥ê¥Õ¥³¡¼¥É¡£ + +
  • ¥«¥Æ¥´¥ê + +¤½¤Î¥¹¥Æ¡¼¥¸¤Î @c CATEGORY-TABLE ¤ÇÄêµÁ¤µ¤ì¤¿¥«¥Æ¥´¥ê¡¼¥³¡¼¥É¡£ + +
  • ·ë¹çµ¬Â§ + +0 ¤Ç¤Ê¤±¤ì¤Ð¡¢¤³¤Î¡ÊÃæ´Ö¡Ë¥°¥ê¥Õ¤òÁ°¤Î¤â¤Î¤È¤É¤¦·ë¹ç¤¹¤ë¤«¤ò»ØÄꤹ¤ë¡£ + +
  • º¸¥Ñ¥Ç¥£¥ó¥°¥Õ¥é¥° + +0 ¤Ç¤Ê¤±¤ì¤Ð¡¢É½¼¨´Ø¿ô¤Ë¤³¤Î¡ÊÃæ´Ö¡Ë¥°¥ê¥Õ¤ÎÁ°¤Ë¥¹¥Ú¡¼¥¹¤òÁÞÆþ¤·¤Æ¡¢Á° +¤Î¥°¥ê¥Õ¤È½Å¤Ê¤é¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤è¤¦»Ø¼¨¤¹¤ë¡£ + +
  • ±¦¥Ñ¥Ç¥£¥ó¥°¥Õ¥é¥° + +0 ¤Ç¤Ê¤±¤ì¤Ð¡¢É½¼¨´Ø¿ô¤Ë¤³¤Î¡ÊÃæ´Ö¡Ë¥°¥ê¥Õ¤Î¸å¤Ë¥¹¥Ú¡¼¥¹¤òÁÞÆþ¤·¤Æ¡¢¸å +¤Î¥°¥ê¥Õ¤È½Å¤Ê¤é¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤è¤¦»Ø¼¨¤¹¤ë¡£ + +
+ +¥ì¥¤¥¢¥¦¥È¥¨¥ó¥¸¥ó¤¬¥Æ¥­¥¹¥È¤òÉÁ¤¯ºÝ¤Ë¤Ï¡¢¤Þ¤º¥Æ¥­¥¹¥È¤Î³Æʸ»ú¤ËÂФ·¤Æ +¤½¤ì¤¾¤ì¥Õ¥©¥ó¥È¤ÈFLT ¤ò·èÄꤹ¤ë¡£Æ±¤¸¥Õ¥©¥ó¥È¤È FLT ¤òÍѤ¤¤ëÉôʬʸ»ú +Îó¤Ë´Ø¤·¤Æ¡¢¥ì¥¤¥¢¥¦¥È¥¨¥ó¥¸¥ó¤ÏÂбþ¤¹¤ëÃæ´ÖŪ¤Ê¥°¥ê¥Õ¤ÎÎó¤òÀ¸À®¤¹¤ë¡£ +Ãæ´ÖŪ¤Ê¥°¥ê¥Õ¥³¡¼¥É¤Î³ÆÍ×ÁǤϡ¢¥³¡¼¥É¤Î°À­¤È¤·¤ÆÂбþ¤¹¤ëʸ»ú¥³¡¼¥É¡¢ +¾¤Î°À­¤È¤·¤Æ 0 ¤ò»ý¤Ä¡£¤³¤ÎÎó¤ÏFLT ¤ÎºÇ½é¤Î¥¹¥Æ¡¼¥¸¤Ç¸½¹Ô¤Î @e ¥é¥ó +(ÉôʬÎó) ¤È¤·¤Æ½èÍý¤µ¤ì¤ë¡£ + +³Æ¥¹¥Æ¡¼¥¸¤Ï°Ê²¼¤Î¤è¤¦¤ËƯ¤¯¡£ + +¤Þ¤º¤³¤Î¥¹¥Æ¡¼¥¸¤Ë @c CATEGORY-TABLE ¤¬¤¢¤ì¤Ð¡¢¸½¹Ô¤Î¥é¥ó¤Î¤¹¤Ù¤Æ¤Î¥° +¥ê¥Õ¤Î¥«¥Æ¥´¥ê¤¬¹¹¿·¤µ¤ì¤ë¡£¥«¥Æ¥´¥ê¤Î̵¤¤¥°¥ê¥Õ¤¬¤¢¤ì¤Ð¡¢¥é¥ó¤Ï¤½¤Î¥° +¥ê¥Õ¤ÎÁ°¤Ç½ª¤ë¡£ + +¼¡¤Ë¤³¤Î¥¹¥Æ¡¼¥¸¤Î¥³¡¼¥É¥ª¥Õ¥»¥Ã¥È¡¢·ë¹çµ¬Â§¡¢º¸¥Ñ¥Ç¥£¥ó¥°¥Õ¥é¥°¤¬ 0 +¤Ë½é´ü²½¤µ¤ì¤ë¡£ + +¼¡¤¤¤Ç¡¢¤³¤Î¥¹¥Æ¡¼¥¸¤ÎºÇ½é¤ÎÊÑ´¹µ¬Â§¤¬¸½¹Ô¤Î¥é¥ó¤ËŬÍѤµ¤ì¤ë¡£ + +ºÇ¸å¤Ë¸½¹Ô¤Î¥é¥ó¤Ï¿·¤·¤¯ºî¤é¤ì¤¿¡ÊÃæ´Ö¡Ë¥°¥ê¥ÕÎó¤ËÃÖ¤­´¹¤¨¤é¤ì¤ë¡£ + +@subsection flt-syntax ʸˡ¤È°ÕÌ£ + +m17n ¥é¥¤¥Ö¥é¥ê ¤Ï m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥¿¥° \ ¤òÍѤ¤¤Æ FLT ¤ò¥í¡¼¥É¤¹¤ë¡£FLT ¤Î¥Ç¡¼¥¿¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï°Ê²¼¤ÎÄ̤ꡧ + +@verbatim +FONT-LAYOUT-TABLE ::= STAGE0 STAGE * + +STAGE0 ::= CATEGORY-TABLE GENERATOR + +STAGE ::= CATEGORY-TABLE ? GENERATOR + +CATEGORY-TABLE ::= '(' 'category' CATEGORY-SPEC + ')' + +CATEGORY-SPEC ::= '(' CODE CATEGORY ')' + | '(' CODE CODE CATEGORY ')' + +CODE ::= INTEGER + +CATEGORY ::= INTEGER +@endverbatim + +@c CATEGORY-SPEC ¤ÎÄêµÁÃæ¤Ç¡¢ @c CODE ¤Ï¥°¥ê¥Õ¥³¡¼¥É @c CATEGORY ¤ÏÂç +ʸ»ú¤¢¤ë¤¤¤Ï¾®Ê¸»ú¤Î ASCII code¡¢¤¹¤Ê¤ï¤Á 'A', ... 'Z', 'a', .. 'z' ¤Î +¤¤¤º¤ì¤«¤Ç¤¢¤ë¡£ + +@c CATEGORY-SPEC ¤ÎºÇ½é¤Î·Á¼°¤Ï¡¢@c CATEGORY ¤ò¥³¡¼¥É @c CODE ¤ò»ý¤Ä¥° +¥ê¥Õ¤Ë³ä¤êÅö¤Æ¡¢Æó¤ÄÌܤηÁ¼°¤Ï @c CATEGORY ¤òÆó¤Ä¤Î @c CODE ¤Î´Ö¤Î¥³¡¼ +¥É¤ò»ý¤Ä¥°¥ê¥Õ¤Ë³ä¤êÅö¤Æ¤ë¡£ + +@verbatim +GENERATOR ::= '(' 'generator' RULE MACRO-DEF * ')' + +RULE ::= REGEXP-BLOCK | MATCH-BLOCK | SUBST-BLOCK | COND-BLOCK + | DIRECT-CODE | COMBINING-SPEC | OTF-SPEC + | PREDEFINED-RULE | MACRO-NAME + +MACOR-DEF ::= '(' MACRO-NAME RULE + ')' +@endverbatim + +³Æ @c RULE ¤Ï¡¢¾ÃÈñ¤¹¤ë¥°¥ê¥Õ¤ÈÀ¸À®¤¹¤ë¥°¥ê¥Õ¤ò»ØÄꤹ¤ë¡£¡Ö¾ÃÈñ¤µ¤ì¤¿¡× +¥°¥ê¥Õ¤Ï¸½¹Ô¤Î¥é¥ó¤«¤é¼è¤ê½ü¤«¤ì¤ë¡£¥ë¡¼¥ë¤Ï¾õ¶·¤Ë¤è¤Ã¤Æ¤Ï¼ºÇÔ¤¹¤ë¡£ÌÀ +¼¨Åª¤Ë¼ºÇԤȽñ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¤ò¤Î¤¾¤­¡¢À®¸ù¤È¤ß¤Ê¤¹¡£ + +@verbatim +DIRECT-CODE ::= INTEGER +@endverbatim + +¤³¤Î¥ë¡¼¥ë¤Ï¥°¥ê¥Õ¤ò¾ÃÈñ¤»¤º¡¢°Ê²¼¤Î°À­¤ò»ý¤Ä¥°¥ê¥Õ¤òÀ¸À®¤¹¤ë¡£ + +
    +
  • ¥³¡¼¥É : @c INTEGER ¡Ü ¥Ç¥Õ¥©¥ë¥È¤Î¥³¡¼¥É¥ª¥Õ¥»¥Ã¥È +
  • ·ë¹çµ¬Â§ : ¥Ç¥Õ¥©¥ë¥ÈÃÍ +
  • º¸¥Ñ¥Ç¥¤¥ó¥°¥Õ¥é¥° : ¥Ç¥Õ¥©¥ë¥ÈÃÍ +
  • ±¦¥Ñ¥Ç¥¤¥ó¥°¥Õ¥é¥° : 0 +
+ +¥°¥ê¥ÕÀ¸À®¸å¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥³¡¼¥É¥ª¥Õ¥»¥Ã¥È¡¢·ë¹çµ¬Â§, º¸¥Ñ¥Ç¥£¥ó¥°¥Õ¥é +¥° ¤Ï¤¹¤Ù¤Æ 0 ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤ë¡£ + +@verbatim +PREDEFINED-RULE ::= '=' | '*' | '<' | '>' | '|' | '[' | ']' +@endverbatim + +¤³¤ì¤é¤Ï°Ê²¼¤Î¤è¤¦¤ËƯ¤¯¡£ + +
    +
  • @c = + +¸½¹Ô¤Î¥é¥ó¤ÎºÇ½é¤Î¥°¥ê¥Õ¤ò¾ÃÈñ¤·¡¢Æ±¤¸¥°¥ê¥Õ¤òÀ¸À®¤¹¤ë¡£¸½¹Ô¤Î¥é¥ó¤¬¶õ +¤Ê¤é¤Ð¼ºÇÔ¤¹¤ë¡£ + +
  • @c * + +Á°¤Î¥ë¡¼¥ë¤ò·«¤êÊÖ¤·¼Â¹Ô¤¹¤ë¡£Á°¤Î¥ë¡¼¥ë¤¬¼ºÇÔ¤¹¤ì¤Ð¡¢²¿¤â¤»¤º¼ºÇÔ¤¹¤ë¡£ + +
  • @c @< + +½ñµ­ÁÇ¥¯¥é¥¹¥¿¤Î»Ï¤á¤ò¼¨¤¹¡£ + +
  • @c @> + +½ñµ­ÁÇ¥¯¥é¥¹¥¿¤Î½ª¤ê¤ò¼¨¤¹¡£ + +
  • @c @[ + +¤³¤Îµ¬Â§¤Ï¥Ç¥Õ¥©¥ë¥È¤Îº¸¥Ñ¥Ç¥£¥ó¥°¥Õ¥é¥°¤ò 1 ¤Ë¤¹¤ë¡£¥°¥ê¥Õ¤Î¾ÃÈñ¤äÀ¸ +À®¤Ï¤·¤Ê¤¤¡£ + +
  • @c @] + +¤³¤Îµ¬Â§¤ÏºÇ¶áÀ¸À®¤µ¤ì¤¿¥°¥ê¥Õ¤Î±¦¥Ñ¥Ç¥£¥ó¥°¥Õ¥é¥°¤ò 1 ¤Ë¤¹¤ë¡£¥°¥ê¥Õ +¤Î¾ÃÈñ¤äÀ¸À®¤Ï¤·¤Ê¤¤¡£ + +
  • @c | + +¥°¥ê¥Õ¤ò¾ÃÈñ¤»¤º¡¢¥«¥Æ¥´¥ê¤¬ ' ' ¤Ç¾¤Î°À­¤¬ 0 ¤Ç¤¢¤ëÆÃÊ̤ʥ°¥ê¥Õ¤òÀ¸ +À®¤¹¤ë¡£¤³¤Îµ¬Â§¤À¤±¤¬¤³¤ÎÆÃÊ̤ʥ°¥ê¥Õ¤òÀ¸À®¤¹¤ë¡£ + +
+ +@verbatim +REGEXP-BLOCK ::= '(' REGEXP RULE * ')' + +REGEXP ::= MTEXT +@endverbatim + +@c MTEXT ¤Ï¸½¹Ô¤Î¥é¥ó¤Î¥«¥Æ¥´¥êÎó¤Ë¹çÃפ¹¤Ù¤­Àµµ¬É½¸½¤Ç¤¢¤ë¡£¹çÃפ¹¤ì +¤Ð¡¢¤³¤Îµ¬Â§¤Ï°ì»þŪ¤Ë¸½¹Ô¤Î¥é¥ó¤ò¹çÃפ·¤¿Éôʬ¤À¤±¤Ë¸ÂÄꤷ¤¿¾å¤Ç¡¢@c +RULE ¤ò¼Â¹Ô¤¹¤ë¡£¹çÃפ·¤¿Éôʬ¤Ï¤³¤Îµ¬Â§¤Ë¤è¤Ã¤Æ¾ÃÈñ¤µ¤ì¤ë¡£ + +³ç¸Ì¤Î¤Ä¤¤¤¿Éôʬɽ¸½¤¬¤¢¤ì¤Ð¡¢@c RULE ¤ÎÃæ¤Ë½Ð¸½¤¹¤ë¤«¤â¤·¤ì¤Ê¤¤ @c +MATCH-BLOCK ¤Ë¤è¤Ã¤Æ»ÈÍѤ¹¤ë¤¿¤á¤Ëµ­Ï¿¤µ¤ì¤ë¡£ + +¹çÃפ¹¤ëÉôʬ¤¬Ìµ¤±¤ì¤Ð¡¢¤³¤Îµ¬Â§¤Ï¼ºÇÔ¤¹¤ë¡£ + +@verbatim +MATCH-BLOCK ::= '(' MATCH-INDEX RULE * ')' + +MATCH-INDEX ::= INTEGER +@endverbatim + +@c MATCH-INDEX ¤ÏľÁ°¤Î @c REGEXP-BLOCK ¤Ë¤è¤Ã¤Æµ­Ï¿¤µ¤ì¤¿Éôʬɽ¸½¤ò»Ø +Äꤹ¤ëÀ°¿ô¤Ç¤¢¤ë¡£¤³¤Î¤è¤¦¤ÊÉôʬɽ¸½¤¬¤¢¤ì¤Ð¡¢¤³¤Îµ¬Â§¤Ï°ì»þŪ¤Ë¸½¹Ô¤Î +¥é¥ó¤ò¹çÃפ·¤¿Éôʬɽ¸½¤À¤±¤Ë¸ÂÄꤷ¤¿¾å¤Ç¡¢@c RULE ¤ò¼Â¹Ô¤¹¤ë¡£¹çÃפ·¤¿ +Éôʬ¤Ï¤³¤Îµ¬Â§¤Ë¤è¤Ã¤Æ¾ÃÈñ¤µ¤ì¤ë¡£ + +¹çÃפ¹¤ëÉôʬ¤¬Ìµ¤±¤ì¤Ð¡¢¤³¤Îµ¬Â§¤Ï¼ºÇÔ¤¹¤ë¡£ + +¤³¤Îµ¬Â§¤¬¥¹¥Æ¡¼¥¸¤ÎºÇ½é¤Ëµ¬Â§¤Ç¤¢¤ì¤Ð¡¢@c MATCH-INDEX ¤Ï 0 ¤Ç¤¢¤ê¡¢¸½ +¹Ô¤Î¥é¥óÁ´ÂΤ˹çÃפ¹¤ë¡£ + +@verbatim +SUBST-BLOCK ::= '(' SOURCE-PATTERN RULE * ')' + +SOURCE-PATTERN ::= '(' CODE + ')' + | (' 'range' CODE CODE ')' +@endverbatim + +¸½¹Ô¤Î¥é¥ó¤Î¥³¡¼¥ÉÎó¤¬ @c SOURCE-PATTERN ¤È¹çÃפ¹¤ì¤Ð¡¢¤³¤Îµ¬Â§¤Ï°ì»þ +Ū¤Ë¸½¹Ô¤Î¥é¥ó¤ò¹çÃפ·¤¿Éôʬ¤À¤±¤Ë¸ÂÄꤷ¤¿¾å¤Ç¡¢@c RULE ¤ò¼Â¹Ô¤¹¤ë¡£ +¹çÃפ·¤¿Éôʬ¤Ï¾ÃÈñ¤µ¤ì¤ë¡£ + +@c SOURCE-PATTERN ¤ÎºÇ½é¤Î·Á¼°¤Ï¡¢¹çÃפ¹¤ë¥°¥ê¥Õ¥³¡¼¥É¤ÎÎó¤ò»ØÄꤹ¤ë¡£ +¤³¤Î¾ì¹ç¡¢¤³¤Îµ¬Â§¤Ï¥Ç¥Õ¥©¥ë¥È¤Î¥³¡¼¥É¥ª¥Õ¥»¥Ã¥È¤ò 0 ¤Ë¥ê¥»¥Ã¥È¤¹¤ë¡£ + +Æó¤Ä¤á¤Î·Á¼°¤Ï¡¢¥³¡¼¥ÉÎó¤ÎºÇ½é¤Î¥°¥ê¥Õ¥³¡¼¥É¤ÎÈϰϤò»ØÄꤹ¤ë¡£¤³¤Î¾ì¹ç¡¢ +¤³¤Îµ¬Â§¤Ï¥Ç¥Õ¥©¥ë¥È¤Î¥³¡¼¥É¥ª¥Õ¥»¥Ã¥È¤òºÇ½é¤Î¥°¥ê¥Õ¥³¡¼¥É¤«¤éÈϰϤò»Ø +Äꤹ¤ë½é¤á¤Î @c CODE ¤ò°ú¤¤¤¿¤â¤Î¤ËÀßÄꤹ¤ë¡£ + +¹çÃפ¹¤ëÉôʬ¤¬Ìµ¤±¤ì¤Ð¡¢¤³¤Îµ¬Â§¤Ï¼ºÇÔ¤¹¤ë¡£ + +@verbatim +COND-BLOCK ::= '(' 'cond' RULE + ')' +@endverbatim + +¤³¤Îµ¬Â§¤Ï @c RULE ¤ò½ç¤Ë¡¢¤É¤ì¤«¤¬À®¸ù¤¹¤ë¤Þ¤Ç¼Â¹Ô¤¹¤ë¡£¤É¤Î¥ë¡¼¥ë¤â +À®¸ù¤·¤Ê¤±¤ì¤Ð¡¢¤³¤Îµ¬Â§¤Ï¼ºÇÔ¤¹¤ë¡£¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÀ®¸ù¤Ç¤¢¤ë¡£ + +@verbatim +OTF-SPEC ::= SYMBOL +@endverbatim + +@c OTF-SPEC ¤Ï¡¢OTF ¥É¥é¥¤¥Ð¤Ø¤Î»Ø¼¨¤ò»ØÄꤹ¤ë̾Á°¤ò»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£ +̾Á°¤Ï°Ê²¼¤Îʸˡ¤Ë½¾¤¦¡£ + +@verbatim + OTF-SPEC-NAME ::= 'otf:' SCRIPT LANGSYS ? GSUB-FEATURES ? GPOS-FEATURES ? + + SCRIPT ::= SYMBOL + + LANGSYS ::= '/' SYMBOL + + GSUB-FEATURES ::= '=' FEATURE-LIST ? + + GPOS-FEATURES ::= '+' FEATURE-LIST ? + + FEATURE-LIST ::= ( SYMBOL ',' ) * [ SYMBOL | '*' ] + +@endverbatim + +³Æ @c SYMBOL ¤Ï OpenType specification Ãæ¤Ç¤Î¥¿¥°Ì¾¤ò»ØÄꤹ¤ë¡£ + +@c SCRIPT ¤Ë¤Ä¤¤¤Æ¤Ï¡¢@c SYMBOL ¤Ï¥¹¥¯¥ê¥×¥È¥¿¥°Ì¾¤òɽ¤¹¡£Devanagari +¤Ï deva ¤Ê¤É¡£) + +@c LANGSYS ¤Î¾ì¹ç¤Ï¡¢@c SYMBOL ¤Ï¸À¸ì¥·¥¹¥Æ¥à¥¿¥°Ì¾¤ò»ØÄꤹ¤ë¡£@c +LANGSYS ¤¬¾Êά¤µ¤ì¤ì¤Ð¡¢¥Ç¥Õ¥©¥ë¥È¤Î¸À¸ì¥·¥¹¥Æ¥à¥Æ¡¼¥Ö¥ë¤¬»ÈÍѤµ¤ì¤ë¡£ + +@c GSUB-FEATURES ¤Ç¤Ï¡¢ @c FEATURE LIST Ãæ¤Î³Æ @c SYMBOL ¤Ï ŬÍѤ¹¤ë +GSUB feature ¥¿¥°Ì¾¤ò»ØÄꤹ¤ë¡£'*' ¤Ï»Ä¤ê¤¹¤Ù¤Æ¤Î feature ¤ò»ØÄꤹ¤ë¤¿ +¤á¤ËºÇ¸å¤ÎÍ×ÁǤȤ·¤ÆÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ @c SYMBOL ¤ÎÁ°¤Ë'~' ¤¬¤Ä¤¤¤Æ +¤ª¤ê¡¢ºÇ¸å¤ÎÍ×ÁǤ¬ '*' ¤Ê¤é¤Ð¡¢@c SYMBOL ¤ÏŬÍѤ¹¤ëfeature ¤«¤é½ü¤«¤ì +¤ë¡£@c SYMBOL ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢GSUB feature ¤ÏŬÍѤµ¤ì¤Ê¤¤¡£@c +GSUB-FEATURES ¼«ÂΤ¬¾Êά¤µ¤ì¤ì¤Ð¤¹¤Ù¤Æ¤Î GSUB feature ¤¬Å¬ÍѤµ¤ì¤ë¡£ + +@c GPOS-FEATURES ¤Î»ØÄê¤Ï @c GSUB-FEATURES ¤Î¾ì¹ç¤ÈƱÍͤǤ¢¤ë¡£ + +Á´¤Æ¤Î¥¿¥°Ì¾¤Ï ASCII ¤Î£´Ê¸»ú¤Ç¤¢¤ë¤³¤È¡£ + +OpenType ¤Î»ØÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï¼¡¤Î¥Ú¡¼¥¸¤ò»²¾È¤Î¤³¤È¡£\n + + +@verbatim +COMBINING ::= SYMBOL +@endverbatim + +@c COMBINING ¤Ï¡¢ ¼¡¤Î¥°¥ê¥Õ¤òÁ°¤Î¤â¤Î¤È¤É¤¦·ë¹ç¤¹¤ë¤«¤Î»Ø¼¨¤ò̾Á°¤È¤· +¤Æ»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£¤³¤Î¥ë¡¼¥ë¤Ï¥Ç¥Õ¥©¥ë¥È¤Î·ë¹çµ¬Â§¤ò¥·¥ó¥Ü¥ë̾¸ÇÍ­ +¤ÎÀ°¿ô¥³¡¼¥É¤Ë¥»¥Ã¥È¤¹¤ë¡£Ì¾Á°¤Ï°Ê²¼¤Îʸˡ¤Ë½¾¤¦¡£ +following syntax. + +@verbatim + COMBINING-NAME ::= VPOS HPOS OFFSET VPOS HPOS + + VPOS ::= 't' | 'c' | 'b' | 'B' + + HPOS ::= 'l' | 'c' | 'r' + + OFFSET :: = '.' | XOFF | YOFF XOFF ? + + XOFF ::= ('<' | '>') INTEGER ? + + YOFF ::= ('+' | '-') INTEGER ? +@endverbatim + +@c VPOS ¤È @c HPOS ¤Ï¼¡¤Î¤è¤¦¤Ë¿âľ¡¢¿åÊ¿°ÌÃÖ¤ò»ØÄꤹ¤ë¡£ + +@verbatim + POINT VPOS HPOS + ----- ---- ---- + 0----1----2 <---- top 0 t l + | | 1 t c + | | 2 t r + | | 3 B l + 9 10 11 <---- center 4 B c + | | 5 B r + --3----4----5-- <-- baseline 6 b l + | | 7 b c + 6----7----8 <---- bottom 8 b r + 9 c l + | | | 10 c c + left center right 11 c r +@endverbatim + +º¸¤Î¿Þ¤Ï¤¢¤ë¥°¥ê¥Õ¤Î 12 ¤Î»²¾ÈÅÀ¤ò 0 ¤«¤é 11 ¤Þ¤Ç¤Î¿ô»ú¤Ç¼¨¤·¤Æ¤¤¤ë¡£ +»Í³Ñ·Á 0-6-8-2 ¤Ï¥°¥ê¥Õ¤Îɽ¼¨Îΰè¤Ç¤¢¤ê¡¢°ÌÃÖ3, 4, 5 ¤Ï¥Ù¡¼¥¹¥é¥¤¥ó¾å +¤Ë¤¢¤ë¡£ 9 ¤È 11 ¤Ï¤½¤ì¤¾¤ìÀþ0-6 ¤È 2-8 ¤ÎÃæ¿´¤Ç¤¢¤ë¡£1, 10, 4, 7 ¤Ï¤½ +¤ì¤¾¤ìÀþ1-2, 3-5, 9-11, 6-8 ¤ÎÃæ¿´¤Ç¤¢¤ë¡£ + +±¦¤Îɽ¤Ï¡¢³Æ»²¾ÈÅÀ¤¬@c VPOS ¤È @c HPOS ¤ÎÁȹ礻¤Ë¤è¤Ã¤Æ¤É¤Î¤è¤¦¤Ë»ØÄê +¤µ¤ì¤ë¤«¤ò¼¨¤·¤Æ¤¤¤ë¡£ + +@c COMBINING-NAME ¤ÎÄêµÁÃæ¤ÎºÇ½é¤Î @c VPOS ¤È @c HPOS ¤Ï¡¢Á°¤Î¥°¥ê¥Õ¤Î +»²¾ÈÅÀ¤ò¡¢Æó¤ÄÌܤΠ@c VPOS ¤È @c HPOS ¤Ï¼¡¤Î¥°¥ê¥Õ¤Î»²¾ÈÅÀ¤ò»ØÄꤹ¤ë¡£ +¼¡¤Î¥°¥ê¥Õ¤Ï¤³¤ÎÆó¸Ä¤Î»²¾ÈÅÀ¤¬½Å¤Ê¤ë¤è¤¦¤ËÉÁ¤«¤ì¤ë¡£ + +@c OFFSET ¤Ï½Å¤Ê¤ê¤«Â¾¤Î¾ÜºÙ¤ò»ØÄꤹ¤ë¡£'.' ¤Ç¤¢¤ì¤Ð¡¢»²¾ÈÅÀÆó¤Ä¤ÏƱ¤¸ +°ÌÃ֤ˤ¢¤ë¡£ + +@c XOFF ¤Ï¡¢¼¡¤Î¥°¥ê¥Õ¤Î»²¾ÈÅÀ¤Î X ºÂɸ¤ò¡¢Á°¤Î»²¾ÈÅÀ¤«¤é¤É¤ì¤Û¤É±¦ +('<') ¤¢¤ë¤¤¤Ïº¸ ('>') ¤Ø¤º¤é¤¹¤«»ØÄꤹ¤ë¡£ + +@c YOFF ¤Ï¡¢¼¡¤Î¥°¥ê¥Õ¤Î»²¾ÈÅÀ¤Î Y ºÂɸ¤ò¡¢Á°¤Î»²¾ÈÅÀ¤«¤é¤É¤ì¤Û¤É¾å +('+') ¤¢¤ë¤¤¤Ï²¼ ('-') ¤Ø¤º¤é¤¹¤«»ØÄꤹ¤ë¡£ + +¤É¤Á¤é¤Î¾ì¹ç¤Ë¤â¡¢@c INTEGER ¤Ï¥Õ¥©¥ó¥È¥µ¥¤¥º¤Î²¿¡ó¤º¤é¤¹¤«¤ò¼¨¤¹ÃÍ¤Ç +¤¢¤ë¡£¤¹¤Ê¤ï¤Á¡¢¤â¤· @c INTEGER ¤¬ 10 ¤Ê¤é¤Ð¥Õ¥©¥ó¥È¥µ¥¤¥º¤Î10% (1/10) +¤º¤é¤¹¤³¤È¤Ë¤Ê¤ë¡£ @c INTEGER ¤¬¾Êά¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢5 ¤¬»ØÄꤵ¤ì¤¿¤â¤Î +¤È¤¹¤ë¡£ + +¼¡¤Î¥°¥ê¥Õ¤¬Á°¤Î¥°¥ê¥Õ¤Ë·ë¹ç¤µ¤ì¤ë¤È¡¢¤½¤ì¤é¤Ï°ì¤Ä¤Î·ë¹ç¥°¥ê¥Õ¤È¤·¤Æ°· +¤ï¤ì¤ë¡£ + +@verbatim +MACRO-NAME ::= SYMBOL +@endverbatim + +@c MACRO-NAME ¤Ï @c MACRO-DEF ¤Î¤¤¤º¤ì¤«¤Ë¸½¤ï¤ì¤ë¥·¥ó¥Ü¥ë¤Ç¤¢¤ê¡¢Âбþ +¤¹¤ë@c RULE ¤ÎÎó¤ËŸ³«¤µ¤ì¤ë¡£ + +@subsection flt-context-dependent ʸ̮¤Ë°Í¸¤¹¤ë¿¶Éñ + +¤³¤³¤Þ¤Ç¤Ï¡¢ÆÃÄê¤Î¥Õ¥©¥ó¥È¤ÇÉÁ¤«¤ì¤ë³Æʸ»ú¡¿¥°¥ê¥ÕÎó¤¬Ê¸Ì®¼«Í³¤Ç¤¢¤ë¤³ +¤È¡¢¤¹¤Ê¤ï¤ÁÁ°¸å¤Î¥°¥ê¥Õ¤Ë±Æ¶Á¤µ¤ì¤Ê¤¤¤³¤È¤òÁ°Äó¤È¤·¤Æ¤­¤¿¡£¤³¤ì¤Ï¡¢Îó +S1 ¤¬¥Õ¥©¥ó¥ÈF1 ¤Ë¤è¤Ã¤ÆÉÁ¤«¤ì¡¢Àè¹Ô¤¹¤ëÎó S0 ¤¬¾ï¤Ë¥Õ¥©¥ó¥È F0 ¤òÍ×µá +¤¹¤ë¾ì¹ç¤Ë¤ÏÀµ¤·¤¤¡£ + +@verbatim + Îó S0 S1 + ¸½¹Ô¤Î¥Õ¥©¥ó¥È F0 F1 + ÍøÍѲÄǽ¤Ê¥Õ¥©¥ó¥È F0 F1 +@endverbatim + +¤·¤«¤·»þ¤Ë¤Ï¡¢Îó¤òÌÀ³Î¤Ë¶èÀڤ뤳¤È¤¬¤Ç¤­¤Ê¤¤¾ì¹ç¤â¤¢¤ë¡£Àè¹Ô¤¹¤ëÎó S0 +¤¬ F0 ¤À¤±¤Ç¤Ê¤¯ F1 ¤Ç¤âÉÁ¤±¤ë¤È¤·¤è¤¦¡£ + +@verbatim + Îó S0 S1 + ¸½¹Ô¤Î¥Õ¥©¥ó¥È F0 F1 + ÍøÍѲÄǽ¤Ê¥Õ¥©¥ó¥È F0,F1 F1 +@endverbatim + +¤³¤Î¾ì¹ç¡¢Àè¹Ô¤¹¤ë S0 ¤òÉÁ¤¯¤¿¤á¤Ë»È¤ï¤ì¤¿¥°¥ê¥Õ¤¬ S1 ¤Î¥°¥ê¥Õ¤ÎÀ¸À®¤Ë +±Æ¶Á¤òÍ¿¤¨¤ë¤³¤È¤â¤¢¤ë¡£¤½¤³¤Ç S1 ¤Î½èÍý¤ÎºÝ¤Ë¤¹¤Ç¤Ë½èÍý¤Î½ª¤Ã¤¿ S0 ¤Ë +´Ø¤¹¤ë¾ðÊó¤Ë¥¢¥¯¥»¥¹¤¹¤ëɬÍפ¬¤¢¤ë¡£ºÇ½é¤Î¥¹¥Æ¡¼¥¸¡Ê¤³¤Î¥¹¥Æ¡¼¥¸¤Î¤ß¡Ë +¤ÎÀ¸À®µ¬Â§¤Ï¡¢½èÍýºÑ¤ß¤ÎÉôʬ¤Ø¥¢¥¯¥»¥¹¤¹¤ëÆÃÊ̤ÊÀµµ¬É½¸½¤òµö¤·¤Æ¤¤¤ë¡£ + +@verbatim + "RE0 RE1" +@endverbatim + +@c RE0 ¤È @c RE1 ¤ÏÀè¹Ô¤ÎÎó S0 ¤È¸å³¤ÎÎó S1 ¤Ë¤½¤ì¤¾¤ìÂбþ¤¹¤ëÀµµ¬É½ +¸½¤Ç¤¢¤ë¡£ + +Æó¤Ä¤ÎÀµµ¬É½¸½¤Î´Ö¤Î¥¹¥Ú¡¼¥¹¤ËÃí°Õ¡£¤³¤ì¤ÏÆÃÊ̤ʥ«¥Æ¥´¥ê ' ' ¤ò¼¨¤·¤Æ +¤¤¤ë (¾åµ­»²¾È) ¡£¤³¤ÎÀµµ¬É½¸½¤Ï¥Õ¥©¥ó¥È F1 ¤ò»ÈÍѤ¹¤ë¥°¥ê¥ÕÀ¸À®µ¬Â§¤Ë +°¤·¤Æ¤ª¤ê¡¢¤·¤¿¤¬¤Ã¤Æ RE1 ¤À¤±¤Ç¤Ê¤¯RE0 ¤â F1 ÍѤΥ«¥Æ¥´¥ê¤òÍѤ¤¤Æɽ +¸½¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤Ä¤Þ¤ê¡¢Àè¹Ô¤¹¤ëÎóS0 ¤¬ F1 ÍѤΥ«¥Æ¥´¥ê¤Çɽ¤» +¤Ê¤¤¾ì¹ç¤Ë¤Ï(¾å¤ÎºÇ½é¤ÎÎã¤Î¤è¤¦¤Ë) ¤³¤Î¥Ñ¥¿¡¼¥ó¤ò»ý¤ÄÀ¸À®µ¬Â§¤Ë¤Ï¹çÃ× +¤·¤Ê¤¤¡£ + +@subsection flt-seealso »²¾È + +@ref mdbGeneral "mdbGeneral(5)", +@ref flt-list "FLTs provided by the m17n database" +*/ +/***en + +@section mdbFLT Font Layout Table + +@subsection flt-description DESCRIPTION + +For simple scripts, the rendering engine converts character codes into glyph +codes one by one by consulting the encoding of each selected font. +But, to render text that requires complicated layout (e.g. Thai and +Indic scripts), one to one conversion is not sufficient. A sequence +of characters may have to be drawn as a single ligature. Some +glyphs may have to be drawn at 2-dimensionally shifted positions. + +To handle those complicated scripts, the m17n library uses Font Layout +Tables (FLTs for short). The FLT driver interprets an FLT and +converts a character sequence into a glyph sequence that is ready to +be passed to the rendering engine. + +An FLT can contain information to extract a grapheme cluster from a +character sequence and to reorder the characters in the cluster, in +addition to information found in OpenType Layout Tables (CMAP, GSUB, +and GPOS). + +An FLT is a cascade of one or more conversion stages. In each stage, a +sequence is converted into another sequence to be read in the +next stage. The length of sequences may differ from stage to +stage. Each element in a sequence has the following integer attributes. + +
    +
  • code + +In the first conversion stage, this is the character code in the +original character sequence. In the last stage, it is the glyph code +passed to the rendering engine. In other cases, it is an intermediate +glyph code. + +
  • category + +This is the category code defined in the @c CATEGORY-TABLE +of the current stage. + +
  • combining-spec + +If nonzero, it specifies how to combine this (intermediate) glyph +with the previous one. + +
  • left-padding-flag + +If nonzero, it instructs the rendering function to insert a padding +space before this (intermediate) glyph so that the glyph does not +overlap with the previous one. + +
  • right-padding-flag + +If nonzero, it instructs the rendering function to insert a padding +space after this (intermediate) glyph so that the glyph does not +overlap with the next one. + +
+ +When the layout engine draws text, it at first determines a font and +an FLT for each character in the text. For each subsequence of +characters that use use the same font and FLT, the layout engine +generates an intermediate glyph sequence from the character +subsequence. Each element in the intermediate glyph sequence +has the corresponding character code as the code attribute and zeroes +for other attributes. This sequence is processed in the +first stage of FLT as the current @e run (substring). + +Each stage works as follows. + +At first, if the stage has a @c CATEGORY-TABLE, the category of each glyph +in the current run is updated. If there is a glyph that has no category, +the current run ends before that glyph. + +Then, the default values of code-offset, combining-spec, and left-padding-flag +of this stage are initialized to zero. + +Next, the initial conversion rule of the stage is applied to the +current run. + +Lastly, the current run is replaced with the newly produced +(intermediate) glyph sequence. + +@subsection flt-syntax SYNTAX and SEMANTICS + +The m17n library loads an FLT from the m17n database using the tag +\. The date format of an FLT is as follows: + +@verbatim +FONT-LAYOUT-TABLE ::= STAGE0 STAGE * + +STAGE0 ::= CATEGORY-TABLE GENERATOR + +STAGE ::= CATEGORY-TABLE ? GENERATOR + +CATEGORY-TABLE ::= '(' 'category' CATEGORY-SPEC + ')' + +CATEGORY-SPEC ::= '(' CODE CATEGORY ')' + | '(' CODE CODE CATEGORY ')' + +CODE ::= INTEGER + +CATEGORY ::= INTEGER +@endverbatim + +In the definition of @c CATEGORY-SPEC, @c CODE is a glyph code, and @c +CATEGORY is ASCII code of an upper or lower letter, i.e. one of 'A', +... 'Z', 'a', .. 'z'. + +The first form of @c CATEGORY-SPEC assigns @c CATEGORY to a glyph +whose code @c CODE. The second form assigns @c CATEGORY to glyphs +whose code falls between the two @c CODEs. + +@verbatim +GENERATOR ::= '(' 'generator' RULE MACRO-DEF * ')' + +RULE ::= REGEXP-BLOCK | MATCH-BLOCK | SUBST-BLOCK | COND-BLOCK + | DIRECT-CODE | COMBINING-SPEC | OTF-SPEC + | PREDEFINED-RULE | MACRO-NAME + +MACOR-DEF ::= '(' MACRO-NAME RULE + ')' +@endverbatim + +Each @c RULE specifies glyphs to be consumed and glyphs to be produced. When +some glyphs are consumed, they are taken away from the current run. A +rule may fail in some condition. If not described explicitly to +fail, it should be regarded that the rule succeeds. + +@verbatim +DIRECT-CODE ::= INTEGER +@endverbatim + +This rule consumes no glyph and produces a glyph which has the +following attributes: + +
    +
  • code : @c INTEGER plus the default code-offset +
  • combining-spec : default value +
  • left-padding-flag : default value +
  • right-padding-flag : zero +
+ +After having produced the glyph, the default code-offset, +combining-spec, and left-padding-flag are all reset to zero. + +@verbatim +PREDEFINED-RULE ::= '=' | '*' | '<' | '>' | '|' | '[' | ']' +@endverbatim + +They perform actions as follows. + +
    +
  • @c = + +This rule consumes the first glyph in the current run and produces the +same glyph. It fails if the current run is empty. + +
  • @c * + +This rule repeatedly executes the previous rule. +If the previous rule fails, this rule does nothing and fails. + +
  • @c @< + +This rule specifies the start of a grapheme cluster. + +
  • @c @> + +This rule specifies the end of a grapheme cluster. + +
  • @c @[ + +This rule sets the default left-padding-flag to 1. +No glyph is consumed. No glyph is produced. + +
  • @c @] + +This rule changes the right-padding-flag of the lastly generated +glyph to 1. +No glyph is consumed. No glyph is produced. + +
  • @c | + +This rule consumes no glyph and produces a special glyph whose +category is ' ' and other attributes are zero. +This is the only rule that produces that special glyph. + +
+ +@verbatim +REGEXP-BLOCK ::= '(' REGEXP RULE * ')' + +REGEXP ::= MTEXT +@endverbatim + +@c MTEXT is a regular expression that should match the sequence of +categories of the current run. If a match is found, this rule +executes @c RULEs temporarily limiting the current run to the matched +part. The matched part is consumed by this rule. + +Parenthesized subexpressions, if any, are recorded to be used in @c +MATCH-BLOCK that may appear in one of @c RULEs. + +If no match is found, this rule fails. + +@verbatim +MATCH-BLOCK ::= '(' MATCH-INDEX RULE * ')' + +MATCH-INDEX ::= INTEGER +@endverbatim + +@c MATCH-INDEX is an integer specifying a parenthesized subexpression +recorded by the previous @c REGEXP-BLOCK. If such a subexpression was +found by the previous regular expression matching, this rule executes @c +RULEs temporarily limiting the current run to the matched part +of the subexpression. The matched part is consumed by this rule. + +If no match was found, this rule fails. + +If this is the first rule of the stage, @c MATCH-INDEX must be 0, and +it matches the whole current run. + +@verbatim +SUBST-BLOCK ::= '(' SOURCE-PATTERN RULE * ')' + +SOURCE-PATTERN ::= '(' CODE + ')' + | (' 'range' CODE CODE ')' +@endverbatim + +If the sequence of codes of the current run matches @c SOURCE-PATTERN, +this rule executes @c RULEs temporarily limiting the current run to +the matched part. The matched part is consumed. + +The first form of @c SOURCE-PATTERN specifies a sequence of glyph codes to be +matched. In this case, this rule resets the default code-offset to +zero. + +The second form specifies a range of codes that should match the first +glyph code of the code sequence. In this case, this rule sets the +default code-offset to the first glyph code minus the first @c CODE +specifying the range. + + +If no match is found, this rule fails. + +@verbatim +COND-BLOCK ::= '(' 'cond' RULE + ')' +@endverbatim + +This rule sequentially executes @c RULEs until one succeeds. If no +rule succeeds, this rule fails. Otherwise, it succeeds. + +@verbatim +OTF-SPEC ::= SYMBOL +@endverbatim + +@c OTF-SPEC is a symbol whose name specifies an instruction to the OTF +driver. The name has the following syntax. + +@verbatim + OTF-SPEC-NAME ::= 'otf:' SCRIPT LANGSYS ? GSUB-FEATURES ? GPOS-FEATURES ? + + SCRIPT ::= SYMBOL + + LANGSYS ::= '/' SYMBOL + + GSUB-FEATURES ::= '=' FEATURE-LIST ? + + GPOS-FEATURES ::= '+' FEATURE-LIST ? + + FEATURE-LIST ::= ( SYMBOL ',' ) * [ SYMBOL | '*' ] + +@endverbatim + +Each @c SYMBOL specifies a tag name defined in the OpenType +specification. + +For @c SCRIPT, @c SYMBOL specifies a Script tag name (e.g. deva for +Devanagari). + +For @c LANGSYS, @c SYMBOL specifies a Language System tag name. If @c +LANGSYS is omitted, the Default Language System +table is used. + +For @c GSUB-FEATURES, each @c SYMBOL in @c FEATURE LIST specifies a GSUB Feature tag name +to apply. '*' is allowed as the last item to specify all remaining +features. If @c SYMBOL is preceded by '~' and the last item is '*', +@c SYMBOL is excluded from the features to apply. If no @c SYMBOL is +specified, no GSUB feature is applied. If @c GSUB-FEATURES itself is +omitted, all GSUB features are applied. + +The specification of @c GPOS-FEATURES is analogous to that of @c +GSUB-FEATURES. + +Please note that all the tags above must be 4 ASCII printable characters. + +See the following page for the OpenType specification.\n + + +@verbatim +COMBINING ::= SYMBOL +@endverbatim + +@c COMBINING is a symbol whose name specifies how +to combine the next glyph with the previous one. This rule sets the +default combining-spec to an integer code that is unique to the symbol +name. The name has the following syntax. + +@verbatim + COMBINING-NAME ::= VPOS HPOS OFFSET VPOS HPOS + + VPOS ::= 't' | 'c' | 'b' | 'B' + + HPOS ::= 'l' | 'c' | 'r' + + OFFSET :: = '.' | XOFF | YOFF XOFF ? + + XOFF ::= ('<' | '>') INTEGER ? + + YOFF ::= ('+' | '-') INTEGER ? +@endverbatim + +@c VPOS and @c HPOS specify the vertical and horizontal positions +as described below. + +@verbatim + POINT VPOS HPOS + ----- ---- ---- + 0----1----2 <---- top 0 t l + | | 1 t c + | | 2 t r + | | 3 B l + 9 10 11 <---- center 4 B c + | | 5 B r + --3----4----5-- <-- baseline 6 b l + | | 7 b c + 6----7----8 <---- bottom 8 b r + 9 c l + | | | 10 c c + left center right 11 c r +@endverbatim + +The left figure shows 12 reference points of a glyph by numbers 0 to +11. The rectangle 0-6-8-2 is the bounding box of the glyph, the +positions 3, 4, and 5 are on the baseline, 9 and 11 are on the center +of the lines 0-6 and 2-8 respectively, 1, 10, 4, and 7 are on the +center of the lines 1-2, 3-5, 9-11, and 6-8 respectively. + +The right table shows how those reference points are specified by a +pair of @c VPOS and @c HPOS. + +The first @c VPOS and @c HPOS in the definition of @c COMBINING-NAME +specify the +reference point of the previous glyph, and the second @c VPOS and @c +HPOS specify that of the next glyph. +The next glyph is drawn so that these two reference points align. + +@c OFFSET specifies the way of alignment in detail. If it is '.', the +reference points are on the same position. + +@c XOFF specifies how much the X position of the reference point of +the next glyph should be shifted to the right ('<') or left ('>') from +the previous reference point. + +@c YOFF specifies how much the Y position of the reference point the +next glyphshould be shifted upward ('+') or downward ('-') from the +previous reference point. + +In both cases, @c INTEGER is the amount of shift expressed as a +percentage of the font size, i.e., if @c INTEGER is 10, it means +10% (1/10) of the font size. If @c INTEGER is omitted, it is assumed that +5 is specified. + +Once the next glyph is combined with the previous one, they +are treated as a single combined glyph. + +@verbatim +MACRO-NAME ::= SYMBOL +@endverbatim + +@c MACRO-NAME is a symbol that appears in one of @c MACRO-DEF. It is +exapanded to the sequence of the correponding @c RULEs. + +@subsection flt-context-dependent CONTEXT DEPENDENT BEHAVIOR + +So far, it has been assumed that each sequence, which is drawn with a +specific font, is context free, i.e. not affected by the glyphs +preceding or following that sequence. This is true when sequence S1 +is drawn with font F1 while the preceding sequence S0 unconditionally +requires font F0. + +@verbatim + sequence S0 S1 + currently used font F0 F1 + usable font(s) F0 F1 +@endverbatim + +Sometimes, however, a clear separation of sequences is not possible. +Suppose that the preceding sequence S0 can be drawn not only with F0 +but also with F1. + +@verbatim + sequence S0 S1 + currently used font F0 F1 + usable font(s) F0,F1 F1 +@endverbatim + +In this case, glyphs used to draw the preceding S0 may affect glyph +generation of S1. Therefore it is necessary to access information +about S0, which has already been processed, when processing S1. +Generation rules in the first stage (only in the first stage) accept a +special regular expression to access already processed parts. + +@verbatim + "RE0 RE1" +@endverbatim + +@c RE0 and @c RE1 are regular expressions that match the preceding +sequence S0 and the following sequence S1, respectively. + +Pay attention to the space between the two regular expressions. It +represents the special category ' ' (see above). Note that the +regular expression above belongs to glyph generation rules using font +F1, therefore not only RE1 but also RE0 must be expressed with the +categories for F1. This means when the preceding sequence S0 cannot +be expressed with the categories for F1 (as in the first example +above) generation rules having these patterns never match. + +@subsection flt-seealso SEE ALSO + +@ref mdbGeneral "mdbGeneral(5)", +@ref flt-list "FLTs provided by the m17n database" +*/ +/***ja + +@section mdbFontEncoding ¥Õ¥©¥ó¥È¥¨¥ó¥³¡¼¥Ç¥£¥ó¥° + +@subsection font-encoding-description ÀâÌÀ + +m17n ¥é¥¤¥Ö¥é¥ê¤Ï¡¢m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é \ ¥¿¥°¤Ë¤è¤Ã +¤Æ¸Ä¡¹¤Î¥Õ¥©¥ó¥È¤Î¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤Ë´Ø¤¹¤ë¾ðÊó¤ò¥í¡¼¥É¤¹¤ë¡£¤³¤Î¥Ç¡¼¥¿ +¤Ï°Ê²¼¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤È¤·¤Æ¥í¡¼¥É¤µ¤ì¤ë¡£ + +@verbatim +FONT-ENCODING ::= PER-FONT * + +PER-FONT ::= '(' FONT-SPEC ENCODING [ REPERTORY ] ')' + +FONT-SPEC ::= + '(' [ FOUNDRY FAMILY + [ WEIGHT [ STYLE [ STRETCH [ ADSTYLE ]]]]] + REGISTRY ')' + +ENCODING ::= SYMBOL +@endverbatim + +@c FONT-SPEC ¤Ï¥Õ¥©¥ó¥È¤Î¥×¥í¥Ñ¥Æ¥£¤ò»ØÄꤹ¤ë¡£@c FOUNDRY ¤«¤é @c +REGISTRY ¤Ï¥Õ¥©¥ó¥È¤Î #Mfoundry ¤«¤é #Mregistry ¥×¥í¥Ñ¥Æ¥£¤ËÂбþ¤¹¤ë¥· +¥ó¥Ü¥ë¤Ç¤¢¤ë¡£³Æ¥×¥í¥Ñ¥Æ¥£¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ï @ref m17nFont »²¾È¡£ + +¤¿¤È¤¨¤Ð¤³¤Î @c FONT-SPEC: + +@verbatim + (nil alice0\ lao iso8859-1) +@endverbatim + +¤Ï¥Õ¥©¥ó¥È¤Î¥Õ¥¡¥ß¥ê̾¤¬ "alice0 lao" ¤Ç¥ì¥¸¥¹¥È¥ê¤¬ "iso8859-1" ¤Ç¤¢ +¤ë¤¹¤Ù¤Æ¤Î¥Õ¥©¥ó¥È¤ËŬÍѤǤ­¤ë¡£ + +@c ENCODING ¤Ïʸ»ú¥»¥Ã¥È¤ò¼¨¤¹¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£@c FONT-SPEC ¤Ë¹çÃפ¹¤ë +¥Õ¥©¥ó¥È¤Ï¡¢¤½¤Îʸ»ú¥»¥Ã¥È¤ÎÁ´Ê¸»ú¤ò¥µ¥Ý¡¼¥È¤·¡¢¤½¤Îʸ»ú¥»¥Ã¥È¤Ë¤è¤Ã¤Æ +ʸ»ú¥³¡¼¥É¤Ï¤½¤Î¥Õ¥©¥ó¥È¤ÎÂбþ¤¹¤ë¥°¥ê¥Õ¥³¡¼¥É¤Ë¥Þ¥Ã¥×¤µ¤ì¤ë¡£ + +@c REPERTORY ¤Ïʸ»ú¥»¥Ã¥È¤ò¼¨¤¹¥·¥ó¥Ü¥ë¤« "nil" ¤Ç¤¢¤ë¡£¾Êά¤·¤¿¾ì¹ç¤Ï¡¢ +@c ENCODING ¤ò @c REPERTORY ¤Ë»ØÄꤷ¤¿¤Î¤ÈƱ¤¸°ÕÌ£¤Ë¤Ê¤ë¡£"nil" ¤Ç¤Ê¤± +¤ì¤Ð¡¢Ê¸»ú¥»¥Ã¥È¤Ï¥Õ¥©¥ó¥È¤Î¥ì¥Ñ¡¼¥È¥ê¡¢¤¹¤Ê¤ï¤Á¥µ¥Ý¡¼¥È¤¹¤ëʸ»ú¤ò¼¨¤¹¡£ +¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢ÆÃÄê¤Îʸ»ú¤¬¤½¤Î¥Õ¥©¥ó¥È¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ï +¸Ä¡¹¤Î¥Õ¥©¥ó¥È¥É¥é¥¤¥Ð¤ËÌ䤤¹ç¤ï¤»¤ë¡£ + +¤¤¤ï¤æ¤ë¥æ¥Ë¥³¡¼¥É¥Õ¥©¥ó¥È (¥ì¥¸¥¹¥È¥ê¤Ï "iso10646-1") ¤Ë¤Ä¤¤¤Æ¤Ï¡¢Éá +ÄÌ¥æ¥Ë¥³¡¼¥Éʸ»ú¤Î°ìÉô¤·¤«¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤¿¤á¡¢@c REPERTORY ¤ò +"nil" ¤Ë¤¹¤ë¤³¤È¤¬Ë¾¤Þ¤·¤¤¡£ */ +/***en + +@section mdbFontEncoding Font Encoding + +@subsection font-encoding-description DESCRIPTION + +The m17n library loads information about the encoding of each font +form the m17n database by the tags \. The data is +loaded as a plist of this format. + +@verbatim +FONT-ENCODING ::= PER-FONT * + +PER-FONT ::= '(' FONT-SPEC ENCODING [ REPERTORY ] ')' + +FONT-SPEC ::= + '(' [ FOUNDRY FAMILY + [ WEIGHT [ STYLE [ STRETCH [ ADSTYLE ]]]]] + REGISTRY ')' + +ENCODING ::= SYMBOL +@endverbatim + +@c FONT-SPEC is to specify properties of a font. @c FOUNDRY to @c +REGISTRY are symbols corresponding to #Mfoundry to #Mregistry property +of a font. See @ref m17nFont for the meaning of each property. + +For instance, this @c FONT-SPEC: + +@verbatim + (nil alice0\ lao iso8859-1) +@endverbatim + +should be applied to all fonts whose family name is "alice0 lao", and +registry is "iso8859-1". + +@c ENCODING is a symbol representing a charset. A font matching @c +FONT-SPEC supports all characters of the charset, and a character code +is mapped to the corresponding glyph code of the font by this charset. + +@c REPERTORY is a symbol representing a charset or "nil". Omitting it +is the same as specifying @c ENCODING as @c REPERTORY. If it is not +"nil", the charset specifies the repertory of the font, i.e, which +character it supports. Otherwise, whether a specific character is +supported by the font or not is asked to each font driver. + +For so called Unicode fonts (registry is "iso10646-1"), it is +recommended to specify "nil" as @c REPERTORY because such fonts +usually supports only a subset of Unicode characters. */ +/***ja + +@section mdbFontSize ¥Õ¥©¥ó¥È¥µ¥¤¥º + +@subsection font-size-description ÀâÌÀ + +»þ¤Ë¥Õ¥©¥ó¥È¤Ï¤½¤Î¥µ¥¤¥º¤Ë¤Ä¤¤¤Æ¸í¤Ã¤¿¾ðÊó¤ò´Þ¤ó¤Ç¤¤¤ë¤³¤È¤¬¤¢¤ë (ŵ·¿ +Ū¤ÊÎã¤È¤·¤Æ¤Ï hack ¤µ¤ì¤¿ TrueType ¥Õ¥©¥ó¥È¤Ê¤É) ¡£¤³¤Î¤è¤¦¤Ê¥Õ¥©¥ó¥È +¤¬Â¾¤Î¥Õ¥©¥ó¥È¤È°ì½ï¤Ë»È¤ï¤ì¤ë¤È¡¢¥ì¥¤¥¢¥¦¥È¤¬¤ª¤«¤·¤¯¤Ê¤ë¡£¤³¤ÎÌäÂê¤ò +²ò·è¤¹¤ë¤¿¤á¡¢m17n ¥é¥¤¥Ö¥é¥ê¤Ïm17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥¿¥° \ ¤ò»ý¤Ä¥Ç¡¼¥¿¤ò¥í¡¼¥É¤·¡¢¥Õ¥©¥ó¥È¥µ¥¤¥º¤òÄ´À°¤¹¤ë¤¿¤á¤Î¾ðÊó¤È¤· +¤ÆÍѤ¤¤ë¡£¤³¤Î¥Ç¡¼¥¿¤Ï°Ê²¼¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ý¤Ä¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤È¤·¤Æ¥í¡¼ +¥É¤µ¤ì¤ë¡£ + +@verbatim +FONT-SIZE-ADJUSTMENT ::= PER-FONT * + +PER-FONT ::= '(' FONT-SPEC ADJUST-RATIO ')' + +FONT-SPEC ::= + '(' [ FOUNDRY FAMILY + [ WEIGHT [ STYLE [ STRETCH [ ADSTYLE ]]]]] + REGISTRY ')' + +ADJUST-RATIO ::= INTEGER +@endverbatim + +@c FONT-SPEC ¤Ï¥Õ¥©¥ó¥È¤Î¥×¥í¥Ñ¥Æ¥£¤ò»ØÄꤹ¤ë¡£@c FOUNDRY ¤«¤é @c +REGISTRY ¤Þ¤Ç¤Ï¡¢¤½¤ì¤¾¤ì¥Õ¥©¥ó¥È¤Î #Mfoundry ¤«¤é #Mregistry ¥×¥í¥Ñ¥Æ¥£ +¤Þ¤Ç¤ËÂбþ¤·¤Æ¤¤¤ë¡£³Æ¥×¥í¥Ñ¥Æ¥£¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ï @ref m17nFont »²¾È¤Î¤³¤È¡£ + +@c ADJUST-RATIO ¤Ï¡¢À°¿ôÃͤǤ¢¤ê¡¢¥Õ¥©¥ó¥È¥µ¥¤¥º¤ò¤É¤Î¤è¤¦¤ËÄ´À°¤¹¤ì¤Ð +¤è¤¤¤«¤ò¥Ñ¡¼¥»¥ó¥È¤Ç¤¢¤é¤ï¤¹¡£¤¿¤È¤¨¤Ð°Ê²¼¤Î @c PER-FONT: + +@verbatim + ((devanagari-cdac) 150) +@endverbatim + +¤Ï¡¢m17n ¥é¥¤¥Ö¥é¥ê¤Î¥Õ¥©¥ó¥È¥Ï¥ó¥É¥é¤Ë¡¢"devanagari-cdac" ¤È¤¤¤¦¥ì¥¸¥¹ +¥È¥ê¤ò»ý¤Ä¥Õ¥©¥ó¥È¤Ë¤Ä¤¤¤Æ¤Ï¡¢Í׵ᤵ¤ì¤¿Â礭¤µ¤Î 1.5 ÇܤΥµ¥¤¥º¤Î¥Õ¥©¥ó +¥È¤ò³«¤¯¤è¤¦¤Ë»Ø¼¨¤¹¤ë¤â¤Î¤Ç¤¢¤ë¡£ + +*/ +/***en + +@section mdbFontSize Font Size + +@subsection font-size-description DESCRIPTION + +In some case, a font contains incorrect information about its size +(typically in the case of a hacked TrueType font), which results in a +bad text layout when such a font is used in combination with the other +fonts. To overcome this problem, the m17n library loads information +about font-size adjustment from the m17n database by the tags \. The data is loaded as a plist of this format. + +@verbatim +FONT-SIZE-ADJUSTMENT ::= PER-FONT * + +PER-FONT ::= '(' FONT-SPEC ADJUST-RATIO ')' + +FONT-SPEC ::= + '(' [ FOUNDRY FAMILY + [ WEIGHT [ STYLE [ STRETCH [ ADSTYLE ]]]]] + REGISTRY ')' + +ADJUST-RATIO ::= INTEGER +@endverbatim + +@c FONT-SPEC is to specify properties of a font. @c FOUNDRY to @c +REGISTRY are symbols corresponding to #Mfoundry to #Mregistry property +of a font. See @ref m17nFont for the meaning of each property. + +@c ADJUST-RATIO is an integer number specifying by percentage how much +the font-size must be adjusted. For instance, this @c PER-FONT: + +@verbatim + ((devanagari-cdac) 150) +@endverbatim + +instructs the font handler of the m17n library to open a font of 1.5 +times bigger than a requested size on opening a font whose registry +is "devanagari-cdac". +*/ +/***ja + +@section mdbFontset ¥Õ¥©¥ó¥È¥»¥Ã¥È + +@subsection fontset-description ÀâÌÀ + +m17n ¥é¥¤¥Ö¥é¥ê¤Ï¡¢m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é \ ¥¿ +¥°¤Ë¤è¤Ã¤Æ¥Õ¥©¥ó¥È¥»¥Ã¥È¤ÎÄêµÁ¤ò¥í¡¼¥É¤¹¤ë¡£¤³¤Î¥Ç¡¼¥¿¤Ï°Ê²¼¤Î¥Õ¥©¡¼¥Þ¥Ã +¥È¤Î¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤È¤·¤Æ¥í¡¼¥É¤µ¤ì¤ë¡£ + +@verbatim +FONTSET ::= PER-SCRIPT * PER-CHARSET * FALLBACK * + +PER-SCRIPT ::= '(' SCRIPT PER-LANGUAGE + ')' + +PER-LANGUAGE ::= '(' LANGUAGE FONT-SPEC-ELEMENT + ')' + +PER-CHARSET ::= '(' CHARSET FONT-SPEC-ELEMENT + ')' + +FALLBACK ::= FONT-SPEC-ELEMENT + +FONT-SPEC-ELEMENT ::= '(' FONT-SPEC [ FLT-NAME ] ')' + +FONT-SPEC ::= + '(' [ FOUNDRY FAMILY + [ WEIGHT [ STYLE [ STRETCH [ ADSTYLE ]]]]] + REGISTRY ')' +@endverbatim + +@c SCRIPT ¤Ï¥¹¥¯¥ê¥×¥È̾ (e.g. latin, han) ¤ò¼¨¤¹¥·¥ó¥Ü¥ë¤« @c nil¤Ç¤¢ +¤ë¡£@c LANGUAGE ¤ÏISO 639 ¤ËÄêµÁ¤µ¤ì¤¿¸À¸ì̾¥³¡¼¥É (e.g. ja, zh) ¤Ç¤¢ +¤ë£²Ê¸»ú¤Î¥·¥ó¥Ü¥ë¤« @c nil ¤Ç¤¢¤ë¡£ + +@c FONT-SPEC ¤Ï¥Õ¥©¥ó¥È¤Î¥×¥í¥Ñ¥Æ¥£¤ò»ØÄꤹ¤ë¡£@c FOUNDRY ¤«¤é @c +REGISTRY ¤Ï¥Õ¥©¥ó¥È¤Î #Mfoundry ¤«¤é #Mregistry ¥×¥í¥Ñ¥Æ¥£¤ËÂбþ¤¹¤ë¥· +¥ó¥Ü¥ë¤Ç¤¢¤ë¡£³Æ¥×¥í¥Ñ¥Æ¥£¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ï @ref m17nFont »²¾È¡£ + +@c FLT-NAME ¤Ï¥Õ¥©¥ó¥È¥ì¥¤¥¢¥¦¥È¥Æ¡¼¥Ö¥ë¤Î̾Á°¤Ç¤¢¤ë¡£(@ref mdbFLT). + +@subsection fontset-example Îã + +¤³¤ì¤Ï @c PER_SCRIPT ¤ÎÎã¤Ç¤¢¤ë¡£ + +@verbatim +(han + (ja + ((jisx0208.1983-0))) + (zh + ((gb2312.1980-0))) + (nil + ((big5-0)))) +@endverbatim + +¤³¤ì¤Ë¤è¤Ã¤Æ¥Õ¥©¥ó¥È¥»¥ì¥¯¥¿¤Ï¡¢"han" ʸ»ú (¤Ä¤Þ¤ê#Mscript ¥×¥í¥Ñ¥Æ¥£ +¤¬ 'han' ¤Ç¤¢¤ëʸ»ú)¤Î¤¦¤Á¡¢Ê¸»ú¤Î M-text Ãæ¤Ç¤Î #Mlanguage ¥Æ¥­¥¹¥È¥× +¥í¥Ñ¥Æ¥£¤¬ "ja" ¤Ç¤¢¤ê¤½¤Îʸ»ú¤¬¥Õ¥©¥ó¥È¤Î¥ì¥Ñ¡¼¥È¥ê¡¼¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ì¤â +¤Î¤Ë¤Ä¤¤¤Æ¤Ï¡¢¥ì¥¸¥¹¥È¥ê¤¬"jisx0208.1983-0" ¤Ç¤¢¤ë¥Õ¥©¥ó¥È¤ò»È¤¦¤³¤È¤ò +»Ø¼¨¤µ¤ì¤ë¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢¥ì¥¸¥¹¥È¥ê¤¬ "gb2312.1980-0" ¤ä"big5-0" ¤Ç +¤¢¤ë¤â¤Î¤¬»î¤µ¤ì¤ë¡£"han" ʸ»ú¤Ë #Mlanguage ¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤¬Ìµ¤±¤ì +¤Ð¡¢£³¤Ä¤È¤â»î¤µ¤ì¤ë¡£ + +¥Õ¥©¥ó¥ÈÁªÂò¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï´Ø¿ô mdraw_text () »²¾È¡£ +*/ +/***en + +@section mdbFontset Fontset + +@subsection fontset-description DESCRIPTION + +The m17n library loads a fontset definition from the m17n database by +the tags \. The plist format of the data is +as follows: + +@verbatim +FONTSET ::= PER-SCRIPT * PER-CHARSET * FALLBACK * + +PER-SCRIPT ::= '(' SCRIPT PER-LANGUAGE + ')' + +PER-LANGUAGE ::= '(' LANGUAGE FONT-SPEC-ELEMENT + ')' + +PER-CHARSET ::= '(' CHARSET FONT-SPEC-ELEMENT + ')' + +FALLBACK ::= FONT-SPEC-ELEMENT + +FONT-SPEC-ELEMENT ::= '(' FONT-SPEC [ FLT-NAME ] ')' + +FONT-SPEC ::= + '(' [ FOUNDRY FAMILY + [ WEIGHT [ STYLE [ STRETCH [ ADSTYLE ]]]]] + REGISTRY ')' +@endverbatim + +@c SCRIPT is a symbol of script name (e.g. latin, han) or @c nil. @c +LANGUAGE is a two-letter symbol of language name code defined by ISO +639 (e.g. ja, zh) or @c nil. + +@c FONT-SPEC is to specify properties of a font. @c FOUNDRY to @c +REGISTRY are symbols corresponding to #Mfoundry to #Mregistry property +of a font. See @ref m17nFont for the meaning of each property. + +@c FLT-NAME is a name of Font Layout Table (@ref mdbFLT). + +@subsection fontset-example EXAMPLE + +This is an example of @c PER_SCRIPT. + +@verbatim +(han + (ja + ((jisx0208.1983-0))) + (zh + ((gb2312.1980-0))) + (nil + ((big5-0)))) +@endverbatim + +It instructs the font selector to use a font of registry +"jisx0208.1983-0" for a "han" character (i.e. a character whose +#Mscript property is 'han') if the character has #Mlanguage text +property "ja" in an M-text and the character is in the repertories of +such fonts. Otherwise, try a font of registry "gb2312.1980-0" or +"big5-0". If that "han" character does not have #Mlanguage text +property, try all three fonts. + +See the function mdraw_text () for the detail of how a font is +selected. +*/ +/***ja + +@section mdbIM ¥¤¥ó¥×¥Ã¥È¥á¥½¥Ã¥É + +@subsection im-description ÀâÌÀ + +m17n ¥é¥¤¥Ö¥é¥ê¤Ï¡¢m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éưŪ¤Ë¥í¡¼¥É¤Ç¤­¤ëÆþÎϥ᥽¥Ã¥É +¥É¥é¥¤¥Ð¤òÄ󶡤·¤Æ¤¤¤ë¡£(@ref m17nInputMethod »²¾È¡£ @latexonly +(P.\pageref{group__m17nInputMethod}) @endlatexonly). + +¤³¤³¤Ç¤ÏÆþÎϥ᥽¥Ã¥ÉÄêµÁ¤Î¥Ç¡¼¥¿¥Õ¥©¡¼¥Þ¥Ã¥È¤òÀâÌÀ¤¹¤ë¡£ + +@subsection im-format ʸˡ¤È°ÕÌ£ + +°Ê²¼¤Î¥Ç¡¼¥¿¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤è¤Ã¤ÆÆþÎϥ᥽¥Ã¥É¤¬ÄêµÁ¤µ¤ì¤ë¡£¥É¥é¥¤¥Ð¤Ï¥Õ¥¡ +¥¤¥ë¤ä¥¹¥È¥ê¡¼¥à¤«¤éÄêµÁ¤ò¥í¡¼¥É¤·¡¢¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¤Î·Á¼°¤ËÊÑ´¹¤¹¤ë¡£ + +@verbatim +INPUT-METHOD ::= TITLE MAP-LIST MACRO-LIST ? MODULE-LIST ? STATE-LIST + +TITLE ::= '(' 'title' MTEXT ')' +@endverbatim + +@c MTEXT ¤Ï¤³¤ÎÆþÎϥ᥽¥Ã¥É¤¬Í­¸ú¤ÊºÝ¥¹¥¯¥ê¡¼¥ó¾å¤Ëɽ¼¨¤µ¤ì¤ë¥Æ¥­¥¹¥È¤Ç¤¢¤ë ¡£ + +@verbatim +MAP-LIST ::= '(' 'map' MAP * ')' + +MAP ::= '(' MAP-NAME RULE * ')' + +MAP-NAME ::= SYMBOL + +RULE ::= '(' KEYSEQ MAP-ACTION * ')' + +KEYSEQ ::= MTEXT | '(' [ SYMBOL | INTEGER ] * ')' +@endverbatim + +@c MAP-NAME ÄêµÁÃæ¤Î @c SYMBOL ¤Ï¡¢ @c t ¤¢¤ë¤¤¤Ï @c nil ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê +¤é¤Ê¤¤¡£ + +@c KEYSEQ ÄêµÁÃæ¤Î @c MTEXT ¤Ï¡¢¥­¡¼¥Ü¡¼¥É¤«¤éÀ¸À®¤Ç¤­¤ëʸ»ú¤Ç¹½À®¤µ¤ì +¤ë¡£¤¹¤Ê¤ï¤Á @c MTEXT ¤ÏÄ̾ïASCII ʸ»ú¤Î¤ß¤ò´Þ¤à¡£¤·¤«¤·¡¢ÆþÎϥ᥽¥Ã¥É +¤¬¤¿¤È¤¨¤ÐÀ¾¥è¡¼¥í¥Ã¥ÑÍÑ¥­¡¼¥Ü¡¼¥É¤ò»È¤¦¤³¤È¤òÁÛÄꤷ¤¿¤â¤Î¤Ç¤¢¤ì¤Ð¡¢@c +MTEXT ¤Ï Latin-1 ʸ»ú¤ò´Þ¤ó¤Ç¤â¤è¤¤¡£ + +@c KEYSEQ ÄêµÁÃæ¤Î @c SYMBOL ¤Ï¡¢´Ø¿ô minput_event_to_key () ¤ÎÌá¤êÃÍ +¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + +@c KEYSEQ ÄêµÁÃæ¤Î @c INTEGER ¤Ï¡¢Í­¸ú¤Êʸ»ú¥³¡¼¥É¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + +@verbatim +MAP-ACTION ::= ACTION + +ACTION ::= INSERT | DELETE | SELECT | MOVE | MARK | + | SHOW | HIDE | PUSHBACK | UNDO | SHIFT | CALL + | SET | IF | '(' MACRO-NAME ')' + +PREDEFINED-SYMBOL ::= + '@0' | '@1' | '@2' | '@3' | '@4' | + '@5' | '@6' | '@7' | '@8' | '@9' | + '@<' | '@=' | '@>' | '@-' | '@+' | '@[' | '@]' +@endverbatim +@verbatim +MACRO-LIST ::= '(' 'macro' MACRO * ')' + +MACRO ::= '(' MACRO-NAME MACRO-ACTION * ')' + +MACRO-NAME ::= SYMBOL + +MACRO-ACTION ::= ACTION +@endverbatim +@verbatim +MODULE-LIST ::= '(' 'module' MODULE * ')' + +MODULE ::= '(' MODULE-NAME FUNCTION * ')' + +MODULE-NAME ::= SYMBOL + +FUNCTION ::= SYMBOL +@endverbatim + +³Æ @c MODULE ¤Ï³°Éô¥â¥¸¥å¡¼¥ë (ưŪ¥é¥¤¥Ö¥é¥ê) ¤Î̾Á°¤È¤½¤Î¥â¥¸¥å¡¼¥ë +¤¬¸ø³«¤¹¤ë´Ø¿ô̾¤òÀë¸À¤¹¤ë¡£@c FUNCTION ¤¬ "init" ¤È¤¤¤¦Ì¾Á°¤Ç¤¢¤ì¤Ð¡¢ +¤³¤ÎÆþÎϥ᥽¥Ã¥ÉÍѤÎÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤¬À¸À®¤µ¤ì¤ëºÝ¤Ë¤Î¤ß¡¢¥Ç¥Õ¥©¥ë¥È¤Î +°ú¿ô (@c CALL ¤ÎÀỲ¾È) ¤È¤È¤â¤Ë¸Æ¤Ð¤ì¤ë¡£ @c FUNCTION ¤¬ "fini" ¤È¤¤ +¤¦Ì¾Á°¤ò»ý¤Æ¤Ð, ÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤¬Ç˲õ¤µ¤ì¤ëºÝ¤Ë¤Î¤ß¡¢¥Ç¥Õ¥©¥ë¥È¤Î°ú¿ô +¤È¤È¤â¤Ë¸Æ¤Ð¤ì¤ë¡£ + +@verbatim +STATE-LIST ::= '(' 'state' STATE * ')' + +STATE ::= '(' STATE-NAME BRANCH * ')' + +STATE-NAME ::= SYMBOL + +BRANCH ::= '(' MAP-NAME BRANCH-ACTION * ')' + | '(' nil BRANCH-ACTION * ')' + | '(' t BRANCH-ACTION * ')' +@endverbatim + +@c BRANCH ¤ÎºÇ½é¤Î·Á¼°¤Ç¤Ï¡¢@c MAP-NAME ¤Ï @c MAP ¤Ë¸½¤ï¤ì¤ë¤â¤Î¤Ç¤Ê¤¯ +¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£¤³¤Î¾ì¹ç¡¢@c MAP-NAME ¤Î @c KEYSEQ ¤Î°ì¤Ä¤Ë¹çÃפ¹¤ë¥­¡¼ +Î󤬥¿¥¤¥×¤µ¤ì¤ì¤Ð¡¢ @c BRANCH-ACTION ¤¬¼Â¹Ô¤µ¤ì¤ë¡£ + +@c BRANCH ¤ÎÆó¤ÄÌܤηÁ¼°¤Ç¤Ï¡¢¤½¤Î»þÅÀ¤Î¾õÂ֤Τ¤¤º¤ì¤Î @c BRANCH ¤Ë¤â +¹çÃפ·¤Ê¤¤¥­¡¼Î󤬥¿¥¤¥×¤µ¤ì¤ì¤Ð¡¢@c BRANCH-ACTION¤¬¼Â¹Ô¤µ¤ì¤ë¡£ + +@c BRANCH ¤Î»°¤ÄÌܤηÁ¼°¤Ç¤Ï¡¢¤¹¤Ù¤Æ¤Î¥­¡¼¤ò½èÍý¤·¤¿¸å¤Ç¤½¤Î¾õÂ֤˰ÜÆ° +¤·¤¿¾ì¹ç¤Ë @c BRANCH-ACTION ¤¬¼Â¹Ô¤µ¤ì¤ë¡£¤â¤·½é´ü¾õÂ֤Ǥ¢¤ì¤Ð¡¢ÆþÎÏ¥á +¥½¥Ã¥É¤ÎÆþÎÏ¥³¥ó¥Æ¥¯¥¹¥È¤òÀ¸À®¤·¤¿Ä¾¸å¤Ë @c BRANCH-ACTION ¤ò¼Â¹Ô¤¹¤ë¡£ + +@verbatim +BRANCH-ACTION ::= ACTION +@endverbatim + +ÆþÎϥ᥽¥Ã¥É¤Ï¼¡¤ÎÆó¤Ä¤Î¥·¥ó¥Ü¥ë¤Î¥ê¥¹¥È¤ò»ý¤Ä¡£ + +
    +
  • ¥Þ¡¼¥«¥ê¥¹¥È + +¥Þ¡¼¥«¤Ï preediting ¥Æ¥­¥¹¥ÈÃæ¤Ç¤Îʸ»ú°ÌÃÖ¤ò¼¨¤¹¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£@c +MARK ¥¢¥¯¥·¥ç¥ó¤Ï¥Þ¡¼¥«¤ò¤¢¤ë°ÌÃÖ¤ËÀßÄꤹ¤ë¡£@c MOVE ¤È @c DELETE ¥¢¥¯ +¥·¥ç¥ó¤Ï¥Þ¡¼¥«¤Î°ÌÃÖ¤ò»²¾È¤¹¤ë¡£ + +
  • ÊÑ¿ô¥ê¥¹¥È + +ÊÑ¿ô¤ÏÀ°¿ô¤ÎÃͤò»ý¤Ä¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£ÃͤÏ@c SET ¥¢¥¯¥·¥ç¥ó¤Ë¤è¤Ã¤ÆÀßÄê +¤µ¤ì¡¢@c SET, @c INSERT, @c IF ¤Ë»²¾È¤µ¤ì¤ë¡£¤¹¤Ù¤Æ¤ÎÊÑ¿ô¤Î½é´üÃÍ¤Ï 0 +¤Ç¤¢¤ë¡£ + +
+ +@c PREDEFINED-SYMBOL ¤Ï¥Þ¡¼¥«¤È¤·¤ÆÍѤ¤¤é¤ì¤¿¾ì¹çÆÃÊ̤ʰÕÌ£¤ò»ý¤Ä¡£ + +
    +
  • @c @@0, @c @@1, @c @@2, @c @@3, @c @@4, @c @@5, @c @@6, @c @@7, @c @@8, @c @@9 + +¤½¤ì¤¾¤ì£°ÈÖÌܤ«¤é£¹ÈÖÌܤΰÌÃÖ + +
  • @c @@<, @c @@=, @c @@> + +ºÇ½é¤Î¡¢º£¤Î¡¢ºÇ¸å¤Î°ÌÃÖ + +
  • @c @@-, @c @@+ + +Á°¤Î¡¢¼¡¤Î°ÌÃÖ + +
  • @c @@[, @c @@] + +¸õÊä¥ê¥¹¥È¤¬ÊѲ½¤¹¤ëºÝ¤ÎÁ°¤È¼¡¤Î°ÌÃÖ +
+ +@c PREDEFINED-SYMBOL ¤Ï @c SELECT ¥¢¥¯¥·¥ç¥óÃæ¤Ç¸õÊä¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤È¤· +¤ÆÍѤ¤¤é¤ì¤¿ºÝÆÃÊ̤ʰÕÌ£¤ò»ý¤Ä¡£ + +
    +
  • @c @@<, @c @@=, @c @@> + +¸½ºß¤Î¸õÊ䥰¥ë¡¼¥×Ãæ¤Ç¤ÎºÇ½é¤Î¡¢º£¤Î¡¢ºÇ¸å¤Î¸õÊä + +
  • @c @@- + +Á°¸õÊä¡£º£¤Î¸õÊ䤬º£¤Î¸õÊ䥰¥ë¡¼¥×Ãæ¤Ç¤ÎºÇ½é¤Î¤â¤Î¤Ç¤¢¤ì¤Ð¡¢Á°¤Î¸õÊ䥰 +¥ë¡¼¥×¤ÎºÇ¸å¤Î¸õÊä¡£ + +
  • @c @@+ + +¼¡¸õÊä¡£º£¤Î¸õÊ䤬º£¤Î¸õÊ䥰¥ë¡¼¥×Ãæ¤Ç¤ÎºÇ¸å¤Î¤â¤Î¤Ç¤¢¤ì¤Ð¡¢¼¡¤Î¸õÊ䥰 +¥ë¡¼¥×¤ÎºÇ½é¤Î¸õÊä¡£ + +
  • @c @@[, @c @@] + +¤½¤ì¤¾¤ìÁ°¤È¸å¤Î¸õÊ䥰¥ë¡¼¥×Ãæ¤Ç¡¢º£¤Î¸õÊä¤ÈƱ¤¸¸õÊ䥤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä +¤â¤Î¡£ +
+ +³Æ¥¢¥¯¥·¥ç¥ó¤Î°ú¿ô¤È¿¶Éñ¤¤¤Ï°Ê²¼¤ÎÄ̤ꡣ + +@verbatim +INSERT ::= '(' 'insert' MTEXT ')' + | MTEXT + | INTEGER + | '(' 'insert' SYMBOL ')' + | '(' 'insert' '(' CANDIDATES * ')' ')' + | '(' CANDIDATES * ')' + +CANDIDATES ::= MTEXT | '(' MTEXT * ')' +@endverbatim + +Âè°ì¡¢ÂèÆó¤Î·Á¼°¤Ï @c MTEXT ¤ò¸½ºß¤Î°ÌÃÖ¤ÎÁ°¤ËÁÞÆþ¤¹¤ë¡£ + +Âè»°¤Î·Á¼°¤Ï¡¢Ê¸»ú @c INTEGER ¤ò¸½ºß¤Î°ÌÃÖ¤ÎÁ°¤ËÁÞÆþ¤¹¤ë¡£ + +Âè»Í¤Î·Á¼°¤Ï¡¢@c SYMBOL ¤òÊÑ¿ô¤È¤·¤Æ°·¤¤¡¢¤½¤ÎÃͤ¬Àµ¤·¤¤Ê¸»ú¥³¡¼¥É¤Ç +¤¢¤ì¤Ð¸½ºß¤Î°ÌÃÖ¤ÎÁ°¤ËÁÞÆþ¤¹¤ë¡£ + +Âè¸Þ¡¢ÂèÏ»¤Î·Á¼°¤Ç¤Ï¡¢@c CANDIDATES ¤Ï¸õÊ䥰¥ë¡¼¥×¤òɽ¤·¡¢@c +CANDIDATES ¤Î³ÆÍ×ÁǤ¬¸õÊä¤òɽ¤¹¡£¤Ä¤Þ¤ê@c CANDIDATES ¤¬ M-text ¤Ç¤¢¤ì +¤Ð¡¢¸õÊä¤Ï¤½¤ÎM-text Ãæ¤Îʸ»ú¤Ç¤¢¤ê¡¢@c CANDIDATES ¤¬ M-text ¤Î¥ê¥¹¥È +¤Ç¤¢¤ì¤Ð¡¢¸õÊä¤Ï¤½¤ì¤é¤Î M-text ¤Ç¤¢¤ë¡£ + +¤³¤ì¤é¤Î·Á¼°¤Ï¸½ºß¤Î°ÌÃ֤ξÁ°¤ËºÇ½é¤Î¸õÊä¤òÁÞÆþ¤¹¤ë¡£ÁÞÆþ¤µ¤ì¤¿Ê¸»úÎó +¤Ë¤Ï¡¢¸õÊä¤Î¥ê¥¹¥È¤È¸½ºßÁªÂò¤µ¤ì¤Æ¤¤¤ë¸õÊä¤ò»Ø¤¹¾ðÊó¤¬Éղ䵤ì¤Æ¤¤¤ë¡£ + +ÁÞÆþ¤Ë¤è¤Ã¤Æ¥Þ¡¼¥«¤Î°ÌÃ֤ϼ«Æ°Åª¤ËÊѹ¹¤µ¤ì¤ë¡£ + +@verbatim +DELETE ::= '(' 'delete' SYMBOL ')' + | '(' 'delete' INTEGER ')' +@endverbatim + +Âè°ì¤Î·Á¼°¤Ï @c SYMBOL ¤ò¥Þ¡¼¥«¤È¤·¤Æ¡¢¥Þ¡¼¥«¤È¸½ºß¤Î°ÌÃ֤δ֤Îʸ»ú¤ò +ºï½ü¤¹¤ë¡£ + +ÂèÆó¤Î·Á¼°¤Ï @c INTEGER ¤òʸ»ú°ÌÃ֤Ȥ·¤Æ¡¢¤½¤Îʸ»ú°ÌÃ֤ȸ½ºß¤Î°ÌÃÖ¤Î´Ö +¤Îʸ»ú¤òºï½ü¤¹¤ë¡£ + +ºï½ü¤Ë¤è¤Ã¤Æ¥Þ¡¼¥«¤Î°ÌÃ֤ϼ«Æ°Åª¤ËÊѹ¹¤µ¤ì¤ë¡£ + +@verbatim +SELECT ::= '(' 'select' PREDEFINED-SYMBOL ')' + | '(' 'select' INTEGER ')' +@endverbatim + +¤³¤Î¥¢¥¯¥·¥ç¥ó¤Ï¤Þ¤º¡¢¸½ºß¤Î°ÌÃ֤ξÁ°¤Îʸ»ú¤¬¡¢¸õÊä¥ê¥¹¥È¤¬Éղ䵤ì¤Æ +¤¤¤ëʸ»úÎó¤Ë°¤¹¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¡£¤½¤¦¤Ç¤¢¤ì¤Ð¡¢¤½¤Îʸ»úÎó¤ò°ú¿ô¤Ë¤è¤Ã +¤Æ»ØÄꤵ¤ì¤¿¸õÊä¤ËÆþ¤ì´¹¤¨¤ë¡£ + +Âè°ì¤Î·Á¼°¤Ç¤Ï @c PREDEFINED-SYMBOL ¤òÁ°½Ò¤Î¸õÊ䥤¥ó¥Ç¥Ã¥¯¥¹¤È¤·¤Æ°·¤¤¡¢ +¤½¤ì¤Ë¤è¤Ã¤Æ¸õÊä¥ê¥¹¥ÈÃæ¤Î¿·¤·¤¤¸õÊ䤬»ØÄꤵ¤ì¤ë¡£ + +ÂèÆó¤Î·Á¼°¤Ç¤Ï @c INTEGER ¤Ï¸õÊ䥤¥ó¥Ç¥Ã¥¯¥¹¤Ç¤¢¤ê¡¢¸õÊä¥ê¥¹¥ÈÃæ¤Î¿·¤· +¤¤¸õÊä¤ò»ØÄꤹ¤ë¡£ + +@verbatim +SHOW ::= '(show)' +@endverbatim + +¤³¤Î¥¢¥¯¥·¥ç¥ó¤Ï¡¢ÆþÎϥ᥽¥Ã¥É¥É¥é¥¤¥Ð¤Ë¸½ºß¤Î°ÌÃÖ¤ÎÁ°¤Ë¤¢¤ëʸ»úÎó¤ËÉÕ +²Ã¤µ¤ì¤Æ¤¤¤ë¸õÊä¥ê¥¹¥È¤ò¼¨¤¹¤è¤¦¤Ë»Ø¼¨¤¹¤ë¡£ + +@verbatim +HIDE ::= '(hide)' +@endverbatim + +¤³¤Î¥¢¥¯¥·¥ç¥ó¤Ï¡¢ÆþÎϥ᥽¥Ã¥É¥É¥é¥¤¥Ð¤Ë¸½ºß¼¨¤µ¤ì¤Æ¤¤¤ë¸õÊä¥ê¥¹¥È¤ò±£ +¤¹¤è¤¦¤Ë»Ø¼¨¤¹¤ë¡£ + +@verbatim +MOVE ::= '(' 'move' SYMBOL ')' + | '(' 'move' INTEGER ')' +@endverbatim + +Âè°ì¤Î·Á¼°¤Ï @c SYMBOL ¤ò¥Þ¡¼¥«¤È¤·¤Æ¡¢¤½¤ì¤ò¿·¤·¤¤¸½ºß¤Î°ÌÃ֤Ȥ¹¤ë¡£ + +ÂèÆó¤Î·Á¼°¤Ï @c INTEGER ¤òʸ»ú°ÌÃ֤Ȥ·¤Æ¡¢¤½¤Î°ÌÃÖ¤ò¿·¤·¤¤¸½ºß¤Î°ÌÃÖ¤È +¤¹¤ë¡£ + +@verbatim +MARK ::= '(' 'mark' SYMBOL ')' +@endverbatim + +¤³¤Î¥¢¥¯¥·¥ç¥ó¤Ï @c SYMBOL ¤ò¥Þ¡¼¥«¤È¤·¤Æ¡¢¤½¤ì¤ò¸½ºß¤Î°ÌÃÖ¤ËÀßÄꤹ¤ë¡£ +@c SYMBOL ¤Ï @c PREDEFINED-SYMBOL ¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + + +@verbatim +PUSHBACK :: = '(pushback INTEGER)' +@endverbatim + +¤³¤Î¥¢¥¯¥·¥ç¥ó¤ÏºÇ¿·¤Î¥­¡¼¥¤¥Ù¥ó¥È¤ò¥¤¥Ù¥ó¥È¥­¥å¡¼¤ËÌ᤹¡£ + +@verbatim +UNDO :: = '(undo)' +@endverbatim + +¤³¤Î¥¢¥¯¥·¥ç¥ó¤ÏºÇ¸å¤Î¥­¡¼¥¤¥Ù¥ó¥È¤ò¼è¤ê¾Ã¤¹¡£ + +@verbatim +SHIFT :: = '(' 'shift' STATE-NAME ')' +@endverbatim + +¤³¤Î¥¢¥¯¥·¥ç¥ó¤Ï¸½ºß¤Î¾õÂÖ¤ò @c STATE-NAME ¤Ë°ÜÆ°¤µ¤»¤ë¡£ @c +STATE-NAME ¤Ï @c STATE-LIST ¤Ë¸½¤ï¤ì¤ë¤â¤Î¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + +@verbatim +CALL ::= '(' 'call' MODULE-NAME FUNCTION ARG * ')' + +ARG ::= INTEGER | SYMBOL | MTEXT | PLIST +@endverbatim + +¤³¤Î¥¢¥¯¥·¥ç¥ó¤Ï³°Éô¥â¥¸¥å¡¼¥ë @c MODULE-NAME ¤Î´Ø¿ô @c FUNCTION ¤ò¸Æ +¤Ö¡£@c MODULE-NAME ¤È @c FUNCTION ¤Ï @c MODULE-LIST ¤Ë¸½¤ï¤ì¤ë¤â¤Î¤Ç¤Ê +¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + +´Ø¿ô¤Ï (#MPlist *) ·¿¤Î°ú¿ô¤È¤È¤â¤Ë¸Æ¤Ð¤ì¤ë¡£ºÇ½é¤ÎÍ×ÁǤΥ­¡¼¤Ï #Mt ¤Ç +¤¢¤ê¡¢¤½¤ÎÃͤÏ#MInputContext ·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£ÂèÆó +¤ÎÍ×ÁǤΥ­¡¼¤Ï#Msymbol ¤Ç¤¢¤ê¡¢Ãͤϸ½ºß¤Î¾õÂÖ̾¤Ç¤¢¤ë¡£ @c ARGs ¤Ï»°¤Ä +ÌܰʹߤÎÍ×ÁǤÎÃͤȤ·¤ÆÍѤ¤¤é¤ì¤ë¡£¤½¤ì¤é¤ÎÍ×ÁǤΥ­¡¼¤Ï¼«Æ°Åª¤Ë·èÄꤵ¤ì +¤ë¡£@c ARG ¤¬À°¿ôÃͤʤé¤ÐÂбþ¤¹¤ë¥­¡¼¤Ï #Minteger ¤Ç¤¢¤ê¡¢@c ARG ¤¬¥· +¥ó¥Ü¥ë¤Ê¤é¤Ð¡¢Âбþ¤¹¤ë¥­¡¼¤Ï #Msymbol¡¢¤Ê¤É¤Î¤è¤¦¤Ë¡£ + +´Ø¿ô¤Ï NULL ¤òÊÖ¤¹¤«¡¢¤Þ¤¿¤Ï¹Ô¤¦¤Ù¤­¥¢¥¯¥·¥ç¥ó¤Î¥ê¥¹¥È¤òɽ¤¹ (#MPlist +*) ·¿¤ÎÃͤòÊÖ¤µ¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + +@verbatim +SET ::= '(' OPERAND SYMBOL1 [ INTEGER | SYMBOL2 ] ')' + +OPERAND ::= 'set' | 'add' | 'sub' | 'mul' | 'div' +@endverbatim + +¤³¤Î¥¢¥¯¥·¥ç¥ó¤Ï @c SYMBOL1 ¤È @c SYMBOL2 ¤òÊÑ¿ô¤È¤·¤Æ¡¢@c SYMBOL1 ¤Î +Ãͤò°Ê²¼¤Î¤è¤¦¤ËÀßÄꤹ¤ë¡£ + +@c OPERAND ¤¬ 'set' ¤Ê¤é¤Ð¡¢@c SYMBOL1 ¤ÎÃÍ¤Ï @c INTEGER ¤Þ¤¿¤Ï @c +SYMBOL2 ¤ËÀßÄꤵ¤ì¤ë¡£ + +@c OPERAND ¤¬ 'add' ¤Ê¤é¤Ð¡¢@c SYMBOL1 ¤ÎÃͤò @c INTEGER ¤Þ¤¿¤Ï @c +SYMBOL2 ¤ÎÃͤÀ¤±Áý¤ä¤¹¡£ + +@c OPERAND ¤¬ 'sub' ¤Ê¤é¤Ð¡¢@c SYMBOL1 ¤ÎÃͤò @c INTEGER ¤Þ¤¿¤Ï @c +SYMBOL2 ¤ÎÃͤÀ¤±¸º¤é¤¹¡£ + +@c OPERAND ¤¬ 'mul' ¤Ê¤é¤Ð¡¢@c SYMBOL1 ¤ÎÃÍ¤Ë @c INTEGER ¤Þ¤¿¤Ï @c +SYMBOL2 ¤ÎÃͤò³Ý¤±¤ë¡£ + +@c OPERAND ¤¬ 'div' ¤Ê¤é¤Ð¡¢@c SYMBOL1 ¤ÎÃͤò @c INTEGER ¤Þ¤¿¤Ï @c +SYMBOL2 ¤ÎÃͤdzä¤ë¡£ + +@verbatim +IF ::= '(' 'if' CONDITION ACTION-LIST1 ACTION-LIST2 * ')' + +CONDITION ::= '(' OPERAND VAL1 VAL2 ')' + +ACTION-LIST1 ::= '(' ACTION * ')' + +ACTION-LIST2 ::= '(' ACTION * ')' + +OPERAND ::= '=' '<' '>' + +VAL1 ::= [ INTEGER1 | SYMBOL1 ] + +VAL2 ::= [ INTEGER2 | SYMBOL2 ] +@endverbatim + +¤³¤Î¥¢¥¯¥·¥ç¥ó¤Ï¡¢ @c CONDITION ¤¬¿¿¤Ç¤¢¤ì¤Ð @c ACTION-LIST1 ¤ò¼Â¹Ô¤·¡¢ +¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @c ACTION-LIST2 ¤ò (¤â¤·¤¢¤ì¤Ð) ¼Â¹Ô¤¹¤ë¡£ + +@c SYMBOL1 ¤È @c SYMBOL2 ¤ÏÊÑ¿ô¤È¤·¤Æ°·¤ï¤ì¤ë¡£ + +@ifnot FOR-MAN + +@subsection im-seealso SEE ALSO + +@ref mim-list "Input Methods provided by the m17n database", +@ref mdbGeneral "mdbGeneral(5)" +*/ +/***en + +@section mdbIM Input Method + +@subsection im-description DESCRIPTION + +The m17n library provides a driver for input methods that are +dynamically loadable from the m17n database (see @ref m17nInputMethod +@latexonly (P.\pageref{group__m17nInputMethod}) @endlatexonly). + +This section describes the data format that defines those input +methods. + +@subsection im-format SYNTAX and SEMANTICS + +The following data format defines an input method. The driver loads +a definition from a file, a stream, etc. A definitions is converted +into the form of plist in the driver. + +@verbatim +INPUT-METHOD ::= TITLE MAP-LIST MACRO-LIST ? MODULE-LIST ? STATE-LIST + +TITLE ::= '(' 'title' MTEXT ')' +@endverbatim + +@c MTEXT is a text displayed on the screen when this input method is +active. + +@verbatim +MAP-LIST ::= '(' 'map' MAP * ')' + +MAP ::= '(' MAP-NAME RULE * ')' + +MAP-NAME ::= SYMBOL + +RULE ::= '(' KEYSEQ MAP-ACTION * ')' + +KEYSEQ ::= MTEXT | '(' [ SYMBOL | INTEGER ] * ')' +@endverbatim + +@c SYMBOL in the definitions of @c MAP-NAME must not be @c t nor @c +nil. + +@c MTEXT in the definition of @c KEYSEQ consists of characters that +can be generated by a keyboard. Therefore @c MTEXT usually contains +only ASCII characters. However, if the input method is intended to be +used, for instance, with a West European keyboard, @c MTEXT may +contain Latin-1 characters. + +@c SYMBOL in the definition of @c KEYSEQ must be the return value of +the minput_event_to_key () function. + +@c INTEGER in the definition of @c KEYSEQ must be a valid character +code. + +@verbatim +MAP-ACTION ::= ACTION + +ACTION ::= INSERT | DELETE | SELECT | MOVE | MARK | + | SHOW | HIDE | PUSHBACK | UNDO | SHIFT | CALL + | SET | IF | '(' MACRO-NAME ')' + +PREDEFINED-SYMBOL ::= + '@0' | '@1' | '@2' | '@3' | '@4' | + '@5' | '@6' | '@7' | '@8' | '@9' | + '@<' | '@=' | '@>' | '@-' | '@+' | '@[' | '@]' +@endverbatim +@verbatim +MACRO-LIST ::= '(' 'macro' MACRO * ')' + +MACRO ::= '(' MACRO-NAME MACRO-ACTION * ')' + +MACRO-NAME ::= SYMBOL + +MACRO-ACTION ::= ACTION +@endverbatim +@verbatim +MODULE-LIST ::= '(' 'module' MODULE * ')' + +MODULE ::= '(' MODULE-NAME FUNCTION * ')' + +MODULE-NAME ::= SYMBOL + +FUNCTION ::= SYMBOL +@endverbatim + +Each @c MODULE declares the name of external module (i.e. dynamic +library) and function names exported by the module. If a @c FUNCTION has +name "init", it is called with only the default arguments (see the +section about @c CALL) when an input context is created for the input +method. If a @c FUNCTION has name "fini", it is called with only the +default arguments when an input context is destroyed. + +@verbatim +STATE-LIST ::= '(' 'state' STATE * ')' + +STATE ::= '(' STATE-NAME BRANCH * ')' + +STATE-NAME ::= SYMBOL + +BRANCH ::= '(' MAP-NAME BRANCH-ACTION * ')' + | '(' nil BRANCH-ACTION * ')' + | '(' t BRANCH-ACTION * ')' +@endverbatim + +In the first form of @c BRANCH, @c MAP-NAME must be an item that appears +in @c MAP. In this case, if a key sequence matching one of @c +KEYSEQs of @c MAP-NAME is typed, @c BRANCH-ACTIONs are executed. + +In the second form of @c BRANCH, @c BRANCH-ACTIONs are executed if a +key sequence that doesn't match any of @c Branch's of the current +state is typed. + +In the third form of @c BRANCH, @c BRANCH-ACTIONs are executed if we +shift to the current state after handling all typed keys. If the +current state is the initial state, @c BRANCH-ACTIONs are executed +just after an input context of the input method is created. + +@verbatim +BRANCH-ACTION ::= ACTION +@endverbatim + +An input method has the following two lists of symbols. + +
    +
  • marker list + +A marker is a symbol indicating a character position in the preediting +text. The @c MARK action assigns a position to a marker. The +position of a marker is referred by the @c MOVE and the @c DELETE actions. + +
  • variable list + +A variable is a symbol associated with an integer value. The value of +a variable is set by the @c SET action, and is referred by the @c SET, +the @c INSERT, and the @c IF actions. All variables are implicitly +initialized to zero. + +
+ +Each @c PREDEFINED-SYMBOL has a special meaning when used as a marker. + +
    +
  • @c @@0, @c @@1, @c @@2, @c @@3, @c @@4, @c @@5, @c @@6, @c @@7, @c @@8, @c @@9 + +The 0th, 1st, 2nd, ... 9th position respectively. + +
  • @c @@<, @c @@=, @c @@> + +The first, the current, and the last position. + +
  • @c @@-, @c @@+ + +The previous and the next position. + +
  • @c @@[, @c @@] + +The previous and the next position where a candidate list changes. +
+ +Some of the @c PREDEFINED-SYMBOL has a special meaning when used as a candidate +index in the @c SELECT action. + +
    + +
  • @c @@<, @c @@=, @c @@> + +The first, the current, and the last candidate of the current candidate group. + +
  • @c @@- + +The previous candidate. If the current candidate is the first one in +the current candidate group, then it means the last candidate in the +previous candidate group. + +
  • @c @@+ + +The next candidate. If the current candidate is the last one in the +current candidate group, then it means the first candidate in the next +candidate group. + +
  • @c @@[, @c @@] + +The candidate in the previous and the next candidate group having the same +candidate index as the current one. +
+ +The arguments and the behavior of each action are listed below. + +@verbatim +INSERT ::= '(' 'insert' MTEXT ')' + | MTEXT + | INTEGER + | '(' 'insert' SYMBOL ')' + | '(' 'insert' '(' CANDIDATES * ')' ')' + | '(' CANDIDATES * ')' + +CANDIDATES ::= MTEXT | '(' MTEXT * ')' +@endverbatim + +The first and second forms insert @c MTEXT before the current position. + +The third form inserts the character @c INTEGER before the current +position. + +The fourth form treats @c SYMBOL as a variable, and inserts its value +(if it is a valid character code) before the current position. + +In the fifth and sixth forms, each @c CANDIDATES represents a +candidate group, and each element of @c CANDIDATES represents a +candidate, i.e. if @c CANDIDATES is an M-text, the candidates are the +characters in the M-text; if @c CANDIDATES is a list of M-texts, the +candidates are the M-texts in the list. + +These forms insert the first candidate before the current position. +The inserted string is associated with the list of candidates and +the information indicating the currently selected candidate. + +The marker positions affected by the insertion are automatically relocated. + +@verbatim +DELETE ::= '(' 'delete' SYMBOL ')' + | '(' 'delete' INTEGER ')' +@endverbatim + +The first form treats @c SYMBOL as a marker, and deletes characters +between the current position and the marker position. + +The second form treats @c INTEGER as a character position, and deletes +characters between the current position and the character position. + +The marker positions affected by the deletion are automatically relocated. + +@verbatim +SELECT ::= '(' 'select' PREDEFINED-SYMBOL ')' + | '(' 'select' INTEGER ')' +@endverbatim + +This action first checks if the character just before the current position +belongs to a string that is associated with a candidate list. If it is, +the action replaces that string with a candidate specified by the +argument. + +The first form treats @c PREDEFINED-SYMBOL as a candidate index (as +described above) that specifies a new candidate in the candidate list. + +The second form treats @c INTEGER as a candidate index that specifies a +new candidate in the candidate list. + +@verbatim +SHOW ::= '(show)' +@endverbatim + +This actions instructs the input method driver to display a candidate +list associated with the string before the current position. + +@verbatim +HIDE ::= '(hide)' +@endverbatim + +This action instructs the input method driver to hide the currently +displayed candidate list. + +@verbatim +MOVE ::= '(' 'move' SYMBOL ')' + | '(' 'move' INTEGER ')' +@endverbatim + +The first form treats @c SYMBOL as a marker, and makes the marker +position be the new current position. + +The second form treats @c INTEGER as a character position, and makes +that position be the new current position. + +@verbatim +MARK ::= '(' 'mark' SYMBOL ')' +@endverbatim + +This action treats @c SYMBOL as a marker, and sets its position to the +current position. @c SYMBOL must not be a @c PREDEFINED-SYMBOL. + + +@verbatim +PUSHBACK :: = '(pushback INTEGER)' +@endverbatim + +This action pushes back the latest @c INTEGER number of key events to the event queue. + +@verbatim +UNDO :: = '(undo)' +@endverbatim + +This action cancels the last key event. + +@verbatim +SHIFT :: = '(' 'shift' STATE-NAME ')' +@endverbatim + +This action shifts the current state to @c STATE-NAME. @c +STATE-NAME must appear in @c STATE-LIST. + +@verbatim +CALL ::= '(' 'call' MODULE-NAME FUNCTION ARG * ')' + +ARG ::= INTEGER | SYMBOL | MTEXT | PLIST +@endverbatim + +This action calls the function @c FUNCTION of external module @c +MODULE-NAME. @c MODULE-NAME and @c FUNCTION must appear in @c +MODULE-LIST. + +The function is called with an argument of the type (#MPlist *). The +key of the first element is #Mt and its value is a pointer to an +object of the type #MInputContext. The key of the second element is +#Msymbol and its value is the current state name. @c ARGs are used as +the value of the third and later elements. Their keys are determined +automatically; if an @c ARG is an integer, the corresponding key is +#Minteger; if an @c ARG is a symbol, the corresponding key is +#Msymbol, etc. + +The function must return NULL or a value of the type (#MPlist *) that +represents a list of actions to take. + +@verbatim +SET ::= '(' OPERAND SYMBOL1 [ INTEGER | SYMBOL2 ] ')' + +OPERAND ::= 'set' | 'add' | 'sub' | 'mul' | 'div' +@endverbatim + +This action treats @c SYMBOL1 and @c SYMBOL2 as variables and sets the +value of @c SYMBOL1 as below. + +If @c OPERAND is 'set', it sets the value of @c SYMBOL1 to @c INTEGER or the +value of @c SYMBOL2. + +If @c OPERAND is 'add', it increments the value of @c SYMBOL1 by @c INTEGER +or the value of @c SYMBOL2. + +If @c OPERAND is 'sub', it decrements the value of @c SYMBOL1 by @c INTEGER +or the value of @c SYMBOL2. + +If @c OPERAND is 'mul', it multiplies the value of @c SYMBOL1 by @c INTEGER +or the value of @c SYMBOL2. + +If @c OPERAND is 'div', it divides the value of @c SYMBOL1 by @c INTEGER or +the value of @c SYMBOL2. + +@verbatim +IF ::= '(' CONDITION ACTION-LIST1 ACTION-LIST2 * ')' + +CONDITION ::= OPERAND VAL1 VAL2 + +ACTION-LIST1 ::= '(' ACTION * ')' + +ACTION-LIST2 ::= '(' ACTION * ')' + +OPERAND ::= '=' '<' '>' + +VAL1 ::= [ INTEGER1 | SYMBOL1 ] + +VAL2 ::= [ INTEGER2 | SYMBOL2 ] +@endverbatim + +This action performs actions in @c ACTION-LIST1 if @c CONDITION is +true, and performs @c ACTION-LIST2 (if any) otherwise. + +@c SYMBOL1 and @c SYMBOL2 are treated as variables. + +@ifnot FOR-MAN + +@subsection im-example1 EXAMPLE 1 + +This is a very simple example for inputting Latin characters with +diacritical marks (acute and cedilla). For instance, when you type: +@verbatim + Comme'die-Franc,ais, chic,, +@endverbatim +you will get this: +@if FOR-HTML +@verbatim + Commédie-Français, chic, +@endverbatim +@endif +@if FOR-LATEX +@latexonly +\hskip5mm\texttt{\footnotesize Comm\'{e}die-Fran\c{c}ais, chic,} +@endlatexonly +@endif + +The definition of the input method is very simple as below, and it is +quite straight forward to extend it to cover all Latin characters. + +@if FOR-HTML +@verbatim +(title "latin-postfix") +(map + (trans + ("a'" ?á) ("e'" ?é) ("i'" ?í) ("o'" ?ó) ("u'" ?ú) ("c," ?ç) + ("A'" ?Á) ("E'" ?É) ("I'" ?Í) ("O'" ?Ó) ("U'" ?Ú) ("C," ?Ç) + ("a''" "a'") ("e''" "e'") ("i''" "i'") ("o''" "o'") ("u''" "u'") + ("c,," "c,") + ("A''" "A'") ("E''" "E'") ("I''" "I'") ("O''" "O'") ("U''" "U'") + ("C,," "C,"))) +(state + (init + (trans))) +@endverbatim +@endif +@if FOR-LATEX +@latexonly +\texttt{\footnotesize +\hskip2mm(title "latin-postfix")\\ +\hskip2mm(map\\ +\hskip4mm (trans\\ +\hskip6mm ("a'" ?\'{a}) ("e'" ?\'{e}) ("i'" ?\'{i}) ("o'" ?\'{o}) +("u'" ?\'{u}) ("c," ?\c{c})\\ +\hskip6mm ("A'" ?\'{A}) ("E'" ?\'{E}) ("I'" ?\'{I}) ("O'" ?\'{O}) +("U'" ?\'{U}) ("C," ?\c{C})\\ +\hskip6mm ("a''" "a'") ("e''" "e'") ("i''" "i'") ("o''" "o'") ("u''" "u'")\\ +\hskip6mm ("c,," "c,")\\ +\hskip6mm ("A''" "A'") ("E''" "E'") ("I''" "I'") ("O''" "O'") ("U''" "U'")\\ +\hskip6mm ("C,," "C,")))\\ +\hskip2mm(state\\ +\hskip4mm (init\\ +\hskip6mm (trans)))} +@endlatexonly +@endif + +@subsection im-example2 EXAMPLE 2 + +This example is for inputting Unicode characters by typing C-u +(Control-u) followed by four hexadecimal numbers. For instance, when +you type ("^u" means Control-u): +@verbatim + ^u2190^u2191^u2192^u2193 +@endverbatim +you will get this (Unicode arrow symbols): +@verbatim + ←↑→↓ +@endverbatim + +The definition utilizes @c SET and @c IF commands as below: +@verbatim +(title "UNICODE") +(map + (starter + ((C-U) "U+")) + (hex + ("0" ?0) ("1" ?1) ... ("9" ?9) ("a" ?A) ("b" ?B) ... ("f" ?F))) +(state + (init + (starter (set code 0) (set count 0) (shift unicode))) + (unicode + (hex (set this @-) + (< this ?A + ((sub this 48)) + ((sub this 55))) + (mul code 16) (add code this) + (add count 1) + (= count 4 + ((delete @<) (insert code) (shift init)))))) +@endverbatim + +@subsection im-example3 EXAMPLE 3 + +This example is for inputting Chinese characters by typing PinYin key +sequence. +@if FOR-HTML +For instance, when you type: +@verbatim + nihaobei2jing2 +@endverbatim +you will get: +@verbatim + 你好北京 +@endverbatim + +The definition utilizes @c CANDIDATE and @c SELECT commands as below. +Note that this is just an example, and it ignores such important key +as Backspace. + +@verbatim +(title "拼") + +(map + ;; The initial character of Pinyin. + (starter + ("a") ("b") ... ("h") ("j") ... ("t") ("w") ("x") ("y") ("z")) + + ;; Big table of Pinyin vs the corresponding Chinese characters. + (pinyin + ... + ("bei" ("被北备背悲辈杯倍贝碑" ...)) + ("hao" ("好号毫豪浩耗皓嚎昊郝" ...)) + ("jing" ("经京精境警竟静惊景敬" ...)) + ("ni" ("你呢尼泥逆倪匿拟腻妮" ...)) + ...) + ;; Typing 1, 2, ..., 0 selects the 0th, 1st, ..., 9th candidate. + (choose + ("1" (select 0)) ("2" (select 1)) ... ("9" (select 8)) ("0" (select 9)))) + +(state + (init + ;; When an initial character of Pinyin is typed, re-handle it in + ;; "main" state. Anything else is just produced as is. + (starter (show) (pushback 1) (shift main))) + + (main + ;; When a complete Pinyin sequence is typed, shift to "select" state + ;; to allow users to select one from the candidates. + (pinyin (shift select)) + + ;; When anything else is typed, produce the current candidate (if + ;; any), and re-handle the last input in "init" state. + (nil (hide) (shift init))) + + (select + ;; When a number is typed, select the corresponding canidate, + ;; produce it, and shift to "init" state. + (choose (hide) (shift init)) + + ;; When anything else is typed, produce the current candidate, + ;; and re-handle the last input in "init" state. + (nil (hide) (shift init)))) +@endverbatim + +@elseif FOR-LATEX +@latexonly +\begin{center} +\fbox{This example is readable only in the documentation of HTML version.} +\end{center} +@endlatexonly +@endif + +@endif + +@subsection im-seealso SEE ALSO + +@ref mim-list "Input Methods provided by the m17n database", +@ref mdbGeneral "mdbGeneral(5)" +*/