pango 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +27 -5
- data/ext/pango/depend +2 -2
- data/ext/pango/extconf.rb +32 -28
- data/ext/pango/pango.def +0 -16
- data/ext/pango/rb-pango-attr-list.c +64 -0
- data/ext/pango/rb-pango-attribute.c +147 -0
- data/ext/pango/rb-pango-context.c +79 -0
- data/ext/pango/{rbpangoconversions.h → rb-pango-conversions.h} +4 -6
- data/ext/pango/rb-pango-private.h +27 -0
- data/ext/pango/rb-pango.c +32 -0
- data/ext/pango/rb-pango.h +29 -0
- data/extconf.rb +25 -9
- data/lib/pango.rb +24 -68
- data/lib/pango/cairo-loader.rb +63 -0
- data/lib/pango/color.rb +31 -0
- data/lib/pango/deprecated.rb +37 -0
- data/lib/pango/font-description.rb +29 -0
- data/lib/pango/language.rb +29 -0
- data/lib/pango/layout.rb +41 -0
- data/lib/pango/loader.rb +87 -0
- data/lib/pango/markup.rb +31 -0
- data/lib/pango/matrix.rb +64 -0
- data/lib/pango/rectangle.rb +28 -0
- data/lib/pango/version.rb +30 -0
- data/test/pango-test-utils.rb +7 -7
- data/test/run-test.rb +34 -8
- data/test/test-attr-list.rb +28 -0
- data/test/test-color.rb +1 -3
- data/test/test-context.rb +4 -4
- data/test/test-enum.rb +37 -0
- data/test/test-font-description.rb +31 -0
- data/test/test-language.rb +2 -1
- data/test/test-layout.rb +12 -0
- data/test/test-markup.rb +30 -0
- data/test/test-matrix.rb +131 -5
- data/test/test-rectangle.rb +16 -3
- metadata +42 -56
- data/README +0 -32
- data/ext/pango/rbpango.c +0 -356
- data/ext/pango/rbpango.h +0 -95
- data/ext/pango/rbpangoanalysis.c +0 -218
- data/ext/pango/rbpangoattribute.c +0 -506
- data/ext/pango/rbpangoattriterator.c +0 -141
- data/ext/pango/rbpangoattrlist.c +0 -101
- data/ext/pango/rbpangocairo.c +0 -122
- data/ext/pango/rbpangocairocontext.c +0 -131
- data/ext/pango/rbpangocolor.c +0 -120
- data/ext/pango/rbpangocontext.c +0 -344
- data/ext/pango/rbpangocoverage.c +0 -106
- data/ext/pango/rbpangoengine.c +0 -73
- data/ext/pango/rbpangofont.c +0 -110
- data/ext/pango/rbpangofontdescription.c +0 -282
- data/ext/pango/rbpangofontface.c +0 -73
- data/ext/pango/rbpangofontfamily.c +0 -79
- data/ext/pango/rbpangofontmap.c +0 -102
- data/ext/pango/rbpangofontmetrics.c +0 -85
- data/ext/pango/rbpangofontset.c +0 -69
- data/ext/pango/rbpangofontsetsimple.c +0 -60
- data/ext/pango/rbpangoglyphinfo.c +0 -123
- data/ext/pango/rbpangoglyphitem.c +0 -125
- data/ext/pango/rbpangoglyphstring.c +0 -151
- data/ext/pango/rbpangogravity.c +0 -54
- data/ext/pango/rbpangoitem.c +0 -95
- data/ext/pango/rbpangolanguage.c +0 -94
- data/ext/pango/rbpangolayout.c +0 -583
- data/ext/pango/rbpangolayoutiter.c +0 -189
- data/ext/pango/rbpangolayoutline.c +0 -243
- data/ext/pango/rbpangologattr.c +0 -109
- data/ext/pango/rbpangomatrix.c +0 -143
- data/ext/pango/rbpangoprivate.h +0 -49
- data/ext/pango/rbpangorectangle.c +0 -170
- data/ext/pango/rbpangorenderer.c +0 -193
- data/ext/pango/rbpangoscript.c +0 -84
- data/ext/pango/rbpangoscriptiter.c +0 -92
- data/ext/pango/rbpangotabarray.c +0 -128
- data/sample/attribute.rb +0 -82
- data/sample/break.rb +0 -28
- data/sample/gdk_layout.rb +0 -27
- data/sample/glyphstring.rb +0 -61
- data/sample/item.rb +0 -37
- data/sample/label.rb +0 -23
- data/sample/layout.rb +0 -102
- data/sample/pango_cairo.rb +0 -66
- data/sample/parse.rb +0 -33
- data/sample/sample.txt +0 -10
- data/sample/script.rb +0 -23
data/ext/pango/rbpangocoverage.c
DELETED
@@ -1,106 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
/*
|
3
|
-
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
-
* Copyright (C) 2005 Masao Mutoh
|
5
|
-
*
|
6
|
-
* This library is free software; you can redistribute it and/or
|
7
|
-
* modify it under the terms of the GNU Lesser General Public
|
8
|
-
* License as published by the Free Software Foundation; either
|
9
|
-
* version 2.1 of the License, or (at your option) any later version.
|
10
|
-
*
|
11
|
-
* This library is distributed in the hope that it will be useful,
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
-
* Lesser General Public License for more details.
|
15
|
-
*
|
16
|
-
* You should have received a copy of the GNU Lesser General Public
|
17
|
-
* License along with this library; if not, write to the Free Software
|
18
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
-
* MA 02110-1301 USA
|
20
|
-
*/
|
21
|
-
|
22
|
-
#include "rbpangoprivate.h"
|
23
|
-
|
24
|
-
#define RG_TARGET_NAMESPACE cCoverage
|
25
|
-
#define _SELF(self) (RVAL2PANGOCOVERAGE(self))
|
26
|
-
|
27
|
-
/**********************************/
|
28
|
-
GType
|
29
|
-
pango_coverage_get_type(void)
|
30
|
-
{
|
31
|
-
static GType our_type = 0;
|
32
|
-
|
33
|
-
if (our_type == 0)
|
34
|
-
our_type = g_boxed_type_register_static ("PangoCoverage",
|
35
|
-
(GBoxedCopyFunc)pango_coverage_copy,
|
36
|
-
(GBoxedFreeFunc)pango_coverage_unref);
|
37
|
-
return our_type;
|
38
|
-
}
|
39
|
-
/**********************************/
|
40
|
-
|
41
|
-
static VALUE
|
42
|
-
rg_initialize(VALUE self)
|
43
|
-
{
|
44
|
-
G_INITIALIZE(self, pango_coverage_new());
|
45
|
-
return Qnil;
|
46
|
-
}
|
47
|
-
|
48
|
-
static VALUE
|
49
|
-
rg_get_level(VALUE self, VALUE index_)
|
50
|
-
{
|
51
|
-
return PANGOCOVERAGELEVEL2RVAL(pango_coverage_get(_SELF(self), NUM2INT(index_)));
|
52
|
-
}
|
53
|
-
|
54
|
-
static VALUE
|
55
|
-
rg_max_bang(VALUE self, VALUE other)
|
56
|
-
{
|
57
|
-
pango_coverage_max(_SELF(self), _SELF(other));
|
58
|
-
return self;
|
59
|
-
}
|
60
|
-
|
61
|
-
static VALUE
|
62
|
-
rg_set(VALUE self, VALUE index_, VALUE level)
|
63
|
-
{
|
64
|
-
pango_coverage_set(_SELF(self), NUM2INT(index_),
|
65
|
-
RVAL2PANGOCOVERAGELEVEL(level));
|
66
|
-
return self;
|
67
|
-
}
|
68
|
-
|
69
|
-
static VALUE
|
70
|
-
rg_to_bytes(VALUE self)
|
71
|
-
{
|
72
|
-
guchar* bytes;
|
73
|
-
int n_bytes;
|
74
|
-
VALUE ret;
|
75
|
-
|
76
|
-
pango_coverage_to_bytes(_SELF(self), &bytes, &n_bytes);
|
77
|
-
ret = rb_str_new((const char*)bytes, n_bytes);
|
78
|
-
g_free(bytes);
|
79
|
-
|
80
|
-
return ret;
|
81
|
-
}
|
82
|
-
|
83
|
-
static VALUE
|
84
|
-
rg_s_from_bytes(G_GNUC_UNUSED VALUE self, VALUE bytes)
|
85
|
-
{
|
86
|
-
StringValue(bytes);
|
87
|
-
return PANGOCOVERAGE2RVAL(pango_coverage_from_bytes((guchar *)RSTRING_PTR(bytes),
|
88
|
-
RSTRING_LEN(bytes)));
|
89
|
-
}
|
90
|
-
|
91
|
-
void
|
92
|
-
Init_pango_coverage(VALUE mPango)
|
93
|
-
{
|
94
|
-
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_COVERAGE, "Coverage", mPango);
|
95
|
-
|
96
|
-
RG_DEF_METHOD(initialize, 0);
|
97
|
-
RG_DEF_METHOD(get_level, 0);
|
98
|
-
RG_DEF_METHOD_BANG(max, 1);
|
99
|
-
RG_DEF_METHOD(set, 2);
|
100
|
-
RG_DEF_METHOD(to_bytes, 0);
|
101
|
-
RG_DEF_SMETHOD(from_bytes, 1);
|
102
|
-
|
103
|
-
/* PangoCoverageLevel */
|
104
|
-
G_DEF_CLASS(PANGO_TYPE_COVERAGE_LEVEL, "Level", RG_TARGET_NAMESPACE);
|
105
|
-
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_COVERAGE_LEVEL, "PANGO_COVERAGE_");
|
106
|
-
}
|
data/ext/pango/rbpangoengine.c
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
/*
|
3
|
-
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
-
* Copyright (C) 2005 Masao Mutoh
|
5
|
-
*
|
6
|
-
* This library is free software; you can redistribute it and/or
|
7
|
-
* modify it under the terms of the GNU Lesser General Public
|
8
|
-
* License as published by the Free Software Foundation; either
|
9
|
-
* version 2.1 of the License, or (at your option) any later version.
|
10
|
-
*
|
11
|
-
* This library is distributed in the hope that it will be useful,
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
-
* Lesser General Public License for more details.
|
15
|
-
*
|
16
|
-
* You should have received a copy of the GNU Lesser General Public
|
17
|
-
* License along with this library; if not, write to the Free Software
|
18
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
-
* MA 02110-1301 USA
|
20
|
-
*/
|
21
|
-
|
22
|
-
#include "rbpangoprivate.h"
|
23
|
-
|
24
|
-
#ifdef PANGO_TYPE_ENGINE
|
25
|
-
|
26
|
-
#define _SELF(self) (RVAL2PANGOENGINE(self))
|
27
|
-
|
28
|
-
/* FIXME
|
29
|
-
static VALUE
|
30
|
-
rbpango_s_engine_list(VALUE self)
|
31
|
-
{
|
32
|
-
PangoEngineInfo* engines = g_new(PangoEngineInfo, 1);
|
33
|
-
int i, n;
|
34
|
-
VALUE ary;
|
35
|
-
|
36
|
-
script_engine_list(&engines, &n);
|
37
|
-
ary = rb_ary_new();
|
38
|
-
|
39
|
-
for(i = 0; i < n; i++){
|
40
|
-
rb_ary_push(ary, GOBJ2RVAL(&engines[i]));
|
41
|
-
}
|
42
|
-
return ary;
|
43
|
-
}
|
44
|
-
|
45
|
-
static VALUE
|
46
|
-
rbpango_s_engine_create(VALUE self, VALUE id)
|
47
|
-
{
|
48
|
-
return GOBJ2RVAL(script_engine_create(RVAL2CSTR(id)));
|
49
|
-
}
|
50
|
-
*/
|
51
|
-
/*
|
52
|
-
void script_engine_init (GTypeModule *module);
|
53
|
-
void script_engine_exit (void);
|
54
|
-
PangoEngine* script_engine_create (const char *id);
|
55
|
-
*/
|
56
|
-
|
57
|
-
#endif
|
58
|
-
|
59
|
-
void
|
60
|
-
Init_pango_engine(VALUE mPango)
|
61
|
-
{
|
62
|
-
#ifdef PANGO_TYPE_ENGINE
|
63
|
-
G_DEF_CLASS(PANGO_TYPE_ENGINE, "Engine", mPango);
|
64
|
-
|
65
|
-
/* FIXME
|
66
|
-
rb_define_singleton_method(engine, "engines", rbpango_s_engine_list, 0);
|
67
|
-
rb_define_singleton_method(engine, "create", rbpango_s_engine_create, 1);
|
68
|
-
*/
|
69
|
-
G_DEF_CLASS(PANGO_TYPE_ENGINE_LANG, "EngineLang", mPango);
|
70
|
-
G_DEF_CLASS(PANGO_TYPE_ENGINE_SHAPE, "EngineShape", mPango);
|
71
|
-
#endif
|
72
|
-
}
|
73
|
-
|
data/ext/pango/rbpangofont.c
DELETED
@@ -1,110 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
/*
|
3
|
-
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
-
* Copyright (C) 2002-2006 Masao Mutoh
|
5
|
-
*
|
6
|
-
* This library is free software; you can redistribute it and/or
|
7
|
-
* modify it under the terms of the GNU Lesser General Public
|
8
|
-
* License as published by the Free Software Foundation; either
|
9
|
-
* version 2.1 of the License, or (at your option) any later version.
|
10
|
-
*
|
11
|
-
* This library is distributed in the hope that it will be useful,
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
-
* Lesser General Public License for more details.
|
15
|
-
*
|
16
|
-
* You should have received a copy of the GNU Lesser General Public
|
17
|
-
* License along with this library; if not, write to the Free Software
|
18
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
-
* MA 02110-1301 USA
|
20
|
-
*/
|
21
|
-
|
22
|
-
#include "rbpangoprivate.h"
|
23
|
-
|
24
|
-
#define RG_TARGET_NAMESPACE cFont
|
25
|
-
#define _SELF(self) (RVAL2PANGOFONT(self))
|
26
|
-
|
27
|
-
static VALUE
|
28
|
-
rg_find_shaper(VALUE self, VALUE language, VALUE ch)
|
29
|
-
{
|
30
|
-
return GOBJ2RVAL(pango_font_find_shaper(_SELF(self),
|
31
|
-
RVAL2PANGOLANGUAGE(language),
|
32
|
-
NUM2UINT(ch)));
|
33
|
-
}
|
34
|
-
|
35
|
-
static VALUE
|
36
|
-
rg_describe(int argc, VALUE *argv, VALUE self)
|
37
|
-
{
|
38
|
-
VALUE desc, absolute_size;
|
39
|
-
rb_scan_args(argc, argv, "01", &absolute_size);
|
40
|
-
|
41
|
-
if (NIL_P(absolute_size) || ! RVAL2CBOOL(absolute_size)){
|
42
|
-
desc = PANGOFONTDESCRIPTION2RVAL(pango_font_describe(_SELF(self)));
|
43
|
-
} else {
|
44
|
-
desc = PANGOFONTDESCRIPTION2RVAL(pango_font_describe_with_absolute_size(_SELF(self)));
|
45
|
-
}
|
46
|
-
return desc;
|
47
|
-
}
|
48
|
-
|
49
|
-
static VALUE
|
50
|
-
rg_get_coverage(VALUE self, VALUE language)
|
51
|
-
{
|
52
|
-
PangoCoverage* c = pango_font_get_coverage(_SELF(self),
|
53
|
-
RVAL2PANGOLANGUAGE(language));
|
54
|
-
return PANGOCOVERAGE2RVAL(c);
|
55
|
-
}
|
56
|
-
|
57
|
-
static VALUE
|
58
|
-
rg_get_glyph_extents(VALUE self, VALUE glyph)
|
59
|
-
{
|
60
|
-
PangoRectangle ink_rect, logical_rect;
|
61
|
-
pango_font_get_glyph_extents(_SELF(self),
|
62
|
-
NUM2UINT(glyph),
|
63
|
-
&ink_rect, &logical_rect);
|
64
|
-
|
65
|
-
return rb_assoc_new(PANGORECTANGLE2RVAL(&ink_rect),
|
66
|
-
PANGORECTANGLE2RVAL(&logical_rect));
|
67
|
-
|
68
|
-
}
|
69
|
-
|
70
|
-
static VALUE
|
71
|
-
rg_metrics(int argc, VALUE *argv, VALUE self)
|
72
|
-
{
|
73
|
-
VALUE language;
|
74
|
-
PangoLanguage* lang = NULL;
|
75
|
-
|
76
|
-
rb_scan_args(argc, argv, "01", &language);
|
77
|
-
|
78
|
-
if (!NIL_P(language))
|
79
|
-
lang = RVAL2PANGOLANGUAGE(language);
|
80
|
-
|
81
|
-
return PANGOFONTMETRICS2RVAL(pango_font_get_metrics(_SELF(self), lang));
|
82
|
-
}
|
83
|
-
|
84
|
-
static VALUE
|
85
|
-
rg_font_map(VALUE self)
|
86
|
-
{
|
87
|
-
return GOBJ2RVAL(pango_font_get_font_map(_SELF(self)));
|
88
|
-
}
|
89
|
-
|
90
|
-
void
|
91
|
-
Init_pango_font(VALUE mPango)
|
92
|
-
{
|
93
|
-
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT, "Font", mPango);
|
94
|
-
|
95
|
-
RG_DEF_METHOD(find_shaper, 2);
|
96
|
-
RG_DEF_METHOD(describe, -1);
|
97
|
-
RG_DEF_METHOD(get_coverage, 1);
|
98
|
-
RG_DEF_METHOD(get_glyph_extents, 1);
|
99
|
-
RG_DEF_METHOD(metrics, -1);
|
100
|
-
RG_DEF_METHOD(font_map, 0);
|
101
|
-
|
102
|
-
G_DEF_CLASS3("PangoXFont", "XFont", mPango);
|
103
|
-
G_DEF_CLASS3("PangoFT2Font", "FT2Font", mPango);
|
104
|
-
G_DEF_CLASS3("PangoFcFont", "FcFont", mPango);
|
105
|
-
G_DEF_CLASS3("PangoXftFont", "XftFont", mPango);
|
106
|
-
G_DEF_CLASS3("PangoCairoFcFont", "CairoFcFont", mPango);
|
107
|
-
G_DEF_CLASS3("PangoCairoFont", "CairoFont", mPango);
|
108
|
-
G_DEF_CLASS3("PangoCairoWin32Font", "CairoWin32Font", mPango);
|
109
|
-
G_DEF_CLASS3("PangoATSUIFont", "ATSUIFont", mPango);
|
110
|
-
}
|
@@ -1,282 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
/*
|
3
|
-
* Copyright (C) 2011-2013 Ruby-GNOME2 Project Team
|
4
|
-
* Copyright (C) 2002-2005 Masao Mutoh
|
5
|
-
*
|
6
|
-
* This library is free software; you can redistribute it and/or
|
7
|
-
* modify it under the terms of the GNU Lesser General Public
|
8
|
-
* License as published by the Free Software Foundation; either
|
9
|
-
* version 2.1 of the License, or (at your option) any later version.
|
10
|
-
*
|
11
|
-
* This library is distributed in the hope that it will be useful,
|
12
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
-
* Lesser General Public License for more details.
|
15
|
-
*
|
16
|
-
* You should have received a copy of the GNU Lesser General Public
|
17
|
-
* License along with this library; if not, write to the Free Software
|
18
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19
|
-
* MA 02110-1301 USA
|
20
|
-
*/
|
21
|
-
|
22
|
-
#include "rbpangoprivate.h"
|
23
|
-
|
24
|
-
#define RG_TARGET_NAMESPACE cFontDescription
|
25
|
-
#define _SELF(self) (RVAL2PANGOFONTDESCRIPTION(self))
|
26
|
-
|
27
|
-
static VALUE
|
28
|
-
rg_initialize(int argc, VALUE *argv, VALUE self)
|
29
|
-
{
|
30
|
-
VALUE str;
|
31
|
-
PangoFontDescription *description;
|
32
|
-
|
33
|
-
rb_scan_args(argc, argv, "01", &str);
|
34
|
-
|
35
|
-
if (NIL_P(str)) {
|
36
|
-
description = pango_font_description_new();
|
37
|
-
} else {
|
38
|
-
description = pango_font_description_from_string(RVAL2CSTR(str));
|
39
|
-
}
|
40
|
-
|
41
|
-
G_INITIALIZE(self, description);
|
42
|
-
|
43
|
-
return Qnil;
|
44
|
-
}
|
45
|
-
/*
|
46
|
-
PangoFontDescription* pango_font_description_copy
|
47
|
-
(const PangoFontDescription *desc);
|
48
|
-
PangoFontDescription* pango_font_description_copy_static
|
49
|
-
(const PangoFontDescription *desc);
|
50
|
-
*/
|
51
|
-
|
52
|
-
static VALUE
|
53
|
-
rg_hash(VALUE self)
|
54
|
-
{
|
55
|
-
return UINT2NUM(pango_font_description_hash(_SELF(self)));
|
56
|
-
}
|
57
|
-
|
58
|
-
static VALUE
|
59
|
-
rg_operator_font_desc_equal(VALUE self, VALUE other)
|
60
|
-
{
|
61
|
-
return CBOOL2RVAL(pango_font_description_equal(_SELF(self), _SELF(other)));
|
62
|
-
}
|
63
|
-
|
64
|
-
/* Don't we need this?
|
65
|
-
void pango_font_descriptions_free (PangoFontDescription **descs,
|
66
|
-
int n_descs);
|
67
|
-
*/
|
68
|
-
|
69
|
-
static VALUE
|
70
|
-
rg_set_family(VALUE self, VALUE family)
|
71
|
-
{
|
72
|
-
pango_font_description_set_family(_SELF(self), RVAL2CSTR(family));
|
73
|
-
return self;
|
74
|
-
}
|
75
|
-
/* Don't we need this?
|
76
|
-
void pango_font_description_set_family_static
|
77
|
-
(PangoFontDescription *desc,
|
78
|
-
const char *family);
|
79
|
-
*/
|
80
|
-
|
81
|
-
static VALUE
|
82
|
-
rg_family(VALUE self)
|
83
|
-
{
|
84
|
-
return CSTR2RVAL(pango_font_description_get_family(_SELF(self)));
|
85
|
-
}
|
86
|
-
|
87
|
-
static VALUE
|
88
|
-
rg_set_style(VALUE self, VALUE style)
|
89
|
-
{
|
90
|
-
pango_font_description_set_style(_SELF(self), RVAL2PANGOSTYLE(style));
|
91
|
-
return self;
|
92
|
-
}
|
93
|
-
|
94
|
-
static VALUE
|
95
|
-
rg_style(VALUE self)
|
96
|
-
{
|
97
|
-
return PANGOSTYLE2RVAL(pango_font_description_get_style(_SELF(self)));
|
98
|
-
}
|
99
|
-
|
100
|
-
static VALUE
|
101
|
-
rg_set_variant(VALUE self, VALUE variant)
|
102
|
-
{
|
103
|
-
pango_font_description_set_variant(_SELF(self), RVAL2PANGOVARIANT(variant));
|
104
|
-
return self;
|
105
|
-
}
|
106
|
-
|
107
|
-
static VALUE
|
108
|
-
rg_variant(VALUE self)
|
109
|
-
{
|
110
|
-
return PANGOVARIANT2RVAL(pango_font_description_get_variant(_SELF(self)));
|
111
|
-
}
|
112
|
-
|
113
|
-
static VALUE
|
114
|
-
rg_set_weight(VALUE self, VALUE weight)
|
115
|
-
{
|
116
|
-
pango_font_description_set_weight(_SELF(self),
|
117
|
-
RVAL2PANGOWEIGHT(weight));
|
118
|
-
return self;
|
119
|
-
}
|
120
|
-
|
121
|
-
static VALUE
|
122
|
-
rg_weight(VALUE self)
|
123
|
-
{
|
124
|
-
return PANGOWEIGHT2RVAL(pango_font_description_get_weight(_SELF(self)));
|
125
|
-
}
|
126
|
-
|
127
|
-
static VALUE
|
128
|
-
rg_set_stretch(VALUE self, VALUE stretch)
|
129
|
-
{
|
130
|
-
pango_font_description_set_stretch(_SELF(self), RVAL2PANGOSTRETCH(stretch));
|
131
|
-
return self;
|
132
|
-
}
|
133
|
-
|
134
|
-
static VALUE
|
135
|
-
rg_stretch(VALUE self)
|
136
|
-
{
|
137
|
-
return PANGOSTRETCH2RVAL(pango_font_description_get_stretch(_SELF(self)));
|
138
|
-
}
|
139
|
-
|
140
|
-
static VALUE
|
141
|
-
rg_set_size(VALUE self, VALUE size)
|
142
|
-
{
|
143
|
-
pango_font_description_set_size(_SELF(self), NUM2INT(size));
|
144
|
-
return self;
|
145
|
-
}
|
146
|
-
|
147
|
-
static VALUE
|
148
|
-
rg_size(VALUE self)
|
149
|
-
{
|
150
|
-
return INT2NUM(pango_font_description_get_size(_SELF(self)));
|
151
|
-
}
|
152
|
-
|
153
|
-
static VALUE
|
154
|
-
rg_set_absolute_size(VALUE self, VALUE size)
|
155
|
-
{
|
156
|
-
pango_font_description_set_absolute_size(_SELF(self), NUM2INT(size));
|
157
|
-
return self;
|
158
|
-
}
|
159
|
-
|
160
|
-
static VALUE
|
161
|
-
rg_size_is_absolute_p(VALUE self)
|
162
|
-
{
|
163
|
-
return CBOOL2RVAL(pango_font_description_get_size_is_absolute(_SELF(self)));
|
164
|
-
}
|
165
|
-
|
166
|
-
#if PANGO_VERSION_CHECK(1,16,0)
|
167
|
-
static VALUE
|
168
|
-
rg_gravity(VALUE self)
|
169
|
-
{
|
170
|
-
return PANGOGRAVITY2RVAL(pango_font_description_get_gravity(_SELF(self)));
|
171
|
-
}
|
172
|
-
|
173
|
-
static VALUE
|
174
|
-
rg_set_gravity(VALUE self, VALUE gravity)
|
175
|
-
{
|
176
|
-
pango_font_description_set_gravity(_SELF(self), RVAL2PANGOGRAVITY(gravity));
|
177
|
-
return self;
|
178
|
-
}
|
179
|
-
#endif
|
180
|
-
|
181
|
-
static VALUE
|
182
|
-
rg_set_fields(VALUE self)
|
183
|
-
{
|
184
|
-
return PANGOFONTMASK2RVAL(pango_font_description_get_set_fields(_SELF(self)));
|
185
|
-
}
|
186
|
-
|
187
|
-
static VALUE
|
188
|
-
rg_unset_fields(VALUE self, VALUE to_unset)
|
189
|
-
{
|
190
|
-
pango_font_description_unset_fields(_SELF(self), RVAL2PANGOFONTMASK(to_unset));
|
191
|
-
return self;
|
192
|
-
}
|
193
|
-
|
194
|
-
static VALUE
|
195
|
-
rg_merge(VALUE self, VALUE desc_to_merge, VALUE replace_existing)
|
196
|
-
{
|
197
|
-
pango_font_description_merge(_SELF(self), _SELF(desc_to_merge),
|
198
|
-
RVAL2CBOOL(replace_existing));
|
199
|
-
return self;
|
200
|
-
}
|
201
|
-
|
202
|
-
/* Don't we need this?
|
203
|
-
void pango_font_description_merge_static
|
204
|
-
(PangoFontDescription *desc,
|
205
|
-
const PangoFontDescription *desc_to_merge,
|
206
|
-
gboolean replace_existing);
|
207
|
-
*/
|
208
|
-
|
209
|
-
static VALUE
|
210
|
-
rg_better_match(VALUE self, VALUE old_match, VALUE new_match)
|
211
|
-
{
|
212
|
-
return CBOOL2RVAL(pango_font_description_better_match(_SELF(self),
|
213
|
-
_SELF(old_match),
|
214
|
-
_SELF(new_match)));
|
215
|
-
}
|
216
|
-
|
217
|
-
static VALUE
|
218
|
-
rg_to_str(VALUE self)
|
219
|
-
{
|
220
|
-
return CSTR2RVAL(pango_font_description_to_string(_SELF(self)));
|
221
|
-
}
|
222
|
-
|
223
|
-
static VALUE
|
224
|
-
rg_to_filename(VALUE self)
|
225
|
-
{
|
226
|
-
return CSTR2RVAL(pango_font_description_to_filename(_SELF(self)));
|
227
|
-
}
|
228
|
-
|
229
|
-
void
|
230
|
-
Init_pango_font_description(VALUE mPango)
|
231
|
-
{
|
232
|
-
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONT_DESCRIPTION, "FontDescription", mPango);
|
233
|
-
|
234
|
-
RG_DEF_METHOD(initialize, -1);
|
235
|
-
RG_DEF_METHOD(hash, 0);
|
236
|
-
RG_DEF_METHOD_OPERATOR("==", font_desc_equal, 1);
|
237
|
-
RG_DEF_METHOD(set_family, 1);
|
238
|
-
RG_DEF_METHOD(family, 0);
|
239
|
-
RG_DEF_METHOD(set_style, 1);
|
240
|
-
RG_DEF_METHOD(style, 0);
|
241
|
-
RG_DEF_METHOD(set_variant, 1);
|
242
|
-
RG_DEF_METHOD(variant, 0);
|
243
|
-
RG_DEF_METHOD(set_weight, 1);
|
244
|
-
RG_DEF_METHOD(weight, 0);
|
245
|
-
RG_DEF_METHOD(set_stretch, 1);
|
246
|
-
RG_DEF_METHOD(stretch, 0);
|
247
|
-
RG_DEF_METHOD(set_size, 1);
|
248
|
-
RG_DEF_METHOD(size, 0);
|
249
|
-
RG_DEF_METHOD(set_absolute_size, 1);
|
250
|
-
RG_DEF_METHOD_P(size_is_absolute, 0);
|
251
|
-
#if PANGO_VERSION_CHECK(1,16,0)
|
252
|
-
RG_DEF_METHOD(set_gravity, 1);
|
253
|
-
RG_DEF_METHOD(gravity, 0);
|
254
|
-
#endif
|
255
|
-
RG_DEF_METHOD(set_fields, 0);
|
256
|
-
RG_DEF_METHOD(unset_fields, 1);
|
257
|
-
RG_DEF_METHOD(merge, 2);
|
258
|
-
RG_DEF_METHOD(better_match, 2);
|
259
|
-
RG_DEF_METHOD(to_str, 0);
|
260
|
-
RG_DEF_ALIAS("to_s", "to_str");
|
261
|
-
RG_DEF_METHOD(to_filename, 0);
|
262
|
-
|
263
|
-
/* PangoStyle */
|
264
|
-
G_DEF_CLASS(PANGO_TYPE_STYLE, "Style", RG_TARGET_NAMESPACE);
|
265
|
-
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_STYLE, "PANGO_");
|
266
|
-
|
267
|
-
/* PangoWeight */
|
268
|
-
G_DEF_CLASS(PANGO_TYPE_WEIGHT, "Weight", RG_TARGET_NAMESPACE);
|
269
|
-
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_WEIGHT, "PANGO_");
|
270
|
-
|
271
|
-
/* PangoVariant */
|
272
|
-
G_DEF_CLASS(PANGO_TYPE_VARIANT, "Variant", RG_TARGET_NAMESPACE);
|
273
|
-
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_VARIANT, "PANGO_");
|
274
|
-
|
275
|
-
/* PangoStretch */
|
276
|
-
G_DEF_CLASS(PANGO_TYPE_STRETCH, "Stretch", RG_TARGET_NAMESPACE);
|
277
|
-
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_STRETCH, "PANGO_");
|
278
|
-
|
279
|
-
/* PangoFontMask */
|
280
|
-
G_DEF_CLASS(PANGO_TYPE_FONT_MASK, "FontMask", RG_TARGET_NAMESPACE);
|
281
|
-
G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, PANGO_TYPE_FONT_MASK, "PANGO_");
|
282
|
-
}
|