class org.aswing.ASFont

Font that specified the font name, size, style and whether or not embed.

Author paling, ngrebenshikov

Instance Fields

var size:Int

function new(?name:String = 'Tahoma', ?size:Float = 11, ?bold:Bool = false, ?italic:Bool = false, ?underline:Bool = false, ?embedFontsOrAdvancedPros:Dynamic = null): Void

Create a font.

@see ASFontAdvProperties

embedFontsOrAdvancedPros

a boolean to indicate whether or not embedFonts or a ASFontAdvProperties instance.

function apply(textField:TextField, ?beginIndex:Int = -1, ?endIndex:Int = -1): Void

Applys the font to the specified text field.

textField

the text filed to be applied font.

beginIndex

The zero-based index position specifying the first character of the desired range of text.

endIndex

The zero-based index position specifying the last character of the desired range of text.

function changeBold(bold:Bool): ASFont

Clones a font with the different bold property

function changeItalic(italic:Bool): ASFont

Clones a font with the different italic property

function changeName(name:String): ASFont

Clones a font with the different name property

function changeSize(size:Int): ASFont

Clones a font with the different size property

function changeUnderline(underline:Bool): ASFont

Clones a font with the different underline property

function clone(): ASFont

Clone a ASFont, most time you dont need to call this but to avoid UIResource, you can call this.

function computeTextSize(text:String, ?includeGutters:Bool = true): IntDimension

Computes text size with this font.

@see AsWingUtils.computeStringSizeWithFont

text

the text to be compute

includeGutters

whether or not include the 2-pixels gutters in the result

returns

the computed size of the text

function getTextFormat(): TextFormat

Creates a text format that contains the font properties.

returns

a text format.

function isEmbedFonts(): Bool

function toString(): String