Class: Fontisan::Tables::Svg::SvgDocumentRecord

Inherits:
Binary::BaseRecord show all
Defined in:
lib/fontisan/tables/svg.rb

Overview

SVG Document Index Entry structure

Each entry associates a glyph range with an SVG document. Structure (12 bytes): start_glyph_id, end_glyph_id, svg_doc_offset, svg_doc_length

Instance Method Summary collapse

Methods inherited from Binary::BaseRecord

#raw_data, read, #valid?

Instance Method Details

#glyph_rangeRange

Get the glyph range for this record

Returns:

  • (Range)

    Range of glyph IDs



72
73
74
# File 'lib/fontisan/tables/svg.rb', line 72

def glyph_range
  start_glyph_id..end_glyph_id
end

#includes_glyph?(glyph_id) ⇒ Boolean

Check if this record includes a specific glyph ID

Parameters:

  • glyph_id (Integer)

    Glyph ID to check

Returns:

  • (Boolean)

    True if glyph is in range



65
66
67
# File 'lib/fontisan/tables/svg.rb', line 65

def includes_glyph?(glyph_id)
  glyph_id >= start_glyph_id && glyph_id <= end_glyph_id
end