Class Joyau::IntraText
In: Drawable.cpp
Parent: Joyau::Drawable

Methods

activate   altFont=   encoding=   load   max_width=   setStyle   text   text=  

Public Instance methods

Activates a font.

[Source]

/*
  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.

[Source]

/*
  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)
{
   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).

[Source]

/*
  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.

[Source]

/*
  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)
{
   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.

[Source]

/*
  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.

[Source]

/*
  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.

[Source]

/*
  Returns an intratext's content.
*/
VALUE IntraText_text(VALUE self)
{
   IntraText &ref = getRef<IntraText>(self);
   return rb_str_new2(ref.getText().c_str());
}

Sets an intratext’s content.

[Source]

/*
  call-seq: text=(val)

  Sets an intratext's content.
*/
VALUE IntraText_setText(VALUE self, VALUE txt)
{
   IntraText &ref = getRef<IntraText>(self);
   ref.setText(StringValuePtr(txt));

   return txt;
}

[Validate]