SFML community forums

General => General discussions => Topic started by: ldrrn on August 14, 2007, 05:09:18 am

Title: unicode support
Post by: ldrrn on August 14, 2007, 05:09:18 am
does SFML support unicode? if it wasn't, will it be in SFML's road map?
Title: unicode support
Post by: ExcessNeo on August 14, 2007, 05:32:41 am
If you mean by taking input while running then it appears so:

From: Window Events Tutorial. (http://sfml.sourceforge.net/tutorials/window-events.php)
Quote
Text events (TextEntered)

    * Event.Text.Unicode contains the UTF-16 code of the character that has been entered


Event.Text is part of the sfEvent Class (http://sfml.sourceforge.net/documentation/classsfEvent.htm).
Title: unicode support
Post by: Laurent on August 14, 2007, 09:05:44 am
Yes, this is the way to handle Unicode with SFML.

Note that this event is not implemented yet on the Linux version (Unicode with XLib looks not as easy as with Win32).
Title: unicode support
Post by: PM on August 14, 2007, 09:08:29 am
True.
But the sfString (http://sfml.sourceforge.net/documentation/classsfString.htm) class doesn't seem to support unicode. If it would support unicode - translating your game would be a lot simpler...
Title: unicode support
Post by: Laurent on August 14, 2007, 09:23:26 am
Quote
But the sfString class doesn't seem to support unicode

That's right. But supporting Unicode is a bit complicated with bitmap fonts, as I need to generate a texture containing all the characters. Possible solutions could be to let the user choose the set of characters he wants to use, or handle several characters textures.
Title: unicode support
Post by: ldrrn on August 14, 2007, 09:58:04 am
sorry i still don't quite get it, does it means that on win32 both unicode display (by using truetype font) and unicode input (fareast characters) are supported?

i know the best way to find out is to test it myself, please forgive my laziness  :oops:
Title: unicode support
Post by: Laurent on August 14, 2007, 10:02:58 am
No, Unicode is only implemented in the TextEntered event under Windows. Nothing has been done yet for sfString.
Title: unicode support
Post by: ldrrn on August 14, 2007, 11:54:35 am
too bad, most of my projects are required multilingual support, but i really like SFML design especially the ability to embed SFML into standard win32 controls.

keep up the good work, i aready bookmarked your homepage, and will check your progress from time to time
Title: unicode support
Post by: Laurent on August 14, 2007, 12:05:51 pm
I think full unicode support will be one of the next priorities, it looks an important feature for most developers.
Title: unicode support
Post by: PM on August 14, 2007, 12:40:43 pm
Quote from: "Laurent"
I think full unicode support will be one of the next priorities, it looks an important feature for most developers.

Woot! Good to know. ;)
Title: unicode support
Post by: ldrrn on August 14, 2007, 01:35:01 pm
that'll be great! if possible do something similar to this http://sdl-im.csie.net/SDL_imm/index.html
Title: unicode support
Post by: Laurent on August 17, 2007, 10:23:03 am
I added support for Unicode in sfString. It's not perfect (the number of characters for each font is still quite limited), but it works fine, without affecting the old behavior.

Here is a sample showing some chinese characters rendered with sfString using a chinese-compliant font :

(http://sfml.sourceforge.net/temp/sfml-unicode.png)

If you don't want to wait for the next release, you can get the sources from SVN and recompile the Graphics package.
Title: unicode support
Post by: ldrrn on August 19, 2007, 03:34:08 am
i downloaded and tested the svn version, but i couldn't find the sfString chinese characters example. besides this i also found out all the openal related example crashed on my pc, that's happened when i exiting the example. i believe this is caused by mismatch of openal dll and lib. i'm using the latest precompiled sdk version from creative website. i hope you could check in your openal dll into svn for me to confirm the problem.

In case you like the detail, this's the location where they crashed
Code: [Select]

sfAudioDevice::~sfAudioDevice()
{
    // Destroy all device-dependant resources
    std::for_each(myResources.begin(), myResources.end(), std::mem_fun(&sfAudioResource::DestroyAudioResources));

    // Destroy the context
    alcMakeContextCurrent(NULL); // access violation reading location 0xXXXXX
    if (myContext)
        alcDestroyContext(myContext);

    // Destroy the device
    if (myDevice)
        alcCloseDevice(myDevice);
}


btw, i hope you could set vc2005 project property "configuration properties/debugging/working directory" to $(TargetDir). i hope this could make anyone use the svn version  easier to debug. thanks
Title: unicode support
Post by: Laurent on August 19, 2007, 10:51:32 am
Quote
i downloaded and tested the svn version, but i couldn't find the sfString chinese characters example

There is no chinese sample :wink:
I just tested it quickly on another sample (the OpenGL one).

Quote
besides this i also found out all the openal related example crashed on my pc, that's happened when i exiting the example

This is a known bug, and I'm working to fix it as soon as possible.

Quote
btw, i hope you could set vc2005 project property "configuration properties/debugging/working directory" to $(TargetDir). i hope this could make anyone use the svn version easier to debug. thanks

Actually... this is what I do. Did I forget to set this path for one sample ?