X-TrueType 1.x Resources
We'll stop the development of X-TT 1.x near the future.
The New FreeType(libfreetype-xtt2) Resources
We have been working for enhancements of the FreeType backend
to support the X-TT functionalities for CJKV.
The XFree86 Project
has accepted our results;
not only the "freetype" module but also the xfs and Xnest can handle
the perfect TTCap options
Here are some explanation on the new FreeType(libfreetype-xtt2)
backend in the XFree86-4.4.0 release.
The power of the new FreeType backend
When loading a proportional fonts which contain a huge number of glyphs,
the old FreeType
delayed glyph rasterisation until the time at which the glyph was first used.
But the new FreeType(libfreetype-xtt2) has the improved `very lazy' metric
calculation method to speed up the process when loading TrueType or
The following is the result of testing the performance of the new FreeType backend
using the following simple code:
/* bench.c */
int main( int argc, char *argv )
XLoadQueryFont( dis, argv );
The Cyberbit unicode font was used, and this is the test command:
% time ./bench "-bitstream-cyberbit-medium-r-normal--0-0-0-0-p-0-iso10646-1"
This is the result:
We find that the new FreeType's `very lazy' method is super-fast.
This is the default method for FreeType when it loads multi-byte fonts.
So, even with a unicode font with tens of thousands of glyphs,
there will be no worrisome delays as long as the new
FreeType backend is utilized.
Reference for TTCap Options
Following are the available options:
-- This option specifies the face number for the TrueType/OpenType
Collection (*.ttc or *.otc) file.
(fn : Face Number)
-- This option specifies how the glyph is slanted.
(ai : Automatic Italic)
-- This option specifies how the font metrics are calculated.
Font metrics are calculated regarding SPACING field of XLFD
as specifying VALUE. If this option does not exist, the
SPACING field of XLFD is honored.
(fs : Force Spacing)
-- This option specifies the magnification ratio to the width of
bounding box and spacing adjustment in pixel units.
Using additional integer parameters,
you can set the adjustment value of width, left side bearing and
right side bearing to each integer parameter in pixel units.
It is useful in adjusting font spacing which can be too
narrow or too wide when small fonts are used.
If this option does not exist, the ratio is set to be 1.
(bw : Bounding box Width)
-- Set this option y or m if you want double-stroke boldfacing.
When font size is small, conventional double striking
may render the fonts unreadable.
Using "ds=m", the process leaves the edge of bitmaps
as is, which improves the font readability.
(We call this processing "mkbold method").
To automatically adjust the bounding box,
specify "ds=yb" or "ds=mb".
This will increase the width of the bounding box by 1 pixel.
The last option INTEGER is the size
of the application limit of "mkbold method" in pixel units.
the process is applied only when the font size is smaller than
the specified size.
Screen shot :
(ds : Double Strike)
-- Setting this option to y, the font metrics are calculated by
using the `very lazy' method which is derived from the font
header(htmx) in the case of Proportional or Monospaced TrueType/OpenType font.
This is efficient when using proportional fonts
which contain a huge number of glyphs, e.g., MS P Gothic Japanese
Font. (Conversely, the fonts are inefficiently utilized with
the strict metrics calculation.)
On one hand, the response time improves since the metrics are
calculated quickly; on the other hand, the metrics information
is not exact. (But, such inexactness is probably insignificant in
The maximum error of bitmap position using the `very lazy' method is 1 pixel,
and is the same as that of a character-cell spacing.
When the X-TT backend is used with the "vl=y" option, a chipped bitmap is
displayed with certain fonts.
However, the new FreeType backend has minimal problem with this,
since it uses `italicAngle' in the TrueType/OpenType post table,
and does automatic correction of bitmap positions.
If this option is not set, the metrics of single-byte fonts
are calculated by using the strict method which is derived from the
outline data, while the very lazy method is
automatically enabled when loading multi-byte fonts.
(vl : Very Lazy metrics calculation method)
-- If you set this option to n, the FreeType renderer doesn't use
the hint information in the font file.
(hi : HInting)
-- Restrict code range of font. Each of "Range" is specified
as the one of following:
The fragmented ranges can be specified by comma separation;
however, the FreeType backend will treat it not as a fragmented range
but a single consecutive range that covers all. Each
"number" can be specified either in octal, decimal, or hexadecimal format. Octal numbers are distinguished from decimal
by the prefix "0", and hexadecimal is similarly distinguished by
the prefix "0x".
This option is especially useful when only portion of a Unicode font
is necessary. XLFD range specification has a similar effect, but
this option is different in a sense that the client displays the font
as if the font only has glyphs within the specified range.
(cr : Code Range)
-- 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.
The Embedded bitmaps are also used when Auto Italic
("ai" option) is set when "eb=y".
If you don't want to use the embedded bitmaps when Auto Italic is set,
set "eb=n" to TTCap.
If "eb" is not set, embedded bitmaps are used when
Auto Italic is not set.
Screen shot :
(eb: Embedded Bitmaps)
-- Specify code range for forcing the FreeType backend to use constant metrics.
The "Range" is specified as the one of following:
Each "number" can be specified
in octal, decimal, or hexadecimal format. Octal is distinguished from decimal by
the prefix "0", and hexadecimal is similarily distinguished by
the prefix "0x".
Reverse number specificaton, e.g. "fc=0xaa00-0xa0ff", means
specifying the ranges 0x0000-0xa0ff and 0xaa00-0xffff.
This option is available only for proportional spacing in FreeType backend,
and calculations of metrics on the specified code range
are not performed because of handling them as -c- spacing.
This option is useful to achieve *extremely* fast loading of
GB18030, unicode, or big Japanese fonts with "-p-" in the XLFD.
(fc : Force Constant spacing code range).
-- Set metrics in the range specified by "fc" Option.
If the "fm" option is not set,
the metrics in the range of "fc" specification
become the metrics of header information.
But this is not always convenient;
instead, you can specify the metrics by "Code" or "magnification ratio".
If "Code" (e.g. "fm=0x5a00") is set,
when loading font, the FreeType backend calculates the metrics of
"Code" first and copy the metrics to all glyphs in the "fc"
On the other hand, when
"magnification ratio" (e.g. "fm=0.5,0,0.5")
is set, all glyphs in the "fc" obey the setting.
Each number after "fm=" corresponds to width, left side bearing
and right side bearing, and is the magnification ratio
to the width of bounding box from the header information.
(fm : Force constant spacing Metrics).
Last Modified: 5 Dec. 2003