Sha256: 731c6e9c871281414bd42c59f3d328fd4a7f1df1ccf984b67774665df7c35efc
Contents?: true
Size: 1.02 KB
Versions: 7
Compression:
Stored size: 1.02 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$ #++ # 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
7 entries across 7 versions & 3 rubygems