Logo Search packages:      
Sourcecode: adesklets version File versions

void imlib_get_text_advance ( const char *  text,
int *  horizontal_advance_return,
int *  vertical_advance_return 
)

Parameters:
text A string.
horizontal_advance_return Horizontal offset.
vertical_advance_return Vertical offset.
Gets the advance horizontally and vertically in pixels the next text string would need to be placed at for the current font. The advances are not adjusted for rotation so you will have to translate the advances (which are calculated as if the text was drawn horizontally from left to right) depending on the text orientation.

Definition at line 3726 of file imlib2.c.

{
   ImlibFont          *fn;
   int                 w, h;

   if (!ctx)
      ctx = imlib_context_new();
   CHECK_PARAM_POINTER("imlib_get_text_advance", "font", ctx->font);
   CHECK_PARAM_POINTER("imlib_get_text_advance", "text", text);
   fn = (ImlibFont *) ctx->font;
   imlib_font_query_advance(fn, text, &w, &h);
   if (horizontal_advance_return)
      *horizontal_advance_return = w;
   if (vertical_advance_return)
      *vertical_advance_return = h;
}


Generated by  Doxygen 1.6.0   Back to index