DAFontStyle Class

The DAFontStyle class is used to specify how strings will be rendered into images. These functions are similar to the HTML tags specifying the font face (called here a family), size, color and attributes (bold and italic).

For relevant functions and properties from the DAStatics class, see the following topics.

DAFontStyle Functions

AntiAliasingDetermines whether the font will be antialiased.
BoldSpecifies that, when the string is rendered into an image, it will be in bold.
ColorSpecifies the color of the string when it is rendered into an image.
Family Specifies the font face that will be used when the image is rendered. Same as FamilyAnim except that face is a nonanimated string.
FamilyAnim Specifies the font face that will be used when the image is rendered.
ItalicSpecifies that, when the string is rendered into an image, it will be italicized.
Size Specifies the size of the font, in points. Same as SizeAnim except that points is a nonanimated number (a double).
SizeAnim Specifies the size of the font, in points.
StrikethroughSpecifies that, when the string is rendered into an image, it will be struck through.
TransformCharactersSpecifies that, when the string is rendered into an image, the given DATranform2 is applied to the characters.
UnderlineSpecifies that, when a string is rendered into an image, it will be underlined.
Weight Specifies the thickness of the boldness of the font. Same as WeightAnim except that the parameter is nonanimated (a double).
WeightAnim Specifies the thickness of the boldness of the font.

AntiAliasing

DAFontStyle Class

Determines whether the font will be antialiased.

Syntax

fontstyleObj.AntiAliasing( antialias )

Parameters

antialias
A double value that can be either 0 or 1. If antialias is 0 (the default), there is no antialiasing. If it is 1, there is antialiasing.

Return Value

Returns the DAFontStyle object.

Bold

DAFontStyle Class

Specifies that, when the string is rendered into an image, it will be in bold.

Syntax

fontstyleObj.Bold( )

Return Value

Returns the DAFontStyle object.

Color

DAFontStyle Class

Specifies the color of the string when it is rendered into an image. Because this is a DAColor object, the color can vary over time.

Syntax

fontstyleObj.Color( color )

Parameters

color
DAColor object specifying the color of the string.

Return Value

Returns the DAFontStyle object.

Family

DAFontStyle Class

Specifies the font face that will be used when the image is rendered. Same as FamilyAnim except that face is a nonanimated string.

Syntax

fontstyleObj.Family( face )

Parameters

face
Nonanimated string specifying the font face.

Return Value

Returns the DAFontStyle object.

Example

The following JScript code shows how to use this function.

fs = m.DefaultFont.Family("Arial").Color(m.Red).Bold();

FamilyAnim

DAFontStyle Class

Specifies the font face that will be used when the image is rendered. Because this is a DAString object, the face can vary over time.

Syntax

fontstyleObj.FamilyAnim( face )

Parameters

face
DAString object specifying the font face.

Return Value

Returns the DAFontStyle object.

Italic

DAFontStyle Class

Specifies that, when the string is rendered into an image, it will be italicized.

Syntax

fontstyleObj.Italic( )

Return Value

Returns the DAFontStyle object.

Size

DAFontStyle Class

Specifies the size of the font, in points. Same as SizeAnim except that points is a nonanimated number (a double).

Syntax

fontstyleObj.Size( points )

Parameters

points
Nonanimated double value specifying the size of the font.

Return Value

Returns the DAFontStyle object.

SizeAnim

DAFontStyle Class

Specifies the size of the font, in points. Because this is a DANumber object, the size can vary over time.

Syntax

fontstyleObj.SizeAnim( points )

Parameters

points
DANumber object specifying the size of the font.

Return Value

Returns the DAFontStyle object.

Strikethrough

DAFontStyle Class

Specifies that, when the string is rendered into an image, it will be struck through.

Syntax

fontstyleObj.Strikethrough( )

Return Value

Returns the DAFontStyle object.

TransformCharacters

DAFontStyle Class

Specifies that, when the string is rendered into an image, the given DATranform2 is applied to the characters.

Note this function can be used only with Microsoft® DirectAnimation® version 6.x or later.

Syntax

fontstyleObj.TransformCharacters( xf2 )

Parameters

xf2
The DATranform2 to apply to the characters of the string before rendering it as an image.

Return Value

Returns the DAFontStyle object.

Underline

DAFontStyle Class

Specifies that, when a string is rendered into an image, it will be underlined.

Syntax

fontstyleObj.Underline( )

Return Value

Returns the DAFontStyle object.

Weight

DAFontStyle Class

Specifies the thickness of the boldness of the font. Same as WeightAnim except that the parameter is nonanimated (a double).

Syntax

fontstyleObj.Weight( )

Parameters

weight
Nonanimated double value that specifies the thickness of the boldness of the font. The value can range from 0 (the thinnest) to 1 (the thickest).

Return Value

Returns the DAFontStyle object.

WeightAnim

DAFontStyle Class

Specifies the thickness of the boldness of the font. This attribute can be thought of as an animated bold. Note that the font itself has specific, discrete settings for the weight. Varying the value of the weight results in discrete, rather than continuous, changes. The DAFontStyle.Bold function always overrides this setting.

Syntax

fontstyleObj.WeightAnim( weight )

Parameters

weight
DANumber object that specifies the thickness of the boldness of the font. The value can range from 0 (the thinnest) to 1 (the thickest).

Return Value

Returns the DAFontStyle object.

See Also

Weight


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.