Sha256: ed4159680a0c592711a17ccd10b2684b200325b18afc14c4ea96a0d67f771cf5

Contents?: true

Size: 1 KB

Versions: 71

Compression:

Stored size: 1 KB

Contents

# -*- coding: utf-8 -*-

=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".codepoints.first)[0].to_a
  ana.set_extra_attrs(attrs)
  p ana.extra_attrs
end

Version data entries

71 entries across 63 versions & 2 rubygems

Version Path
savant-echo-1.0.4 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/pango-3.1.0/sample/item.rb
savant-echo-1.0.4 bin/packaging/vendor/ruby/2.2.0/gems/pango-3.1.0/sample/item.rb
pango-3.1.1-x64-mingw32 sample/item.rb
pango-3.1.1-x86-mingw32 sample/item.rb
pango-3.1.1 sample/item.rb
savant-echo-1.0.1 bin/packaging/vendor/ruby/2.2.0/gems/pango-3.1.0/sample/item.rb
savant-echo-1.0.1 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/pango-3.1.0/sample/item.rb
savant-echo-0.1.91 bin/packaging/vendor/ruby/2.2.0/gems/pango-3.1.0/sample/item.rb
savant-echo-0.1.91 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/pango-3.1.0/sample/item.rb
savant-echo-0.1.9 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/pango-3.1.0/sample/item.rb
savant-echo-0.1.9 bin/packaging/vendor/ruby/2.2.0/gems/pango-3.1.0/sample/item.rb
savant-echo-0.1.6 bin/packaging/vendor/ruby/2.2.0/gems/pango-3.1.0/sample/item.rb
savant-echo-0.1.6 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/pango-3.1.0/sample/item.rb
savant-echo-0.1.5 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/pango-3.1.0/sample/item.rb
savant-echo-0.1.5 bin/packaging/vendor/ruby/2.2.0/gems/pango-3.1.0/sample/item.rb
savant-echo-0.1.4 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/pango-3.1.0/sample/item.rb
savant-echo-0.1.4 bin/packaging/vendor/ruby/2.2.0/gems/pango-3.1.0/sample/item.rb
savant-echo-0.1.3 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/pango-3.1.0/sample/item.rb
savant-echo-0.1.3 bin/packaging/vendor/ruby/2.2.0/gems/pango-3.1.0/sample/item.rb
pango-3.1.0-x64-mingw32 sample/item.rb