Class: Cairo::FontOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/cairo.rb,
ext/cairo/rb_cairo_font_options.c

Instance Method Summary collapse

Constructor Details

#initializeObject



71
72
73
74
75
76
77
78
79
80
# File 'ext/cairo/rb_cairo_font_options.c', line 71

static VALUE
cr_options_create (VALUE self)
{
  cairo_font_options_t *options;

  options = cairo_font_options_create ();
  cr_options_check_status (options);
  DATA_PTR (self) = options;
  return Qnil;
}

Instance Method Details

#==Object



95
96
97
98
99
100
101
102
# File 'ext/cairo/rb_cairo_font_options.c', line 95

static VALUE
cr_options_equal (VALUE self, VALUE other)
{
  if (!rb_cairo__is_kind_of (other, rb_cCairo_FontOptions))
    return Qfalse;

  return CBOOL2RVAL (cairo_font_options_equal (_SELF (self), _SELF (other)));
}

#antialiasObject



117
118
119
120
121
# File 'ext/cairo/rb_cairo_font_options.c', line 117

static VALUE
cr_options_get_antialias (VALUE self)
{
  return INT2NUM (cairo_font_options_get_antialias (_SELF (self)));
}

#dupObject



82
83
84
85
86
# File 'ext/cairo/rb_cairo_font_options.c', line 82

static VALUE
cr_options_copy (VALUE self)
{
  return CRFONTOPTIONS2RVAL (_SELF (self));
}

#eql?Boolean

Returns:

  • (Boolean)


95
96
97
98
99
100
101
102
# File 'ext/cairo/rb_cairo_font_options.c', line 95

static VALUE
cr_options_equal (VALUE self, VALUE other)
{
  if (!rb_cairo__is_kind_of (other, rb_cCairo_FontOptions))
    return Qfalse;

  return CBOOL2RVAL (cairo_font_options_equal (_SELF (self), _SELF (other)));
}

#hashObject



104
105
106
107
108
# File 'ext/cairo/rb_cairo_font_options.c', line 104

static VALUE
cr_options_hash (VALUE self)
{
  return INT2NUM (cairo_font_options_hash (_SELF (self)));
}

#hint_metricsObject



159
160
161
162
163
# File 'ext/cairo/rb_cairo_font_options.c', line 159

static VALUE
cr_options_get_hint_metrics (VALUE self)
{
  return INT2NUM (cairo_font_options_get_hint_metrics (_SELF (self)));
}

#hint_styleObject



145
146
147
148
149
# File 'ext/cairo/rb_cairo_font_options.c', line 145

static VALUE
cr_options_get_hint_style (VALUE self)
{
  return INT2NUM (cairo_font_options_get_hint_style (_SELF (self)));
}

#merge(other) ⇒ Object



143
144
145
# File 'lib/cairo.rb', line 143

def merge(other)
  dup.merge!(other)
end

#merge!Object Also known as: update



88
89
90
91
92
93
# File 'ext/cairo/rb_cairo_font_options.c', line 88

static VALUE
cr_options_merge (VALUE self, VALUE other)
{
  cairo_font_options_merge (_SELF (self), _SELF (other));
  return self;
}

#set_antialiasObject



110
111
112
113
114
115
# File 'ext/cairo/rb_cairo_font_options.c', line 110

static VALUE
cr_options_set_antialias (VALUE self, VALUE antialias)
{
  cairo_font_options_set_antialias (_SELF (self), RVAL2CRANTIALIAS (antialias));
  return self;
}

#set_hint_metricsObject



151
152
153
154
155
156
157
# File 'ext/cairo/rb_cairo_font_options.c', line 151

static VALUE
cr_options_set_hint_metrics (VALUE self, VALUE hint_metrics)
{
  cairo_font_options_set_hint_metrics (_SELF (self),
                                       RVAL2CRHINTMETRICS (hint_metrics));
  return self;
}

#set_hint_styleObject



137
138
139
140
141
142
143
# File 'ext/cairo/rb_cairo_font_options.c', line 137

static VALUE
cr_options_set_hint_style (VALUE self, VALUE hint_style)
{
  cairo_font_options_set_hint_style (_SELF (self),
                                     RVAL2CRHINTSTYLE (hint_style));
  return self;
}

#set_subpixel_orderObject



123
124
125
126
127
128
129
# File 'ext/cairo/rb_cairo_font_options.c', line 123

static VALUE
cr_options_set_subpixel_order (VALUE self, VALUE subpixel_order)
{
  cairo_font_options_set_subpixel_order (_SELF (self),
                                         RVAL2CRSUBPIXELORDER (subpixel_order));
  return self;
}

#set_variationsObject



166
167
168
169
170
171
172
# File 'ext/cairo/rb_cairo_font_options.c', line 166

static VALUE
cr_options_set_variations (VALUE self, VALUE variations)
{
  cairo_font_options_set_variations (_SELF (self),
                                     RVAL2CSTR (variations));
  return self;
}

#subpixel_orderObject



131
132
133
134
135
# File 'ext/cairo/rb_cairo_font_options.c', line 131

static VALUE
cr_options_get_subpixel_order (VALUE self)
{
  return INT2NUM (cairo_font_options_get_subpixel_order (_SELF (self)));
}

#variationsObject



174
175
176
177
178
179
180
181
182
183
184
# File 'ext/cairo/rb_cairo_font_options.c', line 174

static VALUE
cr_options_get_variations (VALUE self)
{
  const char *variations;

  variations = cairo_font_options_get_variations (_SELF (self));
  if (!variations)
    return Qnil;

  return CSTR2RVAL (variations);
}