lib/ttfunk/table/head.rb in ttfunk-1.4.0 vs lib/ttfunk/table/head.rb in ttfunk-1.5.0
- old
+ new
@@ -1,8 +1,8 @@
require_relative '../table'
-module TTFunk
+module TTFunk
class Table
class Head < TTFunk::Table
attr_reader :version
attr_reader :font_revision
attr_reader :checksum_adjustment
@@ -21,24 +21,24 @@
attr_reader :index_to_loc_format
attr_reader :glyph_data_format
def self.encode(head, loca)
table = head.raw
- table[8,4] = "\0\0\0\0" # set checksum adjustment to 0 initially
- table[-4,2] = [loca[:type]].pack("n") # set index_to_loc_format
- return table
+ table[8, 4] = "\0\0\0\0" # set checksum adjustment to 0 initially
+ table[-4, 2] = [loca[:type]].pack('n') # set index_to_loc_format
+ table
end
private
- def parse!
- @version, @font_revision, @check_sum_adjustment, @magic_number,
- @flags, @units_per_em, @created, @modified = read(36, "N4n2q2")
-
- @x_min, @y_min, @x_max, @y_max = read_signed(4)
-
- @mac_style, @lowest_rec_ppem, @font_direction_hint,
- @index_to_loc_format, @glyph_data_format = read(10, "n*")
- end
+ def parse!
+ @version, @font_revision, @check_sum_adjustment, @magic_number,
+ @flags, @units_per_em, @created, @modified = read(36, 'N4n2q2')
+
+ @x_min, @y_min, @x_max, @y_max = read_signed(4)
+
+ @mac_style, @lowest_rec_ppem, @font_direction_hint,
+ @index_to_loc_format, @glyph_data_format = read(10, 'n*')
+ end
end
end
end