Method: HexaPDF::Font::Encoding.for_name

Defined in:
lib/hexapdf/font/encoding.rb

.for_name(name) ⇒ Object

Returns the encoding object for the given name, or nil if no such encoding is available.



56
57
58
59
60
61
62
63
64
65
66
# File 'lib/hexapdf/font/encoding.rb', line 56

def self.for_name(name)
  case name
  when :WinAnsiEncoding then @win_ansi ||= WinAnsiEncoding.new
  when :MacRomanEncoding then @mac_roman ||= MacRomanEncoding.new
  when :StandardEncoding then @standard ||= StandardEncoding.new
  when :MacExpertEncoding then @mac_expert ||= MacExpertEncoding.new
  when :SymbolEncoding then @symbol ||= SymbolEncoding.new
  when :ZapfDingbatsEncoding then @zapf_dingbats ||= ZapfDingbatsEncoding.new
  else nil
  end
end