update at 2026-02-07 14:16:46
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
import type { FontInfo, FontListItem } from '../types/font'
|
||||
|
||||
/**
|
||||
* 将 fonts.json 项转换为 FontInfo 运行时结构。
|
||||
*/
|
||||
export function toFontInfo(item: FontListItem): FontInfo {
|
||||
return {
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
path: item.path,
|
||||
category: item.category,
|
||||
isFavorite: false,
|
||||
loaded: false,
|
||||
progress: 0,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量转换字体清单。
|
||||
*/
|
||||
export function toFontInfoList(items: FontListItem[]): FontInfo[] {
|
||||
return items.map(toFontInfo)
|
||||
}
|
||||
Reference in New Issue
Block a user