Class: Fontisan::Commands::TablesCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Fontisan::Commands::TablesCommand
- Defined in:
- lib/fontisan/commands/tables_command.rb
Overview
Command to list all tables in a font file.
This command extracts metadata about all tables present in a font file, including their tags, lengths, offsets, and checksums.
Instance Method Summary collapse
-
#run ⇒ Models::TableInfo
Extract table information from the font.
Methods inherited from BaseCommand
Constructor Details
This class inherits a constructor from Fontisan::Commands::BaseCommand
Instance Method Details
#run ⇒ Models::TableInfo
Extract table information from the font.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/fontisan/commands/tables_command.rb', line 18 def run table_info = Models::TableInfo.new table_info.sfnt_version = format_sfnt_version(font.header.sfnt_version) table_info.num_tables = font.tables.length table_info.tables = font.tables.map do |entry| Models::TableEntry.new( tag: entry.tag, length: entry.table_length, offset: entry.offset, checksum: entry.checksum, ) end table_info end |