[Freeciv-Dev] Re: (PR#2559) SDL_ttf font problem
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Fri, 2003-01-31 at 09:03, Jason Short via RT wrote:
> Here is a patch that aims to fix the problem.
>
> I believe this will work for Davide's system. However I seem to recall
> already testing this solution on Bernd's system and it didn't work. In
> that case there's probably a different SDL_ttf bug at work.
I disagree. I'm quite sure that with the proper testing of the BeOS
machine of Bernd, we will discover that it is a matter or feeding
SDL_ttf in the right way. (But I can be wrong)
>
> Note that this code will still fail if you are using UTF-8. The code
> assumes a 1-1 correspondence between 2-byte UTF-16 and 1-byte
> local-encoding blocks. In utf-8 this isn't the case.
>
> Nonetheless it is still a big step forward.
I agree.
>
> Davide pointed out that SDL_BIG_ENDIAN and SDL_LIL_ENDIAN are not
> defined very well: SDL_Byteorder just has a bunch of #ifdefs checking
> for specific systems. It is easy to add a configure check to do this
> (properly) ourselves. If someone wants to do this, you're welcome to it...
I can try, after the patch is in, but I will need help.
>
> jason
>
>
> ______________________________________________________________________
> +#ifdef SDL_LIL_ENDIAN
> + const char *pTocode = "UTF-16LE";
> +#else
> + const char *pTocode = "UTF-16BE";
> +#endif
I can be wrong, but this won't work.
AFAIK SDL_Byterorder.h do define both SDL_LIL_ENDIAN and SDL_BIG_ENDIAN,
and afterwords, it define SDL_BYTEODER as equal to one of those two.
This means that you need to check if SDL_LIL_ENDIAN == SDL_BYTEORDER,
othewise you will always get UTF-16LE.
> +#ifdef HAVE_LANGINFO_CODESET
> + const char *pFromcode = nl_langinfo(CODESET);
> +#else
> + const char *pFromcode = "";
> +#endif
I've installed GNU libiconv 1.8 on my Tru64 Unix 5.1A machine and now I
get support both for "" and "char".
Anyway I will check if this code works.
|
|