module HexaPDF::Type::FontType1::StandardFonts

Provides the names and additional mappings of the Standard 14 Fonts.

Public Class Methods

font(name) click to toggle source

Returns the Type1 font object for the given standard font name, or nil if the given name doesn't belong to a standard font.

# File lib/hexapdf/type/font_type1.rb, line 91
def self.font(name)
  name = @mapping[name]
  if !standard_font?(name)
    nil
  elsif @cache.key?(name)
    @cache[name]
  else
    file = File.join(HexaPDF.data_dir, 'afm', "#{name}.afm")
    @cache[name] = HexaPDF::Font::Type1::Font.from_afm(file)
  end
end
standard_font?(name) click to toggle source

Returns true if the given name is the name of a standard font.

# File lib/hexapdf/type/font_type1.rb, line 77
def self.standard_font?(name)
  @mapping.include?(name)
end
standard_name(name) click to toggle source

Returns the standard name of the font in case an additional name is used, or nil if the given name doesn't belong to a standard font.

# File lib/hexapdf/type/font_type1.rb, line 83
def self.standard_name(name)
  @mapping[name]
end