This is Debian bug https://bugs.debian.org/446705 reported by Robert Smeikal.
Not sure if this is the intended behavior of imlib2.
imlib_get_text_size(..) and imlib_text_draw_with_return_metrics(..) return different width when the text to be drawn contains
characters with code points not supported by the current font. i used utf-8 encoded text with 2-byte characters (cyrillic), i.e.
code point 0x0439, corresponding bytes d0b9. when a font is loaded with support for the code points, the two functions return the
same width, otherwise imlib_text_draw_with_return_metrics(..) returns the correct value, whereas imlib_get_text_size(..) returns a
small number (e.g. 17) which seems to be uncorrelated with the text.