Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/effects-core/src/utils/text.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { isSimulatorCellPhone } from './device';

/**
* 判断是否为可解析的字体
* - 首字母不能为数字或 `.`
Expand All @@ -7,5 +9,5 @@
*/
export function isValidFontFamily (fontFamily: string): boolean {
// iOS 11/12 不支持自定义字体开头为数字的名称,特殊字符也有风险
return /^[^\d.][\w-]*$/.test(fontFamily);
return /^[^\d.][\w-]*$/.test(fontFamily) || !isSimulatorCellPhone();
}