|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.
int w, h;
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);
*horizontal_advance_return = w;
*vertical_advance_return = h;