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



689
690
691
# File 'lib/fontisan/type1/encodings.rb', line 689

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



667
668
669
# File 'lib/fontisan/type1/encodings.rb', line 667

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

.encoding_nameString

Get encoding name

Returns:

  • (String)

    "Unicode"



682
683
684
# File 'lib/fontisan/type1/encodings.rb', line 682

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



659
660
661
# File 'lib/fontisan/type1/encodings.rb', line 659

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



675
676
677
# File 'lib/fontisan/type1/encodings.rb', line 675

def self.include?(_name)
  true
end