SarEngine2D

Document

SarEngine2D Font

Font

规定文本的字体、字体尺寸等。Font成员的详细规范与CSS font值一致。

Syntax

var font = new Font(fontFamily, fontSize);

Parameters

String fontFamily
字体,若未指定该项,则默认为"sans-serif"。
Number fontSize
字体尺寸,若未指定该项,则默认为10px。

Properties

caption
String 用于标题控件(如按钮,下拉列表等)的字体。
fontFamily
String 字体。
fontSize
String 字体尺寸。
fontStyle
String 字体样式。
fontVariant
String 设置小型大写字母的字体。
fontWeight
String 字体线宽。
icon
String 用于标签图标的字体。
menu
String 菜单中(如下拉菜单和菜单列表)使用的字体。
messageBox
String 用于对话框的字体。
smallCaption
String 用于小标号控件的字体。
statusBar
String 用于窗口状态栏的字体。

Methods

复制一个相同的字体实例。
将该字体实例转换为等效的CSS font字符串。