BRAND-MANUAL.md 收敛识别方案裁定与实测判据;TOKEN-MIGRATION.md 记 P1/P3/P4 迁移面与孪生缺陷; TEST-PATCH.md 记 P7 的 1→0 实测。随包入库的是结论赖以成立的仪器与证据:check-assets、check-manual、 verify-assets-cross、check-wordmark-copies、check-docsync、check-probes(四段闸,每段带能失败的负例)、 check-baseline-shift.cjs(平移感知基线判据,四合成样本两绿两红自测通过;它取代被证伪的 「diff 包围盒不许越页眉带」)与 measured/baseline-shift-p1.json(第一批 104 张逐张分类,带 _src 出处戳)。 大体积工作件不入库:样机 HTML 与栅格截图 100+MB、字体母版 45MB 留在盘上,入库 690 个文本/矢量件。
263 lines
13 KiB
Python
263 lines
13 KiB
Python
#!/usr/bin/env python3
|
||
# -*- coding: utf-8 -*-
|
||
"""
|
||
入围两只正面对比:E1 一相圆 vs N5 竹简
|
||
|
||
用户裁定:暂定 E1 与 N5 两只,其余出局。
|
||
本页只做一件事——把这两只放到完全相同的条件与相同的情境里,
|
||
让最后一票能凭看得见的东西投,而不是凭谁的解释更漂亮。
|
||
|
||
同一条件:书法字标 path 原样 + NOVALON 居中锚定(210.27)+ 符号包络 x12..96.3、
|
||
顶底对齐字标块 y20.93..105 + 朱砂 #C41E3A + viewBox 480×120(4:1)。
|
||
|
||
N5 侧收录两个形态:
|
||
N5-a 定稿矩形(你选中的那一版,缝 6 / 绳区 7)
|
||
N5-b 一笔册(笔势化四版里唯一眼睛认账的:简片通高矩形 + 编绳改一道横画)
|
||
※ 悬针/垂露/竹节三版虽部分指标更好,但"不像竹简了",已按视觉否决,不入此表。
|
||
"""
|
||
import importlib.util
|
||
import os
|
||
|
||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||
|
||
|
||
def load(name, path):
|
||
sp = importlib.util.spec_from_file_location(name, path)
|
||
m = importlib.util.module_from_spec(sp)
|
||
sp.loader.exec_module(m)
|
||
return m
|
||
|
||
|
||
ms = load("ms", os.path.join(HERE, "mark-swap.py"))
|
||
n5 = load("n5", os.path.join(HERE, "n5-refine.py"))
|
||
en = load("en", os.path.join(HERE, "enso-refine.py"))
|
||
br = load("br", os.path.join(HERE, "n5-brush.py"))
|
||
|
||
RED, INK, WHITE = n5.RED, n5.INK, n5.WHITE
|
||
|
||
# E1 定档:F2 笔势 + 不圆,开口 270°(正上,笔提起处)
|
||
Sweep = 320.0
|
||
End = 270.0 + (360.0 - Sweep) / 2.0
|
||
E1_BODY = en.enso(prof=en.BRUSH, ecc=0.028, ephi=24.0, theta0=End - Sweep, sweep=Sweep)
|
||
|
||
CANDS = [
|
||
dict(id="E1", nm="一相圆", body=lambda: E1_BODY,
|
||
lineage="beauty.py E1 → enso-refine F2(笔势曲线 + 2.8% 偏圆)→ 开口 270°",
|
||
read="一枚提笔未合的圆相。缺口在正上,是「笔提起来」的位置,不是字母 C 的位置。",
|
||
say="包容 / 系统 / 周而复始;也暗合「智连」",
|
||
risk=["读成字母 O 或一个没画完的圈——需要一次解释",
|
||
"与「技术咨询」的语义连接最弱,靠气质而非含义",
|
||
"尖尾在 16px 会先消失,退化成一枚细环"]),
|
||
dict(id="N5-a", nm="竹简 · 定稿", body=lambda: n5.V1,
|
||
lineage="marks-b2 N5(4 片 · 缝 6 · 绳区 7 纯空隙),你选中的那一版",
|
||
read="四片朱简,一道编绳的空。安静、端正、一看就是「写东西的东西」。",
|
||
say="记录 / 册籍 / 可审计的交付",
|
||
risk=["16px 实测四片并成一块(段数 1)⇒ favicon 必须另出三片版",
|
||
"与通用「列表图标」只差一步,独占性靠比例撑",
|
||
"墨量 70.9%,是书法块的近 4 倍,深底小尺寸时会显得比字重"]),
|
||
]
|
||
|
||
|
||
def lockup(mark, h, color=INK):
|
||
return ('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 120" '
|
||
'style="height:%dpx;width:auto;display:block;color:%s" role="img" '
|
||
'aria-label="睿新致远 NOVALON">%s%s</svg>' % (h, color, mark, n5.wordmark_fixed(color)))
|
||
|
||
|
||
def mark_only(mark, px):
|
||
return ('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 108 120" '
|
||
'style="height:%dpx;width:auto;display:block">%s</svg>' % (px, mark))
|
||
|
||
|
||
CSS = ms.CSS + """
|
||
.hd{display:grid;grid-template-columns:200px 1fr 1fr 1fr;border-bottom:1px solid var(--hair)}
|
||
.hd>div{padding:12px 16px;border-left:1px solid var(--hair);font-family:'PingFang SC',serif;font-size:13px}
|
||
.hd>div:first-child{border-left:0;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;
|
||
color:var(--muted);font-family:'Geist',sans-serif}
|
||
.hd .who{font-weight:700;font-size:14px}
|
||
.hd .who .id{color:var(--red);font-size:11px;letter-spacing:.1em;margin-right:6px}
|
||
.ctx{padding:14px 16px;display:flex;align-items:center;justify-content:center;border-left:1px solid var(--hair)}
|
||
.ctx.dark{background:var(--ink)}
|
||
.ctx.mist{background:var(--mist)}
|
||
.ctx.red{background:#C41E3A}
|
||
.lab{font-family:'PingFang SC',serif;font-size:12.5px;color:var(--muted);padding:12px 16px}
|
||
"""
|
||
|
||
JS = """
|
||
<script>
|
||
const RED=[196,30,58],WHITE=[255,255,255],INK=[10,14,20];
|
||
const D=(a,b)=>Math.hypot(a[0]-b[0],a[1]-b[1],a[2]-b[2]);
|
||
function raster(el,size){
|
||
const c=el.cloneNode(true);c.setAttribute('width',size);c.setAttribute('height',size);
|
||
c.removeAttribute('style');
|
||
const url='data:image/svg+xml;charset=utf-8,'+encodeURIComponent(new XMLSerializer().serializeToString(c));
|
||
return new Promise(res=>{const im=new Image();im.onload=()=>{
|
||
const cv=document.createElement('canvas');cv.width=cv.height=size;
|
||
const x=cv.getContext('2d');x.fillStyle='#fff';x.fillRect(0,0,size,size);
|
||
x.drawImage(im,0,0,size,size);res(x.getImageData(0,0,size,size));};
|
||
im.onerror=()=>res(null);im.src=url;});
|
||
}
|
||
async function stats(el,size){
|
||
const im=await raster(el,size); if(!im) return null;
|
||
const d=im.data,W=im.width,H=im.height;
|
||
let best=0,inked=0,minx=W,maxx=0,miny=H,maxy=0;
|
||
for(let y=0;y<H;y++){let n=0,on=false;
|
||
for(let x=0;x<W;x++){const i=(y*W+x)*4,a=d[i+3],p=[d[i],d[i+1],d[i+2]];
|
||
const ink=a>=40&&D(p,WHITE)>=110, r=ink&&D(p,RED)<D(p,INK);
|
||
if(r&&!on){n++;on=true;}else if(!r)on=false;
|
||
if(ink){inked++;if(x<minx)minx=x;if(x>maxx)maxx=x;if(y<miny)miny=y;if(y>maxy)maxy=y;}}
|
||
if(n>best)best=n;}
|
||
return {runs:best,density:inked/(((maxx-minx+1)*(maxy-miny+1))||1)};
|
||
}
|
||
(async()=>{
|
||
const out={};
|
||
for(const el of document.querySelectorAll('svg[data-src]')){
|
||
const k=el.getAttribute('data-src');out[k]={};
|
||
for(const S of [16,24,32]) out[k][S]=await stats(el,S);
|
||
out[k].d=await stats(el,512);
|
||
}
|
||
document.querySelectorAll('[data-m]').forEach(td=>{
|
||
const [k,f]=td.getAttribute('data-m').split('@'); const o=out[k]; if(!o) return;
|
||
if(f==='d'&&o.d) td.textContent=(o.d.density*100).toFixed(1)+'%';
|
||
if(f==='r16'&&o[16]) td.textContent=o[16].runs;
|
||
if(f==='r32'&&o[32]) td.textContent=o[32].runs;
|
||
if(f==='r24'&&o[24]) td.textContent=o[24].runs;
|
||
});
|
||
window.__sl=out;
|
||
})();
|
||
</script>
|
||
"""
|
||
|
||
|
||
def build():
|
||
P = []
|
||
w = P.append
|
||
w('<!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8">'
|
||
'<meta name="viewport" content="width=device-width,initial-scale=1">'
|
||
'<title>入围两只 · E1 一相圆 vs N5 竹简 · 2026-10-13</title>')
|
||
w('<style>' + CSS.replace("__GEIST__", ms.GEIST_B64) + '</style></head><body><div class="wrap">')
|
||
w('<header class="top"><div class="eyebrow">Shortlist · 2026-10-13 · 评审稿(repo 零改动)</div>')
|
||
w('<h1>入围两只:<em>E1 一相圆 vs N5 竹简(定稿)</em></h1>')
|
||
w('<p class="lede">其余全部出局。这两只放在完全相同的条件下——同一份书法 path、'
|
||
'同一个居中的 NOVALON、同一包络、同顶底对齐、同一朱砂、同 4:1 画布——'
|
||
'在六个真实情境里并排一次,让最后一票凭眼睛投。</p></header>')
|
||
|
||
# 表头
|
||
w('<div class="hd"><div>情境</div>')
|
||
for c in CANDS:
|
||
w('<div><span class="who"><span class="id">%s</span>%s</span></div>' % (c["id"], c["nm"]))
|
||
w('</div>')
|
||
|
||
def row(label, cell, cls=""):
|
||
w('<div class="hd" style="border-top:0"><div class="lab">%s</div>' % label)
|
||
for c in CANDS:
|
||
w('<div class="ctx %s">%s</div>' % (cls, cell(c)))
|
||
w('</div>')
|
||
|
||
row("主标识 · 浅底 96px", lambda c: lockup(c["body"](), 96))
|
||
row("header 40px(md:h-10)", lambda c: lockup(c["body"](), 40))
|
||
row("header 32px(移动 h-8)", lambda c: lockup(c["body"](), 32))
|
||
row("深色 Hero · 白字版", lambda c: lockup(c["body"](), 40, WHITE), "dark")
|
||
row("单色落款(全墨)",
|
||
lambda c: lockup(c["body"]().replace('fill="%s"' % RED, 'fill="%s"' % INK), 40))
|
||
row("朱底反白",
|
||
# 字标已被替换成显式色,此处必须直接用 WHITE 重建 lockup,
|
||
# 不能再 replace('currentColor')(会静默失效,导致黑字压红底)
|
||
lambda c: lockup(c["body"]().replace('fill="%s"' % RED, 'fill="%s"' % WHITE), 40, WHITE),
|
||
"red")
|
||
row("符号 48px", lambda c: mark_only(c["body"](), 48), "mist")
|
||
row("符号 32px", lambda c: mark_only(c["body"](), 32), "mist")
|
||
row("符号 16px(favicon 临界)", lambda c: mark_only(c["body"](), 16), "mist")
|
||
|
||
# 量测
|
||
w('<section class="band" style="padding-top:34px"><h2 class="band">量测(页内实测)</h2>')
|
||
w('<table><thead><tr><th>候选</th><th>墨量密度</th><th>16px 段数</th><th>24px</th>'
|
||
'<th>32px</th><th>小尺寸结论</th></tr></thead><tbody>')
|
||
for c in CANDS:
|
||
w('<tr><td><b>%s %s</b></td><td class="n" data-m="%s@d">…</td>'
|
||
'<td class="n" data-m="%s@r16">…</td><td class="n" data-m="%s@r24">…</td>'
|
||
'<td class="n" data-m="%s@r32">…</td>'
|
||
'<td class="small">%s</td></tr>'
|
||
% (c["id"], c["nm"], c["id"], c["id"], c["id"], c["id"],
|
||
{"E1": "环是连续形,缝隙消失也不会读错",
|
||
"N5-a": "16px 并成一块 ⇒ 必须另出三片版",
|
||
}[c["id"]]))
|
||
w('</tbody></table>')
|
||
w('<p class="small">口径同前几轮:密度=非白像素 ÷ ink 包围盒(512 栅格);'
|
||
'段数=真栅格化后逐行红色行程取最大值(ΔE(白)≥110)。书法块密度 18.2%。</p>')
|
||
w('</section>')
|
||
|
||
# 各自的说辞与风险
|
||
w('<section class="band"><h2 class="band">各自说什么、赌什么</h2>')
|
||
for c in CANDS:
|
||
w('<div class="hd" style="border-top:1px solid var(--hair)"><div class="lab">'
|
||
'<b>%s %s</b><br><span class="small">%s</span></div>' % (c["id"], c["nm"], c["lineage"]))
|
||
w('<div style="grid-column:span 3;padding:14px 18px;border-left:1px solid var(--hair)">'
|
||
'<p style="margin:0 0 6px;font-family:PingFang SC,serif;font-size:13.5px">%s</p>' % c["read"])
|
||
w('<p style="margin:0 0 8px;font-family:PingFang SC,serif;font-size:13px">'
|
||
'<b>语义</b>:%s</p>' % c["say"])
|
||
w('<ul style="margin:0;font-size:13px">')
|
||
for r in c["risk"]:
|
||
w('<li>%s</li>' % r)
|
||
w('</ul></div></div>')
|
||
w('</section>')
|
||
|
||
w('<section class="band"><h2 class="band">投之前要知道的三件事</h2><ol>')
|
||
for li in [
|
||
'<b>这两只不是同一类东西。</b>E1 是<b>纯符号</b>——它不指向任何具体器物,'
|
||
'靠气质工作,所以别人抄不走,但也"什么都没说",需要品牌故事去喂。'
|
||
'N5 是<b>有指涉的符号</b>——一看就是简册,自带"记录/可审计"的含义,'
|
||
'代价是它离通用列表图标只有一步。',
|
||
'<b>小尺寸上 E1 结构性占优。</b>环是连续形,缝隙消失仍是一枚环;'
|
||
'竹简一旦缝隙消失就成一块红方。N5 要上 favicon 必须另出三片版,'
|
||
'这是它已知的、你已接受的代价。',
|
||
'<b>最后 5% 两只都还没拿到。</b>都是程序生成的规则轮廓。'
|
||
'真到落地,E1 需要手工描笔锋与飞白,N5 需要手工修竹片的微差不齐——'
|
||
'这一步不做,无论选哪只都会停在"很好"。',
|
||
]:
|
||
w('<li>%s</li>' % li)
|
||
w('</ol></section>')
|
||
|
||
w('<div style="position:absolute;width:0;height:0;overflow:hidden" aria-hidden="true">')
|
||
for c in CANDS:
|
||
w('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 108 120" data-src="%s">%s</svg>'
|
||
% (c["id"], c["body"]()))
|
||
w('</div>')
|
||
w(JS)
|
||
w('<footer>生成器 <code>shortlist.py</code> · 汇总 beauty / enso-refine / n5-refine / n5-brush '
|
||
'四份脚本的成果 · 全部复用同一份 <code>public/logo.svg</code> 字标 path</footer>')
|
||
w('</div></body></html>')
|
||
return "".join(P)
|
||
|
||
|
||
def export():
|
||
d = os.path.join(HERE, "assets-shortlist")
|
||
os.makedirs(d, exist_ok=True)
|
||
for c in CANDS:
|
||
body = c["body"]()
|
||
open(os.path.join(d, "%s-logo.svg" % c["id"]), "w", encoding="utf-8").write(
|
||
'<?xml version="1.0" encoding="UTF-8"?>\n<svg xmlns="http://www.w3.org/2000/svg" '
|
||
'viewBox="0 0 480 120" width="480" height="120" role="img" '
|
||
'aria-label="睿新致远 NOVALON">%s%s</svg>\n' % (body, n5.wordmark_fixed(INK)))
|
||
open(os.path.join(d, "%s-logo-white.svg" % c["id"]), "w", encoding="utf-8").write(
|
||
'<?xml version="1.0" encoding="UTF-8"?>\n<svg xmlns="http://www.w3.org/2000/svg" '
|
||
'viewBox="0 0 480 120" width="480" height="120" role="img" '
|
||
'aria-label="睿新致远 NOVALON">%s%s</svg>\n' % (body, n5.wordmark_fixed(WHITE)))
|
||
open(os.path.join(d, "%s-mark.svg" % c["id"]), "w", encoding="utf-8").write(
|
||
'<?xml version="1.0" encoding="UTF-8"?>\n<svg xmlns="http://www.w3.org/2000/svg" '
|
||
'viewBox="0 0 108 120" width="108" height="120" role="img" '
|
||
'aria-label="睿新致远">%s</svg>\n' % body)
|
||
print("assets-shortlist/ →", len(os.listdir(d)), "个文件")
|
||
|
||
|
||
def main():
|
||
path = os.path.join(HERE, "shortlist.html")
|
||
with open(path, "w", encoding="utf-8") as f:
|
||
f.write(build())
|
||
print("shortlist.html %s B" % f"{os.path.getsize(path):,}")
|
||
export()
|
||
|
||
|
||
if __name__ == "__main__":
|
||
main()
|