[patch] Glitch of non-standard font February 10, 2010, 10:48:42 pm Some Chinese players prefer to use wenquanyi_9pt.bdf instead of the standard font as some characters can't be properly displayed.However, the font height of wenquanyi_9pt is actually 14px, resulting in some garbage pixels underneath the characters as in the attached image. Those garbage pixels are caused by the text-displaying routine trying to read beyond the boundary of image data.The attached patch fixes this problem. Quote Selected
Re: [patch] Glitch of non-standard font Reply #1 – February 10, 2010, 11:02:20 pm The reading of the BDF character seems strange: Why ignoring characters with negative offset completely? The should not happen; but moving those characters one pixel down or ignoring top rows would achieve still a readab le charecter (mostly). Quote Selected
Re: [patch] Glitch of non-standard font Reply #2 – February 10, 2010, 11:27:47 pm I think you are referring to this block of code :Quote// read for height timesfor (y = top; y < h; y++) { fgets(str, sizeof(str), fin); if( y>=0 ) { dsp_decode_bdf_data_row(data + char_nr*CHARACTER_LEN, y, xoff, g_width, str); }}If y is negative, calling dsp_decode_bdf_data_row() with such value will cause the previous character's data be overwritten partially. This should not be allowed.Edit :Forgot to say, that this problem does happen in wenquanyi_9pt.bdf. An example will be character with encoding 594 (height=12, desc=2). Edit :Just want to make it clear : my fix above ignores the top (negative) rows only, but not ignoring the character completely as you think. Quote Selected Last Edit: February 10, 2010, 11:41:29 pm by Knightly
Re: [patch] Glitch of non-standard font Reply #3 – February 23, 2010, 10:55:58 pm The display routines are fixed anyway. I will try this for the reader. Quote Selected