88 lines
2.9 KiB
JavaScript
88 lines
2.9 KiB
JavaScript
const fs = require('fs');
|
||
const path = require('path');
|
||
|
||
console.log('=== 查找8个模板的不同配置 ===\n');
|
||
|
||
// 检查所有可能的配置文件
|
||
const filesToCheck = [
|
||
{ name: 'default-templates.json (subtitleStyles)', path: 'packaging/resources/common/config/default-templates.json' },
|
||
{ name: 'default-subtitle-templates.json', path: 'electron/config/default-subtitle-templates.json' },
|
||
{ name: 'C盘配置', path: 'C:\\system-templates.json' },
|
||
];
|
||
|
||
filesToCheck.forEach(fileInfo => {
|
||
if (!fs.existsSync(fileInfo.path)) {
|
||
console.log(`⚠️ ${fileInfo.name} 不存在\n`);
|
||
return;
|
||
}
|
||
|
||
try {
|
||
const data = JSON.parse(fs.readFileSync(fileInfo.path, 'utf-8'));
|
||
|
||
// 检查 subtitleStyles
|
||
if (data.subtitleStyles) {
|
||
console.log(`\n【${fileInfo.name}】- subtitleStyles:`);
|
||
const styles = data.subtitleStyles.filter(s => s.id && s.id.match(/system-subtitle-(11|22|33|44|55|66|77|88)/));
|
||
if (styles.length > 0) {
|
||
styles.forEach(s => {
|
||
console.log(` 模板 ${s.id.replace('system-subtitle-', '')}:`);
|
||
console.log(` 字体: ${s.fontName || 'N/A'}`);
|
||
console.log(` 颜色: ${s.fontColor || 'N/A'}`);
|
||
console.log(` 描边: ${s.outlineColor || 'N/A'}, 宽度: ${s.outlineWidth || 0}`);
|
||
});
|
||
} else {
|
||
console.log(' 未找到系统模板样式');
|
||
}
|
||
}
|
||
|
||
// 检查 subtitleTemplates
|
||
if (data.subtitleTemplates) {
|
||
console.log(`\n【${fileInfo.name}】- subtitleTemplates:`);
|
||
const templates = data.subtitleTemplates.filter(t => t.id && t.id.match(/template_system_(11|22|33|44|55|66|77|88)/));
|
||
if (templates.length > 0) {
|
||
templates.forEach(t => {
|
||
console.log(`\n 模板 ${t.name} (${t.id}):`);
|
||
|
||
// 普通字幕字体(subtitleStyle)
|
||
if (t.config && t.config.subtitleStyle) {
|
||
console.log(` 普通字幕字体: ${t.config.subtitleStyle.fontName || 'N/A'}`);
|
||
console.log(` 普通字幕颜色: ${t.config.subtitleStyle.fontColor || 'N/A'}`);
|
||
} else if (t.config && t.config.subtitleStyleId) {
|
||
console.log(` 普通字幕样式ID: ${t.config.subtitleStyleId}`);
|
||
}
|
||
|
||
// 特效字幕字体和颜色(keywordGroupsStyles)
|
||
if (t.config && t.config.keywordGroupsStyles) {
|
||
console.log(` 特效字幕配置:`);
|
||
t.config.keywordGroupsStyles.forEach((kg, idx) => {
|
||
if (kg.styleOverride && kg.styleOverride.fontName) {
|
||
console.log(` ${kg.groupName}: 字体=${kg.styleOverride.fontName}, 颜色=${kg.color || kg.styleOverride.fontColor}`);
|
||
}
|
||
});
|
||
}
|
||
});
|
||
} else {
|
||
console.log(' 未找到系统模板');
|
||
}
|
||
}
|
||
|
||
console.log('');
|
||
} catch (e) {
|
||
console.log(`❌ 读取 ${fileInfo.name} 失败: ${e.message}\n`);
|
||
}
|
||
});
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|