Class: Fontisan::Models::ColorGlyph
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Fontisan::Models::ColorGlyph
- Defined in:
- lib/fontisan/models/color_glyph.rb
Overview
Color glyph information model
Represents a complete color glyph from the COLR table, containing multiple layers that are rendered in order to create the final multi-colored glyph.
This model uses lutaml-model for structured serialization to YAML/JSON/XML.
Instance Attribute Summary collapse
-
#glyph_id ⇒ Integer
Base glyph ID.
-
#layers ⇒ Array<ColorLayer>
Array of color layers.
-
#num_layers ⇒ Integer
Number of color layers.
Instance Method Summary collapse
-
#empty? ⇒ Boolean
Check if glyph is empty.
-
#has_layers? ⇒ Boolean
Check if glyph has color layers.
Instance Attribute Details
#glyph_id ⇒ Integer
Returns Base glyph ID.
32 |
# File 'lib/fontisan/models/color_glyph.rb', line 32 attribute :glyph_id, :integer |
#layers ⇒ Array<ColorLayer>
Returns Array of color layers.
40 |
# File 'lib/fontisan/models/color_glyph.rb', line 40 attribute :layers, ColorLayer, collection: true |
#num_layers ⇒ Integer
Returns Number of color layers.
36 |
# File 'lib/fontisan/models/color_glyph.rb', line 36 attribute :num_layers, :integer |
Instance Method Details
#empty? ⇒ Boolean
Check if glyph is empty
52 53 54 |
# File 'lib/fontisan/models/color_glyph.rb', line 52 def empty? !has_layers? end |
#has_layers? ⇒ Boolean
Check if glyph has color layers
45 46 47 |
# File 'lib/fontisan/models/color_glyph.rb', line 45 def has_layers? num_layers&.positive? || false end |