Skip to content

Commit

Permalink
resolves prawnpdf#1022 provide more information about missing font
Browse files Browse the repository at this point in the history
- when an afm font is missing, provide more information to the user
- look for font name in family option in case of missing TTF
  • Loading branch information
mojavelinux committed Nov 8, 2017
1 parent 9250c86 commit 3d32b79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/prawn/font/afm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ def self.font_data
end

def initialize(document, name, options = {}) #:nodoc:
name ||= options[:family]
unless BUILT_INS.include?(name)
raise Prawn::Errors::UnknownFont, "#{name} is not a known font."
raise Prawn::Errors::UnknownFont, "#{name} (#{options[:style] || 'regular'}) is not a known font."
end

super
Expand Down

0 comments on commit 3d32b79

Please sign in to comment.