update at 2026-02-07 14:10:02

This commit is contained in:
douboer
2026-02-07 14:10:02 +08:00
parent 593027578a
commit dcaac46f65
6 changed files with 265 additions and 27 deletions

View File

@@ -0,0 +1,23 @@
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)
}