class HexaPDF::Font::TrueType::Table::Head
See: developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6head.html<br><br>The ‘head’ table contains global information about the font.
def checksum_valid?
checksum_adjustment value is not used during the calculation.
The checksum for the head table is calculated differently because the
def checksum_valid? data = raw_data data[8, 4] = 0.chr * 4 directory_entry.checksum == self.class.calculate_checksum(data) end
def parse_table #:nodoc:
def parse_table #:nodoc: @version = read_fixed @font_revision = read_fixed data = read_formatted(46, 'N2n2q>2s>4n2s>3') @checksum_adjustment = data[0] if data[1] != 0x5F0F3CF5 # the magic number raise HexaPDF::Error, "Invalid magic number in 'head' table: #{data[1].to_s(16)}" end @flags, @units_per_em = data[2], data[3] @created, @modified = TIME_EPOCH + data[4], TIME_EPOCH + data[5] @bbox = data[6..9] @mac_style, @smallest_readable_size, @font_direction_hint, @index_to_loc_format = *data[10..13] if data[14] != 0 # glyphDataFormat raise HexaPDF::Error, "Invalid glyph data format value (should be 0): #{data[14]}" end end