Class: Fontisan::Commands::InfoCommand

Inherits:
BaseCommand show all
Defined in:
lib/fontisan/commands/info_command.rb

Overview

Command to extract font metadata information.

This command extracts comprehensive font information from various tables:

  • name table: family names, version, copyright, etc.

  • OS/2 table: vendor ID, embedding permissions

  • head table: font revision, units per em

Examples:

Extract font information

command = InfoCommand.new("path/to/font.ttf")
info = command.run
puts info.family_name

Instance Method Summary collapse

Methods inherited from BaseCommand

#initialize

Constructor Details

This class inherits a constructor from Fontisan::Commands::BaseCommand

Instance Method Details

#runModels::FontInfo

Extract font information from all available tables.

Returns:



20
21
22
23
24
25
26
27
# File 'lib/fontisan/commands/info_command.rb', line 20

def run
  info = Models::FontInfo.new
  populate_font_format(info)
  populate_from_name_table(info) if font.has_table?(Constants::NAME_TAG)
  populate_from_os2_table(info) if font.has_table?(Constants::OS2_TAG)
  populate_from_head_table(info) if font.has_table?(Constants::HEAD_TAG)
  info
end