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.
- $ tar xfpz
x332src-1.tgz
- $ tar xfpz
x332src-2.tgz
- $ tar xfpz
x332src-3.tgz
- $ cd xc
- $ tar xfpz
xtt-1.0.tar.gz
- $ cd xtt-1.0
- Change directory to fix documents.
- $ zcat
xttdoc10-to-pl00.diff.gz | patch -p0
- Fix documents by using a patch file.
- $ cd ..
- $ patch -p1 < xtt-1.0/xtt-1.0.diff
- $ zcat
xtt10-to-pl00.diff.gz | patch -p1
- $ find . -name '*.rej' -print
- $ find . -name '*.orig' -exec rm -f '{}' \;
- Edit your config/cf/site.def.
Add following lines between "#ifdef BeforeVendorCF" and
"#endif /* BeforeVendorCF */".
#define HasFreeType YES
#define BuildWithFreeType YES
#define HasBlindFaithInUnicode YES
- $ touch config/cf/host.def
- $ make Makefile.boot
- $ make Makefiles
- $ make includes
- $ cd lib/fonts
- $ make; make install
- $ cd ../..
- $ cd programs/xfs
- $ 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.
- $ mkdir /usr/local/share/fonts/truetype
- $ cd /usr/local/share/fonts/truetype
- $ cp /cdrom/truetype/* .
- Copy TrueType fonts. ".ttf" and ".ttc" files can be
used.
- $ 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.
- $ 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.
- $ vi /usr/X11R6/lib/X11/fs/config
- Add "/usr/local/share/fonts/truetype/" as
one of catalogue.
- $ xfs
- $ xset +fp tcp/localhost:7100
- Register the xfs to the X system.
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.
- FreeType.xs
- This is a simple caller of the FreeType library. It
has same API as the FreeType library, so please read
a manual of that to understand how to use this.
- FreeTypeWrapper.pm
- This is a simple wrapper of FreeType.xs to use the
FreeType library from perl with easy, perl-like API.
- ftinfo.pl
- This is a dumper of a lot of information in each
TrueType fonts. This convert them as human readable
strings.
- mkttfdir.pl
- This is a maker of fonts.dir by parsing TTF and TTC
fils. It has special handler for DynaLab fonts, so it
make good fonts.dir automatically. And it detects what
language's fonts are contained in it by looking at
code_page_range field in os2 table, so it makes right
entries.
- Problems:
- If the font has japanese, a font entry is created as
-c- (fixed bbox). Otherwise a font entry is created
as -p- (propotional bbox). There is no choice.
- It
won't create -iso8859-1 entries if the code_page_range
field of its font is null. In such case, please use -e
option.
Download
-
perlftlib-1.2.tar.gz
- ftinfo got better display of achVendID and panose in
OS2 information.
- perlftlib-1.1.tar.gz
- Support freetype-1.2.
- perlftlib-1.0.tar.gz
Installation
- $ tar xfpz
perlftlib-1.2.tar.gz
- $ cd perlftlib-1.2
- $ make
- This required freetype-1.2 or later.
- $ make install
If you're using NetBSD, you may have to do following steps.
- Make perl5 in ordinary way.
- $ cd perl5.004_04
- $ echo - -lttf >> ext.libs
- $ make; make install
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 font file?
- There are kinds of extentions. I made following list.
- .otf
- It contains only CFF data (no TrueType outlines)
- .ttf
- It contains both of them. So it can be used from
OLDER version of Windows in which a CFF rasterizer may not
be installed.
- .ttc
- It contains multiple Open Type fonts. The CFF
rasterizer does not currently support TTC files.
- To know more, read
TrueType Typography.
- What is the Open Type font file?
- Please read
The OpenType Font File.
- What is the structure of fonts?
- TTC file has some fonts called faces. The number of faces
are declared in the TTC file. Each font has 'cmap',
'name' and 'OS/2' separately.
References
- Pages about X-TrueType Server
- Pages about FreeType.
- Pages about fonts
- Others
- TrueType Fonts
-
DynaLab Fonts
- DynaLab sells their Japanese TrueType fonts. We can buy them
and use it on one machine.
-
Ricoh Fonts
- Ricoh sells their Japanese TrueType fonts. We can buy them
and use it on one machine.
- Free TrueType Fonts
Jam's welcome page --
Jam@pobox.com --
last modified
December 18 2000 --
93844