Class: Fontisan::Models::Audit::CodepointRange
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Fontisan::Models::Audit::CodepointRange
- Defined in:
- lib/fontisan/models/audit/codepoint_range.rb
Overview
A contiguous run of covered codepoints.
first_cp/last_cp are inclusive integer endpoints. A single-codepoint
"range" has first_cp == last_cp and renders as U+XXXX (no dash).
Produced by Audit::CodepointRangeCoalescer from the cmap coverage. The range view replaces the previous flat per-codepoint list as the default report shape — a 60k-codepoint CJK font produces tens of ranges rather than 60k strings.
Instance Method Summary collapse
-
#to_s ⇒ String
Human-readable form:
U+XXXXfor single codepoints,U+XXXX-U+XXXXfor true ranges.
Instance Method Details
#to_s ⇒ String
Human-readable form: U+XXXX for single codepoints,
U+XXXX-U+XXXX for true ranges.
30 31 32 33 34 35 36 |
# File 'lib/fontisan/models/audit/codepoint_range.rb', line 30 def to_s if first_cp == last_cp format("U+%04<cp>X", cp: first_cp) else format("U+%04<first>X-U+%04<last>X", first: first_cp, last: last_cp) end end |