.\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium .\" .\" Permission is hereby granted, free of charge, to any person obtaining .\" a copy of this software and associated documentation files (the .\" "Software"), to deal in the Software without restriction, including .\" without limitation the rights to use, copy, modify, merge, publish, .\" distribute, sublicense, and/or sell copies of the Software, and to .\" permit persons to whom the Software is furnished to do so, subject to .\" the following conditions: .\" .\" The above copyright notice and this permission notice shall be included .\" in all copies or substantial portions of the Software. .\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. .\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR .\" OTHER DEALINGS IN THE SOFTWARE. .\" .\" Except as contained in this notice, the name of the X Consortium shall .\" not be used in advertising or otherwise to promote the sale, use or .\" other dealings in this Software without prior written authorization .\" from the X Consortium. .\" .\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by .\" Digital Equipment Corporation .\" .\" Portions Copyright \(co 1990, 1991 by .\" Tektronix, Inc. .\" .\" Permission to use, copy, modify and distribute this documentation for .\" any purpose and without fee is hereby granted, provided that the above .\" copyright notice appears in all copies and that both that copyright notice .\" and this permission notice appear in all copies, and that the names of .\" Digital and Tektronix not be used in in advertising or publicity pertaining .\" to this documentation without specific, written prior permission. .\" Digital and Tektronix makes no representations about the suitability .\" of this documentation for any purpose. .\" It is provided ``as is'' without express or implied warranty. .\" .\" Copyright (c) 1998, 2001 The X Japanese Documentation Project. .\" .\" Permission is hereby granted, free of charge, to any person obtaining a .\" copy of this software and associated documentation files (the .\" "Software"), to deal in the Software without restriction, including .\" without limitation the rights to use, copy, modify, merge, publish, dis- .\" tribute, sublicense, and/or sell copies of the Software, and to permit .\" persons to whom the Software is furnished to do so, subject to the fol- .\" lowing conditions: .\" .\" The above copyright notice and this permission notice shall be included .\" in all copies or substantial portions of the Software. .\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- .\" ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT .\" SHALL THE X JAPANESE DOCUMENTATION PROJECT BE LIABLE FOR ANY CLAIM, .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. .\" .\" Except as contained in this notice, the name of The X Japanese .\" Documentation Project shall not be used in advertising or otherwise to .\" promote the sale, use or other dealings in this Software without prior .\" written authorization from The X Japanese Documentation Project. .\" .\" X Window System is a trademark of The Open Group. .\" .\" Translated Tue Oct 27 00:00:00 JST 1998 .\" by FUJIWARA Teruyoshi .\" Corrected by NAKANO Takeo .\" Updated Mon Oct 8 23:43:55 JST 2001 for XFree86 4.1.0 .\" by FUJIWARA Teruyoshi .\" .\" $XFree86: xc/doc/man/X11/XTextExt.man,v 1.3 2001/02/09 03:47:47 tsi Exp $ .\" .ds xT X Toolkit Intrinsics \- C Language Interface .ds xW Athena X Widgets \- C Language X Toolkit Interface .ds xL Xlib \- C Language X Interface .ds xC Inter-Client Communication Conventions Manual .na .de Ds .nf .\\$1D \\$2 \\$1 .ft 1 .\".ps \\n(PS .\".if \\n(VS>=40 .vs \\n(VSu .\".if \\n(VS<=39 .vs \\n(VSp .. .de De .ce 0 .if \\n(BD .DF .nr BD 0 .in \\n(OIu .if \\n(TM .ls 2 .sp \\n(DDu .fi .. .de FD .LP .KS .TA .5i 3i .ta .5i 3i .nf .. .de FN .fi .KE .LP .. .de IN \" send an index entry to the stderr .. .de C{ .KS .nf .D .\" .\" choose appropriate monospace font .\" the imagen conditional, 480, .\" may be changed to L if LB is too .\" heavy for your eyes... .\" .ie "\\*(.T"480" .ft L .el .ie "\\*(.T"300" .ft L .el .ie "\\*(.T"202" .ft PO .el .ie "\\*(.T"aps" .ft CW .el .ft R .ps \\n(PS .ie \\n(VS>40 .vs \\n(VSu .el .vs \\n(VSp .. .de C} .DE .R .. .de Pn .ie t \\$1\fB\^\\$2\^\fR\\$3 .el \\$1\fI\^\\$2\^\fP\\$3 .. .de ZN .ie t \fB\^\\$1\^\fR\\$2 .el \fI\^\\$1\^\fP\\$2 .. .de hN .ie t <\fB\\$1\fR>\\$2 .el <\fI\\$1\fP>\\$2 .. .de NT .ne 7 .ds NO Note .if \\n(.$>$1 .if !'\\$2'C' .ds NO \\$2 .if \\n(.$ .if !'\\$1'C' .ds NO \\$1 .ie n .sp .el .sp 10p .TB .ce \\*(NO .ie n .sp .el .sp 5p .if '\\$1'C' .ce 99 .if '\\$2'C' .ce 99 .in +5n .ll -5n .R .. . \" Note End -- doug kraft 3/85 .de NE .ce 0 .in -5n .ll +5n .ie n .sp .el .sp 10p .. .ny0 .TH XTextExtents 3X11 "Release 6.5" "X Version 11" "XLIB FUNCTIONS" .SH 名前 .\"0 XTextExtents, XTextExtents16, XQueryTextExtents, XQueryTextExtents16 \- compute or query text extents XTextExtents, XTextExtents16, XQueryTextExtents, XQueryTextExtents16 \- テキストの大きさの計算と問い合わせを行なう .SH 書式 XTextExtents\^(\^\fIfont_struct\fP\^, \fIstring\fP\^, \fInchars\fP\^, \fIdirection_return\fP, \fIfont_ascent_return\fP, .br \fIfont_descent_return\fP, \fIoverall_return\fP\^) .br XFontStruct *\fIfont_struct\fP\^; .br char *\fIstring\fP\^; .br int \fInchars\fP\^; .br int *\fIdirection_return\fP\^; .br int *\fIfont_ascent_return\fP, *\fIfont_descent_return\fP\^; .br XCharStruct *\fIoverall_return\fP\^; .LP XTextExtents16\^(\^\fIfont_struct\fP\^, \fIstring\fP\^, \fInchars\fP\^, \fIdirection_return\fP, \fIfont_ascent_return\fP, .br \fIfont_descent_return\fP, \fIoverall_return\fP\^) .br XFontStruct *\fIfont_struct\fP\^; .br XChar2b *\fIstring\fP\^; .br int \fInchars\fP\^; .br int *\fIdirection_return\fP\^; .br int *\fIfont_ascent_return\fP, *\fIfont_descent_return\fP\^; .br XCharStruct *\fIoverall_return\fP\^; .LP XQueryTextExtents\^(\^\fIdisplay\fP, \fIfont_ID\fP, \fIstring\fP, \fInchars\fP, \fIdirection_return\fP, \fIfont_ascent_return\fP, .br \fIfont_descent_return\fP, \fIoverall_return\fP\^) .br Display *\fIdisplay\fP\^; .br XID \fIfont_ID\fP\^; .br char *\fIstring\fP\^; .br int \fInchars\fP\^; .br int *\fIdirection_return\fP\^; .br int *\fIfont_ascent_return\fP, *\fIfont_descent_return\fP\^; .br XCharStruct *\fIoverall_return\fP\^; .LP XQueryTextExtents16\^(\^\fIdisplay\fP, \fIfont_ID\fP, \fIstring\fP, \fInchars\fP, \fIdirection_return\fP, \fIfont_ascent_return\fP, .br \fIfont_descent_return\fP, \fIoverall_return\fP\^) .br Display *\fIdisplay\fP\^; .br XID \fIfont_ID\fP\^; .br XChar2b *\fIstring\fP\^; .br int \fInchars\fP\^; .br int *\fIdirection_return\fP\^; .br int *\fIfont_ascent_return\fP, *\fIfont_descent_return\fP\^; .br XCharStruct *\fIoverall_return\fP\^; .SH 引き数 .IP \fIdirection_return\fP 1i .\"0 Returns the value of the direction hint 方向ヒント(direction hint)の値が返される .\"0 .Pn ( FontLeftToRight .\"0 or .\"0 .ZN FontRightToLeft ). .Pn ( FontLeftToRight または ZN FontRightToLeft )。 .IP \fIdisplay\fP 1i .\"0 Specifies the connection to the X server. X サーバへの接続を指定する。 .IP \fIfont_ID\fP 1i .\"0 Specifies either the font ID or the .\"0 .ZN GContext .\"0 ID that contains the font. フォントIDかフォントを含む .ZN GC の ID を指定する。 .IP \fIfont_ascent_return\fP 1i .\"0 Returns the font ascent. フォントの ascent 値が返される。 .IP \fIfont_descent_return\fP 1i .\"0 Returns the font descent. フォントの descent 値が返される。 .IP \fIfont_struct\fP 1i .\"0 Specifies the .\"0 .ZN XFontStruct .\"0 structure. .ZN XFontStruct 構造体を指定する。 .IP \fInchars\fP 1i .\"0 Specifies the number of characters in the character string. 文字列内の文字数を指定する。 .IP \fIstring\fP 1i .\"0 Specifies the character string. 文字列を指定する。 .IP \fIoverall_return\fP 1i .\"0 Returns the overall size in the specified .\"0 .ZN XCharStruct .\"0 structure. ここに指定した .ZN XCharStruct 構造体に全てのサイズ情報が返される。 .SH 説明 .\"0 The .\"0 .ZN XTextExtents .\"0 and .\"0 .ZN XTextExtents16 .\"0 functions .\"0 perform the size computation locally and, thereby, .\"0 avoid the round-trip overhead of .\"0 .ZN XQueryTextExtents .\"0 and .\"0 .ZN XQueryTextExtents16 . 関数 .ZN XTextExtents および .ZN XTextExtents16 はローカルでサイズの計算を行う。 従って .ZN XQueryTextExtents や .ZN XQueryTextExtents16 で生じるデータのやりとりのオーバヘッドを回避できる。 .\"0 Both functions return an .\"0 .ZN XCharStruct .\"0 structure, whose members are set to the values as follows. どちらの関数も .ZN XCharStruct 構造体を返し、そのメンバの値は以下のように設定される。 .LP .\"0 The ascent member is set to the maximum of the ascent metrics of all .\"0 characters in the string. ascent メンバは、文字列中の各文字 ascent 寸法の最大値に設定される。 .\"0 The descent member is set to the maximum of the descent metrics. descent メンバは descent 寸法の最大値に設定される。 .\"0 The width member is set to the sum of the character-width metrics of all .\"0 characters in the string. width メンバには、文字列中のそれぞれの文字の幅の寸法の総和が設定される。 .\"0 For each character in the string, .\"0 let W be the sum of the character-width metrics of all characters preceding .\"0 it in the string. 文字列中の各文字に対して、W を文字列中でその文字より前にある文字幅の寸 法の総和とする。 .\"0 Let L be the left-side-bearing metric of the character plus W. L はその文字の左側bearing寸法に W を加えたものとする。 .\"0 Let R be the right-side-bearing metric of the character plus W. R はその文字の右側bearing寸法に W を加えたものとする。 .\"0 The lbearing member is set to the minimum L of all characters in the string. lbearing メンバは、文字列中の全ての文字についての L の最小値に設定され る。 .\"0 The rbearing member is set to the maximum R. 同じく rbearing は R の最大値に設定される。 .LP .\"0 For fonts defined with linear indexing rather than 2-byte matrix indexing, .\"0 each .\"0 .ZN XChar2b .\"0 structure is interpreted as a 16-bit number with byte1 as the .\"0 most significant byte. 2バイトの行列形式のインデックス(2-byte matrix indexing)ではなく、線形 インデックス(linear indexing)で定義されたフォントについては、各 .ZN XChar2b 構造体は byte1 が最上位バイトである16ビットの数と解釈される。 .\"0 If the font has no defined default character, .\"0 undefined characters in the string are taken to have all zero metrics. フォントにデフォルト文字が定義されていない場合、文字列中の未定義文字の 寸法は全て 0 として扱われる。 .LP .\"0 The .\"0 .ZN XQueryTextExtents .\"0 and .\"0 .ZN XQueryTextExtents16 .\"0 functions return the bounding box of the specified 8-bit and 16-bit .\"0 character string in the specified font or the font contained in the .\"0 specified GC. 関数 .ZN XQueryTextExtents および .ZN XQueryTextExtents16 は、指定したフォントあるいは指定したGCが含むフォントに関して、指定した 8ビット文字および16ビット文字の文字列のバウンディングボックスを返す。 .\"0 These functions query the X server and, therefore, suffer the round-trip .\"0 overhead that is avoided by .\"0 .ZN XTextExtents .\"0 and .\"0 .ZN XTextExtents16 . これらの関数は X サーバに問い合わせを行うため、 .ZN XTextExtents や .ZN XTextExtents16 では起こらないサーバとのやり取りが余分なオーバヘッドとなる。 .\"0 Both functions return a .\"0 .ZN XCharStruct .\"0 structure, whose members are set to the values as follows. どちらの関数も .ZN XCharStruct を返し、そのメンバは以下のように値が設定される。 .LP .\"0 The ascent member is set to the maximum of the ascent metrics .\"0 of all characters in the string. ascent メンバは、文字列中の各文字 ascent 寸法の最大値に設定される。 .\"0 The descent member is set to the maximum of the descent metrics. descent メンバは descent 寸法の最大値に設定される。 .\"0 The width member is set to the sum of the character-width metrics .\"0 of all characters in the string. width メンバには、文字列中の各文字の幅の寸法の総和が設定される。 .\"0 For each character in the string, .\"0 let W be the sum of the character-width metrics of all characters preceding .\"0 it in the string. 文字列中の各文字に対して、W を文字列中でその文字より前にある文字幅寸法 の総和とする。 .\"0 Let L be the left-side-bearing metric of the character plus W. L はその文字の左側bearing寸法に W を加えたものとする。 .\"0 Let R be the right-side-bearing metric of the character plus W. R はその文字の右側bearing寸法に W を加えたものとする。 .\"0 The lbearing member is set to the minimum L of all characters in the string. lbearing メンバは、文字列中の全ての文字についての L の最小値に設定され る。 .\"0 The rbearing member is set to the maximum R. 同じく rbearing は R の最大値に設定される。 .LP .\"0 For fonts defined with linear indexing rather than 2-byte matrix indexing, .\"0 each .\"0 .ZN XChar2b .\"0 structure is interpreted as a 16-bit number with byte1 as the .\"0 most significant byte. 2バイトの行列形式のインデックスではなく、線形インデックスで定義された フォントについては、各 .ZN XChar2b 構造体は byte1 が最上位バイトである16ビットの数と解釈される。 .\"0 If the font has no defined default character, .\"0 undefined characters in the string are taken to have all zero metrics. フォントにデフォルト文字が定義されていない場合、文字列中の未定義文字の 寸法は全て 0 として扱われる。 .LP .\"0 Characters with all zero metrics are ignored. 寸法が全て 0 である文字は無視される。 .\"0 If the font has no defined default_char, .\"0 the undefined characters in the string are also ignored. フォントにデフォルト文字が定義されていない場合、文字列中の未定義文字も 無視される。 .LP .\"0 .ZN XQueryTextExtents .\"0 and .\"0 .ZN XQueryTextExtents16 .\"0 can generate .\"0 .ZN BadFont .\"0 and .\"0 .ZN BadGC .\"0 errors. .ZN XQueryTextExtents および .ZN XQueryTextExtents16 はエラー .ZN BadFont と .ZN BadGC を起こすことがある。 .SH 返り値 .TP 1i .ZN BadFont .\"0 A value for a Font or GContext argument does not name a defined Font. 引き数の Font あるいは GC の値が、定義されている Font を指していない。 .TP 1i .ZN BadGC .\"0 A value for a GContext argument does not name a defined GContext. 引き数 GC の値が、定義されている GC を指していない。 .SH 関連項目 XLoadFont(3X11), XTextWidth(3X11) .br \fI\*(xL\fP