FONT NEW statement  

Purpose

Create a new font for use with 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

 4

Underline

1

Bold

 8

Strikeout

2

Italic

16

Leading

Some fonts specify "external leading" in their definition.  In some cases, it only applies to certain point sizes of a font.  External Leading specifies that one or more blank pixels are added to the bottom of each character when displayed.  This has an impact on character position and should be considered when creating a font. Normally, the font is created without regard to external leading. That is, it's created so that the visible character face fills the requested point size.  However, if the Leading Option is used, the font will be created so that the visible character face plus the external leading (if any) fills the point size.  In these cases, the character may appear slightly smaller.

charset&

CharSet identifier.

0

ANSI CharSet

162

Turkish CharSet

1

Default CharSet

177

Hebrew CharSet

2

Symbol CharSet

178

Arabic CharSet

77

Mac CharSet

186

Baltic CharSet

128

Shiftjis CharSet

204

Russian CharSet

129

Hangeul CharSet

222

Thai CharSet

130

Johab CharSet

238

East Europe CharSet

136

Chinese CharSet

255

OEM CharSet

161

Greek CharSet

 

 

pitch&

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

0

Default

32

Swiss font (Helvetica, Swiss...)

1

Fixed width font

48

Modern font (Pica, Courier...)

2

Variable width font

64

Script font (Cursive...)

16

Roman font (Times Roman...)

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 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

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