FONT NEW statement  

Purpose

Create a new font for use with CONTROL, GRAPHIC PRINT, XPRINT, etc.

Syntax

FONT NEW fontname$ [,points!, style&, charset&, pitch&, escapement&] TO fhndl

fontname$

Name of the font.

points!

Size of the font, in points. This may be specified as a floating point value for fractional point sizes.

style&

Font style attribute. Any of the following values can be combined or used alone:

0

Normal

1

Bold

2

Italic

4

Underline

8

Strikeout

charset&

CharSet identifier.

0

ANSI CharSet

1

Default CharSet

2

Symbol CharSet

77

Mac CharSet

128

Shiftjis CharSet

129

Hangeul CharSet

130

Johab CharSet

136

Chinese CharSet

161

Greek CharSet

162

Turkish CharSet

177

Hebrew CharSet

178

Arabic CharSet

186

Baltic CharSet

204

Russian CharSet

222

Thai CharSet

238

East Europe CharSet

255

OEM CharSet

pitch&

Pitch and Font Family attribute.  One of each group of  values can be combined or used alone:

0

Default

1

Fixed width font

2

Variable width font

16

Roman font (Times Roman...)

32

Swiss font (Helvetica, Swiss...)

48

Modern font (Pica, Courier...)

64

Script font (Cursive...)

80

Decorative (OldEnglish...)

escapement&

Specifies the angle, in tenths of degrees, between the character base line and the x axis.  Allows printing of text on an angle.

fhndl

Upon successful creation of a new font, a unique PowerBASIC handle is assigned to this Long Integer or DWord variable.  This handle is used with other statements and functions to specify the created font. If the font creation fails, the value zero (0) is assigned to fhndl.

Remarks

This is the preferred method of creating and specifying fonts in PowerBASIC.  Using FONT NEW, you can create a group of fonts, in advance, and switch between them easily using CONTROL SET FONT, GRAPHIC SET FONT, and XPRINT SET FONT.

If the requested font is not available on the computer, Windows will search for a substitute font, which is similar to the attributes specified (CharSet, Font Family, etc.).

You may use the value zero (0) for any of the numeric parameters to designate that the compiler should use the default for that item.  If parameters are missing, the compiler substitutes the default value for all remaining parameters.

See also

CONTROL SET FONT, FONT END, GRAPHIC PRINT, GRAPHIC SET FONT, XPRINT, XPRINT SET FONT