Class: Fontisan::Audit::Extractors::Licensing
- Defined in:
- lib/fontisan/audit/extractors/licensing.rb
Overview
Licensing + embedding permissions + vendor provenance.
Returned fields:
licensing: Models::Audit::Licensing instance, or nil for Type 1
Type 1 fonts have no OS/2 table; their licensing is nil. WOFF/ WOFF2 carry the same OS/2 + name tables as TTF/OTF and need no special handling.
Instance Method Summary collapse
Instance Method Details
#extract(context) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/fontisan/audit/extractors/licensing.rb', line 29 def extract(context) font = context.font return { licensing: nil } unless sfnt?(font) os2 = os2_for(font) name = name_table_for(font) { licensing: Models::Audit::Licensing.new( **name_fields(name), vendor_id: sanitized_vendor_id(os2), embedding_type: Models::Audit::EmbeddingType.decode(os2&.fs_type&.to_i), fs_selection_flags: Models::Audit::FsSelectionFlags.decode(os2&.fs_selection&.to_i), ), } end |