pango 2.2.5 → 3.0.1

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
  SHA1:
3
- metadata.gz: 04dd34ada94f60edc6a6d7a06db7616179cb27e7
4
- data.tar.gz: 1057817adb4a61d0bd75c8c12a819a0fa61b4c18
3
+ metadata.gz: 750c7a52d5bf947bcf792203afb7b640a741479d
4
+ data.tar.gz: b7c925a7251b12cac1cdf0b36d5970763d173496
5
5
  SHA512:
6
- metadata.gz: b8ada2ecc0515dd17802f5b56cdeb96d8b161e665e3b4ffab460b00f500b5b1240af67bb78698d0a7bf6ab5f27648a3a5763a4bd87dd5ffde97cb38d6ee76173
7
- data.tar.gz: 53655fc230de5e9e8d2cd5d50fc8bff6e5f50143d3ac5924e068f5da4cc8419c05cd78907c15303e759dbf68ce016afcf1258a2d4c8ad52176b9b2cefd23425c
6
+ metadata.gz: 893657aaa702cd9750a6f1ef3cf10c93f808d37f6c914752cc6d1bd5bda099b38a9d30536a393996c03e7dd1ea8740d4723f398eb84430248d9c3f9b3e86b656
7
+ data.tar.gz: f501239550e9a23393db0ebf36f49f27a6685ad480a45076f1acbcf6962019f2cc0ccb71a8f12021b34acb809afdd1454eccc4daa4606f4514ef9db7a6b8e3b8
data/Rakefile CHANGED
@@ -1,4 +1,20 @@
1
1
  # -*- ruby -*-
2
+ #
3
+ # Copyright (C) 2011-2015 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
2
18
 
3
19
  $LOAD_PATH.unshift("./../glib2/lib")
4
20
  require "gnome2/rake/package-task"
@@ -13,10 +29,10 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
13
29
  package.external_packages = [
14
30
  {
15
31
  :name => "icu",
16
- :download_base_url => "http://download.icu-project.org/files/icu4c/54.1",
32
+ :download_base_url => "http://download.icu-project.org/files/icu4c/55.1",
17
33
  :label => "gobject-introspection",
18
34
  :base_name => "icu",
19
- :archive_base_name => "icu4c-54_1-src.tgz",
35
+ :archive_base_name => "icu4c-55_1-src.tgz",
20
36
  :compression_method => "gz",
21
37
  :base_dir_in_package => "source",
22
38
  :windows => {
@@ -34,7 +50,7 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
34
50
  :name => "harfbuzz",
35
51
  :download_base_url => "http://www.freedesktop.org/software/harfbuzz/release",
36
52
  :label => "HarfBuzz",
37
- :version => "0.9.35",
53
+ :version => "1.0.3",
38
54
  :compression_method => "bz2",
39
55
  :windows => {
40
56
  :configure_args => [
@@ -2,7 +2,6 @@ install-so: install-headers
2
2
  install-headers:
3
3
  $(INSTALL_DATA) $(srcdir)/rbpango.h $(RUBYARCHDIR)
4
4
  $(INSTALL_DATA) $(srcdir)/rbpangoconversions.h $(RUBYARCHDIR)
5
- $(INSTALL_DATA) rbpangoversion.h $(RUBYARCHDIR)
6
5
 
7
6
  install: install-pc
8
7
  install-pc:
@@ -75,8 +75,6 @@ have_func("pango_attr_iterator_get_attrs", pango_header)
75
75
  have_func("pango_itemize_with_base_dir", pango_header)
76
76
  have_func("pango_font_family_is_monospace", pango_header)
77
77
 
78
- make_version_header("PANGO", "pango", ".")
79
-
80
78
  create_pkg_config_file("Ruby/Pango", package_id)
81
79
  $defs << " -DRUBY_PANGO_COMPILATION"
82
80
  create_makefile(module_name)
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2011 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2011-2015 Ruby-GNOME2 Project Team
4
4
  * Copyright (C) 2002-2005 Masao Mutoh
5
5
  *
6
6
  * This library is free software; you can redistribute it and/or
@@ -31,6 +31,40 @@ extern void Init_pango(void);
31
31
  * Rendering
32
32
  */
33
33
 
34
+ static VALUE
35
+ rg_s_version(G_GNUC_UNUSED VALUE self)
36
+ {
37
+ return INT2NUM(pango_version());
38
+ }
39
+
40
+ static VALUE
41
+ rg_s_version_string(G_GNUC_UNUSED VALUE self)
42
+ {
43
+ return CSTR2RVAL(pango_version_string());
44
+ }
45
+
46
+ static VALUE
47
+ rg_s_check_version(G_GNUC_UNUSED VALUE self,
48
+ VALUE major, VALUE minor, VALUE micro)
49
+ {
50
+ const gchar *error_message;
51
+ error_message = pango_version_check(NUM2INT(major),
52
+ NUM2INT(minor),
53
+ NUM2INT(micro));
54
+ return CSTR2RVAL(error_message);
55
+ }
56
+
57
+ static VALUE
58
+ rg_s_check_version_p(G_GNUC_UNUSED VALUE self,
59
+ VALUE major, VALUE minor, VALUE micro)
60
+ {
61
+ const gchar *error_message;
62
+ error_message = pango_version_check(NUM2INT(major),
63
+ NUM2INT(minor),
64
+ NUM2INT(micro));
65
+ return CBOOL2RVAL(!error_message);
66
+ }
67
+
34
68
  struct rpango_reorder_items_args {
35
69
  PangoItem *item;
36
70
  VALUE ary;
@@ -261,12 +295,16 @@ Init_pango(void)
261
295
  {
262
296
  RG_TARGET_NAMESPACE = rb_define_module("Pango");
263
297
 
264
- rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION",
265
- rb_ary_new3(3,
266
- INT2FIX(PANGO_MAJOR_VERSION),
267
- INT2FIX(PANGO_MINOR_VERSION),
268
- INT2FIX(PANGO_MICRO_VERSION)));
298
+ rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION",
299
+ rb_ary_new3(3,
300
+ INT2FIX(PANGO_VERSION_MAJOR),
301
+ INT2FIX(PANGO_VERSION_MINOR),
302
+ INT2FIX(PANGO_VERSION_MICRO)));
269
303
 
304
+ RG_DEF_SMETHOD(version, 0);
305
+ RG_DEF_SMETHOD(version_string, 0);
306
+ RG_DEF_SMETHOD(check_version, 3);
307
+ RG_DEF_SMETHOD_P(check_version, 3);
270
308
  RG_DEF_SMETHOD(reorder_items, 1);
271
309
  RG_DEF_SMETHOD(unichar_direction, 1);
272
310
  RG_DEF_SMETHOD(find_base_dir, 1);
@@ -29,7 +29,6 @@
29
29
  #endif
30
30
 
31
31
  #include "rbgobject.h"
32
- #include "rbpangoversion.h"
33
32
  #include "rbpangoconversions.h"
34
33
  #include <pango/pangocairo.h>
35
34
 
@@ -282,7 +282,7 @@ attr_AttrAbsoluteSize_initialize(VALUE self, VALUE size)
282
282
  return Qnil;
283
283
  }
284
284
 
285
- #if PANGO_CHECK_VERSION(1,16,0)
285
+ #if PANGO_VERSION_CHECK(1,16,0)
286
286
  static VALUE
287
287
  attr_AttrGravity_initialize(VALUE self, VALUE gravity)
288
288
  {
@@ -438,7 +438,7 @@ Init_pango_attribute(VALUE mPango)
438
438
  MAKE_ATTR(PANGO_ATTR_STRETCH, AttrStretch, pattrint, 1);
439
439
  MAKE_ATTR(PANGO_ATTR_SIZE, AttrSize, pattrint, 1);
440
440
  MAKE_ATTR(PANGO_ATTR_ABSOLUTE_SIZE, AttrAbsoluteSize, pattrint, 1);
441
- #if PANGO_CHECK_VERSION(1,16,0)
441
+ #if PANGO_VERSION_CHECK(1,16,0)
442
442
  MAKE_ATTR(PANGO_ATTR_GRAVITY, AttrGravity, pattrint, 1);
443
443
  MAKE_ATTR(PANGO_ATTR_GRAVITY_HINT, AttrGravityHint, pattrint, 1);
444
444
  #endif
@@ -34,7 +34,7 @@ rg_s_create(int argc, VALUE *argv, G_GNUC_UNUSED VALUE klass)
34
34
  if (NIL_P(rb_font_type)) {
35
35
  font_map = pango_cairo_font_map_new();
36
36
  } else {
37
- #if PANGO_CHECK_VERSION(1, 18, 0)
37
+ #if PANGO_VERSION_CHECK(1, 18, 0)
38
38
  cairo_font_type_t font_type = CAIRO_FONT_TYPE_USER;
39
39
  if (rbgutil_key_equal(rb_font_type, "ft") ||
40
40
  rbgutil_key_equal(rb_font_type, "freetype")) {
@@ -66,7 +66,7 @@ rg_s_default(G_GNUC_UNUSED VALUE klass)
66
66
  return GOBJ2RVAL(pango_cairo_font_map_get_default());
67
67
  }
68
68
 
69
- #if PANGO_CHECK_VERSION(1, 22, 0)
69
+ #if PANGO_VERSION_CHECK(1, 22, 0)
70
70
  static VALUE
71
71
  rg_s_set_default(VALUE klass, VALUE font_map)
72
72
  {
@@ -93,7 +93,7 @@ rg_create_context(VALUE self)
93
93
  {
94
94
  PangoContext *pango_context;
95
95
 
96
- #if PANGO_CHECK_VERSION(1, 22, 0)
96
+ #if PANGO_VERSION_CHECK(1, 22, 0)
97
97
  pango_context = pango_font_map_create_context(PANGO_FONT_MAP(_SELF(self)));
98
98
  #else
99
99
  pango_context = pango_cairo_font_map_create_context(_SELF(self));
@@ -112,7 +112,7 @@ Init_pango_cairo(VALUE mPango)
112
112
 
113
113
  RG_DEF_SMETHOD(create, -1);
114
114
  RG_DEF_SMETHOD(default, 0);
115
- #if PANGO_CHECK_VERSION(1, 22, 0)
115
+ #if PANGO_VERSION_CHECK(1, 22, 0)
116
116
  RG_DEF_SMETHOD(set_default, 1);
117
117
  #endif
118
118
 
@@ -129,7 +129,7 @@ rg_set_base_dir(VALUE self, VALUE direction)
129
129
  return self;
130
130
  }
131
131
 
132
- #if PANGO_CHECK_VERSION(1,16,0)
132
+ #if PANGO_VERSION_CHECK(1,16,0)
133
133
  static VALUE
134
134
  rg_base_gravity(VALUE self)
135
135
  {
@@ -280,7 +280,7 @@ Init_pango_context(VALUE mPango)
280
280
  RG_DEF_METHOD(set_language, 1);
281
281
  RG_DEF_METHOD(base_dir, 0);
282
282
  RG_DEF_METHOD(set_base_dir, 1);
283
- #if PANGO_CHECK_VERSION(1,16,0)
283
+ #if PANGO_VERSION_CHECK(1,16,0)
284
284
  RG_DEF_METHOD(base_gravity, 0);
285
285
  RG_DEF_METHOD(set_base_gravity, 1);
286
286
  RG_DEF_METHOD(gravity_hint, 0);
@@ -163,7 +163,7 @@ rg_size_is_absolute_p(VALUE self)
163
163
  return CBOOL2RVAL(pango_font_description_get_size_is_absolute(_SELF(self)));
164
164
  }
165
165
 
166
- #if PANGO_CHECK_VERSION(1,16,0)
166
+ #if PANGO_VERSION_CHECK(1,16,0)
167
167
  static VALUE
168
168
  rg_gravity(VALUE self)
169
169
  {
@@ -248,7 +248,7 @@ Init_pango_font_description(VALUE mPango)
248
248
  RG_DEF_METHOD(size, 0);
249
249
  RG_DEF_METHOD(set_absolute_size, 1);
250
250
  RG_DEF_METHOD_P(size_is_absolute, 0);
251
- #if PANGO_CHECK_VERSION(1,16,0)
251
+ #if PANGO_VERSION_CHECK(1,16,0)
252
252
  RG_DEF_METHOD(set_gravity, 1);
253
253
  RG_DEF_METHOD(gravity, 0);
254
254
  #endif
@@ -20,7 +20,7 @@
20
20
 
21
21
  #include "rbpangoprivate.h"
22
22
 
23
- #if PANGO_CHECK_VERSION(1,16,0)
23
+ #if PANGO_VERSION_CHECK(1,16,0)
24
24
 
25
25
  #define RG_TARGET_NAMESPACE mGravity
26
26
 
@@ -40,7 +40,7 @@ rg_s_vertical_p(G_GNUC_UNUSED VALUE self, VALUE gravity)
40
40
  void
41
41
  Init_pango_gravity(VALUE mPango)
42
42
  {
43
- #if PANGO_CHECK_VERSION(1,16,0)
43
+ #if PANGO_VERSION_CHECK(1,16,0)
44
44
  VALUE RG_TARGET_NAMESPACE = rb_define_module_under(mPango, "Gravity");
45
45
 
46
46
  RG_DEF_SMETHOD(to_rotation, 1);
@@ -69,6 +69,12 @@ rg_includes_script(VALUE self, VALUE script)
69
69
  RVAL2PANGOSCRIPT(script)));
70
70
  }
71
71
 
72
+ static VALUE
73
+ rg_sample_string(VALUE self)
74
+ {
75
+ return CSTR2RVAL(pango_language_get_sample_string(_SELF(self)));
76
+ }
77
+
72
78
  void
73
79
  Init_pango_language(VALUE mPango)
74
80
  {
@@ -83,4 +89,6 @@ Init_pango_language(VALUE mPango)
83
89
  RG_DEF_ALIAS("to_s", "to_str");
84
90
 
85
91
  RG_DEF_METHOD(includes_script, 1);
92
+
93
+ RG_DEF_METHOD(sample_string, 0);
86
94
  }
@@ -154,7 +154,7 @@ rg_width(VALUE self)
154
154
  return INT2NUM(pango_layout_get_width(_SELF(self)));
155
155
  }
156
156
 
157
- #if PANGO_CHECK_VERSION(1, 20, 0)
157
+ #if PANGO_VERSION_CHECK(1, 20, 0)
158
158
  static VALUE
159
159
  rg_set_height(VALUE self, VALUE width)
160
160
  {
@@ -195,7 +195,7 @@ rg_ellipsize(VALUE self)
195
195
  return PANGOELLIPSIZEMODE2RVAL(pango_layout_get_ellipsize(_SELF(self)));
196
196
  }
197
197
 
198
- #if PANGO_CHECK_VERSION(1, 16, 0)
198
+ #if PANGO_VERSION_CHECK(1, 16, 0)
199
199
  static VALUE
200
200
  rg_ellipsized_p(VALUE self)
201
201
  {
@@ -498,6 +498,14 @@ rg_iter(VALUE self)
498
498
  return PANGOLAYOUTITER2RVAL(pango_layout_get_iter(_SELF(self)));
499
499
  }
500
500
 
501
+ #if PANGO_VERSION_CHECK(1, 22, 0)
502
+ static VALUE
503
+ rg_baseline(VALUE self)
504
+ {
505
+ return INT2NUM(pango_layout_get_baseline(_SELF(self)));
506
+ }
507
+ #endif
508
+
501
509
  void
502
510
  Init_pango_layout(VALUE mPango)
503
511
  {
@@ -517,7 +525,7 @@ Init_pango_layout(VALUE mPango)
517
525
  RG_DEF_METHOD(font_description, 0);
518
526
  RG_DEF_METHOD(set_width, 1);
519
527
  RG_DEF_METHOD(width, 0);
520
- #if PANGO_CHECK_VERSION(1, 20, 0)
528
+ #if PANGO_VERSION_CHECK(1, 20, 0)
521
529
  RG_DEF_METHOD(set_height, 1);
522
530
  RG_DEF_METHOD(height, 0);
523
531
  #endif
@@ -525,7 +533,7 @@ Init_pango_layout(VALUE mPango)
525
533
  RG_DEF_METHOD(wrap, 0);
526
534
  RG_DEF_METHOD(set_ellipsize, 1);
527
535
  RG_DEF_METHOD(ellipsize, 0);
528
- #if PANGO_CHECK_VERSION(1, 16, 0)
536
+ #if PANGO_VERSION_CHECK(1, 16, 0)
529
537
  RG_DEF_METHOD_P(ellipsized, 0);
530
538
  #endif
531
539
  RG_DEF_METHOD(set_indent, 1);
@@ -557,6 +565,9 @@ Init_pango_layout(VALUE mPango)
557
565
  RG_DEF_METHOD(get_line, 1);
558
566
  RG_DEF_METHOD(lines, 0);
559
567
  RG_DEF_METHOD(iter, 0);
568
+ #if PANGO_VERSION_CHECK(1, 22, 0)
569
+ RG_DEF_METHOD(baseline, 0);
570
+ #endif
560
571
 
561
572
  /* PangoWrapMode */
562
573
  G_DEF_CLASS(PANGO_TYPE_WRAP_MODE, "WrapMode", RG_TARGET_NAMESPACE);
@@ -82,7 +82,7 @@ rg_rotate_bang(VALUE self, VALUE degrees)
82
82
  return self;
83
83
  }
84
84
 
85
- #if PANGO_CHECK_VERSION(1,16,0)
85
+ #if PANGO_VERSION_CHECK(1,16,0)
86
86
  static VALUE
87
87
  rg_gravity(VALUE self)
88
88
  {
@@ -129,7 +129,7 @@ Init_pango_matrix(VALUE mPango)
129
129
  RG_DEF_METHOD_BANG(rotate, 1);
130
130
  RG_DEF_METHOD_BANG(concat, 1);
131
131
  RG_DEF_METHOD(font_scale_factor, 0);
132
- #if PANGO_CHECK_VERSION(1,16,0)
132
+ #if PANGO_VERSION_CHECK(1,16,0)
133
133
  RG_DEF_METHOD(gravity, 0);
134
134
  #endif
135
135
  RG_DEF_METHOD(to_a, 0);
@@ -37,7 +37,7 @@ rg_sample_language(VALUE self)
37
37
  return PANGOLANGUAGE2RVAL(lang);
38
38
  }
39
39
 
40
- #if PANGO_CHECK_VERSION(1,16,0)
40
+ #if PANGO_VERSION_CHECK(1,16,0)
41
41
  static VALUE
42
42
  rg_get_gravity(int argc, VALUE *argv, VALUE self)
43
43
  {
@@ -52,7 +52,7 @@ rg_get_gravity(int argc, VALUE *argv, VALUE self)
52
52
  RVAL2PANGOGRAVITY(gravity),
53
53
  RVAL2PANGOGRAVITYHINT(gravity_hint));
54
54
  } else {
55
- # if PANGO_CHECK_VERSION(1,26,0)
55
+ # if PANGO_VERSION_CHECK(1,26,0)
56
56
  g = pango_gravity_get_for_script_and_width(_SELF(self),
57
57
  RVAL2CBOOL(wide),
58
58
  RVAL2PANGOGRAVITY(gravity),
@@ -78,7 +78,7 @@ Init_pango_script(VALUE mPango)
78
78
 
79
79
  RG_DEF_SMETHOD(for_unichar, 1);
80
80
  RG_DEF_METHOD(sample_language, 0);
81
- #if PANGO_CHECK_VERSION(1,16,0)
81
+ #if PANGO_VERSION_CHECK(1,16,0)
82
82
  RG_DEF_METHOD(get_gravity, -1);
83
83
  #endif
84
84
  }
@@ -4,4 +4,9 @@ class TestLanguage < Test::Unit::TestCase
4
4
  def test_default
5
5
  assert_match(/\A[a-z]{2}-[a-z]{2}\z/, Pango::Language.default.to_s)
6
6
  end
7
+
8
+ def test_sample_string
9
+ assert_equal("The quick brown fox jumps over the lazy dog.",
10
+ Pango::Language.new("en").sample_string)
11
+ end
7
12
  end
@@ -2,7 +2,8 @@ class TestLayout < Test::Unit::TestCase
2
2
  include PangoTestUtils
3
3
 
4
4
  def setup
5
- @context = Pango::Context.new
5
+ @font_map = Pango::CairoFontMap.default
6
+ @context = @font_map.create_context
6
7
  @layout = Pango::Layout.new(@context)
7
8
  end
8
9
 
@@ -31,4 +32,9 @@ class TestLayout < Test::Unit::TestCase
31
32
  def test_ellipsized?
32
33
  assert_false(@layout.ellipsized?)
33
34
  end
35
+
36
+ def test_baseline
37
+ only_pango_version(1, 22, 0)
38
+ assert_kind_of(Integer, @layout.baseline)
39
+ end
34
40
  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: 2.2.5
4
+ version: 3.0.1
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: 2015-04-24 00:00:00.000000000 Z
11
+ date: 2015-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cairo
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 2.2.5
33
+ version: 3.0.1
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: 2.2.5
40
+ version: 3.0.1
41
41
  description: Ruby/Pango is a Ruby binding of pango-1.x.
42
42
  email: ruby-gnome2-devel-en@lists.sourceforge.net
43
43
  executables: []