Module: Fontisan::Type1

Defined in:
lib/fontisan/type1.rb,
lib/fontisan/type1/agl.rb,
lib/fontisan/type1/decryptor.rb,
lib/fontisan/type1/encodings.rb,
lib/fontisan/type1/generator.rb,
lib/fontisan/type1/afm_parser.rb,
lib/fontisan/type1/pfa_parser.rb,
lib/fontisan/type1/pfb_parser.rb,
lib/fontisan/type1/pfm_parser.rb,
lib/fontisan/type1/upm_scaler.rb,
lib/fontisan/type1/charstrings.rb,
lib/fontisan/type1/private_dict.rb,
lib/fontisan/type1/afm_generator.rb,
lib/fontisan/type1/inf_generator.rb,
lib/fontisan/type1/pfa_generator.rb,
lib/fontisan/type1/pfb_generator.rb,
lib/fontisan/type1/pfm_generator.rb,
lib/fontisan/type1/seac_expander.rb,
lib/fontisan/type1/font_dictionary.rb,
lib/fontisan/type1/conversion_options.rb,
lib/fontisan/type1/charstring_converter.rb,
lib/fontisan/type1/cff_to_type1_converter.rb,
lib/fontisan/type1/ttf_to_type1_converter.rb

Overview

Adobe Type 1 Font support

[‘Type1`](lib/fontisan/type1.rb) provides parsing and conversion capabilities for Adobe Type 1 fonts in PFB (Printer Font Binary) and PFA (Printer Font ASCII) formats.

Type 1 fonts were the standard for digital typography in the 1980s-1990s and are still encountered in legacy systems and design workflows.

Key features:

  • PFB and PFA format parsing

  • eexec decryption for encrypted font portions

  • CharString decryption with lenIV handling

  • Font dictionary parsing (FontInfo, Private dict)

  • Conversion from TTF/OTF to Type 1 formats

  • UPM scaling for Type 1 compatibility (1000 UPM)

  • Multiple encoding support (AdobeStandard, ISOLatin1, Unicode)

Examples:

Generate Type 1 formats from TTF

font = Fontisan::FontLoader.load("font.ttf")
result = Fontisan::Type1::Generator.generate(font)
result[:afm]   # => AFM file content
result[:pfm]   # => PFM file content
result[:pfb]   # => PFB file content
result[:inf]   # => INF file content

Generate with specific options

options = Fontisan::Type1::ConversionOptions.windows_type1
result = Fontisan::Type1::Generator.generate(font, options)

See Also:

Defined Under Namespace

Modules: AGL, Decryptor, Encodings Classes: AFMGenerator, AFMParser, CffToType1Converter, CharStringConverter, CharStrings, ConversionOptions, FontDictionary, Generator, INFGenerator, PFAGenerator, PFAParser, PFBGenerator, PFBParser, PFMGenerator, PFMParser, PrivateDict, SeacExpander, TTFToType1Converter, UPMScaler