pdf-writer Postscript Type 1 font handling problems

R

Ray(:bies, :mundo)

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
 
A

Austin Ziegler

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
 
R

Ray(:bies, :mundo)

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

Ta, Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top