Object
Prawn::Text::Formatted::Fragment is a state store for a formatted text fragment. It does not render anything.
# File lib/prawn/text/formatted/fragment.rb, line 192 def absolute_bottom absolute_bounding_box[1] end
# File lib/prawn/text/formatted/fragment.rb, line 204 def absolute_bottom_left [absolute_left, absolute_bottom] end
# File lib/prawn/text/formatted/fragment.rb, line 208 def absolute_bottom_right [absolute_right, absolute_bottom] end
# File lib/prawn/text/formatted/fragment.rb, line 76 def absolute_bounding_box box = bounding_box box[0] += @document.bounds.absolute_left box[2] += @document.bounds.absolute_left box[1] += @document.bounds.absolute_bottom box[3] += @document.bounds.absolute_bottom box end
# File lib/prawn/text/formatted/fragment.rb, line 180 def absolute_left absolute_bounding_box[0] end
# File lib/prawn/text/formatted/fragment.rb, line 184 def absolute_right absolute_bounding_box[2] end
# File lib/prawn/text/formatted/fragment.rb, line 188 def absolute_top absolute_bounding_box[3] end
# File lib/prawn/text/formatted/fragment.rb, line 196 def absolute_top_left [absolute_left, absolute_top] end
# File lib/prawn/text/formatted/fragment.rb, line 200 def absolute_top_right [absolute_right, absolute_top] end
# File lib/prawn/text/formatted/fragment.rb, line 103 def anchor @format_state[:anchor] end
# File lib/prawn/text/formatted/fragment.rb, line 160 def bottom baseline - descender end
# File lib/prawn/text/formatted/fragment.rb, line 176 def bottom_left [left, bottom] end
# File lib/prawn/text/formatted/fragment.rb, line 172 def bottom_right [right, bottom] end
# File lib/prawn/text/formatted/fragment.rb, line 72 def bounding_box [left, bottom, right, top] end
# File lib/prawn/text/formatted/fragment.rb, line 141 def callback_objects callback = @format_state[:callback] if callback.nil? [] elsif callback.is_a?(Array) callback else [callback] end end
# File lib/prawn/text/formatted/fragment.rb, line 119 def character_spacing @format_state[:character_spacing] || @document.character_spacing end
# File lib/prawn/text/formatted/fragment.rb, line 107 def color @format_state[:color] end
# File lib/prawn/text/formatted/fragment.rb, line 128 def default_direction=(direction) @format_state[:direction] = direction unless @format_state[:direction] end
# File lib/prawn/text/formatted/fragment.rb, line 124 def direction @format_state[:direction] end
# File lib/prawn/text/formatted/fragment.rb, line 111 def font @format_state[:font] end
# File lib/prawn/text/formatted/fragment.rb, line 53 def height top - bottom end
# File lib/prawn/text/formatted/fragment.rb, line 132 def include_trailing_white_space! @format_state.delete(:exclude_trailing_white_space) end
# File lib/prawn/text/formatted/fragment.rb, line 99 def link @format_state[:link] end
# File lib/prawn/text/formatted/fragment.rb, line 152 def right left + width end
# File lib/prawn/text/formatted/fragment.rb, line 115 def size @format_state[:size] end
# File lib/prawn/text/formatted/fragment.rb, line 136 def space_count string = exclude_trailing_white_space? ? @text.rstrip : @text string.count(" ") end
# File lib/prawn/text/formatted/fragment.rb, line 90 def strikethrough_points y = baseline + ascender * 0.3 [[left, y], [right, y]] end
# File lib/prawn/text/formatted/fragment.rb, line 95 def styles @format_state[:styles] || [] end
# File lib/prawn/text/formatted/fragment.rb, line 57 def subscript? styles.include?(:subscript) end
# File lib/prawn/text/formatted/fragment.rb, line 61 def superscript? styles.include?(:superscript) end
# File lib/prawn/text/formatted/fragment.rb, line 29 def text string = strip_zero_width_spaces(@text) if exclude_trailing_white_space? string = string.rstrip string = process_soft_hyphens(string) end case direction when :rtl if ruby_18 { true } string.scan(/./u).reverse.join else string.reverse end else string end end
# File lib/prawn/text/formatted/fragment.rb, line 156 def top baseline + ascender end
# File lib/prawn/text/formatted/fragment.rb, line 164 def top_left [left, top] end
# File lib/prawn/text/formatted/fragment.rb, line 168 def top_right [right, top] end
# File lib/prawn/text/formatted/fragment.rb, line 85 def underline_points y = baseline - 1.25 [[left, y], [right, y]] end
Generated with the Darkfish Rdoc Generator 2.