Skip to content

struct SF::Glyph
inherits Struct #

Structure describing a glyph

A glyph is the visual representation of a character.

The SF::Glyph structure provides the information needed to handle the glyph:

  • its coordinates in the font's texture
  • its bounding rectangle
  • the offset to apply to get the starting position of the next glyph

See also: SF::Font

Class methods#

.new #

Default constructor

View source

Methods#

#advance : Float32 #

Offset to move horizontally to the next character

View source

#advance=(advance : Number) #

View source

#bounds : FloatRect #

Bounding rectangle of the glyph, in coordinates relative to the baseline

View source

#bounds=(bounds : FloatRect) #

View source

#dup : Glyph #

Returns a shallow copy of this object.

Because Value is a value type, this method returns self, which already involves a shallow copy of this object because value types are passed by value.

View source

#texture_rect : IntRect #

Texture coordinates of the glyph inside the font's texture

View source

#texture_rect=(texture_rect : IntRect) #

View source