public
Description: Fast, Nimble PDF Writer for Ruby
Homepage: http://prawn.majesticseacreature.com
Clone URL: git://github.com/sandal/prawn.git
Ensure font descender calculation did change behavior when advancing to new 
lines in text() [#30]
sandal (author)
Fri Jun 20 12:51:39 -0700 2008
commit  2e7740e75b84fb7b43d70383aad0ab6a47a770f0
tree    624f5ede8810375899a9b015ab706aadb0e3ed24
parent  2cbbfa933865b45ed6353619628b1793edf49a76
...
42
43
44
 
 
 
 
 
 
 
 
 
 
 
 
 
45
46
47
...
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
0
@@ -42,6 +42,19 @@ end
0
 describe "when drawing text" do
0
    
0
    before(:each) { create_pdf } 
0
+
0
+   it "should advance down the document based on font_height" do
0
+     position = @pdf.y
0
+     @pdf.text "Foo"
0
+
0
+     @pdf.y.should be_close(position - @pdf.font_metrics.font_height(12),
0
+                            0.0001)
0
+
0
+     position = @pdf.y
0
+     @pdf.text "Foo\nBar\nBaz"
0
+     @pdf.y.should be_close(position - 3*@pdf.font_metrics.font_height(12),
0
+                            0.0001)
0
+   end
0
    
0
    it "should default to 12 point helvetica" do
0
       @pdf.text "Blah", :at => [100,100]              

Comments