12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/prawn/svg/elements/text.rb', line 12
def render(prawn, renderer)
return unless @root_component.children
origin_x = @root_component.x_values.first
origin_y = @root_component.y_values.first
@root_component.lay_out(prawn)
translate_x =
case @root_component.computed_properties.text_anchor
when 'middle'
-@root_component.calculated_width / 2.0
when 'end'
-@root_component.calculated_width
end
cursor = Cursor.new(0, document.sizing.output_height)
if vertical_writing_mode?
render_vertical(prawn, renderer, cursor, translate_x, origin_x, origin_y)
else
@root_component.render_component(prawn, renderer, cursor, translate_x)
end
end
|