graphic function ttg_font()

T&T graphic function ttg_font

The font handling in Tool&Task Graphics is a bit complex and has changed markedly during development. Good news is the availability of a form to enter font information and to copy it into your clipboard to be pasted into source code.

A font is defined by its index and 6 parameters. Tool&Task keeps data of 6 fonts for each printer. Including the index of the font ('A'-'F'), the function ttg_font will take up to 7 parameters. First parameter is the index just mentioned. The next three parameters are the name of the font, the size, and a string specifying the attributes 'Bold', 'Italic, 'Underline' or 'Normal' ("" = not bold, not italic and not underline). "BIU" would print all characters underlined in bold italic. Name, size and attributes can be selected by a system dialog which is invoked by the FoxdPro command getfont(). Since you can define the 6 fonts 'A' through 'F' for each printer, the corresponding form m_plpage has buttons to call getfont(). With this dialog, font sizes in the range of 5 to 40 point are offered. This is not enough for printers with high resolution. Check the form for further information

TTG uses the full resolution of each printer to combine images and text, the size of the font has to match the resolution of the printer. When you open the page definition for a new printer, some standards are set automatically.

The next two parameters define the 'boldness' of characters. 'Fontweight' is the expression. Firstly, the fontweight for normal characters is set. The range for fontweight is 0 to 999. A value of 100 is a good value for normal characters. The second fontweight determines how 'bold' bold characters shall be. A value of 300 is the TTG initial value. Try it and find out, what you like.

Parameter 6 specifies the color of the font as RGB-value.

You might call ttg_font with the font index and the next 4 parameters (=omitting fontweight and color), with 5 parameters (=omitting color) or with all 6 parameters.

Use ttg_fontweight() to only change the fontweight and ttg_fontcolor() to only influence the color.

See tt_printer() to see when the font information is passed to homerg2.dll and do not forget to select one of the 6 fonts using ttg_fontselect()before writing text (font 'A' is default).

Whenever you select one of your printers, the corresponding 6 fonts are set in homerg2.dll.

6 more fonts ('G' through 'L') are available for additional use in your programs. These fonts have to be defined once in each program. homerg2.dll keeps the setting of these fonts.

Wenever you need different fonts for a document, firstly define them all and afterwards skip the fonts by the use of ttg_fontselect() with their index.

Parameters:

1. Font index 'A' through 'F' for 6 fonts
2. Font name
3. Font size [points]
4. Font attributes (BIU = Bold, Italic and Underline)
5: Font weight normal characters
6: Font weight bold characters
7: Font color as RGB value