Skip to content

Instantly share code, notes, and snippets.

@mkastner
Created April 29, 2012 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkastner/2547562 to your computer and use it in GitHub Desktop.
Save mkastner/2547562 to your computer and use it in GitHub Desktop.
When using column_box hyphenation character is being redered in last line of parargraphs
require 'prawn'
class Hyphen < Prawn::Document
def initialize
super(:margin => [10,10,10,10], :page_size => 'A4')
column_box([0, cursor], columns: 2, width: bounds.width) do
text "This is a test where the very important Hy#{Prawn::Text::SHY}phe#{Prawn::Text::SHY}na#{Prawn::Text::SHY}tion works fine here, but which contains Hy#{Prawn::Text::SHY}phe#{Prawn::Text::SHY}na#{Prawn::Text::SHY}tion\n in the last line of the paragraph Hy#{Prawn::Text::SHY}phe#{Prawn::Text::SHY}na#{Prawn::Text::SHY}ted\n"
bounds.move_past_bottom
text "second column"
end
end
end
Hyphen.new.render_file('hyphentest.pdf')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment