abstract class
Tessell::Text::Measurer
- Tessell::Text::Measurer
- Reference
- Object
Overview
文本测量抽象。真实实现(M2 FreeType/HarfBuzz)不得引用本文件
Direct Known Subclasses
Defined in:
tessell/text/measurer.crInstance Method Summary
-
#font_metrics(font_id : Int32, size : Float32) : FontMetrics
字体度量(issue #6):默认按比例桩值;真实实现应读 FT size metrics。
-
#measure(text : String, font_id : Int32, size : Float32, max_width : Float32) : Size
主接口:按文本内容、字体、字号、可用宽测量
-
#measure(key : MeasureKey) : Size
可选接口:按缓存键测量,内部使用;默认未实现
-
#shape_run(text : String, font_id : Int32, size : Float32) : ShapeRun | Nil
可选接口(issue #56 L2):宽度无关 shaping——advance 序列与行高。 返回 nil 表示不支持(CachingMeasurer 退回全量 measure 路径)。
Instance Method Detail
def font_metrics(font_id : Int32, size : Float32) : FontMetrics
#
字体度量(issue #6):默认按比例桩值;真实实现应读 FT size metrics。
主接口:按文本内容、字体、字号、可用宽测量
可选接口(issue #56 L2):宽度无关 shaping——advance 序列与行高。 返回 nil 表示不支持(CachingMeasurer 退回全量 measure 路径)。