Class: Skrift::RenderedGlyph
- Inherits:
-
Struct
- Object
- Struct
- Skrift::RenderedGlyph
- Defined in:
- lib/skrift/glyph_cache.rb
Overview
A rasterised, cached glyph. A monochrome glyph carries alpha (a row-major 0..255 coverage array, stride padded to a multiple of 4), or nil for a glyph with no outline (e.g. space). A colour glyph (from a colour delegate, see GlyphCache) instead carries rgba, a row-major array of packed 0xRRGGBBAA pixels; for those alpha is nil. Placement fields are shared.
Instance Attribute Summary collapse
-
#advance_width ⇒ Object
Returns the value of attribute advance_width.
-
#alpha ⇒ Object
Returns the value of attribute alpha.
-
#height ⇒ Object
Returns the value of attribute height.
-
#left_side_bearing ⇒ Object
Returns the value of attribute left_side_bearing.
-
#rgba ⇒ Object
Returns the value of attribute rgba.
-
#width ⇒ Object
Returns the value of attribute width.
-
#y_offset ⇒ Object
Returns the value of attribute y_offset.
Instance Method Summary collapse
Instance Attribute Details
#advance_width ⇒ Object
Returns the value of attribute advance_width
7 8 9 |
# File 'lib/skrift/glyph_cache.rb', line 7 def advance_width @advance_width end |
#alpha ⇒ Object
Returns the value of attribute alpha
7 8 9 |
# File 'lib/skrift/glyph_cache.rb', line 7 def alpha @alpha end |
#height ⇒ Object
Returns the value of attribute height
7 8 9 |
# File 'lib/skrift/glyph_cache.rb', line 7 def height @height end |
#left_side_bearing ⇒ Object
Returns the value of attribute left_side_bearing
7 8 9 |
# File 'lib/skrift/glyph_cache.rb', line 7 def left_side_bearing @left_side_bearing end |
#rgba ⇒ Object
Returns the value of attribute rgba
7 8 9 |
# File 'lib/skrift/glyph_cache.rb', line 7 def rgba @rgba end |
#width ⇒ Object
Returns the value of attribute width
7 8 9 |
# File 'lib/skrift/glyph_cache.rb', line 7 def width @width end |
#y_offset ⇒ Object
Returns the value of attribute y_offset
7 8 9 |
# File 'lib/skrift/glyph_cache.rb', line 7 def y_offset @y_offset end |
Instance Method Details
#color? ⇒ Boolean
8 |
# File 'lib/skrift/glyph_cache.rb', line 8 def color? = !rgba.nil? |