Hi folks,
I read this: http://ruby-gnome2.sourceforge.jp/hiki.cgi?pango-markup
And I ran the following snippet on Windows 7.
I’m using Ruby 1.9.3p0. The gtk2, cairo and pango are all 1.0.3.
require ‘cairo’
require ‘pango’
require ‘gtk2’
win = Gtk::Window.new
surface = Cairo::ImageSurface.new Cairo::FORMAT_ARGB32, 300, 300
context = Cairo::Context.new surface
layout = context.create_pango_layout
markup = “small-CAPS\nSMALL-CAPS”
attr_list, text = Pango.parse_markup(markup)
layout.text = text
layout.attributes = attr_list
context.show_pango_layout layout
context.show_page
surface.write_to_png ‘hello.png’
img = Gtk::Image.new ‘hello.png’
canvas = Gtk::Layout.new
canvas.put img, 0, 0
win.add canvas
win.show_all
Gtk.main
I expected that it’d show the same two 'SMALL-CAPS’s.
But I got this: http://www.rin-shun.com/tmp/smallcaps.png
The variant attribute seems not to work well…
Please correct me if I’m wrong.
ashbb