[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3.4.9 Graphics-Mode Text Attributes (%A)

Graphics-Mode Text Attributes sets all of the attributes--cursor, font, size, color, and justification--to control the display of text in the graphics modes.

The Graphics-Mode Text Display command is then used to display text with the specified attributes.

This command also allows the selection of a font. Currently, Cogsys only loads three fonts: the default VGA ROM font, and two Windows fonts: Arial 20 point and BrHand 24 point. This limitation will very likely be removed in future versions of Cogsys (4.2 New Directions).

The font table is initialized like this:

0
`default.rom'
1
`font01.gem'
2
`font02.gem'
n
`fontnn.gem'
20
`font20.gem'

The default font path is is stored in the Cogsys constant DEFAULT_FONT_PATH, and is currently set to `'. It can be controlled by the %M command when the video mode is set. See section Mode (%M).

The default values for the attributes are given below:

cursor position
0,0 (top left of screen)
font
font 0, default VGA ROM font
scale
1
color
color palette 15 (white)
justification
0 (left)

Name:
Graphics-Mode Text Attributes
Class:
Display Text
Code:
%A
Syntax:
%A[ [Xx | Yy | Jjust | Ffont | Sscale | Ccolor] [, ...] ]
x is an integer from 0 to one less than width of the current video mode
y is an integer from 0 to one less than height of the current video mode
just represents text justification as 0 (left), 1 (right), or 2 (center)
font is an integer from 0 to 24 which represents which font to use from the font table
scale is an integer form 0 to 32, which represents how much the font should be scaled
color is an index to the color palette for this video mode (from 0 to one less than maximum number of colors) Note that the syntax definition allows the specification of as many attributes as you like in any order. If the same attribute is specified more than once, the last occurrence is used.
System:
Sets the graphics attributes specified. The cursor is moved to position x,y. Depending on the value of just, text will be aligned to either the right, left, or center of x,y. The text will be displayed in color color. The text will be scaled by the multiple scale; usually scaling more than 2 or 3 will lead to large, blocky results. The font is selected by an index to the font table, as described above.

Once set, an attribute is not changed until another %A command. Attributes retain their values through mode resets.

Requires:
Cogsys must be in a graphics mode.

History:
Originally, the work of %A was part of #G. Very old teslists written for Cogsys 2.7 must be re-written to use %A.

Cogsys 2.8 to 2.9 had a `W' option to %A which allowed the specification of a width string. The width string was an arbitrary string of characters whose length was taken to be the maximum width within which all subsequent text would be centered. This weird option has been replaced with the justification attribute.

Before Cogsys 3, a $F command was used to load text mode fonts. Text mode fonts never worked well and their support was removed from Cogsys 3. The other commands that used text mode fonts ($D, $U and $E) have been removed as well.

In addition to text mode fonts, older versions of Cogsys used two completely different graphics mode fonts: the standard set of BGI fonts for VGA modes, and translated GEM fonts for 256 color modes. Even though Cogsys 2.8 through 2.9 had disabled the use of BGI fonts completely, the fonts were still distributed with every installation of Cogsys.

Cogsys 3 no longer depends on BGI, and instead uses the BGI Toolkit from Ryle Design and uses the GEM fonts exclusively. Any reference to BGI fonts ("Sans Serif", "Triplex", etc) or `*.BGI' font files is obsolete.

Test Files:
`GATR_T01.IN'
tests basic operation

Examples:

input
%M2%A[X320,Y240,J2,S1,F1,C10]#G[Hi, there!]
cogsys
Displays the string `Hi, there!' in Arial 20 at the center of the screen in green.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Usman Muzaffar on June, 28 2000 using texi2html