Class: Ucode::Commands::Audit::FontCommand
- Inherits:
-
Object
- Object
- Ucode::Commands::Audit::FontCommand
- Defined in:
- lib/ucode/commands/audit/font_command.rb
Overview
ucode audit font PATH — audit a single font file or
fontist-resolvable name. Writes the per-face directory tree
under <output_root>/font_audit/<label>/.
Auto-detects collection sources (TTC/OTC/dfong) and falls through to collection-style emission in that case — one tree per face. For an explicit, intent-revealing form, use CollectionCommand.
Pure: Thor never touches this. Real work is delegated to Glyphs::RealFonts::FontLocator (resolve spec → path), Audit::FaceAuditor (build report), and Audit::Emitter::FaceDirectory (write tree).
Defined Under Namespace
Classes: FaceOutcome, Result
Instance Method Summary collapse
Instance Method Details
#call(spec, output_root:, label: nil, unicode_version: nil, verbose: false, with_glyphs: false, brief: false, browse: false, install: true, reference: nil, universal_set_root: nil, with_missing_glyph_pages: false) ⇒ Result
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/ucode/commands/audit/font_command.rb', line 57 def call(spec, output_root:, label: nil, unicode_version: nil, verbose: false, with_glyphs: false, brief: false, browse: false, install: true, reference: nil, universal_set_root: nil, with_missing_glyph_pages: false) located = locate(spec, install: install) reports = Array(audit_faces(located.path, unicode_version: unicode_version, brief: brief, reference: reference)) face_label = label || derived_face_label(reports.first, located) sanitized = sanitize(face_label) directory = Ucode::Audit::Emitter::FaceDirectory.new( output_root: output_root, verbose: verbose, with_glyphs: with_glyphs, emit_browser: browse, universal_set_root: universal_set_root, with_missing_glyph_pages: with_missing_glyph_pages, ) face_outcomes, top_dir = if reports.one? emit_standalone(directory, sanitized, reports.first) else emit_collection(directory, sanitized, reports, output_root) end Result.new(spec: spec, label: face_label, output_dir: top_dir.to_s, faces: face_outcomes) rescue StandardError => e Result.new(spec: spec, error: "#{e.class}: #{e.}") end |