File: text01.rb

package info (click to toggle)
ruby-rmagick 6.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,232 kB
  • sloc: cpp: 19,563; ruby: 17,147; sh: 88; javascript: 36; makefile: 13
file content (16 lines) | stat: -rw-r--r-- 561 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'rvg/rvg'

Magick::RVG.dpi = 90

rvg = Magick::RVG.new(10.cm, 3.cm).viewbox(0, 0, 1000, 300) do |canvas|
  canvas.background_fill = 'white'
  canvas.desc = "Example text01 - 'Hello, out there' in blue"
  canvas.text(250, 150, 'Hello, out there')
        .styles(font_family: 'Verdana', font_size: 55, fill: 'blue', font_weight: 'normal', font_style: 'normal')
  canvas.circle(5, 250, 150).styles(fill: 'red')

  # Show outline of canvas using 'rect' element
  canvas.rect(997, 297).styles(fill: 'none', stroke: 'blue')
end

rvg.draw.write('text01.gif')