On Fri, 2005-12-30 at 17:31 +0100, Kim Woelders wrote:
> I think you are right that something is wrong somewhere around here. 
> However, this patch breaks stuff for certain fonts (w becomes too small, 
> IIRC).

Ok.  I have to plead a bit of ignorance when it comes to font metrics.
But if your problem is with the width, and my original problem is with
the height, then the naive assumption is that if we take the horizontal
advance and the height as returned by imlib_font_query_size(), we should
be ok.

I've coded this up and it looks ok on all of my tests.  Some review and
testing is clearly needed.  The patch is attached.

Regards,
Jason.
--- imlib2-1.2.1.009.orig/src/lib/font_draw.c	2005-12-30 10:49:31.000000000 -0500
+++ imlib2-1.2.1.009/src/lib/font_draw.c	2005-12-30 11:42:11.000000000 -0500
@@ -78,7 +78,8 @@
    DATA32             *data, col;
    int                 nx, ny;
 
-   imlib_font_query_advance(fn, text, &w, &h);
+   imlib_font_query_advance(fn, text, &w, NULL);
+   imlib_font_query_size(fn, text, NULL, &h);
 
    data = malloc(w * h * sizeof(DATA32));
    if (!data)

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to