feat(rules): 建立共享排版契约并收束 WebKit 与 Unicode 基线
This commit is contained in:
Vendored
+15
-4
@@ -1,15 +1,26 @@
|
||||
import type { FeatureLevel, ResolvedOptions } from "../types.js";
|
||||
/** 邏輯 run 中之單一字元來源位置。 */
|
||||
/** 邏輯 run 中之單一 base+optional-VS 來源 UTF-16 位置。 */
|
||||
export interface CharPos {
|
||||
textNode: Text;
|
||||
offset: number;
|
||||
}
|
||||
/** 一段邏輯文本:剝離樣式後之連續字元,及其逐字回映射。 */
|
||||
/** 邏輯字元在單一 Text 節點內之 UTF-16 區間。 */
|
||||
export interface TextSpan {
|
||||
textNode: Text;
|
||||
start: number;
|
||||
end: number;
|
||||
}
|
||||
/** 邏輯字元之完整 DOM 來源跨度;base 與 VS 可分居多個 Text 節點。 */
|
||||
export interface CharSpan {
|
||||
text: string;
|
||||
parts: TextSpan[];
|
||||
}
|
||||
/** 一段邏輯文本:剝離樣式後之連續字元,及其逐邏輯字元回映射。 */
|
||||
export interface LogicalRun {
|
||||
text: string;
|
||||
map: CharPos[];
|
||||
map: CharSpan[];
|
||||
}
|
||||
/** pill 鄰接之邏輯鄰字。 */
|
||||
/** pill 鄰接之邏輯鄰字(base+optional-VS)。 */
|
||||
export interface AdjacentChar {
|
||||
textNode: Text;
|
||||
offset: number;
|
||||
|
||||
Reference in New Issue
Block a user