
text height overflow at table with chinese_text_wrapping
Reported by Hiroshi Shirosaki | July 8th, 2009 @ 12:18 AM
Text height overflow at table cells when I use ':wrap => :character' option.
pdf.text_options.update(:wrap => :character)
The cell height calculated by height_of method is wrong.
naive_wrap method should be called with {:mode => :character}
option.
module Wrapping
def height_of(string, line_width, size=font_size)
string = naive_wrap(string, line_width, size)
string.lines.to_a.length * font.height_at(size) end
TODO: Replace with TeX optimal algorithm
def naive_wrap(string, line_width, font_size, options = {})
scan_pattern = options[:mode] == :character ? /./ : /\S+|\s+/
Comments and changes to this ticket
-
Hiroshi Shirosaki July 8th, 2009 @ 12:24 AM
/document/text/wrapping.rb
def height_of(string, line_width, size=font_size)
string = naive_wrap(string, line_width, size) string.lines.to_a.length * font.height_at(size) end # TODO: Replace with TeX optimal algorithm def naive_wrap(string, line_width, font_size, options = {}) scan_pattern = options[:mode] == :character ? /./ : /\S+|\s+/</code>
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป