Fix issue 60 : Wrong spacing in Text when using bitmap fonts.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@435 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2008-12-28 19:44:17 +00:00
parent 3be825e40d
commit 57c875df3d
2 changed files with 4 additions and 6 deletions

10
SFont.c
View File

@ -129,12 +129,10 @@ void SFont_Write(SDL_Surface *Surface, const SFont_Font *Font,
continue;
}
srcrect.w = dstrect.w =
(Font->CharPos[charoffset+2] + Font->CharPos[charoffset+1])/2 -
(Font->CharPos[charoffset] + Font->CharPos[charoffset-1])/2;
srcrect.x = (Font->CharPos[charoffset]+Font->CharPos[charoffset-1])/2;
dstrect.x = x - (float)(Font->CharPos[charoffset]
- Font->CharPos[charoffset-1])/2;
srcrect.w = Font->CharPos[charoffset+2] - Font->CharPos[charoffset];
dstrect.w = srcrect.w;
srcrect.x = Font->CharPos[charoffset];
dstrect.x = x;
SDL_BlitSurface(Font->Surface, &srcrect, Surface, &dstrect);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB