String Display

After you load a font, use fgf_print() or fgf_printc() to display characters from that font. The difference between these two functions is that fgf_printc() does not display characters or portions of characters outside the clipping region defined by fg_setclip(), while fgf_print() ignores the clipping limits and is thus faster. Both fgf_print() and fgf_printc() display a string from the current font in the active virtual buffer (Fastgraph/Fonts always directs output to a virtual buffer, regardless of the fg_fontdc() setting). The first parameter passed to each function is the character string to display, while the second parameter is the number of characters to display from that string. Both functions leave the graphics cursor positioned at the bottom right corner of the last character displayed.

By default, fgf_print() display strings so their lower left corner is at the graphics cursor position. The fgf_justify() function lets you change this default justification. Its two parameters, xjust and yjust, control the string positioning about the current graphics position, as shown here.

value of xjust

value of yjust

horizontal justification

vertical justification

-1

-1

left

lower

-1

0

left

center

-1

1

left

upper

0

-1

center

lower

0

0

center

center

0

1

center

upper

1

-1

right

lower

1

0

right

center

1

1

right

upper

In the context of vertical justification, lower justification means the bottom of each character (excluding descenders such as "j" and "y") will be at the current graphics y position. Upper justification means the top of the tallest character displayed will be at the graphics y position, while center justification means the center of the tallest character will be at the graphics y position. Notice the default justification settings are xjust = -1 and yjust = -1.

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.