feat: 检索词表 + 表情技能 + 海报字重编排 三向增强
- 中文语义词表 425 → 619 条(+194),新增行业细分/商业指标/技术工程/合规风控/节日节气/生活服务等 17 组场景词;对 11.8 万图标名语料复核覆盖率 99.0% - 表情技能 12 → 20(motion 11→13 新增循环接缝/多元素错峰;emotion 1→7 新增强度匹配/场景克制/覆盖度/可读性/调性一致/情绪跳变) - 共享技能 54 → 55:新增头像向技能 avatar-safe-zone(圆/方裁切安全区),映射到方案评审步骤 - 海报字体层级:新增 TYPE_SCALES 四档白名单(impact/editorial/steady/quiet),AI 决策 JSON 增加 typeScaleId,渲染层按预设输出 400/700/800 与字号比;非法值回退默认 - 修复 audit-emojis.html 技能数量断言过期(12→20);emoji-smoke 62/62 通过,audit-emojis 27 通过 0 失败 - 版本联动 20261108e(cn-tags / skills core+layout / sticker skills / poster-generator+ai)
This commit is contained in:
@@ -389,6 +389,53 @@
|
||||
const edge = { plan: { elements: [{ type: 'icon', iconId: 'x', x: 585, y: 300, w: 30, h: 30 }] } };
|
||||
return { generated: this.run({ plan }).pass !== undefined, edge: this.run(edge).risky.length };
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
id: 'avatar-safe-zone',
|
||||
name: '头像安全区',
|
||||
category: 'layout',
|
||||
emoji: '⭕',
|
||||
scene: '头像导出前的圆/方裁切安全检查(微信/QQ/抖音等平台多为圆形裁切)',
|
||||
summary: '圆形裁切时主体直径占画布 62%-78% 最稳(平台会裁掉四角),方形 70%-88%;主体中心偏移不得超过留白的一半,否则裁切后偏边。',
|
||||
params: [
|
||||
{ name: 'crop', type: 'string', required: false, desc: "裁切形状:'circle' 圆形(默认)/ 'square' 方形" },
|
||||
{ name: 'subjectRatio', type: 'number', required: false, desc: '主体直径占画布比例(默认 0.7)' },
|
||||
{ name: 'size', type: 'number', required: false, desc: '画布边长 px(默认 300)' },
|
||||
{ name: 'offset', type: 'object', required: false, desc: '主体中心相对画布中心偏移 {x,y}(px)' }
|
||||
],
|
||||
source: '自研(平台头像裁切规范:圆形内切 + 留白安全域)',
|
||||
workspaces: ['avatar'],
|
||||
run: function (args) {
|
||||
const crop = (args.crop === 'square') ? 'square' : 'circle';
|
||||
const ratio = Number(args.subjectRatio) || 0.7;
|
||||
const size = Number(args.size) || 300;
|
||||
const off = args.offset || { x: 0, y: 0 };
|
||||
const dx = Number(off.x) || 0;
|
||||
const dy = Number(off.y) || 0;
|
||||
const range = crop === 'circle' ? [0.62, 0.78] : [0.7, 0.88];
|
||||
const pad = size * (1 - ratio) / 2;
|
||||
const tips = [];
|
||||
if (ratio > range[1]) tips.push('主体占比 ' + Math.round(ratio * 100) + '% 偏大(建议 ≤' + Math.round(range[1] * 100) + '%),' + (crop === 'circle' ? '圆形裁切会切到主体边缘' : '导出后显拥挤'));
|
||||
if (ratio < range[0]) tips.push('主体占比 ' + Math.round(ratio * 100) + '% 偏小(建议 ≥' + Math.round(range[0] * 100) + '%),头像缩小后辨识度不足');
|
||||
const maxOff = pad * 0.5;
|
||||
if (Math.abs(dx) > maxOff || Math.abs(dy) > maxOff) {
|
||||
tips.push('主体中心偏移 (x' + Math.round(dx) + ', y' + Math.round(dy) + ') 超过安全留白的一半(±' + Math.round(maxOff) + 'px),裁切后偏边');
|
||||
}
|
||||
if (crop === 'circle' && ratio > 0.78) tips.push('圆形裁切的安全直径约为画布的 100%,但视觉留白建议保留 12% 以上');
|
||||
return {
|
||||
pass: tips.length === 0,
|
||||
crop, subjectRatio: ratio, size, offset: { x: dx, y: dy }, safeRange: range, padding: Math.round(pad),
|
||||
verdict: tips.length ? tips.join(';') : crop === 'circle' ? '主体在圆形裁切安全区内,四角留白充足' : '主体比例与居中位置符合方形头像规范',
|
||||
suggest: tips.length ? '建议把主体缩放到画布 ' + Math.round((range[0] + range[1]) / 2 * 100) + '% 并居中' : '无需调整'
|
||||
};
|
||||
},
|
||||
test: function () {
|
||||
const good = this.run({ crop: 'circle', subjectRatio: 0.7, size: 300, offset: { x: 0, y: 0 } });
|
||||
const big = this.run({ crop: 'circle', subjectRatio: 0.95, size: 300 });
|
||||
const off = this.run({ crop: 'square', subjectRatio: 0.75, size: 300, offset: { x: 60, y: 0 } });
|
||||
return { good: good.pass, bigFails: big.pass === false, offsetFails: off.pass === false };
|
||||
}
|
||||
}
|
||||
]);
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user