GETFONTINFO

Graphics Function: Gets the current font characteristics.

Module: USE DFLIB

Syntax

result = GETFONTINFO (font)

font
(Output) Derived type FONTINFO. Set of characteristics of the current font. The FONTINFO derived type is defined in DFLIB.F90 (in the \DF98\INCLUDE subdirectory) as follows:
TYPE FONTINFO
  INTEGER(4) type        ! 1 = truetype, 0 = bit map
  INTEGER(4) ascent      ! Pixel distance from top to
                         !   baseline
  INTEGER(4) pixwidth    ! Character width in pixels,
                         !   0=proportional
  INTEGER(4) pixheight   ! Character height in pixels
  INTEGER(4) avgwidth    ! Average character width in
                         !   pixels
  CHARACTER(32)xfacename ! Font name
  LOGICAL(1) italic      ! .TRUE. if current font
                         !   formatted italic
  LOGICAL(1) emphasized  ! .TRUE. if current font
                         !   formatted bold
  LOGICAL(1) underline   ! .TRUE. if current font
                         !   formatted underlined
END TYPE FONTINFO

Results:

The result is of type INTEGER(2). The result is zero if successful; otherwise, -1.

You must initialize fonts with INITIALIZEFONTS before calling any font-related function, including GETFONTINFO.

Compatibility

STANDARD GRAPHICS QUICKWIN GRAPHICS LIB

See Also: GETGTEXTEXTENT, GETGTEXTROTATION, GRSTATUS, OUTGTEXT, INITIALIZEFONTS, SETFONT, Using Fonts from the Graphics Library

Example

! Build as QuickWin or Standard Graphics
USE DFLIB
TYPE (FONTINFO) info
INTEGER(2)      numfonts, return, line_spacing
numfonts = INITIALIZEFONTS ( )
return = GETFONTINFO(info)
line_spacing = info%pixheight + 2
END