Example: Color Selection, Underlining, and Kerning

Example FGFW2 illustrates the use of color selection, underlining, and kerning with fgf_print(). It displays a string in two colors (19 and 20) in the upper left corner of the active virtual buffer. The color change resulting from the first fgf_print() call carries over to the second call (that is, the string "still color 20" also appears in color 20, not color 19). Following this, the example displays the string "one word is underlined", with the word "word" underlined and characters one additional pixel apart.

Notice how we use each language's notation of including non-printable characters within strings to specify the option prefix codes and color selection byte. In the C/C++ version, for example, the option prefix code appears as \x07F, and the following byte to select color 20 appears as \x014. The string length passed to fgf_print() or fgf_printc() must include these additional bytes.

C/C++ version

C++Builder version

Delphi version

Visual Basic version

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.