Sha256: 84ba1cf7f25841638dd379949066857612f3efeb8b0514eb8678223aead85780

Contents?: true

Size: 986 Bytes

Versions: 64

Compression:

Stored size: 986 Bytes

Contents

=begin
  item.rb - Ruby/Pango sample script.

  Copyright (c) 2005 Ruby-GNOME2 Project
  This program is licenced under the same licence as Ruby-GNOME2.

  $Id: item.rb,v 1.3 2006/06/17 13:37:01 mutoh Exp $
=end

require 'gtk2'

str = "Ruby-GNOME2こんにちわ" 
win = Gtk::Window.new("Ruby/Pango sample")
win.realize

p screen = Gdk::Screen.default
p context = Gdk::Pango.context(screen)
p attrlist = Pango::AttrList.new

p a = Pango::AttrBackground.new(65535, 0, 0)

attrlist.insert(Pango::AttrBackground.new(65535, 0,0))

attrs = [Pango::AttrBackground.new(65535, 0,0), Pango::AttrForeground.new(65535, 0,0)]

items = context.itemize(Pango::Context::DIRECTION_RTL, str, 0, 40, attrlist)

items.each do |v|
  ana = v.analysis
  puts "shape_engine = #{ana.shape_engine}, lang_engine = #{ana.lang_engine}, font = #{ana.font}, level = #{ana.level}"
  puts "language = #{ana.language}"
  p ana.font.get_glyph_extents("a"[0])[0].to_a
  ana.set_extra_attrs(attrs)
  p ana.extra_attrs
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
pango-2.0.1-x86-mingw32 sample/item.rb
pango-2.0.1 sample/item.rb
pango-2.0.0-x86-mingw32 sample/item.rb
pango-2.0.0 sample/item.rb
pango-1.2.6-x86-mingw32 sample/item.rb
pango-1.2.6 sample/item.rb
pango-1.2.5-x86-mingw32 sample/item.rb
pango-1.2.5 sample/item.rb
pango-1.2.4-x86-mingw32 sample/item.rb
pango-1.2.4 sample/item.rb
pango-1.2.3 sample/item.rb
pango-1.2.3-x86-mingw32 sample/item.rb
pango-1.2.2-x86-mingw32 sample/item.rb
pango-1.2.2 sample/item.rb
pango-1.2.1-x86-mingw32 sample/item.rb
pango-1.2.1 sample/item.rb
pango-1.2.0-x86-mingw32 sample/item.rb
pango-1.2.0 sample/item.rb
pango-1.1.9-x86-mingw32 sample/item.rb
pango-1.1.9 sample/item.rb