Sha256: 3e7691ded05f35f4eeedeb00087effafd4630a1a03f8cd961c984858493a0d7b
Contents?: true
Size: 994 Bytes
Versions: 1
Compression:
Stored size: 994 Bytes
Contents
# class Prawn::Font::AFM # # Patch normalize_encoding method to handle conversion more gracefully. # # # # Any valid utf-8 characters that cannot be encoded to windows-1252 are # # replaced with the logic "not" symbol and a warning is issued identifying # # the text that cannot be converted. # def normalize_encoding(text) # text.encode('utf-8') # #text.encode 'windows-1252' # rescue ::Encoding::UndefinedConversionError # warn 'The following text could not be fully converted to the Windows-1252 character set:' # warn %(#{text.gsub(/^/, '| ').rstrip}) # warn '' # text.encode 'windows-1252', undef: :replace, invalid: :replace, replace: 'x' # rescue ::Encoding::InvalidByteSequenceError # raise Prawn::Errors::IncompatibleStringEncoding, # %(Your document includes text that's not compatible with the Windows-1252 character set. # If you need full UTF-8 support, use TTF fonts instead of PDF's built-in (AFM) fonts\n.) # end # end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
songbooks-0.1.0 | lib/prawn_ext/font/afm.rb |