Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: unicode support  (Read 17715 times)

0 Members and 1 Guest are viewing this topic.

ldrrn

  • Newbie
  • *
  • Posts: 14
    • View Profile
unicode support
« on: August 14, 2007, 05:09:18 am »
does SFML support unicode? if it wasn't, will it be in SFML's road map?

ExcessNeo

  • Newbie
  • *
  • Posts: 16
    • View Profile
unicode support
« Reply #1 on: August 14, 2007, 05:32:41 am »
If you mean by taking input while running then it appears so:

From: Window Events Tutorial.
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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
unicode support
« Reply #2 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).
Laurent Gomila - SFML developer

PM

  • Newbie
  • *
  • Posts: 18
    • View Profile
unicode support
« Reply #3 on: August 14, 2007, 09:08:29 am »
True.
But the sfString class doesn't seem to support unicode. If it would support unicode - translating your game would be a lot simpler...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
unicode support
« Reply #4 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.
Laurent Gomila - SFML developer

ldrrn

  • Newbie
  • *
  • Posts: 14
    • View Profile
unicode support
« Reply #5 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:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
unicode support
« Reply #6 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.
Laurent Gomila - SFML developer

ldrrn

  • Newbie
  • *
  • Posts: 14
    • View Profile
unicode support
« Reply #7 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
unicode support
« Reply #8 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.
Laurent Gomila - SFML developer

PM

  • Newbie
  • *
  • Posts: 18
    • View Profile
unicode support
« Reply #9 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. ;)

ldrrn

  • Newbie
  • *
  • Posts: 14
    • View Profile
unicode support
« Reply #10 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
unicode support
« Reply #11 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 :



If you don't want to wait for the next release, you can get the sources from SVN and recompile the Graphics package.
Laurent Gomila - SFML developer

ldrrn

  • Newbie
  • *
  • Posts: 14
    • View Profile
unicode support
« Reply #12 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
unicode support
« Reply #13 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 ?
Laurent Gomila - SFML developer