Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 9/08/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

GETFONTINFO

Graphics Function: Returns the current font characteristics. This routine is only available for Windows.

Module

USE IFQWIN

result = GETFONTINFO (font)

font

(Output) Derived type FONTINFO. Set of characteristics of the current font. The FONTINFO derived type is defined in IFQWIN.F90 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(81) filename ! File name including path
  CHARACTER(32) facename ! 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 type is INTEGER(2). The result is zero if successful; otherwise, -1.

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

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