Method: PDF::Writer::Object::Font#to_s

Defined in:
lib/pdf/writer/object/font.rb

#to_sObject



58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/pdf/writer/object/font.rb', line 58

def to_s
  res = "\n#{@oid} 0 obj\n<< /Type /Font\n/Subtype /#{@subtype}\n"
  res << "/Name /F#{@font_id}\n/BaseFont /#{@name}\n"
  if @encoding.kind_of?(PDF::Writer::Object::FontEncoding)
    res << "/Encoding #{@encoding.oid} 0 R\n"
  elsif @encoding
    res << "/Encoding /#{@encoding}\n" if @encoding
  end
  res << "/FirstChar #{@firstchar}\n" unless @firstchar.nil?
  res << "/LastChar #{@lastchar}\n" unless @lastchar.nil?
  res << "/Widths #{@widths} 0 R\n" unless @widths.nil?
  res << "/FontDescriptor #{@fontdescriptor} 0 R\n" unless @fontdescriptor.nil?
  res << ">>\nendobj"
end