Class: Ucode::Audit::Extractors::Style

Inherits:
Base
  • Object
show all
Defined in:
lib/ucode/audit/extractors/style.rb

Overview

Style fields: weight, width, italic/bold flags, Panose family classification.

Returned fields:

weight_class, width_class, italic, bold, panose

ucode delta vs fontisan: the standalone ‘StyleExtractor` class is NOT ported. The OS/2 + head interpretation rules live inline here.

MECE: this extractor owns OS/2 + head. fvar-derived fields (axes, named instances, variable presence) live on the VariationDetail extractor (TODO 09).

Boundary: uses only ‘font.has_table?(tag)` and `font.table(tag)`. No class-specific branching — any SFNT-compatible font works.

Instance Method Summary collapse

Instance Method Details

#extract(context) ⇒ Hash{Symbol=>Object}

Parameters:

Returns:

  • (Hash{Symbol=>Object})


28
29
30
31
32
33
34
35
36
37
# File 'lib/ucode/audit/extractors/style.rb', line 28

def extract(context)
  font = context.font
  {
    weight_class: weight_class(font),
    width_class: width_class(font),
    italic: italic(font),
    bold: bold(font),
    panose: panose(font),
  }
end