Home > SYS_FontManager > addFont
SYS_FontManager.addFont() method
Add Font to font list
Signature
typescript
function addFont(fontName: string): Promise<boolean>;1
Parameters
Parameter | Type | Description |
|---|---|---|
fontName | string | Font name |
Returns
Promise<boolean>
Add Whether the operation is successful
Example
javascript
// 1. 添加一个字体到字体列表
const added = await eda.sys_FontManager.addFont('嘉立创示例_测试字体');
// 2. 确认字体已进入列表
const fonts = await eda.sys_FontManager.getFontsList();
// 3. 清理测试字体,恢复原有配置
await eda.sys_FontManager.deleteFont('嘉立创示例_测试字体');
console.log('添加结果:', added);
console.log('已进入字体列表:', fonts.includes('嘉立创示例_测试字体'));1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11