File: break.rb

package info (click to toggle)
ruby-gnome2 0.15.0-1.1
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 7,692 kB
  • ctags: 8,558
  • sloc: ansic: 69,912; ruby: 19,511; makefile: 97; xml: 35; sql: 13
file content (26 lines) | stat: -rw-r--r-- 771 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
=begin
  break.rb - Ruby/Pango sample script.

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

  $Id: break.rb,v 1.1 2005/09/17 17:09:12 mutoh Exp $
=end

require 'pango'

attr = Pango.break("Hello Worldです\n2nd line", Pango::Analysis.new)

p attr.length
attr.each do |v|
  print "line_break:#{v.line_break?}"
  print ", mandatory_break:#{v.mandatory_break?}"
  print ", char_break:#{v.char_break?}"
  print ", white:#{v.white?}"
  print ", cursor_position:#{v.cursor_position?}"
  print ", word_start:#{v.word_start?}"
  print ", word_end:#{v.word_end?}"
  print ", sentence_boundary:#{v.sentence_boundary?}"
  print ", sentence_start:#{v.sentence_start?}"
  print ", sentence_end:#{v.sentence_end?}\n"
end