Class: Skia::FontMetrics

Inherits:
Object
  • Object
show all
Defined in:
lib/skia/font.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(struct) ⇒ FontMetrics

Returns a new instance of FontMetrics.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/skia/font.rb', line 100

def initialize(struct)
  @top = struct[:top]
  @ascent = struct[:ascent]
  @descent = struct[:descent]
  @bottom = struct[:bottom]
  @leading = struct[:leading]
  @avg_char_width = struct[:avgCharWidth]
  @max_char_width = struct[:maxCharWidth]
  @x_min = struct[:xMin]
  @x_max = struct[:xMax]
  @x_height = struct[:xHeight]
  @cap_height = struct[:capHeight]
  @underline_thickness = struct[:underlineThickness]
  @underline_position = struct[:underlinePosition]
  @strikeout_thickness = struct[:strikeoutThickness]
  @strikeout_position = struct[:strikeoutPosition]
end

Instance Attribute Details

#ascentObject (readonly)

Returns the value of attribute ascent.



97
98
99
# File 'lib/skia/font.rb', line 97

def ascent
  @ascent
end

#avg_char_widthObject (readonly)

Returns the value of attribute avg_char_width.



97
98
99
# File 'lib/skia/font.rb', line 97

def avg_char_width
  @avg_char_width
end

#bottomObject (readonly)

Returns the value of attribute bottom.



97
98
99
# File 'lib/skia/font.rb', line 97

def bottom
  @bottom
end

#cap_heightObject (readonly)

Returns the value of attribute cap_height.



97
98
99
# File 'lib/skia/font.rb', line 97

def cap_height
  @cap_height
end

#descentObject (readonly)

Returns the value of attribute descent.



97
98
99
# File 'lib/skia/font.rb', line 97

def descent
  @descent
end

#leadingObject (readonly)

Returns the value of attribute leading.



97
98
99
# File 'lib/skia/font.rb', line 97

def leading
  @leading
end

#max_char_widthObject (readonly)

Returns the value of attribute max_char_width.



97
98
99
# File 'lib/skia/font.rb', line 97

def max_char_width
  @max_char_width
end

#strikeout_positionObject (readonly)

Returns the value of attribute strikeout_position.



97
98
99
# File 'lib/skia/font.rb', line 97

def strikeout_position
  @strikeout_position
end

#strikeout_thicknessObject (readonly)

Returns the value of attribute strikeout_thickness.



97
98
99
# File 'lib/skia/font.rb', line 97

def strikeout_thickness
  @strikeout_thickness
end

#topObject (readonly)

Returns the value of attribute top.



97
98
99
# File 'lib/skia/font.rb', line 97

def top
  @top
end

#underline_positionObject (readonly)

Returns the value of attribute underline_position.



97
98
99
# File 'lib/skia/font.rb', line 97

def underline_position
  @underline_position
end

#underline_thicknessObject (readonly)

Returns the value of attribute underline_thickness.



97
98
99
# File 'lib/skia/font.rb', line 97

def underline_thickness
  @underline_thickness
end

#x_heightObject (readonly)

Returns the value of attribute x_height.



97
98
99
# File 'lib/skia/font.rb', line 97

def x_height
  @x_height
end

#x_maxObject (readonly)

Returns the value of attribute x_max.



97
98
99
# File 'lib/skia/font.rb', line 97

def x_max
  @x_max
end

#x_minObject (readonly)

Returns the value of attribute x_min.



97
98
99
# File 'lib/skia/font.rb', line 97

def x_min
  @x_min
end