This site is no longer active and is available for archival purposes only. Registration and login is disabled.

font maker tool


font maker tool

Postby mamahow » Nov 6, 2008 @ 11:32am

Is it possible to use font maker to build up CJK characters? I've tried it to input two Chinese characters, but it seems to be not correct, please check my attached picture.

MAMAHOW
mamahow
pm Member
 
Posts: 17
Joined: Jul 1, 2008 @ 10:29am


Postby edge » Nov 11, 2008 @ 10:02am

EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby mamahow » Mar 30, 2009 @ 7:14am

Hi,
Please check my setting of Font Maker
and the font image output of Chinese character seems to be chooped out.

Thanks,
Monky
Attachments
font.zip
(25.13 KiB) Downloaded 765 times
mamahow
pm Member
 
Posts: 17
Joined: Jul 1, 2008 @ 10:29am


Postby edge » Mar 30, 2009 @ 9:47am

Hi,

We've tested our makefont tool with Chinese characters without any trouble. Can you post the truetype font file and character set you're using (save the contents of the input box to a unicode textfile).
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby maya » Apr 17, 2009 @ 3:28am

maya
pm Member
 
Posts: 4
Joined: Apr 17, 2009 @ 3:14am


Postby edge » Apr 18, 2009 @ 1:09pm

EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby maya » Apr 21, 2009 @ 4:40am

Hi,
Thanks for your reply.
I create font surface and coding as follows,

font.SetFontCharacters(0, 127);
font.BuildFont(true);
buffer->DrawFont(100, 100, &font, "一二八", EFO_HCENTER | EFO_VCENTER | EFX_OPACITY, 255);

but can't see any font. Anything goes wrong?
Attachments
test.rar
font image
(1.77 KiB) Downloaded 743 times
maya
pm Member
 
Posts: 4
Joined: Apr 17, 2009 @ 3:14am


Postby edge » Apr 22, 2009 @ 11:06am

Hi Maya,

To use non-ascii characers (such as Chinese), we recommend using font.SetCharacterSet. Also make sure to use WCHAR strings instead of char to support unicode.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby maya » Apr 24, 2009 @ 8:05am

I try it as follow,
if (ef.Open("font.epk", EFOF_READ))
{
if (!ef.PackAuthorize(0)){
SetErrorMsg("Pack Authorize fail!!!");
return(E_ERROR);
}
ClassEMemory::DeAlloc(filedata);
}
else{
SetErrorMsg("Open epk fail!!!");
return(E_ERROR);
}
if (ef.PackGetFileData(filedata, filedatasize, "test.png") == E_OK)
{
if (display->CreateSurface(&shared.test, filedata, filedatasize) != E_OK)
{
SetErrorMsg("CreateSurface fail!--> test.png");
return(E_ERROR);
}

WCHAR testFont = (WCHAR)L"一乙丁七乃九了二人儿入八几刀刁力";

shared.test.SetFontCharacterSet(&testFont);

shared.test.BuildFont(true);
ClassEMemory::DeAlloc(filedata);
}
WCHAR testFont1 = (WCHAR)L"一二八";
buffer->DrawFont(iconRC.left+iconWidth/2, iconRC.top+70+offsetH, &shared->test, &testFont1, EFO_HCENTER | EFO_VCENTER | EFX_OPACITY, imgOpacity);

but I still can't see any font.
Could you show me the sample code about Drawing font using non-ASCII character set? thanks a lot!
Attachments
font.rar
font.epk
(1.88 KiB) Downloaded 753 times
maya
pm Member
 
Posts: 4
Joined: Apr 17, 2009 @ 3:14am


Postby edge » Apr 28, 2009 @ 7:10am

EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby maya » May 4, 2009 @ 4:20am

Hi,
Thanks for your reply.
I try your suggestion, it's work.
But I want to show string dynamically,the string is composed of any text in testFont.txt(continue last post), such as "九十","十入"...,because I don't know what string I will draw,I can't store my string in a unicode text file in advance,I try draw as follows,


WCHAR myText[]= L"九十".
buffer->DrawFont(100, 100, &font, myText, EFO_HCENTER | EFO_VCENTER | EFX_OPACITY, 255);

It have compile error as follows,
error C2440: 'initializing' : cannot convert from 'const wchar_t [4]' to 'unsigned short []'
2> There is no context in which this conversion is possible

how can I do?
maya
pm Member
 
Posts: 4
Joined: Apr 17, 2009 @ 3:14am


Postby edge » May 4, 2009 @ 8:21pm

Hi Maya,

Unfortunately, that's not possible. It's mainly due to the difference between the wchar_t and WCHAR datatypes. The only solution would be to write your own wchar_t to WCHAR converter.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Return to EDGELIB


Sort


Forum Description

Powerful and affordable C++ middleware solution covering true multi-platform 2D, 3D and network features for Apple iPhone, Windows Mobile, Symbian S60, UIQ, Linux and Windows desktop.

Moderator:

edge

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron