X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=src%2FSFont.xs;h=017987b29b975423cbee9efcc4558aa4f1951ab6;hb=HEAD;hp=092cf0066a1e5e162781855d9ff45d2b45388ada;hpb=8fde61e3e900d5000c94503679d735221acc1882;p=sdlgit%2FSDL_perl.git diff --git a/src/SFont.xs b/src/SFont.xs index 092cf00..017987b 100644 --- a/src/SFont.xs +++ b/src/SFont.xs @@ -1,10 +1,31 @@ -// SDL::SFont // -// SFont bitmap font support +// SFont.xs // -// SFont library code by Karl Bartel +// Original SFont code Copyright (C) Karl Bartel +// Copyright (C) 2005 David J. Goehrig // -// SFont.xs Copyright (C) 2004 David J. Goehrig +// ------------------------------------------------------------------------------ +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// +// ------------------------------------------------------------------------------ +// +// Please feel free to send questions, suggestions or improvements to: +// +// David J. Goehrig +// dgoehrig@cpan.org // #include "EXTERN.h" @@ -23,8 +44,8 @@ #define HAVE_TLS_CONTEXT #endif -#include "../defines.h" -#include "../SFont.h" +#include "../../src/defines.h" +#include "../../src/SFont.h" #ifdef HAVE_SDL_IMAGE #include @@ -204,7 +225,7 @@ void SFont_InternalInput( SDL_Surface *Dest, SFont_FontInfo *Font, int x, int y, if ((ch=='\b')&&(strlen(text)>0)) text[strlen(text)-1]='\0'; else if (ch!='\b') - sprintf(text,"%s%c",text,ch); + sprintf(text+strlen(text),"%c",ch); if (SFont_TextWidth2(Font,text)>PixelWidth) text[strlen(text)-1]='\0'; SDL_BlitSurface( Back, NULL, Dest, &rect); SFont_PutString2(Dest, Font, x, y, text); @@ -251,6 +272,8 @@ PROTOTYPES : DISABLE #ifdef HAVE_SDL_IMAGE +=for comment + SDL_Surface * NewFont ( filename ) char *filename @@ -260,6 +283,8 @@ NewFont ( filename ) OUTPUT: RETVAL +=cut + void UseFont ( surface ) SDL_Surface *surface