Input in Korean/Chinese/... with IME

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

turbonabi
Just popping in
Just popping in
Posts: 2
Joined: Mon Jul 31, 2006 20:39
Contact:

Input in Korean/Chinese/... with IME

Postby turbonabi » Tue Aug 01, 2006 13:39

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

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Tue Aug 01, 2006 16:13

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.

ethankennerly
Just popping in
Just popping in
Posts: 1
Joined: Tue Jan 15, 2008 06:23

Korean font

Postby ethankennerly » Tue Jan 15, 2008 07:06

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

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Tue Jan 15, 2008 08:36

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!
Check out my released snake game using Cegui!

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Re: Korean font

Postby Rackle » Tue Jan 15, 2008 13:27

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.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 12 guests