Jump to content

Ft2lib

From EDM2

Using Innotek FT2LIB for your own applications

This article is intended to explain how to use the ft2lib ( antialiasing support by innotek InnoTek Font Engine for OS/2 ) in your own applications. It will not discuss in detail how this library works.

Modes of operation

There are 2 ways ftlib can be used from within your application:

  • Intercept all Gpi* API calls, and replace them with ft2lib variants.
  • Use the ft2lib Gpi* API variants within your application directly.

The first has some ease of use advantages over the second. If you replace all Gpi* calls you don't have to actually recode your program to use ft2lib, but you simply tell ft2lib to intercept all Gpi* calls. The second advantage of this approach is that on systems without ft2lib installed your application works as well, just without antialiasing.

Using the second method of course gives you the advantage that you will have full control over where ft2lib is used and where not. This will allow you to use ft2lib within the WPS without enabling ft2lib for the whole WPS.

Intercept all Gpi* API calls

On netlabs you will find a little ft2lib enablement library: ft2lib enablement package. This pacakge is needed for this sample.I will not outline a complete PM program, since I figure that you know how to do that. this will just contain code snipets on how to do it:

#include <ft2lib.h> //Include the ft2lib functions

Now some where in your 'main' line you have to add the following line:

Ft2EnableFontEngine(TRUE);

make sure upon linking to add ft2lib.lib to your make statement.

more to come soon !