Class: Ucode::Glyphs::RealFonts::Block

Inherits:
Struct
  • Object
show all
Defined in:
lib/ucode/glyphs/real_fonts/unicode_17_blocks.rb

Overview

The new blocks introduced by Unicode 17.0 that this audit cares about. Each block carries its explicit assigned-codepoint ranges.

Sources (in priority order):

1. Unicode 17.0 `Blocks.txt` — block name + first/last cp.
2. Per-block code-chart legend on unicode.org — published
   assigned-codepoint count.
3. Direct inspection of a known-good font (fontisan audit)
   — confirms at least the assigned count when a font has
   100% coverage.

Where the chart legend publishes an assigned count but not the exact ranges, we approximate by extending from the block’s first codepoint up to the count. This may mis-attribute a few reserved slots in the middle of a block as “assigned”; the ‘missing_cps` list then over-reports by those slots. Refining to exact ranges is a follow-up once UCD 17.0 text files are integrated into the ucode dataset.

Block names match the verbatim UCD block name (‘Blocks.txt` field 2) — never slugified.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#assigned_rangesObject

Returns the value of attribute assigned_ranges

Returns:

  • (Object)

    the current value of assigned_ranges



28
29
30
# File 'lib/ucode/glyphs/real_fonts/unicode_17_blocks.rb', line 28

def assigned_ranges
  @assigned_ranges
end

#first_cpObject

Returns the value of attribute first_cp

Returns:

  • (Object)

    the current value of first_cp



28
29
30
# File 'lib/ucode/glyphs/real_fonts/unicode_17_blocks.rb', line 28

def first_cp
  @first_cp
end

#last_cpObject

Returns the value of attribute last_cp

Returns:

  • (Object)

    the current value of last_cp



28
29
30
# File 'lib/ucode/glyphs/real_fonts/unicode_17_blocks.rb', line 28

def last_cp
  @last_cp
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



28
29
30
# File 'lib/ucode/glyphs/real_fonts/unicode_17_blocks.rb', line 28

def name
  @name
end

Instance Method Details

#covers?(codepoint) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/ucode/glyphs/real_fonts/unicode_17_blocks.rb', line 30

def covers?(codepoint)
  codepoint.between?(first_cp, last_cp)
end