Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Text and Editbox and UTF8 - UTF 32

Author
Message
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 2nd Jul 2020 12:04
As attached, why does utf text all have those symbol?
Does AppGameKit not fully support UTF?
Are they BOM?

Attachments

Login to view attachments
haliop787
User Offline
Joined: 22nd Mar 2020
Playing: With reality.
Posted: 2nd Jul 2020 12:40
You need to add a font in a specific language in order fkr this to work.

So if you use spanish, you.need to load a spanish font and use it with the textbox or text object.

LoadFont(1,"spanish.ttf")

Seteditboxfont(editboxId,1)

Or

Settextfont(textId,1)
Nadav "Haliop" Rosenberg
Lets make the world great forever.
xcode77
2
Years of Service
User Offline
Joined: 31st Jul 2018
Location:
Posted: 3rd Jul 2020 19:00
Hi,
I need this too for Japanese.
So if set the font with:

LoadFont(1, "togoshi.ttf)

How would I just print "DESU!" (in Japanese on the screen)?
I don't want it in an edit box
something like this?

createText(1, "DESU")
settextfont(1,1)

Then how do I print this in the middle of the screen?
So far I have been calling sprites for individual words because I didn't know how to use Japanese .ttf files, but its far more work than it should be
Thanks for any help
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 4th Jul 2020 08:26
should you not be directly pasting 'です' into AppGameKit?
Or are you asking for a english pinyin to japanese character converter?
Like OS build in language input base on english?

Anyway, I created a BOM stripper that check the first few byte to determine if it is utf8 or even utf32 and remove it.
xcode77
2
Years of Service
User Offline
Joined: 31st Jul 2018
Location:
Posted: 5th Jul 2020 04:56
Hi Chmava, thanks for your reply

Quote: should you not be directly pasting 'です' into AppGameKit?
1. No, I can't, trying to paste in です comes out eg. print("??") in agk IDE which is really frustrating and error prone
(either trying to type Japanese words into AppGameKit IDE or pasting them in, and you'll see what I mean)
2. Printing it onscreen at runtime either comes out [][] or 100001
afaik there's no need for a translator as UTF-8 system and the info contained in Togoshi.ttf (approx 15000 charset) should do
(not to be a pedant, but pinyin is Chinese )

Anyone has an easy solution just simply printing 'です' on the screen?
(I chose Togoshi.ttf because its a free Japanese font to err on the safe side of copyright infringement). most other built in Japanese fonts on MacOS are .ttc

Thanks in advance for any insight into this
Kong2020
User Offline
Joined: 10th Jul 2020
Location:
Posted: 10th Jul 2020 15:42
Quote:
1. No, I can't, trying to paste in です comes out eg. print("??") in agk IDE which is really frustrating and error prone
(either trying to type Japanese words into AppGameKit IDE or pasting them in, and you'll see what I mean)

I have the same problem with Russian' symbols. I can not see any of Russian letter in AppGameKit IDE, all of them looks as "????".

Anyone has an easy solution just simply printing 'Превед' on the screen?

By the way, I can write any Russian text in AppGameKit Classic Visual Editor without any problem! Why it is impossible in AGH Studio ??

Please help
Virtual Nomad
Moderator
14
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 10th Jul 2020 17:07 Edited at: 10th Jul 2020 19:13
Quote: "Quote: should you not be directly pasting 'です' into AppGameKit?
1. No, I can't
...
I can not see any of Russian letter in AppGameKit IDE"

have you checked the IDE Edit/Preferences/Interface Font Settings? Mine work for this:



and, using the togoshi font found HERE:


*i didn't see a text spacing option for edit boxes? they needs it. meanwhile, i've changed SetEditBoxFont(rbox,desu) to SetEditBoxFont(rbox,togo) in the snippet (and left my error showing in the image).


Quote: " Why it is impossible in AGH Studio ??"

i can't speak on Studio since i only have Classic. It may be a Studio IDE bug so, check the Repo to see if it's already been reported, otherwise feel free to report it yourself?


@Chmava, is your issue resolved? this is your thread you said "Anyway, I created a BOM stripper " and i'm not sure what that means (or if it was a solution?). If not, can you direct me to the font you're using?


meanwhile, @Kong2020, any particular reason you Reported xcode77's last post? was that an accident? you can't yet receive PMs so i've asked here

Attachments

Login to view attachments
Kong2020
User Offline
Joined: 10th Jul 2020
Location:
Posted: 10th Jul 2020 18:32
@Virtual Nomad, thank you for answers! I've wrote that all OK with Russian's text in AppGameKit Classic. I can write any Russian's text on buttons, or in edit boxes in AppGameKit Classic's VisualEditor too, without any coding!
So, it was strange for me that I could not do it in Studio.

Quote: "meanwhile, @Kong2020, any particular reason you Reported xcode77's last post? was that an accident? you can't yet receive PMs so i've asked here"
Sorry, it was my big BUG !)
Virtual Nomad
Moderator
14
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 10th Jul 2020 19:10 Edited at: 10th Jul 2020 19:16
i just realized that this line in the above code could have produced an error.

...where desu is the ID of the Text. I got lucky where they both have the same ID

it should be:

...i've made the change in the code snippet a few posts up.
xcode77
2
Years of Service
User Offline
Joined: 31st Jul 2018
Location:
Posted: 15th Jul 2020 01:30 Edited at: 15th Jul 2020 01:45
Thanks so much for your response @ Virtual Nomad.
All is printing well on the screen!

I think the problem was with the AppGameKit documentation to start, then with neither Classic or Studio displaying kana within the IDE on MacOS is really frustrating.
Switching to the ATOM IDE solved the UTF-8 kana ????? problems.
Unfortunately due to AppGameKit Studio compiler not being accesible, I can't use it for studio, or all UTF related problems would be solved.

@Kong 2020, May I suggest if you are using AppGameKit Classic, give the Atom IDE a try, its really fantastic for a number of reasons, showing any language natively is just one reason.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2020-08-04 03:34:32
Your offset time is: 2020-08-04 03:34:32