nanogui: PCF Font spacing


Previous by date: 18 Jan 2007 14:42:51 +0000 Re: Compiling Nano-X, Greg Haerr
Next by date: 18 Jan 2007 14:42:51 +0000 Re: PCF Font spacing, Greg Haerr
Previous in thread: 18 Jan 2007 14:42:51 +0000 Re: PCF Font spacing, Darren Legge
Next in thread: 18 Jan 2007 14:42:51 +0000 Re: PCF Font spacing, Greg Haerr

Subject: Re: [nanogui] PCF Font spacing
From: "Darren Legge" ####@####.####
Date: 18 Jan 2007 14:42:51 +0000
Message-Id: <s5af872f.038@mail.energytechnologycontrol.com>

Hi
Just looking into font_pcf.c and am wondering if the problem I have where the characters are positioned too closely to each other has somthing to do with the left / right bearing.

I notice in the file that negative left bearings are not supported. This is ok as the fonts I am using don't have this but the code looks wrong to me. In line 713 (and 656) of pcf_createfont() I see :

/* Calculate width of output MW font character */
if (metrics[i].leftBearing >= 0) {
	gwidth[i] = metrics[i].leftBearing + ((metrics[i].rightBearing - metrics[i].leftBearing));
} else {
	gwidth[i] = (metrics[i].rightBearing + abs(metrics[i].leftBearing));
}

I am not sure what is going on but subtracting leftBearing from leftBearing will leave zero so you just get rightBearing. This cannot be what was intended ! Just using rightBearing + abs(leftBearing) in all cases gives better results for me, but I know this is not right either.

I was wondering about using the freetype library instead but since I only need 4 or 5 different fonts I didn't think it would be necessary. Would I be right to assume that using freetype will be slower to draw than PCF since the PCF fonts are converted to native fonts upon loading ?
Thanks for any help...
Darren.
####@####.#### 


Previous by date: 18 Jan 2007 14:42:51 +0000 Re: Compiling Nano-X, Greg Haerr
Next by date: 18 Jan 2007 14:42:51 +0000 Re: PCF Font spacing, Greg Haerr
Previous in thread: 18 Jan 2007 14:42:51 +0000 Re: PCF Font spacing, Darren Legge
Next in thread: 18 Jan 2007 14:42:51 +0000 Re: PCF Font spacing, Greg Haerr


Powered by ezmlm-browse 0.20.