04f2b25e4c
行端 lineedge 升級為可配模式(squeeze|hang|none),抽出共用行端標點偵測; squeeze(現有行端半形)保留並修正「行歸屬判定」bug:jz-char 為 inline-block,其行盒 top 與相鄰純文本字形 top 因基線差約 5px、遠小於行高卻超舊容差(EPS=4px),致同行誤判 為下一行;改判「垂直區間」(下一行=b.top≥a.bottom、上一行=b.bottom≤a.top,容 2px)。 標點懸掛 hang 模式經 headless + 真實瀏覽器實測**確認不可行、全面停用**(純負 margin): 1. 句號墨色偏框左下,安全凸出量(<1em)只推出空白半框、墨色仍在版心內(視覺不懸掛); 2. 凸出滿 1em 釋放一整字寬、把下一字拉上本行致重疊; 3. 與 inline-block 對齊原子互斥(justifyAtoms:true 下 margin 被 justify 吸收); 4. ResizeObserver 重排時兩階段標記錯亂。 真正的解為原生 hanging-punctuation,惟 Chrome 不支援、且與本庫原子結構衝突。 **三重防逃逸**(下游以任何方式皆無法啟用):① index 鎖 lineEnd:"squeeze"(忽略 hanging 選項);② lineedge.modeForChar 無條件降 squeeze;③ applyEdge 之 HANG_ENABLED=false 總開關。 hang 之 lineedge 程式碼、CSS(jz-hang-*)、LineEndMode 型別保留休眠,俟原生支援再議。 hanging 選項仍被接受(API 相容)但無效果。 單元測試 90 通過,含防逃逸覆蓋(hanging:true/data-juzhen/blocks 各路徑皆不產生 jz-hang-*)。
115 lines
2.8 KiB
CSS
115 lines
2.8 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;
|
|
}
|
|
jz-char.bd-stop.jz-hang-r,
|
|
jz-char.bd-pause.jz-hang-r {
|
|
margin-right: calc(-1 * var(--jz-hang-stop, 0.5em));
|
|
}
|
|
jz-char.bd-close.jz-hang-r {
|
|
margin-right: calc(-1 * var(--jz-hang-bracket, 0.5em));
|
|
}
|
|
jz-char.bd-open.jz-hang-l {
|
|
margin-left: calc(-1 * var(--jz-hang-bracket, 0.5em));
|
|
}
|
|
|
|
/* 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/_orphan.css */
|
|
jz-orphan {
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* src/css/juzhen.css */
|