X-TrueType Server and TrueType fonts

Our X-TrueType Server project is a project to add displaying ability of TrueType fonts to X through a FreeType library. Moreover, we especialy need to display more than thousand of Japanese characters. It means we have to implement good and fast codes. We are proud of building and maintain such codes.

This page is not the XTT server project's page but my personal page to describe history and tips of XTT programs and the project. if you want to know more and exact information about our XTT project, please read a X-TrueType Server Project page.


Features of XTT

API
The X has a private library named libfont.a. XTT patch changes this library public named libfont.so and add TrueType fonts ability. Therefore both the X server and the xfs program get such ability throught libfont.so by using traditional X API.
xfs
You can replace only a xfs program. For example, you can use special X server for your hardware and use TrueType fonts through new xfs program.
deferglys (it's not a feature but a suggestion)
You should rasterize each character on-the-fly because Chinese, Japanese and Korean fonts have too many glyphs to rasterize them at once. So you shold use "deferglyphs" option for both a xfs program and a X server. It allow to defer the rendering. Please look at each manual page to know a option.
Screen shot
one screen shot.
Here are some html files to check your WEB browser and X-TT.

A mini history before XTT

In Japan, there had been some vector fonts before TrueType fonts has been appeared. There also has been a vector font library named vflib written by Kakugawa-san from 1993. Then Takagi-san made a X server using this vflib at 1997.

After FreeType library is released, Go-san made a X-TrueType server by using above patches and a FreeType library at 1998. Few months later, Shiozaki-san gathered all information and released the X-TrueType server 1.0. To know more history, please see xtt10-miscnote.eng in the package of xtt-1.0 patchlevel 0.

Installation of XTT

Recent XTT is xtt-1.1 patchlevel 00 for XFree-3.3.3. I'll update following installation note soon.

Here is an installation note for xtt-1.0 patchlevel 00. I compiled and installed only xfs like following. If you need X server supporting TrueType, you have to do after all of following operations.

  1. $ tar xfpz x332src-1.tgz
  2. $ tar xfpz x332src-2.tgz
  3. $ tar xfpz x332src-3.tgz
  4. $ cd xc
  5. $ tar xfpz xtt-1.0.tar.gz
  6. $ cd xtt-1.0
    Change directory to fix documents.
  7. $ zcat xttdoc10-to-pl00.diff.gz | patch -p0
    Fix documents by using a patch file.
  8. $ cd ..
  9. $ patch -p1 < xtt-1.0/xtt-1.0.diff
  10. $ zcat xtt10-to-pl00.diff.gz | patch -p1
  11. $ find . -name '*.rej' -print
  12. $ find . -name '*.orig' -exec rm -f '{}' \;
  13. Edit your config/cf/site.def. Add following lines between "#ifdef BeforeVendorCF" and "#endif /* BeforeVendorCF */".
    #define HasFreeType            YES
    #define BuildWithFreeType      YES
    #define HasBlindFaithInUnicode YES
    
  14. $ touch config/cf/host.def
  15. $ make Makefile.boot
  16. $ make Makefiles
  17. $ make includes
  18. $ cd lib/fonts
  19. $ make; make install
  20. $ cd ../..
  21. $ cd programs/xfs
  22. $ make; make intall

Again, the new libfont.so rasterize each character on-the-fly. To use this advantage, using "deferglyphs" option for both a xfs program and a X server are needed. Please check manuals to know exact option and arguments.

Configuration of XTT

TrueType fonts must be registered in a X system. First of all, we have to create a fonts.dir file for those fonts.

  1. $ mkdir /usr/local/share/fonts/truetype
  2. $ cd /usr/local/share/fonts/truetype
  3. $ cp /cdrom/truetype/* .
    Copy TrueType fonts. ".ttf" and ".ttc" files can be used.
  4. $ vi fonts.dir
    Create your fonts.dir with same format of traditional fonts.dir. Here is my example for Microsoft's free True Type Fonts. You can also use my mkttfdir to create fonts.dir file automatically.

Second, we have to register the directory containing fonts.dir to the X system. You can use TrueType fonts from X server directly only If you are using a XTT server by doing like following.

  1. $ xset +fp /usr/local/share/fonts/truetype
    Register a directory to the X system.

Otherwise, we have to register the directory containing fonts.dir to the xfs program, and then register the xfs to the X system like follwoing.

  1. $ vi /usr/X11R6/lib/X11/fs/config
    Add "/usr/local/share/fonts/truetype/" as one of catalogue.
  2. $ xfs
  3. $ xset +fp tcp/localhost:7100
    Register the xfs to the X system.

FreeType library for Perl

This is a package of libraries to use the FreeType library from the perl language. It contains FreeType.xs and FreeTypeWrapper.pm, so you don't need install each of them. It also contains ftinfo.pl and mkttfdir.pl, so you can install all of them by typing "make install". It contains following pieces.

Download

Installation

  1. $ tar xfpz perlftlib-1.2.tar.gz
  2. $ cd perlftlib-1.2
  3. $ make
    This required freetype-1.2 or later.
  4. $ make install

If you're using NetBSD, you may have to do following steps.

  1. Make perl5 in ordinary way.
  2. $ cd perl5.004_04
  3. $ echo - -lttf >> ext.libs
  4. $ make; make install

FREETYPE

I had made few little programs, ftinfo and mkttfdir, before I made perlftlib. Now, these are obsoleted because perlftlib contains all of them. So, please refer FreeType library for Perl to get them.

What is TrueType Font?

References


Jam's welcome page -- Jam@pobox.com -- last modified December 18 2000 -- 93844