Next: Initialization of the X11-Interface
Up: The X11-Interface
Previous: The X11-Interface
Contents
Index
Although it initially was an explicit goal to make the library independent of
X11, there are some strong arguments voting for a subset of functions adapted
to X11 features. Here are some of them.
- X11 can be considered a standard under UNIX and graphical applications
under UNIX would to a high probability rely on X11. For this reason it would
not degrade portability much when using X11 features.
- The standard rastering functions of t1lib strictly use the principle
of generating bitmaps. The rastering functions return bitmaps of a
specific size with reference point at upper left corner and additional
geometric information to tell the user how to position the bitmap correctly
with respect to the current point. A more natural approach would be to have
functions that draw on some existent area at a position and
orientation to be specified with the logical origin of the text taken into
account.
- The standard functions do not deal with color at all. This is especially
complicated in the case of antialiased fonts. If some application wanted to
use an existent (already cached) font, all characters would have to be
removed from memory and recreated using the new color values.
- In case of antialiasing the user has to make a decision on the depth of
the bitmaps. But what if an X-application uses drawables of different depths?
Such configurations could raise the programming effort up infinity (well,
alomst).
- The standard functions cache their bitmaps locally, i.e., on the machine
where the X11-client runs. Every characters bitmap has thus to be
transferred to the X11 server again and again. This might cause an
performance degradation, especially if the client runs on a remote machine
with a slow or heavy-loaded network connection.
Taken these arguments into account I decided to create an additional
``special'' set of functions that allow uncomplicated usage under the X11
window system, similar to the Xlib
-function X11DrawText()
.
The approach used in V. 0.3-beta has been a quite elegant solution
to the problems considered above. Unfortunately, it has been too slow to be
usable in practice. Furthermore, caching in the X11-server produced some
overhead and difficulties. According to my experiences server caching would
only be advantageous for very large characters such as 500 bp and more. As a
consequence, the X11 interface is redesigned and reduced to a simple
wrapper which deals with all but the last of the above items, from
t1lib V. 0.4-beta up.
Next: Initialization of the X11-Interface
Up: The X11-Interface
Previous: The X11-Interface
Contents
Index
2004-10-04