Fix text wrapping
This commit is contained in:
parent
3a98c23838
commit
4cab9f4707
22
main.rb
22
main.rb
|
@ -12,10 +12,26 @@ require 'zlib'
|
||||||
|
|
||||||
include Prawn::Measurements
|
include Prawn::Measurements
|
||||||
|
|
||||||
|
module Prawn
|
||||||
|
module Text
|
||||||
|
module Formatted #:nodoc:
|
||||||
|
# @private
|
||||||
|
class LineWrap #:nodoc:
|
||||||
|
def whitespace()
|
||||||
|
# Wrap by these special characters as well
|
||||||
|
"&:/\\" +
|
||||||
|
"\s\t#{zero_width_space()}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
module Excon
|
module Excon
|
||||||
class Response
|
class Response
|
||||||
def json!()
|
def json!()
|
||||||
puts body
|
# Convenience function
|
||||||
JSON.parse(body)
|
JSON.parse(body)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -80,8 +96,8 @@ def render_label(label)
|
||||||
# Left side
|
# Left side
|
||||||
bounding_box(bounds.top_left, :width => bounds.width-rw) do
|
bounding_box(bounds.top_left, :width => bounds.width-rw) do
|
||||||
text_box label['item']['name'],
|
text_box label['item']['name'],
|
||||||
size: 30, align: :center, valign: :center,
|
size: 40, align: :center, valign: :center, width: bounds.width-10,
|
||||||
inline_format: true, overflow: :shrink_to_fit
|
inline_format: true, overflow: :shrink_to_fit, disable_wrap_by_char: true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue