Please enable JavaScript to view this site.

ESL Documentation

Reference

Define a font.

font {"system"|FONT_NAME}

"system"

Use the Windows or the PM system font in a graphical drawing statement or in the program default font specification. The system font is a proportionally-spaced font and therefore cannot be used in a textual region. The size of the system font is resolution-dependent, but it is not directly proportional to the size of the display.

FONT_NAME

A string value representing a font name, or the identifier for a previously defined font. When specified for a textual region, it must be specified within the textual region definition.

Description

Use this statement to define the default font for your program, the font used for a textual region, or the font used for any drawing statement.

Fonts are either fixed-cell or resolution-dependent. In a fixed-cell font, a text string occupies the same number of pixels, regardless of the resolution of the monitor. In a resolution-dependent font, a text string occupies the same proportion of any display. One font name identifies a family of fonts, and there is one for each display resolution.

ESL supports all fonts supplied with Windows, including TrueType fonts. We recommend that you use these system-supplied fonts whenever possible.

ESL True Type Fonts

As of ESL version 17.10, the old bit mapped fonts have been superseded by True Type fonts, which provide the quality appearance that the User would expect from a Windows font. There 5 font files provided:

EslMono.ttf

EslCaps.ttf

EslMonoBold.ttf

EslMonoBoldOblique.ttf

EslMonoOblique.ttf

As the fonts are True Type, you can set the size as required using the "font is" statement, as with any other Windows font. The advantage of using ESL supplied font is that they are installed with ESL, so there is not the issue of font not being available on a User machine. Note. Unlike Icon resources, a font is not compiled into the Windows Easel Binary file.

ESL Bit-Mapped Fonts

Before ESL 17.10 ESL used to provide its own set of fixed-cell and resolution-dependent fonts. The following table lists the ESL fixed-cell fonts.

Font Name

Total Size

asc37

4 x 9

asc59

7 x 11

asc79

9 x 12

asc510

5 x 10

asc713

7 x 13

asc88

8 x 8

asc814

8 x 14

caps814

8 x 14

asc1115

13 x 18

asc1521

17 x 24

medvt10

8 x 10

medvt12

8 x 12

medvt14

8 x 14

medvt16

8 x 16

medvt20

8 x 20

medvt24

8 x 24

ESL resolution-dependent fonts are available for these displays only:

EGA (640 x 350)

VGA (640 x 480)

8514/A, XGA (1024 x 768)

Note that ESL will use the appropriate font based on the type of display.

The following table lists the ESL resolution-dependent fonts.

Screen Resolution

Font Name

Total Size

640x350

medium

8 x 8

 

large

12 x 14

 

mcaps

8 x 8

 

lcaps

12 x 14

640x480

medium

8 x 12

 

large

12 x 19

 

mcaps

8 x 12

 

lcaps

12 x 19

1024x768

medium

12 x 18

 

large

19 x 30

 

mcaps

12 x 18

 

lcaps

19 x 30

If you are migrating from an earlier version of ESL, we recommend using the newer True Type fonts, although this does require minor source code changes. Using the True Type fonts will give the ESL application a smoother appearance. If you wish to continue using the older fonts, then you must copy the file "ESLFONTS.fon" from an existing installation of ESL, and change the following parameters in the ESL Configuration file:

FONTDLL=eslfonts.fon

DEFAULTFONT=medium

EslCaps, mcaps and lcaps are uppercase fonts, which can be used to display text in uppercase without the need to alter the source string variable.

Fixed-Width and Proportional Fonts

Fonts are also either fixed-width or proportional. In a fixed-width font, every character is the same width. In a proportional font, a thin letter like "i" takes up fewer pixels than a wider letter like "m."

You can use only fixed-width fonts in textual regions; you cannot use proportional fonts. If you specify a proportional font in a textual region, it is replaced by the default font. If the default font is proportional, font medium is used.

Proportionally-spaced fonts and fonts defined with attributes (bold, italic, under line, and strikeout), cannot be used in textual regions.

Non-proportional fonts contain extended ASCII characters for display of National Language characters in a textual region. ESL fonts do not contain extended ASCII characters.

You can specify only one font for each textual region; you cannot change this font during runtime.

Any font can be displayed in a graphical region.

Using screen size dialog units defines a desktop co-ordinate system that is proportional to the size of the system font.

If you do not include a font specification in a textual region definition, the default font (the font specified in the font environment declaration) will be used unless it is a proportionally-spaced font, in which case the default font medium will be used for the textual region.

If you do not specify a font in an environment declaration, the default font for the program is the "esl mono" true type font, or as defined in the ESL Configuration file .

Example

font "esl mono" # Environment declaration

font Asc510 is facename "esl mono" size 5 10

font Asc510 # Environment declaration

textual region News_TR window size 19 columns 5 lines

at position 100 100

font Courier_12_20 # Quotation marks not used

# around names of defined fonts

textual region News_TR window size 19 columns 5 lines

at position 100 100

font Asc510

See Also

font is Font Reference Definition

text Drawing Statement