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  8b9fa47c69dea9ff8eb28ed85cfc798f06c25afb
tree    40bbf4f8d271023ece30fa2ba46c4cd2121c7447
parent  a86c58def3765e69a0692e8a7fb98bb106cd8c09
...
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