Next: Copyrights and Credits
Up: Introduction
Previous: Introduction
Contents
Index
t1lib is a library written in the C programming language
allowing a programmer to generate bitmaps from Adobe (TM) Type 1 fonts
quite easily. These bitmaps are returned in a data structure
with type GLYPH. This special
GLYPH-type is also used in the X11 window system to
describe character bitmaps. It contains the bitmap data as well as
some metric information. But t1lib is in itself entirely independent
of the X11-system or any other graphical user interface.
Given that the X11-system is probably the most frequently used
window system in the UNIX-world, and furthermore assuming that most
graphical applications run under window systems, it appears that
t1lib implements functionality already provided by the
graphical user interface,
the X11-system. Thus the question arises: Why not use X11 directly for
rastering characters? Well, the answer is quite simple; the X11 Font
machinery appears to be too static in order to use it for
certain purposes. Moreover X11-calculations and positioning of
characters are based on bitmap
dimensions and are thus subject to error accumulation.
Here is a list of features which are supported in the current release
of t1lib.
- Rasterizing is done as characters get requested. The X11-server,
in contrast,
rasters a font completely at a given size
when it is loaded. Rastering on demand saves time when the
font is loaded the first time and saves memory since often only the
alphabetic letters and a few other characters are needed.
- The encoding mechanism of PostScript is fully supported. The
user may use the fonts' internal or some other encoding.
Additional encoding files can be loaded at runtime and fonts can be
reencoded at runtime. The syntax of encoding files is
straight-forward and simple.
- The library makes use of Adobe Font Metric data in the form of
AFM files. This may seem a disadvantage, but in order
to make decent typesetting possible, some more information than that
contained in Type 1 font files is needed. Besides, Adobe makes
these AFM files freely available on their ftp-server for all
registered Type 1 fonts.
- In case AFM files are missing, t1lib is able to generate
metrics information in charspace accuracy by rastering each
character at 1000 bp.
- In addition to generation of character bitmaps, there is a way
to directly raster strings of any length in a given font.
The space-width may explicitly be corrected by the user. This
may be needed by word processing applications.
- Strings may be rastered
optionally using pairwise kerning information from
the AFM file. Kerning is an important feature of good
quality typesetting.
Kerning information can also be requested by the user without
rasterization.
- Ligature information is made available to the user in an
efficient way. Use of Ligatures is another characteristic of good
typesetting. As to my
knowledge, only TEX and all related macro-packages are able to
handle ligatures in a natural and efficient way.
- Rotation and arbitrary transformation on the fly is supported.
- t1lib supports antialiasing. In this case, a pixel is
represented as a byte, word or double word. Antialiasing is
implemented by subsampling with factor 2 or 4 alternatively.
If you use the X11-interface introduced in t1lib V. 0.3-beta,
even colored antialiasing between any pair of colors is provided in a
completely transparent way.
- In addition to transformation on the fly, two transformation
types--slanting and extending--are possible on the fontlevel
including bitmap caching. Horizontal expansion of fonts is fully supported
and since version 0.3-beta also slanting of fonts is nearly fully
supported. For restrictions and drawbacks of slanting fonts see
on page
.
- Paths, the library searches for the different needed file types
are specified at runtime by means of a
configuration file. They may thus be changed without needing to
recompile the application. For example, the directories of the
X11-system's Type 1 font files may be specified there in order to use
these fonts with the library. A user may have his own configuration file and
as a fallback/default there is a system wide configuration file. This should
be setup when the library is installed.
- Since of version 0.3-beta a special set of functions is provided which
implements a more comfortable X11-interface. This is due to the fact that
X11 is the only standard window system in the UNIX world. However, as before
t1lib may be compiled and used without even having X11 installed.
- Some decorations like underlining are supported by simply setting
a flag for the rastering functions.
- Right To Left typesetting is supported.
- Font subsetting is easily achieved using a high level function. This
makes it easier for application to efficiently export Postscript files.
- Composite character information can be retrieved. Moreover, t1lib transparently handles and realizes composite character definitions from AFM
files.
There are also some problems and features not yet
implemented, but likely to be implemented in the future.
The main problem up to now is:
- The font cache isn't a font cache really. At this time all
bitmaps are saved by always allocating more memory from the
system. No automatic removal of bitmaps no longer needed is
done. However, the user has the possibility of explicitly
removing data, if he thinks it is not needed anymore.
Next: Copyrights and Credits
Up: Introduction
Previous: Introduction
Contents
Index
2004-10-04