Pdf-writer Postscript Type 1 font handling problems

Folks/Admin, apologies for this cross post. I posted to the wrong group
previously.

Hi, I am trying to get pdf-writer to load up Postscript Type 1 fonts
but am encountering a problem. Using the gettysburg.rb example as a
base for my tests I have implented the following code changes:

PDF::Writer::FONT_PATH.unshift(File.expand_path(“Fonts”))
p PDF::Writer::FONT_PATH

PDF::Writer::FontMetrics::METRICS_PATH.unshift(File.expand_path(“Fonts”))
p PDF::Writer::FontMetrics::METRICS_PATH

pdf.select_font(“GillSan”, :encoding => nil)
pdf.text “The Gettysburg Address\n\n”,
:font_size => 12,
:justification => :center

When I run the program, my ruby session sends back the following error
message:
/opt/local/lib/ruby/site_ruby/1.8/pdf/writer.rb:1102:in font_height': undefined method[]’ for nil:NilClass (NoMethodError)
from /opt/local/lib/ruby/site_ruby/1.8/pdf/writer.rb:2436:in
`text’
from gettysburg.rb:58

Line 58 is “pdf.text “The Gettysburg Address\n\n”,”… Any idea what’s
going on?

I am runnng the following:
Mac: OSX 10.4.7
Ruby: 1.8.4
pdf-writer: 1.1.3
color-tools: 1.3.0
transaction-simple: 1.3.0

Thanks, Ray

Hi Austin, no its not a defult font. I’ve tried with a variety of AFM
fonts all to no avail.

Ta, Ray

On 8/18/06, Ray(:bies, :mundo) [email protected] wrote:

Folks/Admin, apologies for this cross post. I posted to the wrong group
previously.

Is this a default installed font for the Mac? If so, I can test it as
soon as I get Ruby 1.8.4 installed.

-austin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs