lib/ttfunk/table/cmap/format10.rb in ttfunk-1.2.2 vs lib/ttfunk/table/cmap/format10.rb in ttfunk-1.3.0
- old
+ new
@@ -5,11 +5,11 @@
module Format10
attr_reader :language
attr_reader :code_map
def self.encode(charmap)
- next_id = 0
+ next_id = 0
glyph_map = { 0 => 0 }
sorted_chars = charmap.keys.sort
low_char, high_char = sorted_chars.first, sorted_chars.last
entry_count = (1+high_char-low_char)
@@ -35,10 +35,10 @@
true
end
private
def parse_cmap!
- fractional_version, length, @language, firstcode, entrycount = read(18, 'nNNNN')
+ fractional_version, @language, firstcode, entrycount = read(18, 'nx4NNN')
raise NotImplementedError, "cmap version 10.#{fractional_version} is not supported" if fractional_version != 0
@code_map = {}
(firstcode...(firstcode+entrycount)).each do |code|
@code_map[code] = read(2, 'n').first & 0xFFFF
end