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



83
84
85
86
87
88
89
90
91
92
# File 'ext/cairo/rb_cairo_font_options.c', line 83

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

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

Instance Method Details

#==Object



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

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



129
130
131
132
133
# File 'ext/cairo/rb_cairo_font_options.c', line 129

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

#color_modeObject



208
209
210
211
212
# File 'ext/cairo/rb_cairo_font_options.c', line 208

static VALUE
cr_options_get_color_mode (VALUE self)
{
  return INT2NUM (cairo_font_options_get_color_mode (_SELF (self)));
}

#color_paletteObject



222
223
224
225
226
# File 'ext/cairo/rb_cairo_font_options.c', line 222

static VALUE
cr_options_get_color_palette (VALUE self)
{
  return UINT2NUM (cairo_font_options_get_color_palette (_SELF (self)));
}

#dupObject



94
95
96
97
98
# File 'ext/cairo/rb_cairo_font_options.c', line 94

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

#eql?Boolean

Returns:

  • (Boolean)


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

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



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

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

#hint_metricsObject



171
172
173
174
175
# File 'ext/cairo/rb_cairo_font_options.c', line 171

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

#hint_styleObject



157
158
159
160
161
# File 'ext/cairo/rb_cairo_font_options.c', line 157

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

#merge(other) ⇒ Object



112
113
114
# File 'lib/cairo.rb', line 112

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

#merge!Object Also known as: update



100
101
102
103
104
105
# File 'ext/cairo/rb_cairo_font_options.c', line 100

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

#set_antialiasObject



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

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

#set_color_modeObject



200
201
202
203
204
205
206
# File 'ext/cairo/rb_cairo_font_options.c', line 200

static VALUE
cr_options_set_color_mode (VALUE self, VALUE mode)
{
  cairo_font_options_set_color_mode (_SELF (self),
                                     RVAL2CRCOLORMODE (mode));
  return self;
}

#set_color_paletteObject



214
215
216
217
218
219
220
# File 'ext/cairo/rb_cairo_font_options.c', line 214

static VALUE
cr_options_set_color_palette (VALUE self, VALUE index)
{
  cairo_font_options_set_color_palette (_SELF (self),
                                        NUM2UINT (index));
  return self;
}

#set_custom_palette_colorObject



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'ext/cairo/rb_cairo_font_options.c', line 228

static VALUE
cr_options_set_custom_palette_color (VALUE self,
                                     VALUE index,
                                     VALUE red,
                                     VALUE green,
                                     VALUE blue,
                                     VALUE alpha)
{
  cairo_font_options_set_custom_palette_color (_SELF (self),
                                               NUM2UINT (index),
                                               NUM2DBL (red),
                                               NUM2DBL (green),
                                               NUM2DBL (blue),
                                               NUM2DBL (alpha));
  return self;
}

#set_hint_metricsObject



163
164
165
166
167
168
169
# File 'ext/cairo/rb_cairo_font_options.c', line 163

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



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

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



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

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



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

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

#subpixel_orderObject



143
144
145
146
147
# File 'ext/cairo/rb_cairo_font_options.c', line 143

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

#variationsObject



186
187
188
189
190
191
192
193
194
195
196
# File 'ext/cairo/rb_cairo_font_options.c', line 186

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);
}