1 (edited by chldssloani 2011-12-11 23:14:10)

Topic: Japanese environment

Hello ppl,

I've just been trying to show japanese font on INSTEAD windows client.
And peculiar environment problems are suffering me.

every line couldn't return automatically with width of "win"object as you can see linked pic,
because japanese text(also chineese and korean) isn't justifed and separated with single byte space.
then i guess logic could'nt break line, and couldn't get between each words juncture.

I want to make specific to limit of one line charactors, any suggestions?

http://i1085.photobucket.com/albums/j42 … cat002.jpg
(on the picture, it's using modified theme.ini and another fontset)

// anyway this is good system, i love this engine smile

Re: Japanese environment

Ok, i see the problem and will think about it. Will write when i found some solution(s).

Re: Japanese environment

Can you send me some japanese scene to test?

I have done some checks, and it's like that i can break word (utf symbols)  if got CKJ symbol in stream, may be it will be the best solution?

4 (edited by chldssloani 2011-12-12 01:32:52)

Re: Japanese environment

sure, here is in progress translation lua source

cat_jp.zip (9.25 MB)
http://www.multiupload.com/TECACY0XS5

and if you need theme with japanese font,

jp_theme.zip (10.31 MB includeing japanese font)
http://www.multiupload.com/FUCBCQ8YH1

almost forgot, inside "lang" folder
jp.ini (3.67 KB)
http://www.multiupload.com/A0CZ62FY55

Re: Japanese environment

I tested prototype, and it works, but i do not know, what i must do with spaces? Are they used in cjk?
What we must do with this situation? cjk symbol1 space sjk symbol2

Re: Japanese environment

Please, test this .exe.

If you are using Linux, you can get sources from svn.

Post's attachments

Attachment icon sdl-instead.exe.zip 153.76 kb, 143 downloads since 2011-12-12 

Re: Japanese environment

Peter wrote:

Please, test this .exe.

If you are using Linux, you can get sources from svn.

it works!! thanks on behalf of the all eastern asian citizens!

it's can be picked items up, combined items, conversation with another charactors.
im not sure about cjk code, but i think you don't need mind about spaces,
japanese use ideographics space code \u3000 if we need. and  punctuation marks are "、" \u3001, "。" \u3002.
and i putted some single spases on lua some place, it works clearly.

just one error, every links pop up error 'Error while proccesing game: \n attempt to call a nil value',
does this error because from lua script?

Re: Japanese environment

Oh, sorry, i think i must upload lua scripts. Attached:

Post's attachments

Attachment icon stead.zip 33.14 kb, 139 downloads since 2011-12-12 

Re: Japanese environment

In fact there is one problem. It's like that i  can not add jp theme, lang  and font in mainstream version. I have troubles with russian characters with this font. sad So, it can not be used as universal approach currently. And it adds 6Mb to INSTEAD size. So,  may be it is a good idea to support CJK version separated? I can upload win version and CJK theme/lang in separated files with your help. Is it ok?

10 (edited by chldssloani 2011-12-12 18:34:24)

Re: Japanese environment

Peter wrote:

In fact there is one problem. It's like that i  can not add jp theme, lang  and font in mainstream version. I have troubles with russian characters with this font. sad So, it can not be used as universal approach currently. And it adds 6Mb to INSTEAD size. So,  may be it is a good idea to support CJK version separated? I can upload win version and CJK theme/lang in separated files with your help. Is it ok?

of course you can! i appreciate your work!
mentioned i uploaded japaese theme needs little modify.
linked file, themeini, jp.ini

jp_20111212.zip (2.22 KB)
http://www.multiupload.com/CHTH247FX3

you think i'd translate tutorial better?

Re: Japanese environment

Translating tutorial is good idea.  You can get it from instead or here: http://instead.googlecode.com/svn/trunk … tutorial3/

P.S.
Btw, the "return of the quantum cat" is old game (the first game for instead), it was written using old STEAD API and works in compatible mode, so, if you are going to write own game, feel free to ask anything about engine.

12 (edited by chldssloani 2011-12-12 21:45:52)

Re: Japanese environment

Peter wrote:

Translating tutorial is good idea.  You can get it from instead or here: http://instead.googlecode.com/svn/trunk … tutorial3/

P.S.
Btw, the "return of the quantum cat" is old game (the first game for instead), it was written using old STEAD API and works in compatible mode, so, if you are going to write own game, feel free to ask anything about engine.

ok, ill begin after finished Quantum Cat.
i think im going to write some novel-game but ill write japanese guide webpage at first,
my people need to know how to set up INSTEAD, thanks!

And I'm sorry, little problem,
i found still unexpected line break sometime.

-before a single byte alphabet and numeral letter
-unicode signs like exclamation mark, example "…", "!" , "?", "/".  maybe you mentioned symbols about this?

in the conversation list object, before sign and numeral
http://i1085.photobucket.com/albums/j42 … tum001.jpg

before alphabet
http://i1085.photobucket.com/albums/j42 … tum002.jpg

before single numeral, "…"
http://i1085.photobucket.com/albums/j42 … tum003.jpg

before "/", "”", single byte numeral, single byte alphabet
http://i1085.photobucket.com/albums/j42 … tum004.jpg

japanese can use double bytes numeral letter or Kanji numeral instead single byte of them.
then numeral is fine, but double bytes signs is can't be replaced other letter.

i don't want to you bother this but sorry, could you fix?

----
i didn't check but if you see error when load "cat_jp\ep2.lua", delete sign "※" on the source plz
it was forgot my bookmarker, didn't coment it out

Re: Japanese environment

Thank you for testing. Will try fix, can you send save files of situations where is the problem appeares?

Btw. i fixed one thing, may be bugs you found will fixed to? Please, test:

Post's attachments

Attachment icon sdl-instead.exe.zip 153.77 kb, 139 downloads since 2011-12-12 

14 (edited by chldssloani 2011-12-13 17:36:42)

Re: Japanese environment

Peter wrote:

Thank you for testing. Will try fix, can you send save files of situations where is the problem appeares?

Btw. i fixed one thing, may be bugs you found will fixed to? Please, test:

yes! this is good! break line works completely.
i tested till 3rd corridor, i didn't see any bug.

it's not mortal , but italic type text at the top of "win" object,
could you make litte more short pitch? it looks like lengthen japanese

thanks

Re: Japanese environment

too sad, but italic text is SDL  logic, and sometimes it looks ugly. but if you have font with italic glyphs it can be added to theme, as it is done with non cjk font

16 (edited by chldssloani 2011-12-13 22:09:05)

Re: Japanese environment

Peter wrote:

too sad, but italic text is SDL  logic, and sometimes it looks ugly. but if you have font with italic glyphs it can be added to theme, as it is done with non cjk font

ok, i mean i compared pitch of italic letters previous version 1.5.2
http://i1085.photobucket.com/albums/j42 … um_152.jpg

and 1.5.3
http://i1085.photobucket.com/albums/j42 … um_153.jpg

is this depended SDL?
or i should try another font?

Re: Japanese environment

I am afraid, that it is due the fact, that now all cjk symbols renders as separated words. SDL make each CJK symbol italic (wider) and then i place them one by one (word by word), so, we see extra spacing sad

Before my changes, all cjk symbols were part of one huge "word", and there where no extra spacing, while making it italic (as whole looong word).

Currently, it is architecture limitation (cjk symbol must be or word, or latter), and i do not know what i can do sad

18 (edited by chldssloani 2011-12-13 23:58:04)

Re: Japanese environment

im soso sorry it was my mistake on theme.ini sad

;i wrote:
win.fnt.name = ipaexm.ttf

;correctly:
win.fnt.name = {ipam, ipam, ipam}.ttc

then i'm fine now, really sorry
http://i1085.photobucket.com/albums/j42 … ake001.jpg

fixed japanese environment theme with new correction font(ttc)
jp_theme_20111214.zip (10.91 MB)
http://www.multiupload.com/2CQ9CTDBDF

Re: Japanese environment

here, you say to instead use same font for italic, and now it is no italic. so, the problem with italic is still there.

20 (edited by chldssloani 2011-12-14 01:32:32)

Re: Japanese environment

ive searched some outline fonts but i was wrong basiclly what italic font means.
there is no italic japanese font recentry, because apprication converts normal type to italic type by logical.
i found only bitmap of italic font.

Peter wrote:

here, you say to instead use same font for italic, and now it is no italic. so, the problem with italic is still there.

i see, i tested to use bold tag with ttc font, not italic tag but it's gottten longer pitch too
http://i1085.photobucket.com/albums/j42 … tum006.jpg

in japanese case i think normal font would be better than long pitched of italic type.
then could you use i mentioned ttc with theme currenty please?

Re: Japanese environment

Italic font lets player to see changes in text, but i will upload any theme you send. smile

After release 1.5.3 i wll upload game with your theme, cjk theme and (i tink) cjk buld for win.

BTW. i have read SDL-ttf sources and found, that the only solution to make kerning between separated words (CKJ symbols) is to render text myself, with freetype and without SDL. And it is bad solution, so, i will let it be as it is. smile

Re: Japanese environment

Peter wrote:

Italic font lets player to see changes in text, but i will upload any theme you send. smile

After release 1.5.3 i wll upload game with your theme, cjk theme and (i tink) cjk buld for win.

BTW. i have read SDL-ttf sources and found, that the only solution to make kerning between separated words (CKJ symbols) is to render text myself, with freetype and without SDL. And it is bad solution, so, i will let it be as it is. smile

i appreciate it big_smile
i meant... it wasn't just readable with long pitched charactors.

ah, kerning is it.
for example microsoft word has kerning and justify function,
but useally we don't use these english-countries based functions. we use only wordwrap.
some console games made in foreign contury those have same problem i've seen before.

thanks a lot!

23 (edited by chldssloani 2011-12-15 22:18:49)

Re: Japanese environment

maybe im bothering you again,

i can see there are 2 spaces before vobj,

like this
http://i1085.photobucket.com/albums/j42 … tum007.jpg

and i modified with part of stead source
http://i1085.photobucket.com/albums/j42 … tum008.jpg

stead.lua

function room_look(self)
    local i, vv, o;
    for i,o in opairs(self.obj) do
        o = stead.ref(o);
        if isObject(o) then
            vv = stead.par('',vv, o:look());
        end
    end
    return stead.cat(vv,' ');
end

i know english kerning needs this spaces, but japanese dosen't
what shoud i do this?
can lua code reconize lanuage environment?

btw, ive almost done translate with Quantum Cat. ill let my men check text for a few days

Re: Japanese environment

here is tutorial japanese edition

http://www.multiupload.com/QAQ4UWNMIV
tutorial3_jp.zip (4.84 KB)

if you see main menu is broken with charactor, you can replace

        img('jp.png')..' '..[[{jp|Japanese}^]]);

please check

Re: Japanese environment

Ok, will see after work. About spaces, may be i will add parameter.