gir_ffi-pango 0.0.11 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -13
- data/lib/gir_ffi-pango/font_overrides.rb +19 -0
- data/lib/gir_ffi-pango/language_overrides.rb +5 -0
- data/lib/gir_ffi-pango/version.rb +5 -0
- data/lib/gir_ffi-pango.rb +4 -3
- metadata +120 -29
- data/Rakefile +0 -26
- data/lib/gir_ffi-pango/font.rb +0 -16
- data/lib/gir_ffi-pango/language.rb +0 -23
- data/test/end_to_end/context_test.rb +0 -13
- data/test/end_to_end/font_test.rb +0 -22
- data/test/test_helper.rb +0 -8
- data/test/unit/font_test.rb +0 -27
- data/test/unit/language_test.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f40d6170d53c46d006a6f5b771da88f92a2c39b80cfb87c846a8001c1d0c189
|
4
|
+
data.tar.gz: a17e73b41e8e75d4a40bd53f5eb8390a2c3f2ad5015aa088c49375a26110e1dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ceb5df886cdbb45563f00c17d8d8c083fae99d00d81a9f03f1c4566776bcc62d7d43f7985321e9faa24ce4fbe81bab4aa83f89c457f09f175c592066d70d457
|
7
|
+
data.tar.gz: 567d468da2086d181ebe8a9a40e943b3d357c6d04eca9abdb07f54b99cea248a8ee7b667624b5bcbc1d021176e5840b4a7ff78d63559edbc20d0000c4ae36cdd
|
data/README.md
CHANGED
@@ -4,28 +4,34 @@ GirFFI-based bindings for Pango
|
|
4
4
|
|
5
5
|
## Usage
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
```ruby
|
8
|
+
require "gir_ffi-gtk3"
|
9
|
+
require "gir_ffi-pango"
|
9
10
|
|
10
|
-
|
11
|
+
Gtk.init
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
win = Gtk::Window.new :toplevel
|
14
|
+
ctx = win.pango_context
|
15
|
+
fontmap = ctx.font_map
|
16
|
+
fd = Pango::FontDescription.new
|
17
|
+
fd.family = "Sans"
|
18
|
+
fnt = fontmap.load_font ctx, fd
|
19
|
+
puts fnt.describe.to_string
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
+
lang = Pango::Language.from_string "en"
|
22
|
+
puts lang.scripts.to_a
|
23
|
+
```
|
21
24
|
|
22
25
|
## Install
|
23
26
|
|
24
|
-
|
27
|
+
```bash
|
28
|
+
gem install gir_ffi-pango
|
29
|
+
```
|
25
30
|
|
26
31
|
## License
|
27
32
|
|
28
|
-
Copyright © 2012–2016, 2018,
|
33
|
+
Copyright © 2012–2016, 2018–2021,
|
34
|
+
[Matijs van Zuijlen](http://www.matijs.net/)
|
29
35
|
|
30
36
|
GirFFI-Pango is free software, distributed under the terms of the GNU Lesser
|
31
37
|
General Public License, version 2.1 or later. See the file COPYING.LIB for more
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module GirFFIPango
|
4
|
+
# Overrides for PangoFont
|
5
|
+
module FontOverrides
|
6
|
+
def get_coverage(lang)
|
7
|
+
ptr = ::Pango::Lib.pango_font_get_coverage(self, lang)
|
8
|
+
Pango::Coverage.wrap ptr
|
9
|
+
end
|
10
|
+
|
11
|
+
alias coverage get_coverage
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
Pango.load_class :Font
|
16
|
+
Pango::Lib.module_eval do
|
17
|
+
attach_function :pango_font_get_coverage, [:pointer, :pointer], :pointer
|
18
|
+
end
|
19
|
+
Pango::Font.prepend GirFFIPango::FontOverrides
|
data/lib/gir_ffi-pango.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "gir_ffi"
|
4
4
|
|
5
5
|
GirFFI.setup :Pango
|
6
6
|
|
7
|
-
require
|
8
|
-
require
|
7
|
+
require "gir_ffi-pango/font_overrides"
|
8
|
+
require "gir_ffi-pango/language_overrides"
|
9
|
+
require "gir_ffi-pango/version"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gir_ffi-pango
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matijs van Zuijlen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gir_ffi
|
@@ -16,42 +16,140 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.15.2
|
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: 0.
|
26
|
+
version: 0.15.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '5.
|
33
|
+
version: '5.12'
|
34
34
|
type: :development
|
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: '5.
|
40
|
+
version: '5.12'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.14.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.14.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
61
|
+
version: '13.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '13.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake-manifest
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.2.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.2.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 1.25.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.25.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-minitest
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.17.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.17.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop-packaging
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.5.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.5.0
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop-performance
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 1.13.0
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 1.13.0
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: simplecov
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 0.21.0
|
48
146
|
type: :development
|
49
147
|
prerelease: false
|
50
148
|
version_requirements: !ruby/object:Gem::Requirement
|
51
149
|
requirements:
|
52
150
|
- - "~>"
|
53
151
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
152
|
+
version: 0.21.0
|
55
153
|
description: Bindings for Pango generated by GirFFI, with an eclectic set of overrides.
|
56
154
|
email:
|
57
155
|
- matijs@matijs.net
|
@@ -61,20 +159,19 @@ extra_rdoc_files: []
|
|
61
159
|
files:
|
62
160
|
- COPYING.LIB
|
63
161
|
- README.md
|
64
|
-
- Rakefile
|
65
162
|
- lib/gir_ffi-pango.rb
|
66
|
-
- lib/gir_ffi-pango/
|
67
|
-
- lib/gir_ffi-pango/
|
68
|
-
-
|
69
|
-
- test/end_to_end/font_test.rb
|
70
|
-
- test/test_helper.rb
|
71
|
-
- test/unit/font_test.rb
|
72
|
-
- test/unit/language_test.rb
|
163
|
+
- lib/gir_ffi-pango/font_overrides.rb
|
164
|
+
- lib/gir_ffi-pango/language_overrides.rb
|
165
|
+
- lib/gir_ffi-pango/version.rb
|
73
166
|
homepage: http://www.github.com/mvz/gir_ffi-pango
|
74
167
|
licenses:
|
75
168
|
- LGPL-2.1
|
76
|
-
metadata:
|
77
|
-
|
169
|
+
metadata:
|
170
|
+
homepage_uri: http://www.github.com/mvz/gir_ffi-pango
|
171
|
+
source_code_uri: https://github.com/mvz/gir_ffi-pango
|
172
|
+
changelog_uri: https://github.com/mvz/gir_ffi-pango/blob/master/Changelog.md
|
173
|
+
rubygems_mfa_required: 'true'
|
174
|
+
post_install_message:
|
78
175
|
rdoc_options: []
|
79
176
|
require_paths:
|
80
177
|
- lib
|
@@ -82,21 +179,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
82
179
|
requirements:
|
83
180
|
- - ">="
|
84
181
|
- !ruby/object:Gem::Version
|
85
|
-
version: 2.
|
182
|
+
version: 2.6.0
|
86
183
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
184
|
requirements:
|
88
185
|
- - ">="
|
89
186
|
- !ruby/object:Gem::Version
|
90
187
|
version: '0'
|
91
188
|
requirements: []
|
92
|
-
|
93
|
-
|
94
|
-
signing_key:
|
189
|
+
rubygems_version: 3.3.3
|
190
|
+
signing_key:
|
95
191
|
specification_version: 4
|
96
192
|
summary: GirFFI-based bindings for Pango
|
97
|
-
test_files:
|
98
|
-
- test/unit/font_test.rb
|
99
|
-
- test/unit/language_test.rb
|
100
|
-
- test/test_helper.rb
|
101
|
-
- test/end_to_end/font_test.rb
|
102
|
-
- test/end_to_end/context_test.rb
|
193
|
+
test_files: []
|
data/Rakefile
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'rake/testtask'
|
4
|
-
require 'bundler/gem_helper'
|
5
|
-
|
6
|
-
Bundler::GemHelper.install_tasks
|
7
|
-
|
8
|
-
namespace :test do
|
9
|
-
Rake::TestTask.new(:unit) do |t|
|
10
|
-
t.libs = ['lib']
|
11
|
-
t.test_files = FileList['test/unit/*_test.rb']
|
12
|
-
t.warning = true
|
13
|
-
end
|
14
|
-
|
15
|
-
Rake::TestTask.new(:end_to_end) do |t|
|
16
|
-
t.libs = ['lib']
|
17
|
-
t.test_files = FileList['test/end_to_end/*_test.rb']
|
18
|
-
t.warning = true
|
19
|
-
end
|
20
|
-
|
21
|
-
task all: [:unit, :end_to_end]
|
22
|
-
end
|
23
|
-
|
24
|
-
task test: 'test:all'
|
25
|
-
|
26
|
-
task default: 'test'
|
data/lib/gir_ffi-pango/font.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Pango
|
4
|
-
load_class :Font
|
5
|
-
|
6
|
-
class Font
|
7
|
-
def get_coverage(lang)
|
8
|
-
ptr = Lib.pango_font_get_coverage(self, lang)
|
9
|
-
Pango::Coverage.wrap ptr
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
module Lib
|
14
|
-
attach_function :pango_font_get_coverage, [:pointer, :pointer], :pointer
|
15
|
-
end
|
16
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Pango
|
4
|
-
load_class :Language
|
5
|
-
|
6
|
-
class Language
|
7
|
-
setup_instance_method 'get_scripts'
|
8
|
-
|
9
|
-
def get_scripts_with_override
|
10
|
-
result = get_scripts_without_override
|
11
|
-
case result
|
12
|
-
when GirFFI::SizedArray
|
13
|
-
result
|
14
|
-
else
|
15
|
-
ptr, size = *result
|
16
|
-
GirFFI::SizedArray.new Pango::Script, size, ptr
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
alias get_scripts_without_override get_scripts
|
21
|
-
alias get_scripts get_scripts_with_override
|
22
|
-
end
|
23
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
|
4
|
-
|
5
|
-
describe Pango::Context do
|
6
|
-
describe '#get_font_map' do
|
7
|
-
it 'returns a descendant from Pango::FontMap' do
|
8
|
-
ctx = Gdk.pango_context_get
|
9
|
-
result = ctx.get_font_map
|
10
|
-
result.class.ancestors.must_include Pango::FontMap
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
|
4
|
-
|
5
|
-
describe Pango::Font do
|
6
|
-
it 'allows retrieval of coverage information' do
|
7
|
-
ctx = Gdk.pango_context_get
|
8
|
-
|
9
|
-
fontmap = ctx.get_font_map
|
10
|
-
fd = Pango::FontDescription.new
|
11
|
-
fnt = fontmap.load_font ctx, fd
|
12
|
-
|
13
|
-
lang = Pango::Language.from_string 'en'
|
14
|
-
cov = fnt.get_coverage lang
|
15
|
-
|
16
|
-
clist = 'Hello Pango!'.each_char.map { |ch| cov.get ch[0].ord }
|
17
|
-
|
18
|
-
clist.uniq.each do |cval|
|
19
|
-
[:none, :fallback, :approximate, :exact].must_include cval
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
data/test/test_helper.rb
DELETED
data/test/unit/font_test.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
|
4
|
-
|
5
|
-
describe Pango::Font do
|
6
|
-
before do
|
7
|
-
ctx = Gdk.pango_context_get
|
8
|
-
fontmap = ctx.get_font_map
|
9
|
-
fd = Pango::FontDescription.new
|
10
|
-
@fnt = fontmap.load_font ctx, fd
|
11
|
-
end
|
12
|
-
|
13
|
-
describe '#get_coverage' do
|
14
|
-
before do
|
15
|
-
lang = Pango::Language.from_string 'en'
|
16
|
-
@cov = @fnt.get_coverage lang
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'returns an instance of Pango::Coverage' do
|
20
|
-
@cov.must_be_instance_of Pango::Coverage
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'returns valid coverage info' do
|
24
|
-
@cov.get(' '[0].ord).must_equal :exact
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
data/test/unit/language_test.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
|
4
|
-
|
5
|
-
describe Pango::Language do
|
6
|
-
it 'creates an instance with .from_string' do
|
7
|
-
lang = Pango::Language.from_string 'en'
|
8
|
-
lang.wont_be_nil
|
9
|
-
lang.must_be_instance_of Pango::Language
|
10
|
-
end
|
11
|
-
|
12
|
-
describe '#get_scripts' do
|
13
|
-
it 'returns an enumerable of symbols representing scripts' do
|
14
|
-
lang = Pango::Language.from_string 'ja'
|
15
|
-
scripts = lang.get_scripts
|
16
|
-
scripts.to_a.must_equal [:han, :katakana, :hiragana]
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'can safely be run twice' do
|
20
|
-
lang = Pango::Language.from_string 'en'
|
21
|
-
|
22
|
-
result = lang.get_scripts
|
23
|
-
result.to_a.must_equal [:latin]
|
24
|
-
|
25
|
-
result = lang.get_scripts
|
26
|
-
result.to_a.must_equal [:latin]
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|