GROFF_FONT(5) GROFF_FONT(5) 名称 groff_font - groff のデバイスとフォントを記述するファイルの書式 解説 groff のフォントの書式は ditroff のフォントの書式に対し、ほぼスーパセッ トになっています。 ditroff のフォントの書式とは異なり、関連したバイナリ 書式はありません。 name というデバイス用のフォントファイルは devname と いうディレクトリに納められます。ファイルには 2 つの種類があります: それ は DESC と呼ばれるデバイス記述ファイルと、各フォント F ごとに存在する F と呼ばれるフォントファイルです。これらはテキストファイルであり、関連 し たバイナリ書式のファイルはありません。 DESC ファイルの書式 DESC ファイルは以下の形式の行を含むことができます: res n 1 インチあたりのマシン単位は n です。 hor n 水平解像度は n マシン単位です。 vert n 垂直解像度は n マシン単位です。 sizescale n ポ イント数への倍率を指定します。デフォルトの値は 1 です。1 スケ ールドポイントは、1 ポイント/n と等しくなります。 unitwidth コマ ン ドと sizes コマンドへの引数はスケールドポイントで指定されます 。 unitwidth n ポイントサイズが n スケールドポイントのフォントに対して、フォ ン トファイル毎の数量をマシン単位で与えます。 prepro program program をプリプロセッサとして呼び出します。 postpro program program をポストプロセッサとして使用します。 tcommand ポストプロセッサが t と u の出力コマンドを扱えることを表します。 sizes s1 s2...sn 0 デバイスが s1, s2,...sn スケールドポイントのフォントを持つことを 表 します。大きさのリストは 0 で終らなければなりません。各 si は 大きさの範囲 m-n でも指定できます。リストは複数行にわたること も 可能です。 styles S1 S2...Sm 先頭 m 個のフォント位置が、スタイル S1...Sm に関連づけられます。 fonts n F1 F2 F3...Fn フォント F1...Fn がフォント位置 m+1,...,m+n にマウントされま す( m はスタイル数)。このコマンドは複数行にわたることができます。 0 というフォント名を指定すると、対応するフォント位置にはフォントは マウントされません。 family fam デフォルトのフォントファミリは fam です。 use_charnames_in_special こ の コ マ ンドは、スペシャルコマンドにおいては、指定した文字を troff がエンコードすべきであることを指定します。 pass_filenames troff がドライバに対して、処理すべきソースファイル名を伝えるリク エ ス ト です。これは、次に示す別の tcommand にて実現されます: F filename 。 charset この行とファイル内の以下に続く行はすべて無視されます。これは下位 互換性のために許されています。 print program program を、印刷用のスプーラプログラムとして使用します。これが存 在しない場合、 -l と -L の groff オプションが無視されます。 res, unitwidth, fonts, sizes の行は必須です。他のコマンドは troff に は 無 視されますが、デバイスに関する任意の情報を DESC ファイルに入れておく ためにポストプロセッサにより使われるかもしれません。 次に示すのは廃れたキーワードであり、 groff が認識するものの完全に無視す るもののリストです: spare1, spare2, biggestfont 。 フォントファイルの書式 フォントファイルには 2 つのセクションがあります。最初のセクションは空白 で区切られた単語が並んだ一連の行からなります。行の最初の単語はキーで 、 以降の単語はそのキーに対する値となります。 name F フォントの名前は F です。 spacewidth n 空白の通常の幅は n です。 slant n フ ォントの文字が n 度傾斜していることを表します (正の値は進行方 向を意味します)。 ligatures lig1 lig2...lign [0] 文字 lig1, lig2,...,lign は合字 (リガチャ; ligature) です。合 字 には ff, fi, fl, ffi, ffl が使用可能です。下位互換性のために、合 字のリストは 0 で終ってもかまいません。合字のリストは複数行に わ たってはいけません。 special フ ォントは スペシャルです。これは現在のフォントに存在しない文字 が要求された場合、マウントされた全てのスペシャルフォントが検索さ れることを示しています。 他のコマンドは troff には無視されますが、フォントに関する任意の情報をフ ォントファイルに入れておくためにポストプロセッサにより使われるかも知 れ ません。 最初のセクションには # 文字ではじまるコメントを、行末まで入れることがで きます。 次のセクションには 1 つか 2 つのサブセクションが含まれます。サブセク シ ョ ン charset は必須で、サブセクション kernpairs はオプションです。これ らのサブセクションは任意の順番で書くことができます。各サブセクション は 、サブセクション名のみからなる行から始まります。 単語 charset で charset サブセクションを開始します。 charset 行には一連 の行が続きます。各行は 1 文字の情報を与えます。行は空白かタブにより区切 られたいくつかのフィールドから成ります。書式は name metrics type code [entity_name] [-- comment] で 、 name は文字を識別します: name が単一の文字 c ならば、それは groff の入力文字 c を表します。 \c という形式で c が単一の文字なら、groff の 入 力文字 \c を表します。それ以外は groff の入力文字 \[name] を表します (2 文字の xx だとすると、 \(xx として入力されます)。 groff は 8 ビッ ト 文字に対応していますが、いくつかのユーティリティでは 8 ビット文字を扱う のが困難です。このような理由から、文字コードが n である単一の文字と等価 な charn という表記法が存在します。例えば、 char163 は ISO Latin-1 で英 国ポンド記号を表す文字コード 163 の文字と等価です。 --- という name は 特別で、その文字に名前が無いことを示します。そのような文字は troff 中で エスケープシーケンス \N によってのみ使われます。 type フィールドは文字の種類を示します: 1 は descender (ベースラインより下にはみ出した部分) を持つ文字であ ることを表します。例えば p があてはまります。 2 は ascender (x の高さより上に出る部分) を持つ文字であることを表 します。例えば b があてはまります。 3 は ascender と descender の両方を持つ文字であることを表します 。 例えば ( があてはまります。 code フィールドはポストプロセッサが文字を印字するために使うコードを示し ます。 \N というエスケープシーケンスを用いたこのコードを使っ て 、groff に 文字を入力することもできます。 code はどんな整数でもかまいません。 0 から始まると、8 進数として扱われ、 0x や 0X で始まると 16 進数として 扱 われます。 entity_name フィールドは、グリフを識別する ASCII 文字列を与えます。この グリフは、後処理を行うプログラムが文字の印刷に使用します。このフィー ル ド は省略可能であり、 html ドライバが文字集合をエンコード可能とするため に導入されました。例えば、文字 ‘\[Po]’ は、html 4.0 では ‘£’ と表 現されます。 行の code フィールド以降と、‘--’ の後ろは、すべて無視されます。 metrics フィールドの形式はこのようになります: width[,height[,depth[,italic_correction[,left_italic_correc- tion[,subscript_correction]]]]] サブフィールド間には空白を入れてはいけません。サブフィールドが存在し な い場合は 0 として扱われます。サブフィールドは全て 10 進数の整数で指定さ れます。対応するバイナリフォーマットが存在しないので、 ditroff のように こ れらの値を char 型変数の範囲に合わせるという必要はありません。サブフ ィールド width では文字の幅を指定します。サブフィールド height では文字 の高さを指定します (上が正)。文字がベースラインよりも上にいかない場合、 負の高さを持つとするのではなく高さが 0 であるとします。サブフィー ル ド depth では文字の深さを指定します。これはベースラインから文字の一番下ま での長さです (下が正)。文字がベースラインより下に出ていない場合、負の深 さ を 持 つ と す る の ではなく深さが 0 であるとします。サブフィールド italic_correction では直後にローマンフォントの文字が続く時に、文字の 後 に加えられる空白の量を指定します。サブフィールド left_italic_correction では直前にローマンフォントの文字がある時に、文字の前に加えられる空白 の 量 を 指 定 し ます。サブフィールド subscript_correction では添字 (sub- script) を加える際に文字の後に加えられる空白の量を指定します。これは イ タ リック補正 (上記の italic_correction) よりは少なくなければなりません 。 charset セクション内では、以下のような書式の行も可能です name " これは name が前の行で言及した文字の別名であることを表します。 kernpairs セクションは kernpairs という単語から始まります。このセクショ ンは以下のような書式の行からなります: c1 c2 n 文字 c1 が文字 c2 の次に現れる時には、それらの間の空白に n を加えること を意味します。 kernpairs セクションのほとんどのエントリは n に負の値 を 持つことになります。 関連ファイル /usr/share/groff_font/devname/DESC デバイス name 用のデバイス記述ファイル /usr/share/groff_font/devname/F デバイス name のフォント F 用のフォントファイル 関連項目 groff_out(5), troff(1). Groff Version 1.17.2 6 August 2001 GROFF_FONT(5)
GROFF_FONT(5) GROFF_FONT(5) NAME groff_font - format of groff device and font description files DESCRIPTION The groff font format is roughly a superset of the ditroff font format. The font files for device name are stored in a directory devname. There are two types of file: a device description file called DESC and for each font F a font file called F. These are text files; unlike the ditroff font format, there is no associated binary format. DESC file format The DESC file can contain the following types of line as shown below. Later entries in the file override previous values. charset This line and everything following in the file are ignored. It is allowed for the sake of backwards compatibility. family fam The default font family is fam. fonts n F1 F2 F3...Fn Fonts F1...Fn will be mounted in the font positions m+1,...,m+n where m is the number of styles. This command may extend over more than one line. A font name of 0 will cause no font to be mounted on the corresponding font position. hor n The horizontal resolution is n machine units. paperheight n The physical vertical dimension of the output medium in machine units. This isn’t used by troff itself; currently, only grops uses it. paperwidth n The physical horizontal dimension of the output medium in machine units. This isn’t used by troff. Currently, only the grolbp output device uses it. papersize string Select a paper size. Valid values for string are the ISO paper types A0-A7, B0-B7, C0-C7, D0-D7, DL, and the US paper types letter, legal, tabloid, ledger, statement, executive, com10, and monarch. Case is not significant for string if it holds prede- fined paper types. Alternatively, string can be a file name (e.g. ‘/etc/papersize’); if the file can be opened, groff reads the first line and tests for the above paper sizes. Finally, string can be a custom paper size in the format length,width (no spaces before and after the comma). Both length and width must have a unit appended; valid values are ‘i’ for inches, ‘c’ for centimeters, ‘p’ for points, and ‘P’ for picas. Example: 12c,235p. An argument which starts with a digit is always treated as a custom paper format. papersize sets both the ver- tical and horizontal dimension of the output medium. More than one argument can be specified; groff scans from left to right and uses the first valid paper specification. pass_filenames Make troff tell the driver the source file name being processed. This is achieved by another tcommand: F filename. postpro program Use program as the postprocessor. prepro program Call program as a preprocessor. print program Use program as the spooler program for printing. If omitted, the -l and -L options of groff are ignored. res n There are n machine units per inch. sizes s1 s2...sn 0 This means that the device has fonts at s1, s2,...sn scaled points. The list of sizes must be terminated by a 0. Each si can also be a range of sizes m-n. The list can extend over more than one line. sizescale n The scale factor for pointsizes. By default this has a value of 1. One scaled point is equal to one point/n. The arguments to the unitwidth and sizes commands are given in scaled points. styles S1 S2...Sm The first m font positions will be associated with styles S1...Sm. tcommand This means that the postprocessor can handle the t and u output commands. unitwidth n Quantities in the font files are given in machine units for fonts whose point size is n scaled points. use_charnames_in_special This command indicates that troff should encode named characters inside special commands. vert n The vertical resolution is n machine units. The res, unitwidth, fonts, and sizes lines are compulsory. Other com- mands are ignored by troff but may be used by postprocessors to store arbitrary information about the device in the DESC file. Here a list of obsolete keywords which are recognized by groff but com- pletely ignored: spare1, spare2, biggestfont. Font file format A font file has two sections. The first section is a sequence of lines each containing a sequence of blank delimited words; the first word in the line is a key, and subsequent words give a value for that key. ligatures lig1 lig2...lign [0] Characters lig1, lig2, ..., lign are ligatures; possible liga- tures are ff, fi, fl, ffi and ffl. For backwards compatibility, the list of ligatures may be terminated with a 0. The list of ligatures may not extend over more than one line. name F The name of the font is F. slant n The characters of the font have a slant of n degrees. (Positive means forward.) spacewidth n The normal width of a space is n. special The font is special; this means that when a character is requested that is not present in the current font, it will be searched for in any special fonts that are mounted. Other commands are ignored by troff but may be used by postprocessors to store arbitrary information about the font in the font file. The first section can contain comments which start with the # character and extend to the end of a line. The second section contains one or two subsections. It must contain a charset subsection and it may also contain a kernpairs subsection. These subsections can appear in any order. Each subsection starts with a word on a line by itself. The word charset starts the charset subsection. The charset line is followed by a sequence of lines. Each line gives information for one character. A line comprises a number of fields separated by blanks or tabs. The format is name metrics type code [entity_name] [-- comment] name identifies the character: if name is a single character c then it corresponds to the groff input character c; if it is of the form \c where c is a single character, then it corresponds to the special char- acter \[c]; otherwise it corresponds to the groff input character \[name]. If it is exactly two characters xx it can be entered as \(xx. Note that single-letter special characters can’t be accessed as \c; the only exception is ‘\-’ which is identical to ‘\[-]’. The name --- is special and indicates that the character is unnamed; such characters can only be used by means of the \N escape sequence in troff. Groff supports eight-bit characters; however some utilities have diffi- culties with eight-bit characters. For this reason, there is a conven- tion that the name charn is equivalent to the single character whose code is n. For example, char163 would be equivalent to the character with code 163 which is the pounds sterling sign in ISO Latin-1. The type field gives the character type: 1 means the character has a descender, for example, p; 2 means the character has an ascender, for example, b; 3 means the character has both an ascender and a descender, for example, (. The code field gives the code which the postprocessor uses to print the character. The character can also be input to groff using this code by means of the \N escape sequence. The code can be any integer. If it starts with a 0 it will be interpreted as octal; if it starts with 0x or 0X it will be intepreted as hexadecimal. Note, however, that the \N escape sequence only accepts a decimal integer. The entity_name field gives an ascii string identifying the glyph which the postprocessor uses to print the character. This field is optional and has been introduced so that the html device driver can encode its character set. For example, the character ‘\[Po]’ is represented as ‘£’ in html 4.0. Anything on the line after the encoding field resp. after ‘--’ will be ignored. The metrics field has the form (in one line; it is broken here for the sake of readability): width[,height[,depth[,italic-correction [,left-italic-correction[,subscript-correction]]]]] There must not be any spaces between these subfields. Missing sub- fields are assumed to be 0. The subfields are all decimal integers. Since there is no associated binary format, these values are not required to fit into a variable of type char as they are in ditroff. The width subfields gives the width of the character. The height sub- field gives the height of the character (upwards is positive); if a character does not extend above the baseline, it should be given a zero height, rather than a negative height. The depth subfield gives the depth of the character, that is, the distance below the lowest point below the baseline to which the character extends (downwards is posi- tive); if a character does not extend below above the baseline, it should be given a zero depth, rather than a negative depth. The italic-correction subfield gives the amount of space that should be added after the character when it is immediately to be followed by a character from a roman font. The left-italic-correction subfield gives the amount of space that should be added before the character when it is immediately to be preceded by a character from a roman font. The subscript-correction gives the amount of space that should be added after a character before adding a subscript. This should be less than the italic correction. A line in the charset section can also have the format name " This indicates that name is just another name for the character men- tioned in the preceding line. The word kernpairs starts the kernpairs section. This contains a sequence of lines of the form: c1 c2 n This means that when character c1 appears next to character c2 the space between them should be increased by n. Most entries in kernpairs section will have a negative value for n. FILES /usr/share/groff/1.18.1.4/font/devname/DESC Device description file for device name. /usr/share/groff/1.18.1.4/font/devname/F Font file for font F of device name. SEE ALSO groff_out(5), troff(1). Groff Version 1.18.1.4 12 September 2002 GROFF_FONT(5)
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa