pango 3.1.1 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +27 -5
  3. data/ext/pango/depend +2 -2
  4. data/ext/pango/extconf.rb +32 -28
  5. data/ext/pango/pango.def +0 -16
  6. data/ext/pango/rb-pango-attr-list.c +64 -0
  7. data/ext/pango/rb-pango-attribute.c +147 -0
  8. data/ext/pango/rb-pango-context.c +79 -0
  9. data/ext/pango/{rbpangoconversions.h → rb-pango-conversions.h} +4 -6
  10. data/ext/pango/rb-pango-private.h +27 -0
  11. data/ext/pango/rb-pango.c +32 -0
  12. data/ext/pango/rb-pango.h +29 -0
  13. data/extconf.rb +25 -9
  14. data/lib/pango.rb +24 -68
  15. data/lib/pango/cairo-loader.rb +63 -0
  16. data/lib/pango/color.rb +31 -0
  17. data/lib/pango/deprecated.rb +37 -0
  18. data/lib/pango/font-description.rb +29 -0
  19. data/lib/pango/language.rb +29 -0
  20. data/lib/pango/layout.rb +41 -0
  21. data/lib/pango/loader.rb +87 -0
  22. data/lib/pango/markup.rb +31 -0
  23. data/lib/pango/matrix.rb +64 -0
  24. data/lib/pango/rectangle.rb +28 -0
  25. data/lib/pango/version.rb +30 -0
  26. data/test/pango-test-utils.rb +7 -7
  27. data/test/run-test.rb +34 -8
  28. data/test/test-attr-list.rb +28 -0
  29. data/test/test-color.rb +1 -3
  30. data/test/test-context.rb +4 -4
  31. data/test/test-enum.rb +37 -0
  32. data/test/test-font-description.rb +31 -0
  33. data/test/test-language.rb +2 -1
  34. data/test/test-layout.rb +12 -0
  35. data/test/test-markup.rb +30 -0
  36. data/test/test-matrix.rb +131 -5
  37. data/test/test-rectangle.rb +16 -3
  38. metadata +42 -56
  39. data/README +0 -32
  40. data/ext/pango/rbpango.c +0 -356
  41. data/ext/pango/rbpango.h +0 -95
  42. data/ext/pango/rbpangoanalysis.c +0 -218
  43. data/ext/pango/rbpangoattribute.c +0 -506
  44. data/ext/pango/rbpangoattriterator.c +0 -141
  45. data/ext/pango/rbpangoattrlist.c +0 -101
  46. data/ext/pango/rbpangocairo.c +0 -122
  47. data/ext/pango/rbpangocairocontext.c +0 -131
  48. data/ext/pango/rbpangocolor.c +0 -120
  49. data/ext/pango/rbpangocontext.c +0 -344
  50. data/ext/pango/rbpangocoverage.c +0 -106
  51. data/ext/pango/rbpangoengine.c +0 -73
  52. data/ext/pango/rbpangofont.c +0 -110
  53. data/ext/pango/rbpangofontdescription.c +0 -282
  54. data/ext/pango/rbpangofontface.c +0 -73
  55. data/ext/pango/rbpangofontfamily.c +0 -79
  56. data/ext/pango/rbpangofontmap.c +0 -102
  57. data/ext/pango/rbpangofontmetrics.c +0 -85
  58. data/ext/pango/rbpangofontset.c +0 -69
  59. data/ext/pango/rbpangofontsetsimple.c +0 -60
  60. data/ext/pango/rbpangoglyphinfo.c +0 -123
  61. data/ext/pango/rbpangoglyphitem.c +0 -125
  62. data/ext/pango/rbpangoglyphstring.c +0 -151
  63. data/ext/pango/rbpangogravity.c +0 -54
  64. data/ext/pango/rbpangoitem.c +0 -95
  65. data/ext/pango/rbpangolanguage.c +0 -94
  66. data/ext/pango/rbpangolayout.c +0 -583
  67. data/ext/pango/rbpangolayoutiter.c +0 -189
  68. data/ext/pango/rbpangolayoutline.c +0 -243
  69. data/ext/pango/rbpangologattr.c +0 -109
  70. data/ext/pango/rbpangomatrix.c +0 -143
  71. data/ext/pango/rbpangoprivate.h +0 -49
  72. data/ext/pango/rbpangorectangle.c +0 -170
  73. data/ext/pango/rbpangorenderer.c +0 -193
  74. data/ext/pango/rbpangoscript.c +0 -84
  75. data/ext/pango/rbpangoscriptiter.c +0 -92
  76. data/ext/pango/rbpangotabarray.c +0 -128
  77. data/sample/attribute.rb +0 -82
  78. data/sample/break.rb +0 -28
  79. data/sample/gdk_layout.rb +0 -27
  80. data/sample/glyphstring.rb +0 -61
  81. data/sample/item.rb +0 -37
  82. data/sample/label.rb +0 -23
  83. data/sample/layout.rb +0 -102
  84. data/sample/pango_cairo.rb +0 -66
  85. data/sample/parse.rb +0 -33
  86. data/sample/sample.txt +0 -10
  87. data/sample/script.rb +0 -23
data/test/test-enum.rb ADDED
@@ -0,0 +1,37 @@
1
+ # Copyright (C) 2017 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ class TestEnum < Test::Unit::TestCase
18
+ include PangoTestUtils
19
+
20
+ def test_alignment
21
+ assert do
22
+ Pango::Alignment.const_defined?(:LEFT)
23
+ end
24
+ end
25
+
26
+ def test_ellipsize_mode
27
+ assert do
28
+ Pango::EllipsizeMode.const_defined?(:MIDDLE)
29
+ end
30
+ end
31
+
32
+ def test_wrap_mode
33
+ assert do
34
+ Pango::WrapMode.const_defined?(:CHAR)
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,31 @@
1
+ # Copyright (C) 2017 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ class TestFontDescription < Test::Unit::TestCase
18
+ include PangoTestUtils
19
+
20
+ sub_test_case(".new") do
21
+ test("no argument") do
22
+ assert_equal("Normal",
23
+ Pango::FontDescription.new.to_s)
24
+ end
25
+
26
+ test("description") do
27
+ assert_equal("Monospace 18",
28
+ Pango::FontDescription.new("Monospace 18").to_s)
29
+ end
30
+ end
31
+ end
@@ -2,7 +2,8 @@ class TestLanguage < Test::Unit::TestCase
2
2
  include PangoTestUtils
3
3
 
4
4
  def test_default
5
- assert_match(/\A[a-z]{2}-[a-z]{2}\z/, Pango::Language.default.to_s)
5
+ assert_match(/\A(?:[a-z]{2}-[a-z]{2}|(?i:c))\z/,
6
+ Pango::Language.default.to_s)
6
7
  end
7
8
 
8
9
  def test_sample_string
data/test/test-layout.rb CHANGED
@@ -37,4 +37,16 @@ class TestLayout < Test::Unit::TestCase
37
37
  only_pango_version(1, 22, 0)
38
38
  assert_kind_of(Integer, @layout.baseline)
39
39
  end
40
+
41
+ def test_set_text
42
+ text = "Hello <b>World</b>!"
43
+ @layout.text = text
44
+ assert_equal(text, @layout.text)
45
+ end
46
+
47
+ def test_set_markup
48
+ markup = "Hello <b>World</b>!"
49
+ @layout.markup = markup
50
+ assert_equal("Hello World!", @layout.text)
51
+ end
40
52
  end
@@ -0,0 +1,30 @@
1
+ # Copyright (C) 2017 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ class TestPangoMarkup < Test::Unit::TestCase
18
+ include PangoTestUtils
19
+
20
+ def test_plain
21
+ result = Pango.parse_markup("Hello")
22
+ result[0] = result[0].class
23
+ assert_equal([
24
+ Pango::AttrList,
25
+ "Hello",
26
+ nil,
27
+ ],
28
+ result)
29
+ end
30
+ end
data/test/test-matrix.rb CHANGED
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2013 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2013-2017 Ruby-GNOME2 Project Team
4
2
  #
5
3
  # This library is free software; you can redistribute it and/or
6
4
  # modify it under the terms of the GNU Lesser General Public
@@ -19,8 +17,136 @@
19
17
  class TestPangoMatrix < Test::Unit::TestCase
20
18
  include PangoTestUtils
21
19
 
22
- def test_xx
20
+ def test_new
21
+ matrix = Pango::Matrix.new
22
+ assert_equal([
23
+ 1.0, 0.0,
24
+ 0.0, 1.0,
25
+ 0.0,
26
+ 0.0,
27
+ ],
28
+ matrix.to_a)
29
+ end
30
+
31
+ def test_translate
32
+ matrix = Pango::Matrix.new
33
+ new_matrix = matrix.translate(10, 20)
34
+ assert_equal([
35
+ 1.0, 0.0,
36
+ 0.0, 1.0,
37
+ 10.0,
38
+ 20.0,
39
+ ],
40
+ new_matrix.to_a)
41
+ assert_equal(Pango::Matrix.new.to_a,
42
+ matrix.to_a)
43
+ end
44
+
45
+ def test_translate!
46
+ matrix = Pango::Matrix.new
47
+ matrix.translate!(10, 20)
48
+ assert_equal([
49
+ 1.0, 0.0,
50
+ 0.0, 1.0,
51
+ 10.0,
52
+ 20.0,
53
+ ],
54
+ matrix.to_a)
55
+ end
56
+
57
+ def test_scale
58
+ matrix = Pango::Matrix.new
59
+ new_matrix = matrix.scale(3, 5)
60
+ assert_equal([
61
+ 3.0, 0.0,
62
+ 0.0, 5.0,
63
+ 0.0,
64
+ 0.0,
65
+ ],
66
+ new_matrix.to_a)
67
+ assert_equal(Pango::Matrix.new.to_a,
68
+ matrix.to_a)
69
+ end
70
+
71
+ def test_scale!
72
+ matrix = Pango::Matrix.new
73
+ matrix.scale!(3, 5)
74
+ assert_equal([
75
+ 3.0, 0.0,
76
+ 0.0, 5.0,
77
+ 0.0,
78
+ 0.0,
79
+ ],
80
+ matrix.to_a)
81
+ end
82
+
83
+ def test_rotate
84
+ matrix = Pango::Matrix.new
85
+ new_matrix = matrix.rotate(60)
86
+ sin = Math.sin(60 * Math::PI / 180)
87
+ cos = Math.cos(60 * Math::PI / 180)
88
+ assert_equal([
89
+ cos, sin,
90
+ -sin, cos,
91
+ 0.0,
92
+ 0.0,
93
+ ],
94
+ new_matrix.to_a)
95
+ assert_equal(Pango::Matrix.new.to_a,
96
+ matrix.to_a)
97
+ end
98
+
99
+ def test_rotate!
100
+ matrix = Pango::Matrix.new
101
+ matrix.rotate!(60)
102
+ sin = Math.sin(60 * Math::PI / 180)
103
+ cos = Math.cos(60 * Math::PI / 180)
104
+ assert_equal([
105
+ cos, sin,
106
+ -sin, cos,
107
+ 0.0,
108
+ 0.0,
109
+ ],
110
+ matrix.to_a)
111
+ end
112
+
113
+ def test_concat
114
+ matrix = Pango::Matrix.new
115
+ new_matrix = matrix.concat(Pango::Matrix.new.scale(3, 5))
116
+ assert_equal([
117
+ 3.0, 0.0,
118
+ 0.0, 5.0,
119
+ 0.0,
120
+ 0.0,
121
+ ],
122
+ new_matrix.to_a)
123
+ assert_equal(Pango::Matrix.new.to_a,
124
+ matrix.to_a)
125
+ end
126
+
127
+ def test_plus
128
+ matrix = Pango::Matrix.new
129
+ new_matrix = matrix + Pango::Matrix.new.scale(3, 5)
130
+ assert_equal([
131
+ 3.0, 0.0,
132
+ 0.0, 5.0,
133
+ 0.0,
134
+ 0.0,
135
+ ],
136
+ new_matrix.to_a)
137
+ assert_equal(Pango::Matrix.new.to_a,
138
+ matrix.to_a)
139
+ end
140
+
141
+ def test_concat!
23
142
  matrix = Pango::Matrix.new
24
- assert_equal(1.0, matrix.xx)
143
+ matrix.concat!(Pango::Matrix.new.scale(3, 5))
144
+ assert_equal([
145
+ 3.0, 0.0,
146
+ 0.0, 5.0,
147
+ 0.0,
148
+ 0.0,
149
+ ],
150
+ matrix.to_a)
25
151
  end
26
152
  end
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2013 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2013-2017 Ruby-GNOME2 Project Team
4
2
  #
5
3
  # This library is free software; you can redistribute it and/or
6
4
  # modify it under the terms of the GNU Lesser General Public
@@ -19,8 +17,23 @@
19
17
  class TestPangoRectangle < Test::Unit::TestCase
20
18
  include PangoTestUtils
21
19
 
20
+ def test_x
21
+ rectangle = Pango::Rectangle.new(0, 10, 20, 30)
22
+ assert_equal(0, rectangle.x)
23
+ end
24
+
25
+ def test_y
26
+ rectangle = Pango::Rectangle.new(0, 10, 20, 30)
27
+ assert_equal(10, rectangle.y)
28
+ end
29
+
22
30
  def test_width
23
31
  rectangle = Pango::Rectangle.new(0, 10, 20, 30)
24
32
  assert_equal(20, rectangle.width)
25
33
  end
34
+
35
+ def test_height
36
+ rectangle = Pango::Rectangle.new(0, 10, 20, 30)
37
+ assert_equal(30, rectangle.height)
38
+ end
26
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pango
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Ruby-GNOME2 Project Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-26 00:00:00.000000000 Z
11
+ date: 2017-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cairo
@@ -25,19 +25,33 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.14.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: glib2
28
+ name: cairo-gobject
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.1.1
33
+ version: 3.1.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 3.1.1
40
+ version: 3.1.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: gobject-introspection
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 3.1.2
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 3.1.2
41
55
  description: Ruby/Pango is a Ruby binding of pango-1.x.
42
56
  email: ruby-gnome2-devel-en@lists.sourceforge.net
43
57
  executables: []
@@ -45,77 +59,49 @@ extensions:
45
59
  - ext/pango/extconf.rb
46
60
  extra_rdoc_files: []
47
61
  files:
48
- - README
49
62
  - Rakefile
50
63
  - ext/pango/depend
51
64
  - ext/pango/extconf.rb
52
65
  - ext/pango/pango.def
53
- - ext/pango/rbpango.c
54
- - ext/pango/rbpango.h
55
- - ext/pango/rbpangoanalysis.c
56
- - ext/pango/rbpangoattribute.c
57
- - ext/pango/rbpangoattriterator.c
58
- - ext/pango/rbpangoattrlist.c
59
- - ext/pango/rbpangocairo.c
60
- - ext/pango/rbpangocairocontext.c
61
- - ext/pango/rbpangocolor.c
62
- - ext/pango/rbpangocontext.c
63
- - ext/pango/rbpangoconversions.h
64
- - ext/pango/rbpangocoverage.c
65
- - ext/pango/rbpangoengine.c
66
- - ext/pango/rbpangofont.c
67
- - ext/pango/rbpangofontdescription.c
68
- - ext/pango/rbpangofontface.c
69
- - ext/pango/rbpangofontfamily.c
70
- - ext/pango/rbpangofontmap.c
71
- - ext/pango/rbpangofontmetrics.c
72
- - ext/pango/rbpangofontset.c
73
- - ext/pango/rbpangofontsetsimple.c
74
- - ext/pango/rbpangoglyphinfo.c
75
- - ext/pango/rbpangoglyphitem.c
76
- - ext/pango/rbpangoglyphstring.c
77
- - ext/pango/rbpangogravity.c
78
- - ext/pango/rbpangoitem.c
79
- - ext/pango/rbpangolanguage.c
80
- - ext/pango/rbpangolayout.c
81
- - ext/pango/rbpangolayoutiter.c
82
- - ext/pango/rbpangolayoutline.c
83
- - ext/pango/rbpangologattr.c
84
- - ext/pango/rbpangomatrix.c
85
- - ext/pango/rbpangoprivate.h
86
- - ext/pango/rbpangorectangle.c
87
- - ext/pango/rbpangorenderer.c
88
- - ext/pango/rbpangoscript.c
89
- - ext/pango/rbpangoscriptiter.c
90
- - ext/pango/rbpangotabarray.c
66
+ - ext/pango/rb-pango-attr-list.c
67
+ - ext/pango/rb-pango-attribute.c
68
+ - ext/pango/rb-pango-context.c
69
+ - ext/pango/rb-pango-conversions.h
70
+ - ext/pango/rb-pango-private.h
71
+ - ext/pango/rb-pango.c
72
+ - ext/pango/rb-pango.h
91
73
  - extconf.rb
92
74
  - lib/pango.rb
93
- - sample/attribute.rb
94
- - sample/break.rb
95
- - sample/gdk_layout.rb
96
- - sample/glyphstring.rb
97
- - sample/item.rb
98
- - sample/label.rb
99
- - sample/layout.rb
100
- - sample/pango_cairo.rb
101
- - sample/parse.rb
102
- - sample/sample.txt
103
- - sample/script.rb
75
+ - lib/pango/cairo-loader.rb
76
+ - lib/pango/color.rb
77
+ - lib/pango/deprecated.rb
78
+ - lib/pango/font-description.rb
79
+ - lib/pango/language.rb
80
+ - lib/pango/layout.rb
81
+ - lib/pango/loader.rb
82
+ - lib/pango/markup.rb
83
+ - lib/pango/matrix.rb
84
+ - lib/pango/rectangle.rb
85
+ - lib/pango/version.rb
104
86
  - test/pango-test-utils.rb
105
87
  - test/run-test.rb
106
88
  - test/test-analysis.rb
89
+ - test/test-attr-list.rb
107
90
  - test/test-attribute.rb
108
91
  - test/test-color.rb
109
92
  - test/test-context.rb
93
+ - test/test-enum.rb
94
+ - test/test-font-description.rb
110
95
  - test/test-language.rb
111
96
  - test/test-layout.rb
112
97
  - test/test-log-attr.rb
98
+ - test/test-markup.rb
113
99
  - test/test-matrix.rb
114
100
  - test/test-rectangle.rb
115
101
  - test/test-version.rb
116
102
  homepage: http://ruby-gnome2.sourceforge.jp/
117
103
  licenses:
118
- - LGPLv2.1+
104
+ - LGPL-2.1+
119
105
  metadata: {}
120
106
  post_install_message:
121
107
  rdoc_options: []