Add function returning the true string length in pixels.

May be called from outside of x11.c.
This commit is contained in:
Holger Vogt 2017-10-07 18:34:58 +02:00
parent e5e019c6ce
commit 90c59ec39e
1 changed files with 9 additions and 0 deletions

View File

@ -1225,6 +1225,15 @@ Xget_str_length(char *text, int* wlen, int* wheight, XftFont* gfont, char* fonam
return 0;
}
/* get the length of an utf-8 string in pixels */
int
X11_GetLenStr(GRAPH *gr, char* instring)
{
int wl, wh;
Xget_str_length(instring, &wl, &wh, NULL, DEVDEP(gr).fname, DEVDEP(gr).fsize);
return wl;
}
#else
int x11_dummy_symbol;