com.herewhite.sdk.domain.FontFace class 参考
适用版本:Whiteboard Android SDK 2.16.134。
字体配置文件,与 CSS 中的 FontFace 属性对应。
@since 2.11.2
父类:WhiteObject;继承接口详见父类。
属性与 JSON 字段
Java 非公开字段通过对应 getter/setter 访问;可选包装类型未设置时通常不写入 JSON。初值包含字段声明及无参构造中的直接赋值;其他构造参数以签名为准。
| 字段 | 声明 | 源码初值 | 说明 |
|---|---|---|---|
| fontStyle | String fontStyle | 未显式赋值 | 模型属性;通过对应 getter/setter 访问。 |
| fontWeight | String fontWeight | 未显式赋值 | 模型属性;通过对应 getter/setter 访问。 |
| unicodeRange | String unicodeRange | 未显式赋值 | 模型属性;通过对应 getter/setter 访问。 |
| 公开成员签名 | |
| FontFace (String name, String src) | |
| String | getFontStyle () |
| void | setFontStyle (String fontStyle) |
| String | getFontWeight () |
| void | setFontWeight (String fontWeight) |
| String | getUnicodeRange () |
| void | setUnicodeRange (String unicodeRange) |
变量说明
fontStyle
String fontStyle
模型属性;通过对应 getter/setter 访问。
fontWeight
String fontWeight
模型属性;通过对应 getter/setter 访问。
unicodeRange
String unicodeRange
模型属性;通过对应 getter/setter 访问。
函数说明
FontFace()
| FontFace(String name, String src) |
参数
| 参数名 | 描述 |
|---|---|
name | 字体名称,需要和 CSS 中 font-family 字段的值对应。 |
src | 字体文件的地址,需要和 CSS 中 src 字段的值对应。支持的格式为 url(),表示指向远程字体文件位置,例如,url("https://white-pan.oss-cn-shanghai.aliyuncs.com/Pacifico-Regular.ttf")。 |
getFontStyle()
setFontStyle()
| void setFontStyle(String fontStyle) |
设置字体样式。
参数
| 参数名 | 描述 |
|---|---|
fontStyle | 字体样式,需要和 CSS 中 font-style 字段的值对应,取值包括:
|
getFontWeight()
setFontWeight()
getUnicodeRange()
setUnicodeRange()
| void setUnicodeRange(String unicodeRange) |
设置字体的字符编码范围。
参数
| 参数名 | 描述 |
|---|---|
unicodeRange | 字体的字符编码范围,需要和 CSS 中 unicode-range 字段的值对应。 |