RegexContainer

按字符规则与字体 ID 查找字形宽度,供文本对齐使用。 Looks up glyph widths by character rule and font ID for text alignment.

Functions

Link copied to clipboard
open fun add(value: RegexEntity)

追加一个实体。 / Appends an entity.

Link copied to clipboard
open override fun clear()

清空容器。 / Clears the registry.

Link copied to clipboard

返回当前实体列表的快照。 / Returns a snapshot of the current entries.

Link copied to clipboard

查找匹配字符的规则;若无匹配则尝试默认规则。 Finds a rule for the character, falling back to the default rule.

按 ID 查找规则;不存在时返回 null。 Looks up a rule by ID, returning null when absent.

Link copied to clipboard
fun getWidth(char: Char, fontId: String? = null): Int

获取指定字体下的字符宽度并缓存结果。 Gets and caches the character width for the selected font.