Font Object

Overview

The Font object enables setting the current font family, color, size and other properties for text typing operations. This object is obtained via the Font property of the Canvas object.

Member List

Properties


Align As Long (Read/Write)

Specifies text alignment for the Canvas.PrintTextEx method. Valid values are: 0 - left (default), 1 - right, 2 - center and 3 - justified. If a value other than 0 is specified, the Width property must also be specified.

This property was introduced in Version 1.8. It does not affect the PrintText method.

See also: Section 5.3 - Advanced Text Drawing with PrintTextEx.


BkColor As Long (Read/Write)

Specifies the font's background color. Font.BkMode must be set to anything other that "transparent" for this property to take effect. This property is to be used in conjunction with the PrintText method. It does not affect the PrintTextEx method.

See also: Chapter 5 - Drawing & Typing


BkMode As String (Read/Write)

"Transparent" by default. If set to any other value, such as "Opaque", the font's background is colored with Font.BkColor. This property is to be used in conjunction with the PrintText method. It does not affect the PrintTextEx method.

See also: Chapter 5 - Drawing & Typing.


Bold As Long (Read/Write)

Specifies whether a bold font should be used. False by default. This property is to be used in conjunction with the PrintText method. It does not affect the PrintTextEx method.

See also: Chapter 5 - Drawing & Typing.


Color As Long (Read/Write)

Specifies font color, e.g. &H00FF00 for green. 0 (black) by default. Affects both the PrintText and PrintTextEx methods.

See also: Chapter 5 - Drawing & Typing.


Family As String (Read/Write)

Specifies font family such as "Arial" or "Courier New". A system-default font is used if this property is not specified, or the specified font is not found. This property is to be used in conjunction with the PrintText method. It does not affect the PrintTextEx method.

See also: Chapter 5 - Drawing & Typing.


Italic As Long (Read/Write)

Specifies whether an italic font should be used. False by default. This property is to be used in conjunction with the PrintText method. It does not affect the PrintTextEx method.

See also: Chapter 5 - Drawing & Typing.


Opacity As Single (Read/Write)

Specifies text opacity which can be useful for watermarking purposes. 0 means full transparency (text is not visible), and 1 means full opacity (background is not visible). 1 by default.

This property was introduced in Version 1.8 (Service Release 1.8.0.1). This property is to be used in conjunction with the PrintTextEx method. It does not affect the PrintText method.

See also: Section 5.3 - Advanced Text Drawing with PrintTextEx.


Quality As Long (Read/Write)

Specifies text quality. Valid values: 0 (Default), 1 (Draft), 2 (Proof), 3 (Non-Antialiased), 4 (Antialiased).

Text usually appears anti-aliased only if the Font.BkMode is set to "Opaque".

This property is to be used in conjunction with the PrintText method. It does not affect the PrintTextEx method.

See also: Chapter 5 - Drawing & Typing.


Rotation As Long (Read/Write)

Specifies text rotation angle (in degrees, rotation is counter-clockwise) for both the PrintText and PrintTextEx methods. 0 (horizontal) by default.

See also: Chapter 5 - Drawing & Typing.


ShadowColor As Long (Read/Write)

Specifies the color of a text shadow, if present. This property is to be used in conjunction with the PrintText method. It does not affect the PrintTextEx method.

See also: Chapter 5 - Drawing & Typing.


ShadowXoffset As Long (Read/Write)

Specifies horizontal offset of a text shadow, in pixels. 0 by default (no shadow). This property is to be used in conjunction with the PrintText method. It does not affect the PrintTextEx method.

See also: Chapter 5 - Drawing & Typing.


ShadowYoffset As Long (Read/Write)

Specifies vertical offset of a text shadow, in pixels. 0 by default (no shadow). This property is to be used in conjunction with the PrintText method. It does not affect the PrintTextEx method.

See also: Chapter 5 - Drawing & Typing.


Size As Long (Read/Write)

Specifies font size for both PrintText and PrintTextEx methods, in pixels. 24 by default.

See also: Chapter 5 - Drawing & Typing.


Spacing As Long (Read/Write)

Specifies line spacing adjustment (in pixels) for the Canvas.PrintTextEx method. A positive value increases the default line spacing, a negative value decreases it.

This property was introduced in Version 1.8. It does not affect the PrintText method.

See also: Section 5.3 - Advanced Text Drawing with PrintTextEx.


Underlined As Long (Read/Write)

Specifies whether an underlined font should be used. False by default. This property is to be used in conjunction with the PrintText method and, in AspJpeg 2.1+, PrintTextEx method.

As of Version 2.1+, if this property is set to True, the method PrintTextEx draws underlined text. The width and color of the underline is specified via the Pen.Width and Pen.Color properties.

See also: Chapter 5 - Drawing & Typing.


Width As Long (Read/Write)

Specifies the width of an area in which a text string drawn via Canvas.PrintTextEx is to be inscribed. Activates word wrapping if necessary. This property must also be set if the Align property is set to a value other than 0 (left alignment).

This property was introduced in Version 1.8. It does not affect the PrintText method.

See also: Section 5.3 - Advanced Text Drawing with PrintTextEx.

Methods


Function ConvertArabic(Text As String, Reverse As Boolean) As String

When Arabic characters are encountered in Text, converts individual character codes into "ligatures" (contextual joining of letters), for example:

If Reverse is True, also rearranges the characters in the opposite order to be rendered easily via PrintTextEx.

This method was introduced in Version 2.1.