Module: Fontisan::Ufo::Convert::ToPostscript
- Defined in:
- lib/fontisan/ufo/convert/to_postscript.rb
Overview
Shared logic for UFO → PostScript Type 1 (PFB or PFA). Used by ToPfb and ToPfa below; not registered in WRAPPER_FOR_FORMAT directly. Callers should use the format-specific modules.
Class Method Summary collapse
-
.convert(ufo, output_path:, generator_class:, compiler: :ttf, **ps_options) ⇒ String
The output_path.
Class Method Details
.convert(ufo, output_path:, generator_class:, compiler: :ttf, **ps_options) ⇒ String
Returns the output_path.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/fontisan/ufo/convert/to_postscript.rb', line 20 def self.convert(ufo, output_path:, generator_class:, compiler: :ttf, **) compiler_class = Convert::COMPILER_FOR_FORMAT[compiler.to_sym] raise ArgumentError, "unknown intermediate compiler: #{compiler.inspect}" unless compiler_class Dir.mktmpdir do |dir| intermediate_path = File.join(dir, "intermediate#{ext_for(compiler)}") compiler_class.new(ufo).compile(output_path: intermediate_path) loaded = Fontisan::FontLoader.load(intermediate_path) bytes = generator_class.generate(loaded, ) File.binwrite(output_path, bytes) end output_path end |