Module: TTFunk::Table::Post::Format20

Includes:
Format10
Defined in:
lib/ttfunk/table/post/format20.rb

Overview

Version 2.0 is used for fonts that use glyph names that are not in the set of Macintosh glyph names. A given font may map some of its glyphs to the standard Macintosh glyph names, and some to its own custom names. A version 2.0 ‘post` table can be used in fonts with TrueType or CFF version 2 outlines.

Constant Summary

Constants included from Format10

TTFunk::Table::Post::Format10::POSTSCRIPT_GLYPHS

Instance Method Summary collapse

Instance Method Details

#glyph_for(code) ⇒ String

Get glyph name for character code.

Parameters:

  • code (Integer)

Returns:

  • (String)


21
22
23
24
25
26
27
28
29
30
# File 'lib/ttfunk/table/post/format20.rb', line 21

def glyph_for(code)
  index = @glyph_name_index[code]
  return '.notdef' unless index

  if index <= 257
    POSTSCRIPT_GLYPHS[index]
  else
    @names[index - 258] || '.notdef'
  end
end