Class: Fontisan::Collection::Reader::Stats

Inherits:
Struct
  • Object
show all
Defined in:
lib/fontisan/collection/reader/stats.rb

Overview

Snapshot of one face's headline metrics. Pure value object — no methods beyond accessors. Separate file from Fontisan::Collection::Reader so the Stats struct can be referenced without pulling in the full Reader (and its FontLoader dependency).

Instance Attribute Summary collapse

Instance Attribute Details

#codepoint_countInteger (readonly)

Returns count of keys in face's cmap unicode_mappings.

Returns:

  • (Integer)

    count of keys in face's cmap unicode_mappings



19
20
# File 'lib/fontisan/collection/reader/stats.rb', line 19

Stats = Struct.new(:index, :glyph_count, :codepoint_count, :sfnt_version,
keyword_init: true)

#glyph_countInteger (readonly)

Returns face's maxp.numGlyphs.

Returns:

  • (Integer)

    face's maxp.numGlyphs



19
20
# File 'lib/fontisan/collection/reader/stats.rb', line 19

Stats = Struct.new(:index, :glyph_count, :codepoint_count, :sfnt_version,
keyword_init: true)

#indexInteger (readonly)

Returns 0-based face index inside the collection.

Returns:

  • (Integer)

    0-based face index inside the collection



19
20
# File 'lib/fontisan/collection/reader/stats.rb', line 19

Stats = Struct.new(:index, :glyph_count, :codepoint_count, :sfnt_version,
keyword_init: true)

#sfnt_versionInteger (readonly)

Returns face sfnt version (0x00010000 for TTF, 0x4F54544F for OTF).

Returns:

  • (Integer)

    face sfnt version (0x00010000 for TTF, 0x4F54544F for OTF)



19
20
# File 'lib/fontisan/collection/reader/stats.rb', line 19

Stats = Struct.new(:index, :glyph_count, :codepoint_count, :sfnt_version,
keyword_init: true)