Class: Ucode::Audit::Extractors::Identity

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

Overview

Identity fields: the human-readable names a font uses to describe itself, drawn from the ‘name` table (SFNT) or font dictionary (Type 1).

Returned fields:

family_name, subfamily_name, full_name, postscript_name,
version, font_revision

Instance Method Summary collapse

Instance Method Details

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

Parameters:

Returns:

  • (Hash{Symbol=>Object})


18
19
20
21
22
23
24
25
# File 'lib/ucode/audit/extractors/identity.rb', line 18

def extract(context)
  font = context.font
  if font.is_a?(Fontisan::Type1Font)
    type1_identity(font)
  else
    sfnt_identity(font)
  end
end