-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- X TrueType Server Version 1.2 [Aoi MATSUBARA Release 2] Installation Manual (C)1998,1999 X TrueType Server Project All rights reserved. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This file describes how to install X-TT. Currently, X-TT is released as patches for XFree86 3.3.3. [...] ---------------------- 2. SETTING UP FONTS ---------------------- 2.1 Preparing the directory for fonts ------------------------------------- Decide the directory for font files. Then, put the files into that directory. If you have a MS-DOS filesystem holding Windows font files, making symbolic links to them might be useful. 2.2 Preparing fonts.dir file ---------------------------- Create 'fonts.dir' file in the fonts directory. The format of the file is: First line: the number of fonts which are contained in this fonts.dir. the rest: pairs consist of the name of the font file and corresponding XLFD (X Logical Font Descriptor). Each of the pair is in the following form. FILENAME FOUNDRY-FAMILY-WEIGHT-SLANT-WIDTH--0-0-0-0-SPACING-0-CHARSET Note you have to define at least one XLFD for each font. You can write XLFD either by manually, or let them be generated by a perl script "mkttfdir.pl". For mkttfdir.pl, please refer to the following URI: http://www.io.com/~kazushi/xtt/ With X-TT installed, the syntax of fonts.dir file for TrueType fonts is extended with the facility called "TTCap". This extension enables users to control TrueType specific properties, such like transformation of glyphs, in depth. For TTCap, please refer to the section 3 of this document. What follows describes is the meaning of each field of XLFD, as well as how you can specify them. 2.2.1 FOUNDRY and FAMILY fields ------------------------------- - FOUNDRY: Font provider name - FAMILY: Font family name You can arbitrary set the above fields. Netscape Navigator users please note that the name of the font is denoted in the form: "FOUNDRY(FAMILY)" in the font selection dialog. 2.2.2 WEIGHT field ------------------ - WEIGHT: Indicates the looking of the glyph. Appropriate value is either 'normal' or 'bold'. You should set this field so to match the glyph of the font. 2.2.3 SLANT field ----------------- - SLANT: Indicates the looking of the glyph. Valid value is either: 'r' : for regular (upright) fonts, 'i' : for italic fonts, 'ri': for reverse italic fonts, 'o' : for oblique upright fonts, or 'ro': for reverse oblique upright fonts. 2.2.4 WIDTH field ----------------- - WIDTH: Indicates the width. Typically `normal'. 2.2.5 SPACING field ------------------- - SPACING: Indicates the spacing of the glyphs. Valid value is either: p: proportionally spaced, m: mono spacing, or c: constantly spaced. For TrueType fonts, this field's value alters how X-TT to calculate the bounding boxes. If 'p' is set, the bounding boxes are calculated for each glyphs, at time of the request for the metric information. This results the spacing be proportional. MAX/MIN values are determined by comparing all the bounding boxes. If 'm' is set, the boundary of each glyphs are calculated as in the case of 'p', though the MAX/MIN value is determined as in the case of 'c'. If 'c' is set, the parameters on the glyphs are obtained from the property of the font. It takes loooong time to initialize a large charset font like CJK when you specify 'p' here. If you use xfs for CJK with specifying 'm' here, you may feel similar slowness, too. Conversely, for small charset such like iso8859-1, 'p' would be preferable. TTCap enables you this specification with much more flexibility. 2.2.6 CHARSET field ------------------- - CHARSET: Indicate the character set of the font. Examples of CHARSETS: jisx0201.1976-0 jisx0208.1983-0 iso8859-1 unicode-0 iso10646-0 For some TrueType fonts, when it is available, multiple character sets can be extracted by specifying this field. Examples of multiple charset extracting: Original font Charsets extracted ------------------------------------------- ascii ascii. iso8859-1 ascii, iso8859-1. Shift-JIS ascii, iso8859-1(*2), jisx0201, jisx0208. Unicode ascii, iso8859-1, unicode, jisx0201, jisx0208, and others... ---- (*2) In strict sence, this is not a correct thing to do. Though the most part of iso8859-1 is included in jisx0201, it is not a proper inclusion. Nonetheless X-TT does not make this an error for conveniences. 2.3 Example of fonts.dir file ----------------------------- Example of fonts.dir is following: ======================================================================== 8 dfhsmw3.ttc -dynalab-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1983-0 dfhsmw9.ttc -dynalab-mincho-bold-r-normal--0-0-0-0-c-0-jisx0208.1983-0 dfhsgw3.ttc -dynalab-gothic-medium-r-normal--0-0-0-0-c-0-jisx0208.1983-0 dfhsgw9.ttc -dynalab-gothic-bold-r-normal--0-0-0-0-c-0-jisx0208.1983-0 arial.ttf -ms-arial-medium-r-normal--0-0-0-0-p-0-iso8859-1 ariali.ttf -ms-arial-medium-i-normal--0-0-0-0-p-0-iso8859-1 arialbd.ttf -ms-arial-bold-r-normal--0-0-0-0-p-0-iso8859-1 arialbi.ttf -ms-arial-bold-i-normal--0-0-0-0-p-0-iso8859-1 ======================================================================== The top line '8' indicates that there are 8 XLFD entries defined in this file. Each 'dfhs*.ttc' font file is from DynaLab. "dfhsmw" and "dfhsgw" stands for "DynaLab Font Heisei Mincho for Windows", and "DynaLab Font Heisei Gothic for Windows" respectively. "arial.ttf", "ariali.ttf", "arialbd.ttf" and "arialbi.ttf" are fonts from Microsoft Windows, named 'Arial'. 2.4 Adding the Directory to the Fontpath (X Server standalone) -------------------------------------------------------------- Use xset fp+ or command line option. Example: ======================================================================== % xset fp+ /usr/X11R6/lib/X11/fonts/ttf % xset fp rehash ======================================================================== See xset(1) for details. For XFree86 servers, it is also possible to set in /etc/XF86Config. See XF86Config(4/5) for the details. Example for XF86Config: ======================================================================== Section "Files" ..... FontPath "/usr/X11R6/lib/fonts/ttf" ..... EndSection ======================================================================== 2.5 using X-TT through font server ---------------------------------- If you want to use X-TT through font server(xfs), you need to set 'config' file appropriately. refer to xfs(1) to write the config file. example for config fileíº ======================================================================== ....... catalogue = /usr/X11R6/lib/X11/fonts/ttf deferglyphs = 16 port = 7100 ....... ======================================================================== And, start xfs: ======================================================================== % xfs -config /usr/X11R6/lib/X11/fs/config ======================================================================== Next, start X window system with -deferglyphs 16 option for X server: ======================================================================== % startx -- -deferglyphs 16 ======================================================================== Here, it is the point that is specification of 'deferglyphs'. If you don't specify this option, X server get all glyphs in the font when the font is opened. But you may be kept waiting for long time when you use font that contains many many glyphs, such as CJK. If you specify 'deferglyphs' to '16', X server sends inquiry to xfs for each glyphs on demand. If you use such fonts, you must not forget to specify 'deferglyphs' in either X server option and config file for xfs. Finally, specify the font path by using xset as following: ======================================================================== % xset fp+ tcp/localhost:7100 % xset fp rehash ======================================================================== ----------- 3. TTCap ----------- With TTCap, users have decent control to the appearance of TrueType fonts. 3.1 Syntax of TTCap ------------------- For TTCap, the syntax of fonts.dir is extended. See the following example. ----------------- ai=0.4:sb=0.6:cyberbit.ttf -cyberbit-fixed-medium-i-normal--0-0-0-0-c-jisx0201.1976-0 ----------------- The heading "ai=0.4:sb=0.6:" is the part extended by X-TT. In this example, for the Cyberbit's font named "cyberbit.ttf", ANK part will be used as fixed width fonts. Also, the glyphs are transformed to be italic. The options list is in the form "KEYWORD=VALUE" pairs separated with colons, and is placed in front of the fontname. 3.2 Options for TTCap --------------------- Available options are the followings: * fn=INTEGER -- This option specifies the face number for TrueType Collection (*.ttc) file. (fn : Face Number) * ai=REAL_NUMBER -- This option specifies how the glyph is slanted. (ai : Automatic Italic) * fp=[yn] -- This option specifies how the font metrics are calculated. Setting y makes the font treated as proportional. Conversely n makes the font treated as fixed width. If this option does not exist, the SPACING field of XLFD is honored. You should not use this option, since this is obsoleted by 'fs'. (fp : Force Proportional) * fs=[pmc] -- This option specifies how the font metrics are calculated. Font metric is calculated with regarding SPACING field of XLFD as specifying VALUE. If this option does not exist, the SPACING field of XLFD is honored. (fs : Force Spacing) * bw=REAL_NUMBER -- This option specifies the magnification ratio to the width of bounding box. This option is valid only for fixed width fonts. In case this option is applied together with the next option 'sw', then bw scaling is done after the sw scaling. If this option does not exist, the ratio is set to be 1. (bw : Bounding box Width) * sw=REAL_NUMBER -- This option specifies the magnification ratio to the width of glyph. If this option does not exist, the ratio is set to be 1. (sw : Scale Width) * ab=[yn] -- Set this option y if you want pseudo bolding. (ab : Automatic Bolding) * vl=[yn] (This is available on the Ver1.1pl01 or later.) -- If you set this option y, the font metrics is calculated by using the very lazy method which is derived from the font header in the case of Proportional or Monocpaced font. This is efficient if you want to use the proportional fonts which contain huge number of glyphs, e.g. MS P Gothic Japanese Font. (Inversely, we can use such fonts inefficiently with the strict metrics calculation.) On the one hand the responce is improved since the metrics is calculated lazily, on the other hand the metrics informations is not exact, too. (But, such lazyness may be insignificant in most cases.) For this reason, this option is undesirable for the fonts which contain a few glyphs, such as alphabetical font. If this option does not exist, the metrics is calculated by using the strict method which is derived from the outline datas. (vl : Very Lazy metrics calculation method) * eo=String -- Specify options which are sent to code conversion module. The string depend on each code converter. (eo : Encoding Options) * hi=[yn] -- If you set this option to n, the FreeType renderer don't use hint information in font file. (hi : HInting) * cr=Range[,Range,...] -- Restrict code range of font. Each of "Range" is specified as the one of following: number number-number -number number- You can specify the flagmented ranges by separating each ranges by comma, however X-TT treat it as not flagmented range but one range covering the all of ranges. You can specify each "numbers" in octal, decimal, or hexadecimal. Octal is distinguished by prefix '0' from decimal, and hexadecimal is distinguished by prefix '0x' similarly. This option is useful to need only some part of a Unicode font, especially, and etc. It is differ from XLFD range specification, therefore clients might show the font as having only glyphs within specified ranges by nature. (cr : Code Range) * eb=[yn] -- If you set this option to y, the FreeType renderer will try to use embedded bitmaps. However, the font file needs to have the embedded bitmap data and you need to install the FreeType-EB (see http://home.interlink.or.jp/%7Emer/ft-EB/english/) to use this option. You can use this option with vl=y, but X-TT may work correctly, or not. (hi : HInting) Note all the options are case insensitive. $Id: INSTALL.mix,v 1.3 1999/03/07 08:38:02 tshiozak Exp $ # end of file > >Do I need to create a fonts.scale and fonts.dir similar to Type1 support? See above. >There is a type1inst perl script that does this. There is the equivalent >ttmkfdir for TT, is this perl too? > "You can write XLFD either by manually, or let them be generated by a perl script "mkttfdir.pl". For mkttfdir.pl, please refer to the following URI: http://www.io.com/~kazushi/xtt/ " >Any help would be much apprecieated as I've found that it's very difficult >to look for free non-formal/fancy type1 fonts that I want to use for some >projects with GIMP/2. > Installation is way easier if you simply get this fast renderer from Hobbes: xfsttos2 0.9.10 - TrueType X fontserver for OS/2 (1998 Dec 22) http://iiinet.ml.org/xfsttos2 This was a quick port of xfstt, an X fontserver for TrueType fonts written by Herbert Duerr, to OS/2. If tt-fonts are registered to X, you can use them in your app exactly the same way as any other font.