class TTFunk::Table::Glyf::Simple
Simple
TrueType glyph
Attributes
Point indices for the last point of each contour. @return [Array<Integer>]
Glyph ID. @return [Integer]
Total number of bytes for instructions. @return [Integer]
Instruction byte code. @return [Array<Integer>]
Number of contours in this glyph. @return [Integer]
Binary serialization of this glyph. @return [String]
Maximum x for coordinate. @return [Integer]
Minimum x for coordinate. @return [Integer]
Maximum y for coordinate. @return [Integer]
Minimum y for coordinate. @return [Integer]
Public Class Methods
Source
# File lib/ttfunk/table/glyf/simple.rb, line 52 def initialize(id, raw) @id = id @raw = raw io = StringIO.new(raw) @number_of_contours, @x_min, @y_min, @x_max, @y_max = io.read(10).unpack('n*').map { |i| BinUtils.twos_comp_to_int(i, bit_width: 16) } @end_points_of_contours = io.read(number_of_contours * 2).unpack('n*') @instruction_length = io.read(2).unpack1('n') @instructions = io.read(instruction_length).unpack('C*') end
@param id [Integer] glyph ID. @param raw [String]
Public Instance Methods
Source
# File lib/ttfunk/table/glyf/simple.rb, line 69 def compound? false end
Is this glyph compound? @return [false]
Source
# File lib/ttfunk/table/glyf/simple.rb, line 83 def end_point_of_last_contour end_points_of_contours.last + 1 end
End point index of last contour. @return [Integer]
Source
# File lib/ttfunk/table/glyf/simple.rb, line 77 def recode(_mapping) raw end
Recode glyph.
@param _mapping Unused, here for API compatibility. @return [String]