pango 3.4.4 → 3.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/pango.rb +19 -1
- data/lib/pango/cairo-loader.rb +14 -0
- data/{test/test-pango.rb → lib/pango/fc-loader.rb} +7 -6
- data/{test/test-analysis.rb → lib/pango/ft2-loader.rb} +7 -9
- data/{test/test-attr-type.rb → lib/pango/ot-loader.rb} +6 -6
- data/pango.gemspec +9 -3
- metadata +15 -26
- data/test/pango-test-utils.rb +0 -34
- data/test/run-test.rb +0 -29
- data/test/test-attr-iterator.rb +0 -36
- data/test/test-attr-list.rb +0 -46
- data/test/test-attribute.rb +0 -19
- data/test/test-color.rb +0 -45
- data/test/test-context.rb +0 -133
- data/test/test-enum.rb +0 -37
- data/test/test-font-description.rb +0 -31
- data/test/test-language.rb +0 -13
- data/test/test-layout.rb +0 -52
- data/test/test-log-attr.rb +0 -26
- data/test/test-markup.rb +0 -30
- data/test/test-matrix.rb +0 -153
- data/test/test-rectangle.rb +0 -59
- data/test/test-version.rb +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9b3e5f7a71267c411ad7db4e2a00ee4eee2b600e831bd8bcffda25cf5075dab
|
4
|
+
data.tar.gz: 8a0d67cd3b6f40082e05ecd2ea052c0af8485fe7f6ecabd46267e72e5720da16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c629195ebae785ef93ce2ccb0adf71d037b6400ff7062adb84dde97e2b93b597edff40b0a65e8bdb848e1820dddd6b02a4d352a1f2a1f1a33320e9c480eca66
|
7
|
+
data.tar.gz: 95fcdb73b29e62eafbc86b24e6c99caba80b513f1a6c7f82ae622888ea0ce72663c1501abfd9d4263cdd90b87abbc149e26eb6dbea9677a18aac5829c2bca90f
|
data/lib/pango.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2017-
|
1
|
+
# Copyright (C) 2017-2021 Ruby-GNOME Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -20,6 +20,9 @@ require "cairo-gobject"
|
|
20
20
|
|
21
21
|
require "pango/loader"
|
22
22
|
require "pango/cairo-loader"
|
23
|
+
require "pango/fc-loader"
|
24
|
+
require "pango/ft2-loader"
|
25
|
+
require "pango/ot-loader"
|
23
26
|
|
24
27
|
module Pango
|
25
28
|
LOG_DOMAIN = "Pango"
|
@@ -30,4 +33,19 @@ module Pango
|
|
30
33
|
|
31
34
|
cairo_loader = CairoLoader.new(self)
|
32
35
|
cairo_loader.load("PangoCairo")
|
36
|
+
|
37
|
+
fc_loader = FcLoader.new(self)
|
38
|
+
begin
|
39
|
+
fc_loader.load("PangoFc")
|
40
|
+
rescue GObjectIntrospection::RepositoryError::TypelibNotFound
|
41
|
+
end
|
42
|
+
|
43
|
+
ft2_loader = FT2Loader.new(self)
|
44
|
+
ft2_loader.load("PangoFT2")
|
45
|
+
|
46
|
+
ot_loader = OTLoader.new(self)
|
47
|
+
begin
|
48
|
+
ot_loader.load("PangoOT")
|
49
|
+
rescue GObjectIntrospection::RepositoryError::TypelibNotFound
|
50
|
+
end
|
33
51
|
end
|
data/lib/pango/cairo-loader.rb
CHANGED
@@ -21,6 +21,20 @@ module Pango
|
|
21
21
|
@context_class = @base_module.const_get(:Context)
|
22
22
|
end
|
23
23
|
|
24
|
+
def post_load(repository, namespace)
|
25
|
+
font_map = @base_module.const_get("CairoFontMap")
|
26
|
+
font_types = []
|
27
|
+
font_types << :quartz if Cairo::FontFace.quartz_supported?
|
28
|
+
font_types << :win32 if Cairo::Surface.quartz_supported?
|
29
|
+
font_types << :ft if Cairo::FontFace.freetype_supported?
|
30
|
+
font_types.each do |font_type|
|
31
|
+
font_map = font_map.new_for_font_type(font_type)
|
32
|
+
next if font_map.nil?
|
33
|
+
@base_module.const_set(font_map.class.gtype.name.gsub(/\APango/, ""),
|
34
|
+
font_map.class)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
24
38
|
def rubyish_class_name(info)
|
25
39
|
"Cairo#{super}"
|
26
40
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C)
|
1
|
+
# Copyright (C) 2021 Ruby-GNOME Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -14,10 +14,11 @@
|
|
14
14
|
# License along with this library; if not, write to the Free Software
|
15
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
module Pango
|
18
|
+
class FcLoader < GObjectIntrospection::Loader
|
19
|
+
private
|
20
|
+
def rubyish_class_name(info)
|
21
|
+
"Fc#{super}"
|
22
|
+
end
|
22
23
|
end
|
23
24
|
end
|
@@ -1,6 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 Ruby-GNOME2 Project Team
|
1
|
+
# Copyright (C) 2021 Ruby-GNOME 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
|
@@ -16,11 +14,11 @@
|
|
16
14
|
# License along with this library; if not, write to the Free Software
|
17
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
16
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
module Pango
|
18
|
+
class FT2Loader < GObjectIntrospection::Loader
|
19
|
+
private
|
20
|
+
def rubyish_class_name(info)
|
21
|
+
"FT2#{super}"
|
22
|
+
end
|
25
23
|
end
|
26
24
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C)
|
1
|
+
# Copyright (C) 2021 Ruby-GNOME Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -14,11 +14,11 @@
|
|
14
14
|
# License along with this library; if not, write to the Free Software
|
15
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
module Pango
|
18
|
+
class OTLoader < GObjectIntrospection::Loader
|
19
|
+
private
|
20
|
+
def rubyish_class_name(info)
|
21
|
+
"OT#{super}"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
data/pango.gemspec
CHANGED
@@ -21,7 +21,7 @@ require_relative "../glib2/version"
|
|
21
21
|
Gem::Specification.new do |s|
|
22
22
|
s.name = "pango"
|
23
23
|
s.summary = "Ruby/Pango is a Ruby binding of pango-1.x."
|
24
|
-
s.description = "Ruby/Pango is a Ruby binding of pango-1.x."
|
24
|
+
s.description = "Ruby/Pango is a Ruby binding of pango-1.x based on GObject-Introspection."
|
25
25
|
s.author = "The Ruby-GNOME Project Team"
|
26
26
|
s.email = "ruby-gnome2-devel-en@lists.sourceforge.net"
|
27
27
|
s.homepage = "https://ruby-gnome2.osdn.jp/"
|
@@ -39,10 +39,16 @@ Gem::Specification.new do |s|
|
|
39
39
|
]
|
40
40
|
s.files += Dir.glob("lib/**/*.rb")
|
41
41
|
s.files += Dir.glob("ext/#{s.name}/*.{c,h,def,rb}")
|
42
|
-
s.files += Dir.glob("test/**/*")
|
43
42
|
|
44
43
|
s.add_runtime_dependency("cairo-gobject", "= #{s.version}")
|
45
44
|
s.add_runtime_dependency("gobject-introspection", "= #{s.version}")
|
46
45
|
|
47
|
-
s.metadata
|
46
|
+
s.metadata = {
|
47
|
+
"bug_tracker_uri" => "https://github.com/ruby-gnome/ruby-gnome/issues",
|
48
|
+
"changelog_uri" => "https://github.com/ruby-gnome/ruby-gnome/blob/master/NEWS",
|
49
|
+
"documentation_uri" => "https://ruby-gnome2.osdn.jp/hiki.cgi?Ruby%2FPango",
|
50
|
+
"mailing_list_uri" => "https://sourceforge.net/p/ruby-gnome2/mailman/ruby-gnome2-devel-en",
|
51
|
+
"source_code_uri" => "https://github.com/ruby-gnome/ruby-gnome/tree/master/pango",
|
52
|
+
"msys2_mingw_dependencies" => "pango"
|
53
|
+
}
|
48
54
|
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.4.
|
4
|
+
version: 3.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME Project Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cairo-gobject
|
@@ -16,29 +16,29 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.4.
|
19
|
+
version: 3.4.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.4.
|
26
|
+
version: 3.4.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: gobject-introspection
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.4.
|
33
|
+
version: 3.4.5
|
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.4.
|
41
|
-
description: Ruby/Pango is a Ruby binding of pango-1.x.
|
40
|
+
version: 3.4.5
|
41
|
+
description: Ruby/Pango is a Ruby binding of pango-1.x based on GObject-Introspection.
|
42
42
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
43
43
|
executables: []
|
44
44
|
extensions:
|
@@ -66,38 +66,27 @@ files:
|
|
66
66
|
- lib/pango/cairo-loader.rb
|
67
67
|
- lib/pango/color.rb
|
68
68
|
- lib/pango/deprecated.rb
|
69
|
+
- lib/pango/fc-loader.rb
|
69
70
|
- lib/pango/font-description.rb
|
71
|
+
- lib/pango/ft2-loader.rb
|
70
72
|
- lib/pango/language.rb
|
71
73
|
- lib/pango/layout.rb
|
72
74
|
- lib/pango/loader.rb
|
73
75
|
- lib/pango/markup.rb
|
74
76
|
- lib/pango/matrix.rb
|
77
|
+
- lib/pango/ot-loader.rb
|
75
78
|
- lib/pango/rectangle.rb
|
76
79
|
- lib/pango/version.rb
|
77
80
|
- pango.gemspec
|
78
|
-
- test/pango-test-utils.rb
|
79
|
-
- test/run-test.rb
|
80
|
-
- test/test-analysis.rb
|
81
|
-
- test/test-attr-iterator.rb
|
82
|
-
- test/test-attr-list.rb
|
83
|
-
- test/test-attr-type.rb
|
84
|
-
- test/test-attribute.rb
|
85
|
-
- test/test-color.rb
|
86
|
-
- test/test-context.rb
|
87
|
-
- test/test-enum.rb
|
88
|
-
- test/test-font-description.rb
|
89
|
-
- test/test-language.rb
|
90
|
-
- test/test-layout.rb
|
91
|
-
- test/test-log-attr.rb
|
92
|
-
- test/test-markup.rb
|
93
|
-
- test/test-matrix.rb
|
94
|
-
- test/test-pango.rb
|
95
|
-
- test/test-rectangle.rb
|
96
|
-
- test/test-version.rb
|
97
81
|
homepage: https://ruby-gnome2.osdn.jp/
|
98
82
|
licenses:
|
99
83
|
- LGPL-2.1+
|
100
84
|
metadata:
|
85
|
+
bug_tracker_uri: https://github.com/ruby-gnome/ruby-gnome/issues
|
86
|
+
changelog_uri: https://github.com/ruby-gnome/ruby-gnome/blob/master/NEWS
|
87
|
+
documentation_uri: https://ruby-gnome2.osdn.jp/hiki.cgi?Ruby%2FPango
|
88
|
+
mailing_list_uri: https://sourceforge.net/p/ruby-gnome2/mailman/ruby-gnome2-devel-en
|
89
|
+
source_code_uri: https://github.com/ruby-gnome/ruby-gnome/tree/master/pango
|
101
90
|
msys2_mingw_dependencies: pango
|
102
91
|
post_install_message:
|
103
92
|
rdoc_options: []
|
data/test/pango-test-utils.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
# Copyright (C) 2008-2021 Ruby-GNOME 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
|
-
require "pango"
|
18
|
-
|
19
|
-
module PangoTestUtils
|
20
|
-
private
|
21
|
-
def only_pango_version(major, minor, micro=nil)
|
22
|
-
micro ||= 0
|
23
|
-
unless Pango::Version.or_later?(major, minor, micro)
|
24
|
-
omit("Require Pango >= #{major}.#{minor}.#{micro}")
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def only_gi_version(major, minor, micro=nil)
|
29
|
-
micro ||= 0
|
30
|
-
if (GObjectIntrospection::BUILD_VERSION <=> [major, minor, micro]) < 0
|
31
|
-
omit("Require GObject Introspection >= #{major}.#{minor}.#{micro}")
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
data/test/run-test.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# Copyright (C) 2017-2021 Ruby-GNOME Project Team
|
4
|
-
#
|
5
|
-
# This library is free software; you can redistribute it and/or
|
6
|
-
# modify it under the terms of the GNU Lesser General Public
|
7
|
-
# License as published by the Free Software Foundation; either
|
8
|
-
# version 2.1 of the License, or (at your option) any later version.
|
9
|
-
#
|
10
|
-
# This library is distributed in the hope that it will be useful,
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
-
# Lesser General Public License for more details.
|
14
|
-
#
|
15
|
-
# You should have received a copy of the GNU Lesser General Public
|
16
|
-
# License along with this library; if not, write to the Free Software
|
17
|
-
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
-
|
19
|
-
require_relative "../../glib2/test/run-test"
|
20
|
-
|
21
|
-
run_test(__dir__,
|
22
|
-
[
|
23
|
-
"glib2",
|
24
|
-
"gobject-introspection",
|
25
|
-
"cairo-gobject",
|
26
|
-
"pango",
|
27
|
-
]) do
|
28
|
-
require_relative "pango-test-utils"
|
29
|
-
end
|
data/test/test-attr-iterator.rb
DELETED
@@ -1,36 +0,0 @@
|
|
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 TestAttrIterator < Test::Unit::TestCase
|
18
|
-
include PangoTestUtils
|
19
|
-
|
20
|
-
def setup
|
21
|
-
attrs, = Pango.parse_markup("Hello <b>world</b>!")
|
22
|
-
@iterator = attrs.iterator
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_attrs
|
26
|
-
@iterator.next
|
27
|
-
indexes = @iterator.attrs.collect do |attr|
|
28
|
-
[
|
29
|
-
attr.start_index,
|
30
|
-
attr.end_index,
|
31
|
-
attr.value,
|
32
|
-
]
|
33
|
-
end
|
34
|
-
assert_equal([[6, 11, Pango::Weight::BOLD]], indexes)
|
35
|
-
end
|
36
|
-
end
|
data/test/test-attr-list.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
# Copyright (C) 2017-2019 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 TestAttrList < Test::Unit::TestCase
|
18
|
-
include PangoTestUtils
|
19
|
-
|
20
|
-
def setup
|
21
|
-
@attrs = Pango::AttrList.new
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_insert
|
25
|
-
attribute = Pango::AttrLanguage.new(Pango::Language.default)
|
26
|
-
@attrs.insert(attribute)
|
27
|
-
assert_equal([
|
28
|
-
[attribute.value.to_s],
|
29
|
-
[],
|
30
|
-
],
|
31
|
-
@attrs.collect {|iter| iter.attrs.collect {|a| a.value.to_s}})
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_change
|
35
|
-
only_gi_version(1, 60)
|
36
|
-
first_attribute = Pango::AttrLanguage.new(Pango::Language.new("ja-jp"))
|
37
|
-
@attrs.insert(first_attribute)
|
38
|
-
second_attribute = Pango::AttrLanguage.new(Pango::Language.new("en-us"))
|
39
|
-
@attrs.change(second_attribute)
|
40
|
-
assert_equal([
|
41
|
-
[second_attribute.value.to_s],
|
42
|
-
[],
|
43
|
-
],
|
44
|
-
@attrs.collect {|iter| iter.attrs.collect {|a| a.value.to_s}})
|
45
|
-
end
|
46
|
-
end
|
data/test/test-attribute.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
class TestAttribute < Test::Unit::TestCase
|
2
|
-
include PangoTestUtils
|
3
|
-
|
4
|
-
def setup
|
5
|
-
@attribute = Pango::AttrLanguage.new(Pango::Language.default)
|
6
|
-
end
|
7
|
-
|
8
|
-
def test_start_index
|
9
|
-
assert_equal(0, @attribute.start_index)
|
10
|
-
@attribute.start_index = 5
|
11
|
-
assert_equal(5, @attribute.start_index)
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_end_index
|
15
|
-
assert_equal(GLib::MAXUINT, @attribute.end_index)
|
16
|
-
@attribute.end_index = 5
|
17
|
-
assert_equal(5, @attribute.end_index)
|
18
|
-
end
|
19
|
-
end
|
data/test/test-color.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
# Copyright (C) 2013-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 TestPangoColor < Test::Unit::TestCase
|
18
|
-
include PangoTestUtils
|
19
|
-
|
20
|
-
def test_red
|
21
|
-
color = Pango::Color.new(0, 0, 0)
|
22
|
-
assert_equal(0, color.red)
|
23
|
-
color.red = 32768
|
24
|
-
assert_equal(32768, color.red)
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_blue
|
28
|
-
color = Pango::Color.new(0, 0, 0)
|
29
|
-
assert_equal(0, color.blue)
|
30
|
-
color.blue = 32768
|
31
|
-
assert_equal(32768, color.blue)
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_green
|
35
|
-
color = Pango::Color.new(0, 0, 0)
|
36
|
-
assert_equal(0, color.green)
|
37
|
-
color.green = 32768
|
38
|
-
assert_equal(32768, color.green)
|
39
|
-
end
|
40
|
-
|
41
|
-
def test_to_a
|
42
|
-
color = Pango::Color.new(65535, 32768, 0)
|
43
|
-
assert_equal([65535, 32768, 0], color.to_a)
|
44
|
-
end
|
45
|
-
end
|
data/test/test-context.rb
DELETED
@@ -1,133 +0,0 @@
|
|
1
|
-
# Copyright (C) 2016-2019 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 TestContext < Test::Unit::TestCase
|
18
|
-
include PangoTestUtils
|
19
|
-
|
20
|
-
def setup
|
21
|
-
font_map = Pango::CairoFontMap.default
|
22
|
-
@context = font_map.create_context
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_set_font_map
|
26
|
-
font_map = Pango::CairoFontMap.default
|
27
|
-
@context.font_map = font_map
|
28
|
-
assert_equal(font_map, @context.font_map)
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_set_font_description
|
32
|
-
description = Pango::FontDescription.new("monospace")
|
33
|
-
description.size = 10 * Pango::SCALE
|
34
|
-
@context.font_description = description
|
35
|
-
assert_equal("monospace 10", @context.font_description.to_s)
|
36
|
-
end
|
37
|
-
|
38
|
-
def test_set_language
|
39
|
-
@context.language = Pango::Language.new("fr")
|
40
|
-
assert_equal("fr", @context.language.to_s)
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_set_base_dir
|
44
|
-
@context.base_dir = :ltr
|
45
|
-
assert_equal(Pango::Direction::LTR, @context.base_dir)
|
46
|
-
end
|
47
|
-
|
48
|
-
def test_set_gravity
|
49
|
-
@context.gravity_hint = :strong
|
50
|
-
assert_equal(Pango::GravityHint::STRONG, @context.gravity_hint)
|
51
|
-
end
|
52
|
-
|
53
|
-
def test_set_matrix
|
54
|
-
matrix = Pango::Matrix.new(0.1, 0.2, 0.3, 0.4, 0.5, 0.6)
|
55
|
-
@context.matrix = matrix
|
56
|
-
assert_equal(0.1, @context.matrix.xx)
|
57
|
-
assert_equal(0.2, @context.matrix.xy)
|
58
|
-
assert_equal(0.3, @context.matrix.yx)
|
59
|
-
assert_equal(0.4, @context.matrix.yy)
|
60
|
-
assert_equal(0.5, @context.matrix.x0)
|
61
|
-
assert_equal(0.6, @context.matrix.y0)
|
62
|
-
end
|
63
|
-
|
64
|
-
def test_load_font
|
65
|
-
description = Pango::FontDescription.new("monospace")
|
66
|
-
description.size = 10 * Pango::SCALE
|
67
|
-
font = @context.load_font(description)
|
68
|
-
assert_equal(10,
|
69
|
-
(font.describe.size.to_f / Pango::SCALE).round)
|
70
|
-
end
|
71
|
-
|
72
|
-
def test_load_fontset
|
73
|
-
description = Pango::FontDescription.new("monospace")
|
74
|
-
description.size = 10 * Pango::SCALE
|
75
|
-
language = Pango::Language.new("fr")
|
76
|
-
fontset = @context.load_fontset(description, language)
|
77
|
-
a_unicode = GLib::UTF8.get_char("a")
|
78
|
-
font = fontset.get_font(a_unicode)
|
79
|
-
assert_equal(10,
|
80
|
-
(font.describe.size.to_f / Pango::SCALE).round)
|
81
|
-
end
|
82
|
-
|
83
|
-
def test_get_metrics
|
84
|
-
description = Pango::FontDescription.new("monospace")
|
85
|
-
description.size = 10 * Pango::SCALE
|
86
|
-
language = Pango::Language.new("fr")
|
87
|
-
metrics = @context.get_metrics(description, language)
|
88
|
-
assert do
|
89
|
-
metrics.ascent > metrics.descent
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
def test_families
|
94
|
-
family_names = @context.families.collect(&:name)
|
95
|
-
assert do
|
96
|
-
family_names.include?("Monospace")
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
def test_font_options
|
101
|
-
options = Cairo::FontOptions.new
|
102
|
-
options.antialias = Cairo::Antialias::BEST
|
103
|
-
@context.font_options = options
|
104
|
-
assert_equal(Cairo::Antialias::BEST,
|
105
|
-
@context.font_options.antialias)
|
106
|
-
end
|
107
|
-
|
108
|
-
def test_resolution
|
109
|
-
dpi = 72
|
110
|
-
@context.resolution = dpi
|
111
|
-
assert_equal(dpi, @context.resolution)
|
112
|
-
end
|
113
|
-
|
114
|
-
sub_test_case("#set_shape_renderer") do
|
115
|
-
def test_gc
|
116
|
-
GC.start
|
117
|
-
n_contexts = ObjectSpace.each_object(Pango::Context) {}
|
118
|
-
n_procs = ObjectSpace.each_object(Proc) {}
|
119
|
-
n = 1000
|
120
|
-
n.times do
|
121
|
-
context = Pango::CairoFontMap.default.create_context
|
122
|
-
context.set_shape_renderer do
|
123
|
-
end
|
124
|
-
end
|
125
|
-
GC.start
|
126
|
-
n_contexts_after = ObjectSpace.each_object(Pango::Context) {}
|
127
|
-
n_procs_after = ObjectSpace.each_object(Proc) {}
|
128
|
-
assert do
|
129
|
-
(n_contexts_after < n_contexts + n) and (n_procs_after < n_procs + n)
|
130
|
-
end
|
131
|
-
end
|
132
|
-
end
|
133
|
-
end
|
data/test/test-enum.rb
DELETED
@@ -1,37 +0,0 @@
|
|
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
|
@@ -1,31 +0,0 @@
|
|
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
|
data/test/test-language.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
class TestLanguage < Test::Unit::TestCase
|
2
|
-
include PangoTestUtils
|
3
|
-
|
4
|
-
def test_default
|
5
|
-
assert_match(/\A(?:[a-z]{2}-[a-z]{2}|(?i:c))\z/,
|
6
|
-
Pango::Language.default.to_s)
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_sample_string
|
10
|
-
assert_equal("The quick brown fox jumps over the lazy dog.",
|
11
|
-
Pango::Language.new("en").sample_string)
|
12
|
-
end
|
13
|
-
end
|
data/test/test-layout.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
class TestLayout < Test::Unit::TestCase
|
2
|
-
include PangoTestUtils
|
3
|
-
|
4
|
-
def setup
|
5
|
-
@font_map = Pango::CairoFontMap.default
|
6
|
-
@context = @font_map.create_context
|
7
|
-
@layout = Pango::Layout.new(@context)
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_set_font_description
|
11
|
-
assert_nil(@layout.font_description)
|
12
|
-
|
13
|
-
@layout.font_description = "sans 14"
|
14
|
-
assert_equal("sans 14", @layout.font_description.to_s)
|
15
|
-
|
16
|
-
description = Pango::FontDescription.new("monospace")
|
17
|
-
description.size = 10 * Pango::SCALE
|
18
|
-
@layout.font_description = description
|
19
|
-
assert_equal("monospace 10", @layout.font_description.to_s)
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_height
|
23
|
-
assert_equal(-1, @layout.height)
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_set_height
|
27
|
-
new_height = 29 * Pango::SCALE
|
28
|
-
@layout.height = new_height
|
29
|
-
assert_equal(new_height, @layout.height)
|
30
|
-
end
|
31
|
-
|
32
|
-
def test_ellipsized?
|
33
|
-
assert_false(@layout.ellipsized?)
|
34
|
-
end
|
35
|
-
|
36
|
-
def test_baseline
|
37
|
-
only_pango_version(1, 22, 0)
|
38
|
-
assert_kind_of(Integer, @layout.baseline)
|
39
|
-
end
|
40
|
-
|
41
|
-
def test_set_text
|
42
|
-
text = "こんにちは <b>World</b>!"
|
43
|
-
@layout.text = text
|
44
|
-
assert_equal(text, @layout.text)
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_set_markup
|
48
|
-
markup = "こんにちは <b>World</b>!"
|
49
|
-
@layout.markup = markup
|
50
|
-
assert_equal("こんにちは World!", @layout.text)
|
51
|
-
end
|
52
|
-
end
|
data/test/test-log-attr.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 Ruby-GNOME2 Project Team
|
4
|
-
#
|
5
|
-
# This library is free software; you can redistribute it and/or
|
6
|
-
# modify it under the terms of the GNU Lesser General Public
|
7
|
-
# License as published by the Free Software Foundation; either
|
8
|
-
# version 2.1 of the License, or (at your option) any later version.
|
9
|
-
#
|
10
|
-
# This library is distributed in the hope that it will be useful,
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
-
# Lesser General Public License for more details.
|
14
|
-
#
|
15
|
-
# You should have received a copy of the GNU Lesser General Public
|
16
|
-
# License along with this library; if not, write to the Free Software
|
17
|
-
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
-
|
19
|
-
class TestPangoLogAttr < Test::Unit::TestCase
|
20
|
-
include PangoTestUtils
|
21
|
-
|
22
|
-
def test_line_break?
|
23
|
-
attribute = Pango::LogAttr.new
|
24
|
-
assert_false(attribute.line_break?)
|
25
|
-
end
|
26
|
-
end
|
data/test/test-markup.rb
DELETED
@@ -1,30 +0,0 @@
|
|
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
DELETED
@@ -1,153 +0,0 @@
|
|
1
|
-
# Copyright (C) 2013-2018 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 TestPangoMatrix < Test::Unit::TestCase
|
18
|
-
include PangoTestUtils
|
19
|
-
|
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
|
-
n_digits = 10
|
105
|
-
assert_equal([
|
106
|
-
cos, sin,
|
107
|
-
-sin, cos,
|
108
|
-
0.0,
|
109
|
-
0.0,
|
110
|
-
].collect {|number| number.round(n_digits)},
|
111
|
-
matrix.to_a.collect {|number| number.round(n_digits)})
|
112
|
-
end
|
113
|
-
|
114
|
-
def test_concat
|
115
|
-
matrix = Pango::Matrix.new
|
116
|
-
new_matrix = matrix.concat(Pango::Matrix.new.scale(3, 5))
|
117
|
-
assert_equal([
|
118
|
-
3.0, 0.0,
|
119
|
-
0.0, 5.0,
|
120
|
-
0.0,
|
121
|
-
0.0,
|
122
|
-
],
|
123
|
-
new_matrix.to_a)
|
124
|
-
assert_equal(Pango::Matrix.new.to_a,
|
125
|
-
matrix.to_a)
|
126
|
-
end
|
127
|
-
|
128
|
-
def test_plus
|
129
|
-
matrix = Pango::Matrix.new
|
130
|
-
new_matrix = matrix + Pango::Matrix.new.scale(3, 5)
|
131
|
-
assert_equal([
|
132
|
-
3.0, 0.0,
|
133
|
-
0.0, 5.0,
|
134
|
-
0.0,
|
135
|
-
0.0,
|
136
|
-
],
|
137
|
-
new_matrix.to_a)
|
138
|
-
assert_equal(Pango::Matrix.new.to_a,
|
139
|
-
matrix.to_a)
|
140
|
-
end
|
141
|
-
|
142
|
-
def test_concat!
|
143
|
-
matrix = Pango::Matrix.new
|
144
|
-
matrix.concat!(Pango::Matrix.new.scale(3, 5))
|
145
|
-
assert_equal([
|
146
|
-
3.0, 0.0,
|
147
|
-
0.0, 5.0,
|
148
|
-
0.0,
|
149
|
-
0.0,
|
150
|
-
],
|
151
|
-
matrix.to_a)
|
152
|
-
end
|
153
|
-
end
|
data/test/test-rectangle.rb
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
# Copyright (C) 2013-2018 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 TestPangoRectangle < Test::Unit::TestCase
|
18
|
-
include PangoTestUtils
|
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
|
-
|
30
|
-
def test_width
|
31
|
-
rectangle = Pango::Rectangle.new(0, 10, 20, 30)
|
32
|
-
assert_equal(20, rectangle.width)
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_height
|
36
|
-
rectangle = Pango::Rectangle.new(0, 10, 20, 30)
|
37
|
-
assert_equal(30, rectangle.height)
|
38
|
-
end
|
39
|
-
|
40
|
-
def test_ascent
|
41
|
-
rectangle = Pango::Rectangle.new(5, 10, 20, 30)
|
42
|
-
assert_equal(-10, rectangle.ascent)
|
43
|
-
end
|
44
|
-
|
45
|
-
def test_descent
|
46
|
-
rectangle = Pango::Rectangle.new(5, 10, 20, 30)
|
47
|
-
assert_equal(40, rectangle.descent)
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_left_bearing
|
51
|
-
rectangle = Pango::Rectangle.new(5, 10, 20, 30)
|
52
|
-
assert_equal(5, rectangle.left_bearing)
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_right_bearing
|
56
|
-
rectangle = Pango::Rectangle.new(5, 10, 20, 30)
|
57
|
-
assert_equal(25, rectangle.right_bearing)
|
58
|
-
end
|
59
|
-
end
|
data/test/test-version.rb
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
# Copyright (C) 2015 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 TestPangoVersion < Test::Unit::TestCase
|
18
|
-
include PangoTestUtils
|
19
|
-
|
20
|
-
test "STRING" do
|
21
|
-
major = Pango::Version::MAJOR
|
22
|
-
minor = Pango::Version::MINOR
|
23
|
-
micro = Pango::Version::MICRO
|
24
|
-
assert_equal([major, minor, micro].join("."),
|
25
|
-
Pango::Version::STRING)
|
26
|
-
end
|
27
|
-
|
28
|
-
sub_test_case("#or_later?") do
|
29
|
-
test "same" do
|
30
|
-
assert_true(Pango::Version.or_later?(Pango::Version::MAJOR,
|
31
|
-
Pango::Version::MINOR,
|
32
|
-
Pango::Version::MICRO))
|
33
|
-
end
|
34
|
-
|
35
|
-
test "later" do
|
36
|
-
assert_true(Pango::Version.or_later?(Pango::Version::MAJOR,
|
37
|
-
Pango::Version::MINOR,
|
38
|
-
Pango::Version::MICRO - 1))
|
39
|
-
end
|
40
|
-
|
41
|
-
test "earlier" do
|
42
|
-
assert_false(Pango::Version.or_later?(Pango::Version::MAJOR,
|
43
|
-
Pango::Version::MINOR,
|
44
|
-
Pango::Version::MICRO + 1))
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|