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  dcfa7f8d047beb1da729cd46d60e862eb4eef189
tree    b32bc473839c3357218c7b3961f426444b6ab157
parent  e13def82f8b255d2222ddde8c08cf9ede5135a4e
...
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