Sha256: fabaf3822f35f3a735ca720d7d5ec93ca068ada1070975270497983c0409d098
Contents?: true
Size: 1.07 KB
Versions: 29
Compression:
Stored size: 1.07 KB
Contents
#-- # PDF::Writer for Ruby. # http://rubyforge.org/projects/ruby-pdf/ # Copyright 2003 - 2005 Austin Ziegler. # # Licensed under a MIT-style licence. See LICENCE in the main distribution # for full licensing information. # # $Id: fontencoding.rb 101 2005-06-28 21:32:17Z austin $ #++ # The font encoding class PDF::Writer::Object::FontEncoding < PDF::Writer::Object def initialize(parent, encoding, differences) super(parent) @differences = differences @encoding = encoding end attr_accessor :differences attr_accessor :encoding def to_s res = "\n#{@oid} 0 obj\n<< /Type /Encoding\n" enc = @encoding || 'WinAnsiEncoding' res << "/BaseEncoding /#{enc}\n" unless enc == 'none' unless @differences.nil? or @differences.empty? res << "/Differences \n[" n = nil @differences.keys.sort.each do |k| # Cannot make use of consecutive numbering res << "\n#{k} " if n.nil? or k != (n + 1) res << " /#{@differences[k]}" n = k end res << "\n]" end res << "\n>>\nendobj" end end
Version data entries
29 entries across 29 versions & 4 rubygems