# File lib/ttfunk/table/post/format20.rb, line 10 def glyph_for(code) index = @glyph_name_index[code] if index <= 257 POSTSCRIPT_GLYPHS[index] else @names[index - 258] || ".notdef" end end
# File lib/ttfunk/table/post/format20.rb, line 21 def parse_format! number_of_glyphs = read(2, 'n').first @glyph_name_index = read(number_of_glyphs*2, 'n*') @names = [] strings = StringIO.new(io.read(offset + length - io.pos)) while !strings.eof? length = strings.read(1).unpack("C").first @names << strings.read(length) end end