Permalink
Browse files

Reducing unneeded calls to Document#font

  • Loading branch information...
1 parent 4e1f7c8 commit ad37380248725dba65cc45c7e22fc629a3163547 @alexdowad alexdowad committed Aug 21, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/prawn/core/text/formatted/line_wrap.rb
@@ -174,8 +174,9 @@ def initialize_line(options)
def set_soft_hyphen_and_zero_width_space
# this is done once per fragment, after the font settings for the fragment are applied --
# it could actually be skipped if the font hasn't changed
- @soft_hyphen = @document.font.normalize_encoding(Prawn::Text::SHY)
- @zero_width_space = @document.font.unicode? ? Prawn::Text::ZWSP : ""
+ font = @document.font
+ @soft_hyphen = font.normalize_encoding(Prawn::Text::SHY)
+ @zero_width_space = font.unicode? ? Prawn::Text::ZWSP : ""
end
def fragment_finished(fragment)

0 comments on commit ad37380

Please sign in to comment.