SFML community forums
General => General discussions => Topic started 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?
-
If you mean by taking input while running then it appears so:
From: Window Events Tutorial. (http://sfml.sourceforge.net/tutorials/window-events.php)
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).
-
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).
-
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...
-
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.
-
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:
-
No, Unicode is only implemented in the TextEntered event under Windows. Nothing has been done yet for sfString.
-
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
-
I think full unicode support will be one of the next priorities, it looks an important feature for most developers.
-
I think full unicode support will be one of the next priorities, it looks an important feature for most developers.
Woot! Good to know. ;)
-
that'll be great! if possible do something similar to this http://sdl-im.csie.net/SDL_imm/index.html
-
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.
-
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
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
-
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).
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.
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 ?