# File lib/pdf/reader/font.rb, line 32 def initialize(ohash = nil, obj = nil) if ohash.nil? || obj.nil? $stderr.puts "DEPREACTION WARNING - PDF::Reader::Font.new should be called with 2 args" return end @ohash = ohash @tounicode = nil extract_base_info(obj) extract_descriptor(obj) extract_descendants(obj) @encoding ||= PDF::Reader::Encoding.new(:StandardEncoding) end
# File lib/pdf/reader/font.rb, line 47 def basefont=(font) # setup a default encoding for the selected font. It can always be overridden # with encoding= if required case font when "Symbol" then @encoding = PDF::Reader::Encoding.new("SymbolEncoding") when "ZapfDingbats" then @encoding = PDF::Reader::Encoding.new("ZapfDingbatsEncoding") else @encoding = nil end @basefont = font end
# File lib/pdf/reader/font.rb, line 69 def glyph_width(c) @missing_width ||= 0 @widths ||= [] @widths.fetch(c - @first_char, @missing_width) end
# File lib/pdf/reader/font.rb, line 61 def to_utf8(params) if @tounicode to_utf8_via_cmap(params) else to_utf8_via_encoding(params) end end