public
Description: Fast, Nimble PDF Writer for Ruby
Homepage: http://prawn.majesticseacreature.com
Clone URL: git://github.com/sandal/prawn.git
Add spec for font_metrics defaults.  This should cover all changed behaviour as 
a result of the new table code [#30 state:resolved]
sandal (author)
Fri Jun 20 14:01:56 -0700 2008
commit  0f9eef241c3343afbf7937d5bc47f1cdbfb3c3e1
tree    bbb825135b9a6691f507cc23678e1c091bec071b
parent  9d0b188ccf14a1c9afe55ef9fe36125376f8bdcf
...
39
40
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
43
44
...
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
0
@@ -39,6 +39,25 @@ class FontObserver
0
   end
0
 end
0
 
0
+describe "Font Metrics" do
0
+
0
+  it "should default to Helvetica if no font is specified" do
0
+    @pdf = Prawn::Document.new
0
+    @pdf.font_metrics.should == Prawn::Font::Metrics["Helvetica"]
0
+  end
0
+
0
+  it "should use the currently set font for font_metrics" do
0
+    @pdf = Prawn::Document.new
0
+    @pdf.font "Courier"
0
+    @pdf.font_metrics.should == Prawn::Font::Metrics["Courier"]
0
+   
0
+    comicsans = "#{Prawn::BASEDIR}/data/fonts/comicsans.ttf"
0
+    @pdf.font(comicsans)
0
+    @pdf.font_metrics.should == Prawn::Font::Metrics[comicsans]
0
+  end
0
+
0
+end
0
+
0
 describe "when drawing text" do
0
    
0
    before(:each) { create_pdf } 

Comments