lstwid(3G)lstwid(3G)NAMElstwid - returns the width of the specified text string
FORTRAN 77 SPECIFICATION
integer*4 function strwid(type, str, length)
integer*4 type
character*(*) str
integer*4 length
PARAMETERS
type expects one of the following symbolic constants defined in
<gl/fgl.h>:
Each character is represented by
a single unsigned byte.
STRB
Each character is represented by
two, consecutive unsigned bytes.
The first byte is most
significant.
STR2B
Each character is represented by
three, consecutive unsigned
bytes. The first byte is most
significant. The last byte is
least significant.
STR3B
Each character is represented by
four, consecutive unsigned bytes.
The first byte is most
significant. The last byte is
least significant.
STR4B
Each character is represented by
a 16-bit unsigned integer.
STR16
Each character is represented by
a 32-bit unsigned integer.
STR32
str expects the name of the string whose width is to be computed.
The contents of the string should be consistent with respect to
the type parameter.
length expects the number of characters in the string that is to be
measured.
DESCRIPTIONlstwid returns the width of a text string in pixels, using the character
spacing parameters of the current raster font.
Multi-byte types (2B, 3B and 4B) are converted to character values using
the following formulas for character i in unsigned byte-string s:
STR2B: (s[2*i]*256) + s[2*i+1]
STR3B: ((s[3*i]*256) + s[3*i+1])*256 + s[3*i+2]
STR4B: (((s[4*i]*256) + s[4*i+1])*256) + s[4*i+2])*256 + s[4*i+3]
Page 1
lstwid(3G)lstwid(3G)
Undefined characters have zero width.
SEE ALSO
deflfo, getlwi, lchstr, mapw, mapw2
NOTE
This routine is available only in immediate mode.
Page 2