Page 1 of 1

Input in Korean/Chinese/... with IME

Posted: Tue Aug 01, 2006 13:39
by turbonabi
By reading the article in this forum and following the steps, I've suceeded to display Korean/Chinese.. and other languages.

Now I am trying to type Korean characters in a textbox.
There are some articles about writing(inputting) chinese, but I have no idea where to find "win32apphelper.cc" file or how to use WM_IME...

Another problem is that when I start an Ogre+CEGUI application, my IME is inactivated. (I am using English Windows XP)
Do I need my own IME running in Ogre application? Or am I missing something to activate IME when the application starts? :lol:

Please Help~!!

Thank you. :D

Posted: Tue Aug 01, 2006 16:13
by Rackle
I believe the IME is disabled with any DirectX/OpenGL application. The DirectX SDK has a sample showing off a GUI with a functioning IME. You might be able to modify that source code to make it work within Ogre; I'm certain many would be grateful for such a feature.

Korean font

Posted: Tue Jan 15, 2008 07:06
by ethankennerly
I'm new to CEGUI. I've used a little OGRE and Python-Ogre. Last year, a team of us at school made a procedurally modeled game in Ogre (called Euphonics). and last semester we experimented with Python-Ogre for a multi-computer panoramic view of space.

Anyway, for my thesis, I am now prototyping an educational game to teach Korean. I want to use Python-Ogre with CEGUI. but as more of a designer than programmer, I'm facing a newbie problem:

1. Where is a tutorial on displaying a Korean (UTF-8) TrueType font?
2. Where is a tutorial on inputting Korean?

Turbonabi mentions tutorials, but I'm not sure which ones.

I use Windows XP Pro with Korean IME and have used the IME for wxPython. But by being so new to CEGUI, I'm confused how I would go about displaying and inputting Korean there.

Thanks for your help,

-- Ethan

http://finegamedesign.com/euphonics
http://finegamedesign.com/monkeymonastery

Posted: Tue Jan 15, 2008 08:36
by scriptkid
Hi,

i am using Cegui with Python-Ogre myself, and i should be able to help you with the rendering part of unicode characters.

With 'tutorial' i think he meant the FontSample, which can be seen here: http://crayzedsgui.svn.sourceforge.net/ ... iew=markup

In order to print unicode text with Cegui, you need a construction like this:

First, when you define the strings in a python file, that file should contain its encoding, like you'd do with an XML file. The first line should be:

Code: Select all

# -*- coding: utf-8 -*-


This code shows a utf8 string using python:

Code: Select all

name=u"如何使用"  // Don't know what this means :)
cs = CEGUI.String()
cs.assign ( name.encode('utf-8') )
ceguiWidget.text = cs


Note the 'u' before the text, meaning that python must create a unicode string. Next to that, we assign this value. You cannot construct the cegui string with the unicode string directly.

Good luck so far!

Re: Korean font

Posted: Tue Jan 15, 2008 13:27
by Rackle
ethankennerly wrote:2. Where is a tutorial on inputting Korean?


I do not think there is one but searching through the forum may reveal hints or partial solutions. One example is this post, which shows how to deal WM_CHAR messages such that they handle muti-byte characters, which are then injected into Cegui.

Another potential solution is presented in converting DirectInput keys to Cegui. This article deals with dead keys, which essentially means that you have to type two keyboard keys to generate a characters. I wrote that code to handle special french characters such as pressing the ^ and the e key to result in the ê letter. Maybe this is how you input Korean or Chinese characters?

The final approach would be to go through the code within DirectX's IME code, which was available with the DirectX SDK, and code a CEGUI solution.