Home

Text Output

The following procedures are used for writing text into a window and configuring the style to use while drawing said text.

gettextsettings

C void gettextsettings (texttypeinfo)
Fortran subroutine gettextsettings (texttypeinfo)

Description

Retrieves the settings for writing text to the current window

Parameters

Parameter C Type Fortran Type Description
texttypeinfo textsettingstype * type(textsettingstype) A pointer to a variable to receive the current settings or the variable to be populated with the current settings

outtext

C void outtext (text)
Fortran subroutine outtext (text)

Description

Writes the specified string to the current window at the current text position. This routine will respect new line characters within the string. After this call, the text position will be the text line below the just-drawn text, effectively adding a line feed after output.

Parameters

Parameter C Type Fortran Type Description
text char * character(*) The text to output

outtextxy

C void outtextxy (x, y, text)
Fortran subroutine outtextxy (x, y, text)

Description

Writes the specified string to the current window at the specified graphics coordinates. This routine will respect new line characters within the string. After this call, the text position will be the text line below the just-drawn text, effectively adding a line feed after output. This routine is identical to calling settextxy followed by outtext with the appropriate parameters.

Parameters

Parameter C Type Fortran Type Description
x int integer The horizontal coordinate to start drawing text, representing the left-most text position
y int integer The vertical coordinate to start drawing text, representing the top-most text position
text char * character(*) The text to output

setmatchthemetextstyle

C void setmatchthemetextstyle ( )
Fortran subroutine setmatchthemetextstyle ( )

Description

Sets the font face and character height to match the default Windows theme settings.

settextxy

C void settextxy (x, y)
Fortran subroutine settextxy (x, y)

Description

Sets the graphical position of the top-left corner where text will be output on the next call to outtext.

Parameters

Parameter C Type Fortran Type Description
x int integer The horizontal coordinate to start drawing text, representing the left-most text position
y int integer The vertical coordinate to start drawing text, representing the top-most text position

settextjustify

C void settextjustify (horiz, vert)
Fortran subroutine settextjustify (horiz, vert)

Description

Sets the justification of text both horizontally and vertically. The allowed values are:

ID Description
LEFT_TEXT Left-justify text
CENTER_TEXT Center text (horizontally or vertically)
RIGHT_TEXT Right-justify text
BOTTOM_TEXT Bottom-justify text
TOP_TEXT Top-justify text

Parameters

Parameter C Type Fortran Type Description
horiz int integer The horizontal text justification (LEFT_TEXT, CENTER_TEXT, RIGHT_TEXT)
vert int integer The horizontal text justification (BOTTOM_TEXT, CENTER_TEXT, TOP_TEXT)

settextstyle

C void settextstyle (font, direction, charsize)
Fortran subroutine settextstyle (font, direction, charsize)

Description

Sets the style of text to be used. The value of font must be one of the following:

ID Description
DEFAULT_FONT The default Windows GUI font
SANS_SERIF_FONT An Arial- or Helvetica-style font
SERIF_FONT A font similar to Times New Roman
CURSIVE_FONT A font appearing to be hand-written
BOLD_SANS_SERIF_FONT Same as SANS_SERIF_FONT, but in bold
BOLD_SERIF_FONT Same as SERIF_FONT, but in bold
MONOSPACE_FONT A monospace font
WINDOWS_FONT The font used for any static control text

The value of direction may be:

ID Description
HORIZ_DIR Text is horizontally output
VERT_DIR Text is vertically output

Parameters

Parameter C Type Fortran Type Description
font int integer The font family to use
direction int integer The direction the text is generated
charsize int integer The size of characters in pixels

textheight

C int textheight (textstring)
Fortran function textheight (textstring)

Description

Calculates and returns the height in pixels of a given string based on the current text style settings.

Parameters

Parameter C Type Fortran Type Description
textstring char * character(*) The text string for which to calculate the height

Return Value

C int
Fortran integer

The height of the text

textwidth

C int textwidth (textstring)
Fortran function textwidth (textstring)

Description

Calculates and returns the width in pixels of a given string based on the current text style settings.

Parameters

Parameter C Type Fortran Type Description
textstring char * character(*) The text string for which to calculate the width

Return Value

C int
Fortran integer

The width of the text