lib/hexapdf/font_loader/from_configuration.rb in hexapdf-0.5.0 vs lib/hexapdf/font_loader/from_configuration.rb in hexapdf-0.6.0
- old
+ new
@@ -30,10 +30,11 @@
# License, a covered work must retain the producer line in every PDF that
# is created or manipulated using HexaPDF.
#++
require 'hexapdf/font/true_type_wrapper'
+require 'hexapdf/font_loader/from_file'
module HexaPDF
module FontLoader
# This module uses the configuration option 'font.map' for loading a font.
@@ -60,12 +61,10 @@
return nil if file.nil?
unless File.file?(file)
raise HexaPDF::Error, "The configured font file #{file} does not exist"
end
-
- font = HexaPDF::Font::TrueType::Font.new(File.open(file))
- HexaPDF::Font::TrueTypeWrapper.new(document, font, subset: subset)
+ FromFile.call(document, file, subset: subset)
end
end
end