-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- X TrueType Server Version 1.3 [Aoi MATSUBARA Release 3] 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.5. In the procedure below, you are supposed to be familiar with installing X from the source tree. ----------------- 1. Preparations ----------------- 1.1 Files you need ------------------ You need the followings: * This package; xtt-1.3.tar.gz. * FreeType library; freetype-1.3.tar.gz. * The source of XFree86; X335src-1.tgz. In case you do not need xfs, only X335servonly.tgz is needed. * TrueType fonts. * GNU patch. (One of Ver2.5 or newer is ***mandatory***) 1.2 Install FreeType library ---------------------------- First, you need to install FreeType library. FreeType is available from http://www.freetype.org/. To install FreeType, please refer to the documents in FreeType. There should be no big trouble because GNU type configure script is supported. If you are going to use DynaLab fonts, I'd suggest you to apply the patch from X-TT to the source of FreeType, as follow: --- % cd freetype-1.3/lib % patch < **SOMEWHERE**/freetype1.3-adw-nocheck.patch --- 1.3 Apply X-TT patches to XFree86 ----------------------------------- This package (xtt-1.3.tar.gz) contains the following files; * freetype1.3-adw-nocheck.patch (optional) Ad hoc patch to avoid difficulty on `Dynalab' fonts for FreeType 1.3. * ext-xfs.sh Shell script to extract the least files to compile xfs and/or libfont. * shared-libfont-1.2.diff (mandatory) Patches to make libfont as shared library. * xfs-for-delayed-font-1.0.diff (mandatory if you use xfs with X-TT) Patches to cope with using delayed rendering rasterizer such as X-TT for xfs. * make-xfs-only-1.3.diff (optional) Patches to make libfont or xfs only. * xtt-xf335-changes.diff (mandatory) Patches to use X-TT with XFree86. * xtt-core.tar (mandatory) The main body of X-TT font rasterizer. (xc/lib/font/X-TrueType) * contribute/xtt-xfsft-lib.patch (optional) Patches to use the kinds of languages with Type1 and/or Speedo fonts, although it is not part of X-TT. Although you need not to use all of those files for your purpose, you will have to use those files in the above order, since those files depend on the order. Since shared-libfont-1.2.diff contains the patches for all files which need to be changed to make libfont as shared library, you may show the following message : "No file to patch. Skipping...". Probably, you may ignore the above message. But, you should be careful whether you forgot to extract the files which is needed for you. And, you need not always to apply make-xfs-only-1.3.diff, but you may show offset messages in the case when you apply xtt-xf335-changes.diff. You may ignore the messages, too. 1.3.1 Only X server to rasterize -------------------------------- If you do not need xfs to rasterize TrueType, you do not need the entire source of XFree86. Obtain the file X335servonly.tgz from any XFree86 distribution, then apply the patch. *** Example *** ---------------------------------------------------------------------- % tar zxvf **SOMEWHERE**/X335servonly.tgz % cd xc % patch -p1 -t -E -N < **SOMEWHERE**/shared-libfont-1.2.diff % patch -p1 -t -E -N < **SOMEWHERE**/xtt-xf335-changes.diff % patch -p1 -t -E -N < **SOMEWHERE**/contribute/xtt-xfsft-lib.patch (optional) % tar xvf **SOMEWHERE**/xtt-core.tar -C lib/font ---------------------------------------------------------------------- 1.3.2 X font server ------------------- If you want xfs to rasterize, you need to obtain X335src-1.tgz. 1.3.2.1 Only xfs to use X-TT ---------------------------- In this case, you need to rebuild only libfont and xfs. You can extract only files to build xfs, by using shell script 'ext-xfs.sh' containing in xtt-1.3.tar.gz, as follow: *** Example *** -------------------------------------------------------------------- % sh **SOMEWHERE**/ext-xfs.sh **SOMEWHERE**/X335src-1.tgz % cd xc % patch -p1 -t -E -N < **SOMEWHERE**/shared-libfont-1.2.diff % patch -p1 -t -E -N < **SOMEWHERE**/xfs-for-delayed-font-1.0.diff % patch -p1 -t -E -N < **SOMEWHERE**/make-xfs-only-1.3.diff % patch -p1 -t -E -N < **SOMEWHERE**/xtt-xf335-changes.diff % patch -p1 -t -E -N < **SOMEWHERE**/contribute/xtt-xfsft-lib.patch (optional) % tar xvf **SOMEWHERE**/xtt-core.tar -C lib/font -------------------------------------------------------------------- 1.3.2 Full install from sources ------------------------------- You need to obtain X335src-1.tgz (mandatory) and X335src-2.tgz (optional). --------------------------------------------------------------------- % tar zxvf **SOMEWHERE**/X335src-1.tgz % tar zxvf **SOMEWHERE**/X335src-2.tgz (optional) % cd xc % patch -p1 -t -E -N < **SOMEWHERE**/shared-libfont-1.2.diff % patch -p1 -t -E -N < **SOMEWHERE**/xfs-for-delayed-font-1.0.diff % patch -p1 -t -E -N < **SOMEWHERE**/make-xfs-only-1.3.diff (optional) % patch -p1 -t -E -N < **SOMEWHERE**/xtt-xf335-changes.diff % patch -p1 -t -E -N < **SOMEWHERE**/contribute/xtt-xfsft-lib.patch (optional) % tar xvf **SOMEWHERE**/xtt-core.tar -C lib/font --------------------------------------------------------------------- 1.4 Configure the build options of XFree86 ------------------------------------------ Basically to use X-TT, That is all you need to compile the materials with applying the above patches and install the files. However, you can customize X-TT by setting the following macros appropriately: Macro name Description ------------------------------------------------------------------------- HasFreeType Set 'NO' if your system doesn't have the FreeType library. If you want to use X-TT, you must not set 'NO'. (Default : YES) FreeTypeLibDir Set a directory where the FreeType library is located. (Default : /usr/local/lib) FreeTypeIncDir Set a directory where header file for the FreeType library is located. (Default : /usr/local/include) FreeTypeLibName Set the name of the FreeType library. (Default : ttf) BuildXTrueType Set 'NO' if you need not to use TrueType font by using X-TT. If you want to use X-TT, you must not set 'NO'. (Default : YES) Typically, you describe those options in file 'xc/config/cf/xttsite.def'. Concretely, refer to the comments in xttsite.def. 1.5 Compile and Install ----------------------- 1.5.1 Those who want to install all XFree86 3.3.3 files at the same time ------------------------------------------------------------------------ or, install X server only ------------------------------------------- If you set xttsite.def appropriately, just type as follow: % make World # make install 1.5.2 Those who want to install font server only ------------------------------------------------ Just type as follow, too: % make xfs # make install 1.5.3 Those who are updating from the earlier versions of X-TT -------------------------------------------------------------- No change has been made for the X server part since the last version of X-TT. (Actually, nothing has been changed for the X server part since the early stage of the development.) Hence, you can update X-TT simply by replacing the font library 'libfont.so.1.2'. Concretely, type as follow: % make libfont # make install Next, you need to update the hint file for shared libraries. The way of this work depends on your platform. Thus, please refer ldconfig(8) on your platform for further particulars. # ldconfig -R (on FreeBSD) ---------------------- 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) * ds=[yn] -- Set this option y if you want double striking of the face. In the earlier version of X-TT, this effect was called "Pseudo Bold", but because this name is inappropriate, it has been changed. The old option "ab" can still be used, but I recommend to use "ds". (ds : Double Strike) * 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. You can use this option with vl=y, but you might need to adjust by using "bs" option, because bounding box value for embedded bitmap may be often different from them for outlines. Thus, it is not recommended to use "vl" and "eb" in the same time. (hi : HInting) * bs=REAL_NUMBER -- If you specify this option when you also specify both "vl" and "eb", the bounding boxes which is generated from embedded bitmaps is scaled by this value. There is no effect for the glyphs which is generated from outlines. Note all the options are case insensitive. ---------------- 4. bitmap cache ---------------- From X-TT Ver1.3, users can limit the memory resource for bitmap cache. 4.1 terms --------- * balance value It indicates the balance of the memory pools. X-TT bitmap cache has two kind of memory pools, which is chosen by the difference of bitmap size. The total size of the cache is determined, and it is shared between both of the memory pools. This balance value indicate the memory balance ratio. * hi-mark value It indicates the upper limit of the cache size. * low-mark value It indicated the lower limit of the cache size. If the cache is overflow, the contents of the cache will be disposed of until the memory usage becomes under this value. 4.2 adjust the cache -------------------- 4.2.1 X server -------------- For the X server, cache can be adjusted by using xset compiled with font cache extension. Following syntax: xset fc himark lowmark balance Here, himark and lowmark is specified in kBytes, and balance is in percent. For instance, if you want to specify the himark to 1MBytes, lowmakr to 500kBytes, and balance to 50%, then you may specify the following: xset fc 1000 500 50 4.2.2 font server ----------------- For font server, cache can be adjust in the config file. The following tags are added: cache-hi-mark= cache-low-mark= cache-balance= Here, himark and lowmark is specified in kBytes, and balance is in percent. For instance, if you want to specify the himark to 1MBytes, lowmakr to 500kBytes, and balance to 50%, then you may specify the following: cache-hi-mark = 1000 cache-low-mark= 500 cache-balance = 50 $Id: INSTALL.mix,v 1.6 1999/10/08 03:22:57 tshiozak Exp $ # end of file