gir_ffi-pango 0.0.13 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1496224331989ca48cb1eae2e01816f03df7c86caa9eb4198c7325694ef98c18
4
- data.tar.gz: 4e8daf9f71e915d87666ac32619cabda46535e9c8f235d44059f245ece6a7d8c
3
+ metadata.gz: 4f5d221de6efdb0fc77118eeb24970eb751cf722632ba1bed5d8417cbc2b2d0f
4
+ data.tar.gz: 13da772c88fd77f560b5ba4cc2a3f528e654c37c6c0d225f7f85fb9c90de4a70
5
5
  SHA512:
6
- metadata.gz: '0283b28a789f94c6a368071c8faa55aaaaf1c58e8699af1b57ee7210d7304febed0567a34fe22d3003445d604628931ac7403f1ed75bdaa0504edc959e1e74bc'
7
- data.tar.gz: 56ec39352479fc5d7d1d172034dc73232743cf43a4174212951ccc9957f9a72dd3e93411ac34fef8f60111089734ae125b9597fa0df1451d3187f0cbcf2587cf
6
+ metadata.gz: 8529b22c6ed9dc3b99cbfa47e74f6ac9b5ee3e9f33d6c0a371739415216166815df417833b0543b77dacdc4d0628547b2c6ae970d2b206279eed0e07bc715b4e
7
+ data.tar.gz: 0c6b3f8f9db6583ddf7e950041983006906e68d9a8fb4ce2fe2862ed04dde88f8d1cacc5c5f5106f97c081aa2b266fab2852f06b60cac5780122ac69ec1c9a86
data/README.md CHANGED
@@ -4,28 +4,34 @@ GirFFI-based bindings for Pango
4
4
 
5
5
  ## Usage
6
6
 
7
- require 'gir_ffi-gtk3'
8
- require 'gir_ffi-pango'
7
+ ```ruby
8
+ require "gir_ffi-gtk3"
9
+ require "gir_ffi-pango"
9
10
 
10
- Gtk.init
11
+ Gtk.init
11
12
 
12
- ctx = Gdk.pango_context_get
13
- fontmap = ctx.get_font_map
14
- fd = Pango::FontDescription.new
15
- fd.set_family "Sans"
16
- fnt = fontmap.load_font ctx, fd
17
- puts fnt.describe.to_string
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
- lang = Pango::Language.from_string "en"
20
- puts lang.get_stripts
21
+ lang = Pango::Language.from_string "en"
22
+ puts lang.scripts.to_a
23
+ ```
21
24
 
22
25
  ## Install
23
26
 
24
- gem install gir_ffi-pango
27
+ ```bash
28
+ gem install gir_ffi-pango
29
+ ```
25
30
 
26
31
  ## License
27
32
 
28
- Copyright © 2012–2016, 2018, [Matijs van Zuijlen](http://www.matijs.net/)
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
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ Pango.load_class :Language
4
+
5
+ # No overrides are needed currently
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GirFFIPango
4
+ VERSION = "0.0.16"
5
+ end
data/lib/gir_ffi-pango.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'gir_ffi'
3
+ require "gir_ffi"
4
4
 
5
5
  GirFFI.setup :Pango
6
6
 
7
- require 'gir_ffi-pango/font'
8
- require 'gir_ffi-pango/language'
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.13
4
+ version: 0.0.16
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: 2018-09-27 00:00:00.000000000 Z
11
+ date: 2022-05-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.14.0
19
+ version: 0.16.0
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.14.0
26
+ version: 0.16.0
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.0'
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.0'
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: '12.0'
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'
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'
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.19.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.19.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'
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'
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: '12.0'
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/font.rb
67
- - lib/gir_ffi-pango/language.rb
68
- - test/end_to_end/context_test.rb
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
- post_install_message:
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.2.0
182
+ version: 2.7.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
- rubyforge_project:
93
- rubygems_version: 2.7.6
94
- signing_key:
189
+ rubygems_version: 3.3.7
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'
@@ -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
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'minitest/autorun'
4
-
5
- require 'gir_ffi-pango'
6
-
7
- GirFFI.setup :Gdk
8
- Gdk.init []
@@ -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
@@ -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