Class: Fontisan::Tables::Colr::LayerRecord

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

Overview

Layer Record structure for COLR table

Each layer record specifies a glyph and palette index. Structure (4 bytes): glyph_id, palette_index

Constant Summary collapse

FOREGROUND_COLOR =
0xFFFF

Instance Method Summary collapse

Methods inherited from Binary::BaseRecord

#raw_data, read, #valid?

Instance Method Details

#uses_foreground_color?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/fontisan/tables/colr.rb', line 68

def uses_foreground_color?
  palette_index == FOREGROUND_COLOR
end

#uses_palette_color?Boolean

Returns:

  • (Boolean)


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

def uses_palette_color?
  !uses_foreground_color?
end