| Class | Joyau::IntraText |
| In: |
Drawable.cpp
|
| Parent: | Joyau::Drawable |
Activates a font.
/*
Activates a font.
*/
VALUE IntraText_activate(VALUE self)
{
IntraText &ref = getRef<IntraText>(self);
ref.activate();
return Qnil;
}
Sets the font from which characters will be taken if it is not in this one.
/*
call-seq: altFont=(font)
Sets the font from which characters will be taken
if it is not in this one.
*/
VALUE IntraText_setAltFont(VALUE self, VALUE obj)
{
if (!rb_obj_is_kind_of(obj, getClass("IntraText")))
rb_raise(rb_eTypeError, "Can't convert %s into Joyau::IntraText",
rb_obj_classname(obj));
IntraText &ref = getRef<IntraText>(self);
IntraText &val = getRef<IntraText>(obj);
ref.setAltFont(val);
return Qnil;
}
Sets the text’s encoding (required for non-ASCII texts).
/*
call-seq: encoding=(options)
Sets the text's encoding (required for non-ASCII texts).
*/
VALUE IntraText_setEncoding(VALUE self, VALUE options)
{
IntraText &ref = getRef<IntraText>(self);
ref.setEncoding(FIX2INT(options));
return Qnil;
}
Loads a font. You can use flags as option, or give 0.
/*
call-seq: load(font_name, options)
Loads a font. You can use flags as option, or give 0.
*/
VALUE IntraText_load(VALUE self, VALUE name, VALUE options)
{
name = rb_obj_as_string(name);
IntraText &ref = getRef<IntraText>(self);
try {
ref.load(StringValuePtr(name), FIX2INT(options));
}
catch (const RubyException &e) {
e.rbRaise();
}
return Qnil;
}
Sets an intratext’s maximum width.
/* call-seq: max_width=(val) Sets an intratext's maximum width. */ VALUE IntraText_setMaxWidth(VALUE self, VALUE val)
Sets a font style. Flags of options can be given too.
/*
call-seq: setStyle(size, color, shadow, options)
Sets a font style. Flags of options can be given too.
*/
VALUE IntraText_setStyle(VALUE self, VALUE size, VALUE color, VALUE shadow,
VALUE options)
{
IntraText &ref = getRef<IntraText>(self);
ref.setStyle(NUM2DBL(size), hash2col(color), hash2col(shadow),
FIX2INT(options));
return Qnil;
}
Returns an intratext’s content.
/*
Returns an intratext's content.
*/
VALUE IntraText_text(VALUE self)
{
IntraText &ref = getRef<IntraText>(self);
return rb_str_new2(ref.getText().c_str());
}