CEGUI's version is 0.7.2 .
By default, compiler cannot compile Sample_FontDemo.cpp.
VS 2008's compiler seems to be failed to detecting encoding of this file.
Compiler can compile it successfully by adding a UTF-8 BOM to this file, with 61 wornings.
1>Sample_FontDemo.cpp
1>c:\pathToCEGUI\cegui_mk2\samples\fontdemo\sample_fontdemo.cpp(59) : warning C4566: ユニバーサル文字名 '\u00E2' によって表示されている文字は、現在のコード ページ (932) で表示できません
1>c:\pathToCEGUI\cegui_mk2\samples\fontdemo\sample_fontdemo.cpp(59) : warning C4566: ユニバーサル文字名 '\u0103' によって表示されている文字は、現在のコード ページ (932) で表示できません
1>c:\pathToCEGUI\cegui_mk2\samples\fontdemo\sample_fontdemo.cpp(63) : warning C4566: ユニバーサル文字名 '\u015F' によって表示されている文字は、現在のコード ページ (932) で表示できません
1>c:\pathToCEGUI\cegui_mk2\samples\fontdemo\sample_fontdemo.cpp(67) : warning C4566: ユニバーサル文字名 '\u00E5' によって表示されている文字は、現在のコード ページ (932) で表示できません
... And same 57 warnings.
However, some characters (including Japanese and Korean) are can't shown in this demo.
They are replaced to ?.
I added a TrueType font, 梅明朝, which includes Japanese character and modified font name of source file.
But characters are not shown correctly.
I have noticed strings in this demo are defined as char*, and CEGUI::String only supports UTF-32.
I think adding converesion between encodings, such as UTF-8, UTF-16, UTF-32 is not so difficult.
Strings should be defined as wchar_t*.
Why CEGUI::String does not have this function?
Code: Select all
static struct
{
utf8 *Language;
utf8* Font;
utf8 *Text;
} LangList [] =
{
// A list of strings in different languages
// Feel free to add your own language here (UTF-8 ONLY!)...
{ (utf8 *)"English",
(utf8*)"DejaVuSans-10",
(utf8 *)"THIS IS SOME TEXT IN UPPERCASE\n"
"and this is lowercase...\n"
"Try Catching The Brown Fox While It's Jumping Over The Lazy Dog" },
{ (utf8 *)"Русский",
(utf8*)"DejaVuSans-10",
(utf8 *)"Всё ускоряющаяся эволюция компьютерных технологий предъявила жёсткие требования к производителям как собственно вычислительной техники, так и периферийных устройств.\n"
"\nЗавершён ежегодный съезд эрудированных школьников, мечтающих глубоко проникнуть в тайны физических явлений и химических реакций.\n"
"\nавтор панграмм -- Андрей Николаев\n" },
{ (utf8 *)"Română",
(utf8*)"DejaVuSans-10",
(utf8 *)"CEI PATRU APOSTOLI\n"
"au fost trei:\n"
"Luca şi Matfei\n" },
{ (utf8 *)"Dansk",
(utf8*)"DejaVuSans-10",
(utf8 *)"FARLIGE STORE BOGSTAVER\n"
"og flere men små...\n"
"Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen Walther spillede på xylofon\n" },
{ (utf8 *)"Japanese",
(utf8*)"ume-tmo3-30",
(utf8 *)"日本語を選択\n"
"トリガー検知\n"
"鉱石備蓄不足\n" },
{ (utf8 *)"Korean",
(utf8*)"Batang-26",
(utf8 *)"한국어를 선택\n"
"트리거 검지\n"
"광석 비축부족\n" },
{ (utf8 *)"Việt",
(utf8*)"DejaVuSans-10",
(utf8 *)"Chào CrazyEddie !\n"
"Mình rất hạnh phúc khi nghe bạn nói điều đó\n"
"Hy vọng sớm được thấy CEGUI hỗ trợ đầy đủ tiếng Việt\n"
"Cám ơn bạn rất nhiều\n"
"Chúc bạn sức khoẻ\n"
"Tạm biệt !\n" }
};