a2CreateFont()

This command creates a font for use with Advanced 2D text commands.

  Syntax
Return Integer = a2CreateFont(fontName, size, sizeMode, style)
Return Integer = a2CreateFont(fontName, size, sizeMode, style, charSet)
  Parameters
fontName
String
The name of the font used to create this Advanced 2D font.
size
Integer
This value specifies size of the font.
sizeMode
Integer
This value specifies how the font size value is interpreted.
style
Integer
This value specifies the style of the font.
charSet
Integer
This value specifies the character set used for the font.

  Returns

Returns a unique integer that identifies the initialized font.

  Description

a2CreateFont creates a font for use with the Advanced 2D text commands. The size of the font is determined by the size value and the sizeMode parameter. You can optionally specify a character set value when creating your font. The character set value allows you to use other western non-unicode languages not available through the standard ASCII character set. To switch the character set to another language, use an international charset code. These codes can be located in the Principals section of the DBPro help, along with the ASCII Character Code Lists.

Size Mode
a2Size_Cell() - The size is interpretted as the cell size of the font in pixels.
a2Size_Char() - The size is interpretted as the character size of the font in pixels.
a2Size_Point() - The size is interpretted as a point size (such as 12pt).

Styles
a2Style_Bold()
a2Style_BoldItalic()
a2Style_Italic()
a2Style_Normal()

  Example Code
myFont1 = a2CreateFont("ariel", 30, a2Size_Cell(), a2Style_Normal())
myFont2 = a2CreateFont("ariel", 30, a2Size_Char(), a2Style_Normal())
myFont3 = a2CreateFont("ariel", 30, a2Size_Point(), a2Style_Normal())
myFont4 = a2CreateFont("ariel", 30, a2Size_Char(), a2Style_Normal())
myFont5 = a2CreateFont("ariel", 30, a2Size_Char(), a2Style_Bold())
myFont6 = a2CreateFont("ariel", 30, a2Size_Char(), a2Style_Italic())
myFont7 = a2CreateFont("ariel", 30, a2Size_Char(), a2Style_BoldItalic())

a2Text myFont1, 10, 20, "Size 30 from cell size in pixels", 0xFFFFFFFF
a2Text myFont2, 10, 50, "Size 30 from character size in pixels", 0xFFFFFFFF
a2Text myFont3, 10, 80, "Size 30 in points", 0xFFFFFFFF
a2Text myFont4, 10, 150, "Normal text", 0xFFFFFFFF
a2Text myFont5, 10, 180, "Bold text", 0xFFFFFFFF
a2Text myFont6, 10, 210, "Italic text", 0xFFFFFFFF
a2Text myFont7, 10, 240, "Bold Italic text", 0xFFFFFFFF

WAIT KEY
  See also

a2DeleteFont
Charset Codes
Advanced 2D Index
Main Menu