Font object

Build 1501 on 14/Nov/2017  This topic last edited on: 29/Jul/2015, at 09:30

The Font object provides control over font data., e.g. capital height, descender depth etc.

This information was (partially) available inside the markup language via the variables CapH, DesD etc.. and now also from scripting, where it can be handy to compute dimensions based on font characteristics.

The Font object is available in Ted and in Fred, during page editing and text editing.

Properties

Basics

Code PropertyReturns the font code number.
Name PropertyReturns the font name.
Description PropertyReturns the font's description.
Family PropertyReturns the font family name.
PFB PropertyReturns the font's PFB file name.
LayoutId PropertyReturns the layout id of the given font.

Style

IsBold PropertyReturns the font's bold status.
IsItalic PropertyReturns the font's italic status.

Metrics - fixed spaces

EMWidth PropertyReturns the font's EM width.
ENWidth PropertyReturns the font's EN width.
ThinWidth PropertyReturns the font's Thin width.
Slant Property Returns the font's slant.

Metrics - heights, depths and positions

CapHeight PropertyReturns the font's capital height.
XHeight PropertyReturns the font's X height.
DesDepth PropertyReturns the font's descenders depth.
AxisHeight PropertyReturns the font's axis height.

Metrics - small caps

SmallCapsWidth PropertyReturns the width of the small capitals in the given font.
SmallCapsHeight PropertyReturns the height of the small capitals in the given font.

Metrics - kerning

NKernPairs PropertyReturns the number of kerning pairs in the current font.
KernPair PropertyReturns the selected kern pair.
KernValue PropertyReturns the selected kern value.

Metrics - character data

CharWidth PropertyReturns the width for the specified character in the current font.
CharHeight PropertyReturns the height for the specified character in the current font.
CharDepth PropertyReturns the depth for the specified character in the current font.

To create font object

Dim objFont = Ted.GetFont

Dim objFont = Fred.GetFont

See also

Overview

Example