Class: Skrift::RenderedGlyph

Inherits:
Struct
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#advance_widthObject

Returns the value of attribute advance_width

Returns:

  • (Object)

    the current value of advance_width



7
8
9
# File 'lib/skrift/glyph_cache.rb', line 7

def advance_width
  @advance_width
end

#alphaObject

Returns the value of attribute alpha

Returns:

  • (Object)

    the current value of alpha



7
8
9
# File 'lib/skrift/glyph_cache.rb', line 7

def alpha
  @alpha
end

#heightObject

Returns the value of attribute height

Returns:

  • (Object)

    the current value of height



7
8
9
# File 'lib/skrift/glyph_cache.rb', line 7

def height
  @height
end

#left_side_bearingObject

Returns the value of attribute left_side_bearing

Returns:

  • (Object)

    the current value of left_side_bearing



7
8
9
# File 'lib/skrift/glyph_cache.rb', line 7

def left_side_bearing
  @left_side_bearing
end

#rgbaObject

Returns the value of attribute rgba

Returns:

  • (Object)

    the current value of rgba



7
8
9
# File 'lib/skrift/glyph_cache.rb', line 7

def rgba
  @rgba
end

#widthObject

Returns the value of attribute width

Returns:

  • (Object)

    the current value of width



7
8
9
# File 'lib/skrift/glyph_cache.rb', line 7

def width
  @width
end

#y_offsetObject

Returns the value of attribute y_offset

Returns:

  • (Object)

    the current value of y_offset



7
8
9
# File 'lib/skrift/glyph_cache.rb', line 7

def y_offset
  @y_offset
end

Instance Method Details

#color?Boolean

Returns:

  • (Boolean)


8
# File 'lib/skrift/glyph_cache.rb', line 8

def color? = !rgba.nil?