Class: Fontisan::Commands::AuditCommand

Inherits:
BaseCommand show all
Defined in:
lib/fontisan/commands/audit_command.rb

Overview

Produces a structured Models::AuditReport for a single font or an array of reports for every face in a collection.

The audit report is MECE with ucode: fontisan owns the font-identity axis (name table, style metadata, OpenType layout); ucode owns the Unicode-coverage axis (UCD parsing, block/script aggregation). The audit command emits the raw codepoint list so a consumer can run ucode separately without re-reading the font.

Delegates data extraction to existing sub-commands and table readers — no table re-parsing happens here. This keeps the audit command a thin orchestration layer (DRY, single source of truth).

Examples:

Single font

cmd = AuditCommand.new("Inter.ttf", include_codepoints: true)
cmd.run  # => Models::AuditReport

Collection

cmd = AuditCommand.new("Inter.ttc")
cmd.run  # => Array<Models::AuditReport>

Instance Method Summary collapse

Methods inherited from BaseCommand

#initialize

Constructor Details

This class inherits a constructor from Fontisan::Commands::BaseCommand

Instance Method Details

#runModels::AuditReport+



30
31
32
33
34
35
36
# File 'lib/fontisan/commands/audit_command.rb', line 30

def run
  if FontLoader.collection?(@font_path)
    audit_collection
  else
    audit_single_font(font_index: nil, num_fonts: 1)
  end
end