5b9c6b5fa1
下游回饋之字型樹需求。決策:字型屬消費端領域,聚珍不應內建字型堆疊(原 _lang.css
之 Noto 後備係越權,且曾蓋掉消費端字型釀 bug)。採「完全移除、交消費端 CSS」(A 案),
否決「以參數管字型」(B 案——JS 管字型須注入 CSS、違反 JS 注入結構/CSS 給視覺之分工;
而缺 halt 字型須逐字型微調 margin 之指引,由既有 jiya.halfWidth/jiya.bias +文檔承擔)。
移除:
- 刪 src/css/_lang.css,juzhen.css 移除其 @import。dist/juzhen.css 現零 font-family
規則(3.1→2.5kb)。
聚珍保留之三項非管理性本分(確保不礙消費端字型與 locl):
- _normalize.css `jz-* { font: inherit }`:原子繼承消費端字型、不強加。
- _jiya.css 半形 font-feature-settings 顯式改 "locl" 1, "halt" 1(預設+halt-island 兩
處):確保泛 CJK 字型(思源/Noto CJK)之地域標點字形不因設 halt 而失。
- render 只讀不改 lang。body 文本之 locl 全由消費端字型+正確 lang 決定。
驗證(真實 Chromium):
- halt 模式:消費端逐 lang 字型生效並繼承至 jz-inner,無強制 Noto。
- margin 後備:半形盒 0.5em、字身依墨色偏側位移正確、jz-inner 繼承消費端字型、
feature normal(locl 既定開),皆不受字型移除影響。
- demo/index.html、resize-check.html 改示範「消費端逐 lang 設 font-family」之推薦範式;
fallback.html 更新註解。
- README 新增「字型與 locl」節+改寫 CSS 基礎設定字型項;ARCHITECTURE §6.9 改寫
(A 案決策、否決 B 案、三項本分)+檔案樹。
- test:新增 CSS 回歸(不內建 font-family、半形保留 locl)。57 測試通過。
- dist/ 重建(僅 juzhen.css 變動,JS 不變)。
100 lines
2.5 KiB
CSS
100 lines
2.5 KiB
CSS
/* src/css/_normalize.css */
|
|
@supports (text-autospace: no-autospace) {
|
|
.juzhen {
|
|
text-autospace: no-autospace;
|
|
}
|
|
}
|
|
jz-char,
|
|
jz-inner,
|
|
jz-hws,
|
|
jz-cs,
|
|
jz-jinze,
|
|
jz-em {
|
|
font: inherit;
|
|
color: inherit;
|
|
text-indent: 0;
|
|
hanging-punctuation: none;
|
|
}
|
|
jz-char,
|
|
jz-jinze {
|
|
text-decoration: inherit;
|
|
}
|
|
|
|
/* src/css/_spacing.css */
|
|
jz-hws {
|
|
margin-right: 0.25em;
|
|
}
|
|
jz-hws.jz-hws-trim {
|
|
margin-right: 0;
|
|
}
|
|
|
|
/* src/css/_jiya.css */
|
|
jz-char {
|
|
display: inline-block;
|
|
vertical-align: baseline;
|
|
}
|
|
jz-inner {
|
|
display: inline;
|
|
}
|
|
[data-jz-atoms=inline] jz-char {
|
|
display: inline;
|
|
}
|
|
jz-char.jz-half jz-inner,
|
|
jz-char.jz-half-le jz-inner {
|
|
font-feature-settings: "locl" 1, "halt" 1;
|
|
-webkit-font-feature-settings: "locl" 1, "halt" 1;
|
|
}
|
|
[data-jz-halfwidth=margin] jz-char.jz-half jz-inner,
|
|
[data-jz-halfwidth=margin] jz-char.jz-half-le jz-inner {
|
|
font-feature-settings: normal;
|
|
-webkit-font-feature-settings: normal;
|
|
}
|
|
[data-jz-halfwidth=margin] jz-char.jz-half.jz-ink-left,
|
|
[data-jz-halfwidth=margin] jz-char.jz-half.jz-ink-center,
|
|
[data-jz-halfwidth=margin] jz-char.jz-half.jz-ink-right,
|
|
[data-jz-halfwidth=margin] jz-char.jz-half-le.jz-ink-left,
|
|
[data-jz-halfwidth=margin] jz-char.jz-half-le.jz-ink-center,
|
|
[data-jz-halfwidth=margin] jz-char.jz-half-le.jz-ink-right {
|
|
width: 0.5em;
|
|
overflow: visible;
|
|
}
|
|
[data-jz-halfwidth=margin] jz-char.jz-half.jz-ink-left jz-inner,
|
|
[data-jz-halfwidth=margin] jz-char.jz-half.jz-ink-center jz-inner,
|
|
[data-jz-halfwidth=margin] jz-char.jz-half.jz-ink-right jz-inner,
|
|
[data-jz-halfwidth=margin] jz-char.jz-half-le.jz-ink-left jz-inner,
|
|
[data-jz-halfwidth=margin] jz-char.jz-half-le.jz-ink-center jz-inner,
|
|
[data-jz-halfwidth=margin] jz-char.jz-half-le.jz-ink-right jz-inner {
|
|
display: inline-block;
|
|
}
|
|
[data-jz-halfwidth=margin] jz-char.jz-ink-center jz-inner {
|
|
margin-left: -0.25em;
|
|
}
|
|
[data-jz-halfwidth=margin] jz-char.jz-ink-right jz-inner {
|
|
margin-left: -0.5em;
|
|
}
|
|
[data-jz-halfwidth=margin] jz-char jz-inner {
|
|
text-decoration: inherit;
|
|
}
|
|
[data-jz-halfwidth=halt] jz-char.jz-half jz-inner,
|
|
[data-jz-halfwidth=halt] jz-char.jz-half-le jz-inner {
|
|
font-feature-settings: "locl" 1, "halt" 1;
|
|
-webkit-font-feature-settings: "locl" 1, "halt" 1;
|
|
margin-left: 0;
|
|
}
|
|
[data-jz-halfwidth=halt] jz-char.jz-half,
|
|
[data-jz-halfwidth=halt] jz-char.jz-half-le {
|
|
width: auto;
|
|
}
|
|
|
|
/* src/css/_jinze.css */
|
|
jz-jinze {
|
|
display: inline-block;
|
|
white-space: nowrap;
|
|
vertical-align: baseline;
|
|
}
|
|
[data-jz-atoms=inline] jz-jinze {
|
|
display: inline;
|
|
}
|
|
|
|
/* src/css/juzhen.css */
|