prawn-utils/lib/fourmi/prawn/utils/extensions/text_align.rb

22 lines
479 B
Ruby
Raw Normal View History

2022-10-14 09:05:37 +00:00
module Fourmi::Prawn::Utils
module Extensions
module TextAlign
def paragraph(string, options = {})
textj string, options
move_down 4
end
def textc(string, options = {})
text string, {align: :center}.merge(options)
end
def textj(string, options = {})
text string, {align: :justify}.merge(options)
end
end
end
end
require 'prawn/document'
Prawn::Document.extensions << Prawn::Extensions::TextAlign