Class: Fontisan::Formatters::AuditTextRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/fontisan/formatters/audit_text_renderer.rb

Overview

Human-readable, sectioned view of an Models::Audit::AuditReport.

The text formatter is the default --format text output for fontisan audit. Complements YAML/JSON (machine-facing) with a terse, scannable terminal view. Every section is nil-safe so the same renderer covers full OpenType/TrueType faces, Type 1 fonts (no OS/2, no metrics, no layout), and partial reports.

Constant Summary collapse

SEPARATOR =
"=" * 80
LABEL_WIDTH =
18
LIST_LIMIT =
10
WIDTH_NAMES =
{
  1 => "Ultra-condensed", 2 => "Extra-condensed", 3 => "Condensed",
  4 => "Semi-condensed", 5 => "Medium", 6 => "Semi-expanded",
  7 => "Expanded", 8 => "Extra-expanded", 9 => "Ultra-expanded"
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(report) ⇒ AuditTextRenderer

Returns a new instance of AuditTextRenderer.

Parameters:



24
25
26
27
# File 'lib/fontisan/formatters/audit_text_renderer.rb', line 24

def initialize(report)
  @report = report
  @lines = []
end

Instance Method Details

#renderString

Returns:

  • (String)


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/fontisan/formatters/audit_text_renderer.rb', line 30

def render
  render_header
  render_identity
  render_style
  render_metrics
  render_coverage
  render_blocks
  render_licensing
  render_hinting
  render_color
  render_variation
  render_opentype_layout
  render_language_coverage
  render_warnings
  @lines.join("\n")
end