Home > SYS_FontManager > deleteFont
SYS_FontManager.deleteFont() method
删除字体列表内的指定字体
签名
typescript
function deleteFont(fontName: string): Promise<boolean>;1
参数名
参数 | 类型 | 描述 |
|---|---|---|
fontName | string | 字体名称 |
返回值
Promise<boolean>
删除操作是否成功
示例
javascript
// 1. 准备一个待删除的测试字体
await eda.sys_FontManager.addFont('嘉立创示例_测试字体');
// 2. 从字体列表删除该字体
const deleted = await eda.sys_FontManager.deleteFont('嘉立创示例_测试字体');
// 3. 确认字体已不在列表中
const fonts = await eda.sys_FontManager.getFontsList();
console.log('删除结果:', deleted);
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