mirror of
https://github.com/YuleBest/FontMM.git
synced 2026-12-04 03:11:48 +08:00
feat(core): 支持多字重字体安装、Zygisk 预热与升级继承
This commit is contained in:
1 parent
93bdb86599
commit
57a41b71c8
4 files changed
+354
-39
No files matched your search
+8
-7
@@ -122,21 +122,22 @@ await check('派生字体配置未被 git 跟踪', async () => {
|
||||
|
||||
// apply.sh 的占位字体映射 与 empty-font.mjs 的占位清单 必须一致
|
||||
//
|
||||
// apply.sh 里有两类单引号字体名:
|
||||
// 1. 多行的字体列表赋值 (hans_fonts/hant_fonts/en_fonts) —— 会被用户字体覆盖的
|
||||
// SysFont*/SysSans* 占位文件, 必须与 empty-font.mjs 的 PLACEHOLDERS 一一对应
|
||||
// 2. 单行的系统字体名 (DroidSansMono.ttf / NotoColorEmoji.ttf) —— 直接替换系统
|
||||
// apply.sh 里有三类单引号字体名:
|
||||
// 1. 多行的基础占位赋值 (hans_fonts/hant_fonts/en_fonts) —— 0 字节占位文件,
|
||||
// 必须与 empty-font.mjs 的 PLACEHOLDERS 一一对应
|
||||
// 2. 多字重扩展文件名 (FontMM-{Hans,Hant,En}-{100..900}.ttf) —— 按需生成,
|
||||
// 不经过占位机制, 不属于 PLACEHOLDERS, 但必须被 Zygisk 预热清单覆盖
|
||||
// 3. 单行的系统字体名 (DroidSansMono.ttf / NotoColorEmoji.ttf) —— 直接替换系统
|
||||
// 字体文件, 不经过占位机制, 不属于占位清单
|
||||
// 按「是否含换行」区分这两类, 与源码结构一致。
|
||||
await check('apply.sh 占位映射与占位清单一致', async () => {
|
||||
const applySh = await fsp.readFile(path.join(SRC_DIR, 'apply.sh'), 'utf8');
|
||||
const mapped = new Set();
|
||||
for (const m of applySh.matchAll(/'([^']*)'/g)) {
|
||||
const value = m[1];
|
||||
if (!value.includes('\n')) continue; // 跳过单行系统字体名
|
||||
if (!value.includes('\n')) continue; // 跳过单行字体名
|
||||
for (const line of value.split('\n')) {
|
||||
const name = line.trim();
|
||||
if (name.endsWith('.ttf')) mapped.add(name);
|
||||
if (name.endsWith('.ttf') && !name.startsWith('FontMM-')) mapped.add(name);
|
||||
}
|
||||
}
|
||||
if (mapped.size === 0) throw new Error('未从 apply.sh 解析到占位字体列表 (解析逻辑可能已失效)');
|
||||
|
||||
Reference in new issue
Block a user