Class: Fontisan::Type1::Encodings::Unicode

Inherits:
Encoding
  • Object
show all
Defined in:
lib/fontisan/type1/encodings.rb

Overview

Unicode Encoding

Uses the Adobe Glyph List to map Unicode codepoints to glyph names. This encoding supports all Unicode characters through the AGL.

Class Method Summary collapse

Class Method Details

.all_glyph_namesArray<String>

Get all glyph names in AGL

Returns:

  • (Array<String>)

    All glyph names in AGL



691
692
693
# File 'lib/fontisan/type1/encodings.rb', line 691

def self.all_glyph_names
  AGL.all_glyph_names
end

.codepoint_for_glyph(name) ⇒ Integer?

Get Unicode codepoint for glyph name

Parameters:

  • name (String)

    Glyph name

Returns:

  • (Integer, nil)

    Unicode codepoint or nil if not found



669
670
671
# File 'lib/fontisan/type1/encodings.rb', line 669

def self.codepoint_for_glyph(name)
  AGL.unicode_for_glyph_name(name)
end

.encoding_nameString

Get encoding name

Returns:

  • (String)

    “Unicode”



684
685
686
# File 'lib/fontisan/type1/encodings.rb', line 684

def self.encoding_name
  "Unicode"
end

.glyph_name_for_code(codepoint) ⇒ String

Get glyph name for Unicode codepoint

Parameters:

  • codepoint (Integer)

    Unicode codepoint

Returns:

  • (String)

    Glyph name from AGL



661
662
663
# File 'lib/fontisan/type1/encodings.rb', line 661

def self.glyph_name_for_code(codepoint)
  AGL.glyph_name_for_unicode(codepoint)
end

.include?(_name) ⇒ Boolean

Check if glyph name is in encoding (always true for Unicode)

Parameters:

  • name (String)

    Glyph name

Returns:

  • (Boolean)

    Always true for Unicode



677
678
679
# File 'lib/fontisan/type1/encodings.rb', line 677

def self.include?(_name)
  true
end