What t1lib is

t1lib is an open source library developed by Rainer Menzner and is distributed under the GNU General Public Library License. t1lib is written in the C programming language allowing a programmer to generate/rasterize bitmaps from Adobe (TM) Type 1 fonts quite easily. t1lib is based on the code of the X11 rasterizer which was donated by IBM to the X11 project.

The bitmaps created by t1lib 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.

Uses of t1lib

t1lib is useful for adding text to images using the gd library. When t1lib and gd are combined with an Apache web server that is powered by the web scripting language php, web developers can easily add captions, graph legends, logos, copyright notices, etc to images. See the php documentation for an example snippet of php code using t1lib to lay some text on an image: php function imagepstext (the example code is in the user notes dated 22-May-2001 at the very bottom of the page)

Where to get t1lib

t1lib is available by ftp at: ftp://sunsite.unc.edu/pub/Linux/libs/graphics/

Alternatives to using t1lib

  • freetype2 is a free font engine which provides similar functions using True Type Fonts. As with t1lib, freetype2 is used by the gd library to create and modify the images. The php function reference for imagefttext function shows several examples of using free type2 with php.
  • ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. For use with php, it requires PHP version 5.1.3 or higher. Mikko's blog has some sample code for using imagemagick with php.


Custom Search