Skip to content
Browse files

minimal changes to get brine working on prawn 2.X

  • Loading branch information...
1 parent 3a422b9 commit a1e90495e7da0c96473761e42f0deaba2992d334 @yob committed Nov 15, 2008
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/brine.rb
View
12 lib/brine.rb
@@ -20,7 +20,7 @@ def initialize
:top_margin => 0,
:bottom_margin => 0 )
@pdf.font CORE_FONT
- @pdf.font_size!(FONT_SIZE)
+ @pdf.font.size = FONT_SIZE
@slides = []
end
@@ -32,7 +32,7 @@ def slide(string, options={})
@pdf.start_new_page unless @slides.empty?
@pdf.font options[:font] || CORE_FONT
- @pdf.font_size(options[:font_size] || FONT_SIZE) do
+ @pdf.font.size(options[:font_size] || FONT_SIZE) do
centered_text(string)
end
@@ -53,14 +53,14 @@ def render_pdf(file)
private
def text_height(slide)
- metrics = @pdf.font_metrics
+ metrics = @pdf.font.metrics
metrics.string_height(slide, :line_width => @pdf.bounds.width,
- :font_size => @pdf.current_font_size)
+ :font_size => @pdf.font.size)
end
def text_width(slide)
- metrics = @pdf.font_metrics
- slide.lines.map { |e| metrics.string_width(e, @pdf.current_font_size) }.max
+ metrics = @pdf.font.metrics
+ slide.lines.map { |e| metrics.string_width(e, @pdf.font.size) }.max
end
def centered_text(s)

0 comments on commit a1e9049

Please sign in to comment.
Something went wrong with that request. Please try again.