Defines bitmaps for a raster font.
void defrasterfont (Int32 index, Int16 height, Int16 numchars, Fontchar chars [ ], Int16 numraster, Int16 raster [ ])
SUBROUTINE DEFRAS(index, height, numchars, chars, numraster, raster)
INTEGER *4 index, height, numchars, numraster
INTEGER*2 raster(numraster), chars(4*numchars)
Note: For FORTRAN users, this subroutine accepts long integer parameters (INTEGER*4) when invoked from a FORTRAN program, although it accepts short integers when invoked from a C program. The C and FORTRAN syntax shown here reflect this difference.
The defrasterfont subroutine defines a raster font.
To replace a raster font, specify the index of the previous font as the index for the new font. To delete a raster font, define a font with no characters. Patterns, linestyles, cursors, and fonts are available to all windows when using multiple windows. The assumed code set table encoding is locale dependent. In most locales, this is an ISO8859 encoding.
- This subroutine cannot be used to add to a display list.
- The hardest part of creating a new raster font is generating a bitmap for each character. You may want to write a graphically oriented tool for creating the bitmaps expected by the raster parameter.
|index||Specifies a constant to use as the identifier for this raster font. This constant is used as an index into a font table. The default font, 0, is a fixed-pitch font with a height of 16 and width of 9. Font 0 cannot be redefined.|
|height||Specifies the maximum height (in pixels) for a character.|
|numchars||Specifies the number of characters in this font.|
|chars|| Specifies an array of character description structures of type Fontchar. The Fontchar structure is defined in the /usr/include/gl/gl.h file as:
|numraster||Specifies the length of the raster parameter array.|
|raster||Specifies a one-dimensional array that contains all the bitmaps for the characters in the font. Each element of the array is a 16-bit integer and the elements are ordered left to right, bottom to top. When interpreting each element, the bits are left justified within the character's bounding box.|
Maximum row width for a single bitmap is not limited to the capacity of a single 16-bit integer array element. The rows of a bitmap may span more than one array element. However, each new row in the character bitmap must start with its own array element. Likewise, each new character bitmap must start with its own array element. The system reads the row width and starting location for a character bitmap from the structures records in the chars array.
The example C language programs curved.c and font3.c use the defrasterfont subroutine to define a new raster font.
This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.
This subroutine is not available for National Language Support.
|/usr/include/gl/gl.h||Contains C language constant and variable type definitions for GL.|
|/usr/include/gl/fgl.h||Contains FORTRAN constant and variable type definitions for GL.|
Drawing a string of raster characters on the screen with the charstr subroutine.
Updating the current character position with the cmov subroutine.
Selecting a raster font with the font subroutine.
Returning the current character position with the getcpos subroutine.
Returning the baseline extent of the longest character descender with the getdescender subroutine.
Returning the current raster font number with the getfont subroutine.
Returning the maximum character height in the current raster font with the getheight subroutine.
Using an AIXwindows font to define a raster font with the loadXfont subroutine.
Returning the width of the specified text string with the strwidth subroutine.
National Language Support Overview in AIX General Programming Concepts: Writing and Debugging Programs.
Creating Text Characters.