Sha256: 2c695dff82990d70e164608b3e057ae6f58cf80aa3d25037222d9e03ddea1ccb

Contents?: true

Size: 779 Bytes

Versions: 1

Compression:

Stored size: 779 Bytes

Contents

require 'rvg/rvg'
include Magick

RVG.dpi = 90

TEXT_STYLES = {:writing_mode=>'tb',
               :glyph_orientation_vertical=>0,
               :fill=>'red4',
               :font_weight=>'bold',
               :font_size=>16}

TEXT_STYLES2 = {:writing_mode=>'tb',
               :glyph_orientation_vertical=>90,
               :fill=>'green',
               :font_weight=>'bold',
               :font_size=>16}

rvg = RVG.new(1.25.in, 6.in).viewbox(0,0,125,600) do |canvas|
    canvas.background_fill = 'white'

    canvas.text(40, 15, ":glyph_orientation_vertical=0").styles(TEXT_STYLES)
    canvas.text(80, 25, ":glyph_orientation_vertical=90").styles(TEXT_STYLES2)

    canvas.rect(124, 598).styles(:fill=>'none',:stroke=>'blue')
end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rmagick-1.8.0 doc/ex/writing_mode01.rb