RegexEntity

data class RegexEntity(val regex: String? = null, val width: Int = 0, val fontWidths: Map<String, Int> = emptyMap())(source)

字符宽度规则:通过正则表达式匹配字符,可按字体覆盖宽度。 Character-width rule matching a regex, with optional per-font width overrides.

Constructors

Link copied to clipboard
constructor(regex: String? = null, width: Int = 0, fontWidths: Map<String, Int> = emptyMap())

Properties

Link copied to clipboard
@SerializedName(value = "font-widths")
val fontWidths: Map<String, Int>
Link copied to clipboard
lateinit var id: String
Link copied to clipboard
Link copied to clipboard
val width: Int

Functions

Link copied to clipboard
fun getWidth(fontId: String?): Int

优先返回字体专用宽度,否则返回通用宽度。 Returns a font-specific width when defined, otherwise the general width.

Link copied to clipboard
fun match(char: Char): Boolean

判断当前字符是否完整匹配此规则。 Checks whether the character fully matches this rule.