Class: Fontisan::Audit::Extractors::Metrics

Inherits:
Base
  • Object
show all
Defined in:
lib/fontisan/audit/extractors/metrics.rb

Overview

Layout-critical metrics consolidated from head, hhea, OS/2, post.

Returned fields:

metrics: Models::Audit::Metrics instance, or nil for Type 1

All table reads are nil-safe; tables may be absent in stripped WOFF builds or legacy formats.

Instance Method Summary collapse

Instance Method Details

#extract(context) ⇒ Object



14
15
16
17
18
19
# File 'lib/fontisan/audit/extractors/metrics.rb', line 14

def extract(context)
  font = context.font
  return { metrics: nil } unless sfnt?(font)

  { metrics: Models::Audit::Metrics.new(**gather(font)) }
end