FONTMETRIC()

From Recital Documentation Wiki
Jump to: navigation, search

Purpose

Function to return font attribute information


Syntax

FONTMETRIC(<expN1> [,<expC1>,<expN2> [,<expC2>]])


See Also

AFONT(), GETFONT(), WFONT()


Description

The FONTMETRIC() function returns attribute information about the current or specified font.

Parameters

Parameters Description
<expN1> The attribute about which information is returned. Please see table below for attribute numbers and descriptions.
<expC1> The <expC1> can be used to optionally specify a particular font name.
<expN2> The <expN> is used to specify the font size for the font name in <expC1>.
<expC2> The <expC2> can be used to optionally specify a font style code for the font name in <expC1> and font size in <expN2>.


Attributes

The FONTMETRIC() function is included for language compatibility only and the return values for each attribute are shown in the table below.


Code Attribute Return Value
1 Character height (pixels) 16
2 Character ascent (pixels) 13
3 Character descent (pixels) 3
4 Leading (pixels) 3
5 Extra leading (pixels) 0
6 Average character width (pixels) 7
7 Maximum character width (pixels) 14
8 Font weight 400
9 Italic 0
10 Underlined 0
11 Strikeout 0
12 First character 32
13 Last character 255
14 Default character 129
15 Word break character 32
16 Pitch and family 33
17 Character set 0
18 Overhang 0
19 Horizontal aspect 120
20 Vertical aspect 120


Font Styles

Code Style
B Bold
I Italic
N Normal
O Outline
Q Opaque
S Shadow
- Strikeout
T Transparent
U Underline


Example

? fontmetric(20,"Monospaced",12,"B")
       120


Products

Recital Server, Recital