Class: FreeType::API::Glyph

Inherits:
Object
  • Object
show all
Includes:
C
Defined in:
lib/freetype/api.rb

Constant Summary

Constants included from C

C::FT_ENC_TAG, C::FT_Encoding, C::FT_Glyph_Format, C::FT_IMAGE_TAG, C::FT_Kerning_Mode, C::FT_LOAD_COLOR, C::FT_LOAD_COMPUTE_METRICS, C::FT_LOAD_CROP_BITMAP, C::FT_LOAD_DEFAULT, C::FT_LOAD_FORCE_AUTOHINT, C::FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH, C::FT_LOAD_IGNORE_TRANSFORM, C::FT_LOAD_LINEAR_DESIGN, C::FT_LOAD_MONOCHROME, C::FT_LOAD_NO_AUTOHINT, C::FT_LOAD_NO_BITMAP, C::FT_LOAD_NO_HINTING, C::FT_LOAD_NO_RECURSE, C::FT_LOAD_NO_SCALE, C::FT_LOAD_PEDANTIC, C::FT_LOAD_RENDER, C::FT_LOAD_VERTICAL_LAYOUT

Instance Method Summary collapse

Methods included from C::LazyAttach

#attach_function

Constructor Details

#initialize(glyph) ⇒ Glyph

Returns a new instance of Glyph.



148
149
150
# File 'lib/freetype/api.rb', line 148

def initialize(glyph)
  @glyph = glyph
end

Instance Method Details

#[](key) ⇒ Object



152
153
154
# File 'lib/freetype/api.rb', line 152

def [](key)
  @glyph[key]
end

#boldObject



168
169
170
# File 'lib/freetype/api.rb', line 168

def bold
  FT_GlyphSlot_Embolden(@glyph)
end

#char_widthObject



164
165
166
# File 'lib/freetype/api.rb', line 164

def char_width
  @glyph[:metrics][:horiAdvance]
end

#metricsObject



156
157
158
# File 'lib/freetype/api.rb', line 156

def metrics
  @glyph[:metrics]
end

#obliqueObject Also known as: italic



172
173
174
# File 'lib/freetype/api.rb', line 172

def oblique
  FT_GlyphSlot_Oblique(@glyph)
end

#outlineObject



160
161
162
# File 'lib/freetype/api.rb', line 160

def outline
  Outline.new(@glyph[:outline])
end