Class: Ucode::Glyphs::RealFonts::BlockCoverage

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/ucode/glyphs/real_fonts/block_coverage.rb

Overview

Per-block coverage row on a FontCoverageReport.

‘assigned` is the UCD-assigned codepoint count for this block (from Unicode17Blocks); `covered` is the count actually present in the font’s cmap; ‘missing_cps` is the human-readable hex form (`U+XXXX`) of every assigned codepoint the font lacks, so a downstream consumer can audit gaps without re-walking the cmap.

Instance Method Summary collapse

Instance Method Details

#complete?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/ucode/glyphs/real_fonts/block_coverage.rb', line 39

def complete?
  assigned.to_i.positive? && covered == assigned
end

#fill_ratioObject



33
34
35
36
37
# File 'lib/ucode/glyphs/real_fonts/block_coverage.rb', line 33

def fill_ratio
  return 0.0 if assigned.nil? || assigned.zero?

  (covered.to_f / assigned).round(4)
end