Date: Wed, 09 Jun 2004 00:31:21 -0400 From: tj <999alfred@comcast.net> Subject: Re: [nanogui] GrGetFontInfo returns wrong maxwidth Here is the font. Also some code and output: With this code: courR12 = GrCreateFont ("/usr/X11/lib/fonts/75dpi/courR12-ISO8859-1.pcf.gz", 15,NULL); GrGetFontInfo(courR12, &courR12_info); printf("Font maxwidth = %d.\n", courR12_info.maxwidth); printf("Font height = %d.\n", courR12_info.height); printf("Font baseline = %d.\n", courR12_info.baseline); Results with an ouput of: Font maxwidth = 7. Font height = 14. Font baseline = 11. Notice maxwidth of a very narrow 7. I even tried : courR12 = GrCreateFont ("/usr/X11/lib/fonts/75dpi/courR12-ISO8859-1.pcf.gz", 15,NULL); // GrGetFontInfo(courR12, &courR12_info); gc = GrNewGC(); GrSetGCFont (gc, courR12); GrGetGCTextSize (gc , "W", 1, 0,&courR12_info.maxwidth, &courR12_info.height, &courR12_info.baseline); GrDestroyGC(gc); printf("Font maxwidth = %d.\n", courR12_info.maxwidth); printf("Font height = %d.\n", courR12_info.height); printf("Font baseline = %d.\n", courR12_info.baseline); Results on output: Font maxwidth = 7. Font height = 14. Font baseline = 11. The same thing, 7. But the 'W' is longer. Greg Haerr wrote: >Well TJ, you're doing good, finding bugs and issues everywhere! > >Can you send me courR12-ISO8859-1.pcf.gz so I've got it on >file? I'll take a quick look at what the issue is, right after I put >back together my Linux dev system (and mwin cvs) that crashed >hard and lost damn near everything... (there should be some >dprintf code in engine/font_pcf.c that shows the max width. >If you have the bdf source for the font, sometimes I've found that >the font is coded incorrectly, and it's not actually a Microwindows >problem) > >Regards, > >Greg > > >: When I use GrGetFontInfo() it returns maxwidth smaller then the 'W' >: character. So, Wnen I use maxwidth as the x width in the blanking >: GrFillRect() to blank a single char area, it leaves the right portion of >: the'W' on the screen. >: >: Using courR12-ISO8859-1.pcf.gz as the font file. >: >: Even tried writing a ' ' with GrText() over it still leaves the right >: portion of the 'W'. >: >: tj >: >: >: --------------------------------------------------------------------- >: To unsubscribe, e-mail: nanogui-unsubscribe@linuxhacker.org >: For additional commands, e-mail: nanogui-help@linuxhacker.org >: >: filename="courR12-ISO8859-9.pcf.gz"