BoxTextFont

 

Sets the font for a WinBatch box.

Syntax:

BoxTextFont(box ID, name, size, style, pitch & family)

Parameters:

(i) box ID the ID number of the desired WinBatch box.

(s) name name of font typeface, or "".

(i) size size of font, in virtual units.

(i) style style flags for font.

(i) font pitch, family and character set.  See below.

Returns:

(i) @TRUE on success; @FALSE on failure.

 

When defining the font using BoxTextFont, size is based on mapping mode. In the default, a height of 100 is 10% of the height of the box.

If a blank string is specified for "name", the system will select the best available font based upon the other parameters supplied.

 

Style (the following numbers may be added together):

0 Default.

1-99 Weight (40 = Normal, 70 = Bold)

100 Italics

1000 Underlined

 

A style of 1170 give you a bold, underlined, italic font.

 

Pitch & Family parameters do not override the typeface supplied in the Font parameter. If a match cannot be made, (font name mis-spelled, font not on system) they supply a general description for selecting a default font. To combine one pitch flag with one family flag, use the binary OR ("|") operator.

 

Pitch:

0 Default

1 Fixed pitch

2 Variable pitch

 

Family:

0 Default

16 Roman (Times Roman, Century Schoolbook, etc.)

32 Swiss (Helvetica, Swiss, etc.)

48 Modern (Pica, Elite, Courier, etc.)

64 Script

80 Decorative (Old English, etc.)

 

In addition to the existing flags for pitch and family, you can now specify one of the following flags specifying a character set (combined with the pitch and/or family flags using the binary "OR" ("|") operator):

 

Character Set:

ANSI_CHARSET 0 (default)

DEFAULT_CHARSET 256

SYMBOL_CHARSET 512

SHIFTJIS_CHARSET 32768 (Kanji)

HANGEUL_CHARSET 33024

GB2312_CHARSET 34304

CHINESEBIG5_CHARSET 34816

OEM_CHARSET 65280

 

The following character set flags are for Windows NT 4.0+:

JOHAB_CHARSET 33280

HEBREW_CHARSET 45312

ARABIC_CHARSET 45568

GREEK_CHARSET 41216

TURKISH_CHARSET 41472

THAI_CHARSET 56832

EASTEUROPE_CHARSET 60928

RUSSIAN_CHARSET 52224

MAC_CHARSET 19712

BALTIC_CHARSET 47616

 

The character set flags will not override the typeface specified by the font "name" parameter. If you would rather specify a character set than a specific typeface, specify a blank string ("") for font "name".

Note: If you wish to use a Kanji (Japanese) font, you must specify the SHIFTJIS_CHARSET flag (32768).

 

Example:

;; sample script for BoxTextFont
BoxesUp("100,100,900,900", @NORMAL)
BoxCaption(1, "WinBatch BoxTextFont Example")
x1="0,0,0" ;BLACK
x2="0,0,128" ;DKBLUE
x3="255,0,0" ;RED
x4="255,0,255" ;PURPLE
x5="0,0,255" ;BLUE
f1="Times Roman"
f2="Helvetica"
f3="Courier New"
f4="Brush Script MT"
f5="Book Antiqua"
fam=16
size=20
For i=1 To 5
   BoxTextColor(1,x%i%)
   BoxTextFont(1, f%i%, size, 0, fam)
   BoxDrawText(1, "1%size%,2%size%,1000,1000", "WinBatch Box Example- BoxTextFont", @FALSE, 0)
   Fam=fam+16
   size=size+16
   TimeDelay(2)
Next
See Also:

BoxesUp, BoxNew, BoxTextColor