[WIP] Chinese support to Wagic

All code submission.

[WIP] Chinese support to Wagic

Postby linshier » Wed Jul 14, 2010 11:17 am

Advertising
Hi,

I am working on the Chinese support to wagic.
Chinese UI has been discussed before: viewtopic.php?f=14&t=1216
my approach, source codes are modified and the lang files are tranlated. (English and other langs are still supported as before)
I don't known whether the wagic team's Chinese plans are going on, and I do hope mine would not coflit with them.
(I am willing to propose my codes:)

It is almost being done, there are some snapshots of the Chinese wagic:
Image
Image
Image
Image
linshier
 
Posts: 18
Joined: Tue Jul 13, 2010 2:41 am

Re: [WIP] Chinese support to Wagic

Postby leungclj » Wed Jul 14, 2010 11:22 am

o?? ?????????UI??????????UI too, ??????aware of Wagic =) thanks!

^translate

wa! finally someone made a Chinese UI. Now we just need a Japanese UI too, so more people will be aware of Wagic, thanks =)


P.S. is it also possible to add Chinese traditional as well? i cant read simplified (actually, if i can even read any Chinese in the first place xD)
????????????????????????????????????????????????????
leungclj
 
Posts: 347
Joined: Sat Nov 01, 2008 3:21 pm
Location: Hong Kong

Re: [WIP] Chinese support to Wagic

Postby wololo » Wed Jul 14, 2010 1:11 pm

This looks very promising, what is your approach? Ideally, we would like to have UTF8 support, as well as support for the PSP internal fonts, but there is quite a large chinese audience for wagic, so even a "chinese specific" hack is quite interesting...
wololo
Site Admin
 
Posts: 3725
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: [WIP] Chinese support to Wagic

Postby linshier » Wed Jul 14, 2010 2:53 pm

Actually, I found the JGE++ has the Chinese Font support already, named JGBKFont
(it supports Chinese encoding only :( but, I think we can port it to Japanese or other languages)
I am also trying display Chinese wiht UTF8 encoding now. Is there some advise on these?

sp: My code support new language and orig one is under the help of the polymorphism feature of c++ language.
linshier
 
Posts: 18
Joined: Tue Jul 13, 2010 2:41 am

Re: [WIP] Chinese support to Wagic

Postby linshier » Sun Jul 18, 2010 3:00 pm

2 more pictures and fix works:
Image
Image
Some Chinese words followed by number or English may not be seen clearly, and I fix it in the JGE++ as I mention before
JGBKFont is used in my work, and it seems to be a bug where JGBKFont's offset is adjusted during rendering. (might be not)
Also, I add Chinese support (and multi-languages as well) to ai deck descriptions. There is a trick to deal with '\n' which
is translated in the lang files, then translated back when loading the file into memory.
linshier
 
Posts: 18
Joined: Tue Jul 13, 2010 2:41 am

Re: [WIP] Chinese support to Wagic

Postby linshier » Mon Jul 26, 2010 7:01 am

More problems some up.
With the same JGBKFont code, Chinese display of wagic on Windows looks rather bad.
It can not be seen clearly for every single word.
Image

while on Linux it is better (same on PSP). but WHY?!
Image

I am thinking of writing a new font class to improve the displaying, so more testing works need to be done.

I have put a testing demo on this link, Chinese fans may give a try to it
http://u.115.com/file/t0937bc2b8

(sorry that the download page is Chinese only, I can't manage to upload it to mediafire or something :( )
linshier
 
Posts: 18
Joined: Tue Jul 13, 2010 2:41 am

Re: [WIP] Chinese support to Wagic

Postby wololo » Sat Jul 31, 2010 2:46 pm

Thanks a lot, I added your patch to the SVN. I fixed a memory leak as well as a minor compilation problem on Windows. I haven't tested compilation on the PSP yet.
Please check it out.

Thanks for this great patch :)
wololo
Site Admin
 
Posts: 3725
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: [WIP] Chinese support to Wagic

Postby leungclj » Sun Aug 01, 2010 11:44 am

linshier, is this Chinese (sim) only, or chinese (traditional) too? Because i cant read (sim)....
????????????????????????????????????????????????????
leungclj
 
Posts: 347
Joined: Sat Nov 01, 2008 3:21 pm
Location: Hong Kong

Re: [WIP] Chinese support to Wagic

Postby linshier » Sun Aug 01, 2010 5:09 pm

Thanks wololo, I check the svn, and some clean-up code for type defines has been sent.

Sorry leungclj, the work is only simple Chinese now.
but actualy, it can support traditional Chinese(or Japanese?) with the new class WFBFont, if we do some modification.
I do not do that now because I have to keep the font file size down.
With my hacked psp3000, memory seems not that rich for homebrews (32MB?),
supporting too many characters will enlarge the font file, and finally slow down the homebrew and even crash it.
For the font files, I load them whole into the memory (even just load it and do nothing else that slowdown would happend),
I guess there would be some memory leak from somewhere else, but haven't tracked it down.

As you see, I am new to psp programing and wagic, how many memory does wagic used when it is running?
How to find it out?
linshier
 
Posts: 18
Joined: Tue Jul 13, 2010 2:41 am

Re: [WIP] Chinese support to Wagic

Postby wololo » Sun Aug 01, 2010 10:36 pm

hi linshier.
Wagic uses "as much memory as possible" when running on the PSP. basically, images are usually what takes the most RAM, so Wagic takes as much as possible, and when no space is available anymore, it clean up its image cache.
A good way to test is to call "ramAvailable" (defined in utils.cpp). Do not call this function on a PC, only on the PSP!

If we want to add other "complex" languages such as Japanese or traditional Chinese, we might think of using "Intrafont" which uses the PSP internal fonts.

PSP 1000 / HBL have roughly 24MB Ram total. Wagic takes between 5/10MB, the rest is for images
PSP2000 / 3000 can have up to 50MB (chikhen only has 24MB, but the remaining 32MB can be unlocked by GEN)
wololo
Site Admin
 
Posts: 3725
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Advertising

Next

Return to Code submission

Who is online

Users browsing this forum: No registered users and 0 guests