Display chinese

hi all:
I come from China.Now I have a problem to ask.
I want to display a chinese sentence.What should I do?
Thanks!

Well, that depends on how you display text at all. SDL itself doesn’t
have any text or widget support. Add-on libraries (like SDL_ttf,
DFont, GUIlib, libUFO, LibUTA, ParaGUI, SDL Console, SDL_gui,
and SFont) let you do this, or you can write something yourself.

What >I< typically do to display text on the screen is to create
bitmaps of the text (this lets me do more artistic things with them,
e.g. using a paint program).

In rare cases where I need to type ANY text on the screen (not just
pre-determined strings like “Game Over”, “High Score”, “Get Ready!”, etc.),
I often create a bitmap or two which contains all the characters I’ll need
(“ABCDEFG…XYZ0123456789!.?” and so on) (I almost always do this for
digits for score, high score and level)

In the case of Chinese, depending, again, on your overall needs, using
pre-drawn bitmaps of characters may suffice.

Otherwise, you may want to look into some of the more robust font tools
(which one of them (eg, SDL_ttf, DFont, etc.) is the best, I have no
idea…)

Good luck!

-bill!On Thu, Apr 25, 2002 at 03:00:57PM +0800, ??? wrote:

hi all:
I come from China.Now I have a problem to ask.
I want to display a chinese sentence.What should I do?

??e??Look at UTF8 or Unicode to see how to display usual chinese characters,
then using the showfont.exe program that you find in the SDL_ttf pack,
and looking at the code, change it to display your sentence (translated in
UTF8
or unicode) in the programme code (as it would not work using the command
line sentence).

Make sure your are using TTF font supporting chinese character.s If your are
using
an operating system in chinese, you should have some in the fonts directory.

Good luck. It should work well, as I 've able to write text in Ciryllic

(Russian)
Jocelyn.

“???” a ??crit dans le message news:
mailman.1019841616.17060.sdl at libsdl.org…>hi all:
I come from China.Now I have a problem to ask.
I want to display a chinese sentence.What should I do?
Thanks!

I just tried SDL_ttf and have to say I’m deeply impressed by it and SDL in
general. Excellent work!

-Lars> ----- Original Message -----

From: nbs@sonic.net (Bill Kendrick)
To:
Sent: Friday, April 26, 2002 8:04 PM
Subject: Re: [SDL] display chinese

On Thu, Apr 25, 2002 at 03:00:57PM +0800, ??? wrote:

hi all:
I come from China.Now I have a problem to ask.
I want to display a chinese sentence.What should I do?

Well, that depends on how you display text at all. SDL itself doesn’t
have any text or widget support. Add-on libraries (like SDL_ttf,
DFont, GUIlib, libUFO, LibUTA, ParaGUI, SDL Console, SDL_gui,
and SFont) let you do this, or you can write something yourself.

What >I< typically do to display text on the screen is to create
bitmaps of the text (this lets me do more artistic things with them,
e.g. using a paint program).

In rare cases where I need to type ANY text on the screen (not just
pre-determined strings like “Game Over”, “High Score”, “Get Ready!”,
etc.),
I often create a bitmap or two which contains all the characters I’ll need
(“ABCDEFG…XYZ0123456789!.?” and so on) (I almost always do this for
digits for score, high score and level)

In the case of Chinese, depending, again, on your overall needs, using
pre-drawn bitmaps of characters may suffice.

Otherwise, you may want to look into some of the more robust font tools
(which one of them (eg, SDL_ttf, DFont, etc.) is the best, I have no
idea…)

Good luck!

-bill!


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I just tried SDL_ttf and have to say I’m deeply impressed by it and SDL in
general. Excellent work!

Thanks! :slight_smile:

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Yes, indeed SDL_ttf does the job perfectly. If you look
for Chinese examples, here is a game that does both English
and Chinese within the same client, and they use SDL :slight_smile:

http://3kingdoms.gime.com/

Regards,
.paul.On Fri, Apr 26, 2002 at 09:43:03PM +0200, Lars Laukamm wrote:

I just tried SDL_ttf and have to say I’m deeply impressed by it and SDL in
general. Excellent work!

-Lars