main
1class Image
2 def self.find(id)
3 svg = Scale::SVG.new(width: "100%", height: "100%")
4
5 svg.add(Scale::Text.new("HELLO WORLD #{id}", x: 250, y: 250, font_size: 55, font_family: "Verdana"))
6 svg.add(Scale::Path.new.tap do |path|
7 path.move_to(x: 20, y: 1)
8 10.times do |n|
9 path.horizontal(rand(50), relative: true)
10 path.vertical(rand(50), relative: true)
11 path.horizontal(rand(50), relative: true)
12 end
13 path.close_path
14 end)
15 svg.add(Scale::Circle.new(r: 10, cx: 100, cy: 100))
16 svg.add(Scale::Rectangle.new(width: 10, height: 100, x: 200, y: 200))
17 svg
18 end
19end