pango 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -17,6 +17,12 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
17
17
  :label => "HarfBuzz",
18
18
  :version => "0.9.17",
19
19
  :compression_method => "bz2",
20
+ :windows => {
21
+ :patches => [
22
+ "harfbuzz-0.9.17-disable-uniscribe.diff",
23
+ ],
24
+ :need_autoreconf => true,
25
+ },
20
26
  },
21
27
  {
22
28
  :name => "pango",
@@ -28,9 +28,33 @@
28
28
  #define _SELF(self) (RVAL2PANGOCAIROFONTMAP(self))
29
29
 
30
30
  static VALUE
31
- rg_s_create(G_GNUC_UNUSED VALUE klass)
31
+ rg_s_create(int argc, VALUE *argv, G_GNUC_UNUSED VALUE klass)
32
32
  {
33
- return GOBJ2RVAL(pango_cairo_font_map_new());
33
+ VALUE rb_font_type;
34
+ PangoFontMap *font_map = NULL;
35
+
36
+ rb_scan_args(argc, argv, "01", &rb_font_type);
37
+ if (NIL_P(rb_font_type)) {
38
+ font_map = pango_cairo_font_map_new();
39
+ } else {
40
+ cairo_font_type_t font_type = CAIRO_FONT_TYPE_USER;
41
+ if (rbgutil_key_equal(rb_font_type, "ft") ||
42
+ rbgutil_key_equal(rb_font_type, "freetype")) {
43
+ font_type = CAIRO_FONT_TYPE_FT;
44
+ } else if (rbgutil_key_equal(rb_font_type, "win32")) {
45
+ font_type = CAIRO_FONT_TYPE_WIN32;
46
+ } else if (rbgutil_key_equal(rb_font_type, "quartz")) {
47
+ font_type = CAIRO_FONT_TYPE_QUARTZ;
48
+ } else {
49
+ rb_raise(rb_eArgError,
50
+ "font type must be one of "
51
+ ":ft, :freetype, :win32 or :quartz: %s",
52
+ RBG_INSPECT(rb_font_type));
53
+ }
54
+ font_map = pango_cairo_font_map_new_for_font_type(font_type);
55
+ }
56
+
57
+ return GOBJ2RVAL(font_map);
34
58
  }
35
59
 
36
60
  static VALUE
@@ -78,7 +102,7 @@ Init_pango_cairo(VALUE mPango)
78
102
  /* Pango::CairoFontMap */
79
103
  RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_CAIRO_FONT_MAP, "CairoFontMap", mPango);
80
104
 
81
- RG_DEF_SMETHOD(create, 0);
105
+ RG_DEF_SMETHOD(create, -1);
82
106
  RG_DEF_SMETHOD(default, 0);
83
107
  # if PANGO_CHECK_VERSION(1, 22, 0)
84
108
  RG_DEF_SMETHOD(set_default, 1);
@@ -24,18 +24,6 @@
24
24
  #define RG_TARGET_NAMESPACE cFontMap
25
25
  #define _SELF(self) (RVAL2PANGOFONTMAP(self))
26
26
 
27
- #ifdef CAIRO_AVAILABLE
28
- # ifdef HAVE_PANGO_FT2
29
- # define PANGO_TYPE_CAIRO_FC_FONT_MAP \
30
- (pango_cairo_fc_font_map_get_type())
31
- # endif
32
-
33
- # ifdef HAVE_PANGO_WIN32
34
- # define PANGO_TYPE_CAIRO_WIN32_FONT_MAP \
35
- (pango_cairo_win32_font_map_get_type())
36
- # endif
37
- #endif
38
-
39
27
  /*
40
28
  static VALUE
41
29
  rg_initialize(VALUE self)
@@ -112,15 +100,7 @@ Init_pango_font_map(VALUE mPango)
112
100
  G_DEF_CLASS3("PangoXFontMap", "XFontMap", mPango);
113
101
  G_DEF_CLASS3("PangoWin32FontMap", "Win32FontMap", mPango);
114
102
  G_DEF_CLASS3("PangoCoreTextFontMap", "CoreTextFontMap", mPango);
115
- #ifdef PANGO_TYPE_CAIRO_FC_FONT_MAP
116
- G_DEF_CLASS(PANGO_TYPE_CAIRO_FC_FONT_MAP, "CairoFcFontMap", mPango);
117
- #else
118
103
  G_DEF_CLASS3("PangoCairoFcFontMap", "CairoFcFontMap", mPango);
119
- #endif
120
- #ifdef PANGO_TYPE_CAIRO_WIN32_FONT_MAP
121
- G_DEF_CLASS(PANGO_TYPE_CAIRO_WIN32_FONT_MAP, "CairoWin32FontMap", mPango);
122
- #else
123
104
  G_DEF_CLASS3("PangoCairoWin32FontMap", "CairoWin32FontMap", mPango);
124
- #endif
125
105
  G_DEF_CLASS3("PangoCairoCoreTextFontMap", "CairoCoreTextFontMap", mPango);
126
106
  }
@@ -125,13 +125,13 @@ static VALUE
125
125
  rg_glyphs(VALUE self)
126
126
  {
127
127
  int i;
128
- PangoGlyphInfo** glyphs = &_SELF(self)->glyphs;
128
+ PangoGlyphInfo *glyphs = _SELF(self)->glyphs;
129
129
  gint* log_clusters = _SELF(self)->log_clusters;
130
130
 
131
131
  VALUE ret = rb_ary_new();
132
132
  for (i = 0; i < _SELF(self)->num_glyphs; i++) {
133
133
  rb_ary_push(ret,
134
- rb_assoc_new(PANGOGLYPHINFO2RVAL(glyphs[i]),
134
+ rb_assoc_new(PANGOGLYPHINFO2RVAL(glyphs + i),
135
135
  INT2NUM(log_clusters[i])));
136
136
  }
137
137
  return ret;
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  =begin
2
4
  break.rb - Ruby/Pango sample script.
3
5
 
@@ -17,7 +17,7 @@ gdkwin = window.window
17
17
  gc = Gdk::GC.new(gdkwin)
18
18
 
19
19
  layout = window.create_pango_layout
20
- layout.set_markup(File.readlines("sample.txt").to_s, "$")
20
+ layout.set_markup(File.read("sample.txt"), "$")
21
21
  window.signal_connect("expose_event") do
22
22
  gdkwin.draw_layout(gc, 10, 10, layout)
23
23
  end
@@ -42,7 +42,7 @@ p logical_rect.to_a
42
42
 
43
43
  item = Pango::Item.new
44
44
  item.analysis.font = font
45
- item.analysis.shape_engine = font.find_shaper(lang, str[0])
45
+ item.analysis.shape_engine = font.find_shaper(lang, str.codepoints.first)
46
46
 
47
47
  gs = Pango.shape(str, item.analysis)
48
48
 
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  =begin
2
4
  item.rb - Ruby/Pango sample script.
3
5
 
@@ -29,7 +31,7 @@ items.each do |v|
29
31
  ana = v.analysis
30
32
  puts "shape_engine = #{ana.shape_engine}, lang_engine = #{ana.lang_engine}, font = #{ana.font}, level = #{ana.level}"
31
33
  puts "language = #{ana.language}"
32
- p ana.font.get_glyph_extents("a"[0])[0].to_a
34
+ p ana.font.get_glyph_extents("a".codepoints.first)[0].to_a
33
35
  ana.set_extra_attrs(attrs)
34
36
  p ana.extra_attrs
35
37
  end
@@ -9,7 +9,7 @@
9
9
 
10
10
  require 'gtk2'
11
11
 
12
- str = File.readlines("sample.txt").to_s
12
+ str = File.read("sample.txt")
13
13
  attrs, text, accel_char = Pango.parse_markup(str, '$')
14
14
 
15
15
  #This is same as Gtk::Label#set_markup()
@@ -14,7 +14,7 @@ require 'pp'
14
14
  puts
15
15
  puts "Start----------"
16
16
  puts
17
- str = File.readlines("sample.txt").to_s
17
+ str = File.read("sample.txt")
18
18
  context = Gdk::Pango.context
19
19
  context.base_dir = Pango::Context::DIRECTION_LTR
20
20
  context.language = Pango::Language.new("ja_JP")
@@ -10,7 +10,7 @@
10
10
 
11
11
  require 'pango'
12
12
 
13
- str = File.readlines("sample.txt").to_s
13
+ str = File.read("sample.txt")
14
14
  puts str
15
15
  puts "------"
16
16
 
@@ -1,3 +1,5 @@
1
+ # -*- coding: utf-8 -*-
2
+
1
3
  =begin
2
4
  script.rb - Ruby/Pango sample script.
3
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pango
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-25 00:00:00.000000000 Z
12
+ date: 2013-05-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cairo
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - '='
36
36
  - !ruby/object:Gem::Version
37
- version: 2.0.1
37
+ version: 2.0.2
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - '='
44
44
  - !ruby/object:Gem::Version
45
- version: 2.0.1
45
+ version: 2.0.2
46
46
  description: Ruby/Pango is a Ruby binding of pango-1.x.
47
47
  email: ruby-gnome2-devel-en@lists.sourceforge.net
48
48
  executables: []