Text to vertical video in 100+ styles: AI codes each scene (HTML/SVG/WebGL), renders a 9:16 MP4 with music and English/Vietnamese voice. MCP, CLI and REST for AI agents.
// Soát font mọi job trong jobs/ — CHỈ ĐỌC (cảnh được chép ra thư mục tạm trước khi mở).
// node scripts/font-audit.mjs [--json]
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { lintFonts } from '../engine/lib.mjs';
import { fontCheck } from '../engine/fontcheck.mjs';
const ROOT = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
const JOBS = path.join(ROOT, 'jobs');
const rows = [];
for (const id of fs.readdirSync(JOBS).sort()) {
const scene = path.join(JOBS, id, 'scene');
const file = path.join(scene, 'index.html');
if (!fs.existsSync(file)) continue;
const lint = lintFonts(fs.readFileSync(file, 'utf8'));
const rt = await fontCheck(scene, { readOnly: true });
const count = (k) => rt.issues.filter((i) => i.kind === k).length;
rows.push({
job: id,
outside: lint.errors.map((e) => e.match(/"([^"]+)"/)?.[1]).filter(Boolean),
stroke: lint.warnings.some((w) => w.includes('text-stroke')),
FONT_FALLBACK: count('FONT_FALLBACK'), FONT_OUTSIDE: count('FONT_OUTSIDE'), FONT_WEIGHT: count('FONT_WEIGHT'), FONT_DIGITS: count('FONT_DIGITS'),
details: rt.lines, errors: rt.errors, skipped: rt.skipped,
});
process.stderr.write(`.${id}`);
}
process.stderr.write('\n');
if (process.argv.includes('--json')) console.log(JSON.stringify(rows, null, 2));
else {
console.log('| job | font ngoài danh sách (tĩnh) | stroke thiếu paint-order | FALLBACK | OUTSIDE | WEIGHT | DIGITS |');
console.log('|---|---|---|---|---|---|---|');
for (const r of rows) console.log(`| ${r.job} | ${r.outside.join(', ') || '-'} | ${r.stroke ? 'có' : '-'} | ${r.FONT_FALLBACK} | ${r.FONT_OUTSIDE} | ${r.FONT_WEIGHT} | ${r.FONT_DIGITS} |`);
console.log('\nChi tiết:');
for (const r of rows) if (r.details.length || r.errors?.length) console.log(`\n${r.job}\n ` + [...r.details, ...(r.errors || [])].join('\n '));
}