Page 1 of 1

how to set up cyrillic text support?

Posted: Thu Jun 30, 2022 10:08 am
by qnr
hi everyone, i couldn't find any topic related to my question so i made a new one.

i have not played smbx for a very long time, but recently i downloaded the last version and found that there's a
cyrillic font in this directory: SMBX2\data\scripts\textplus\font\pge

so i have a question: when i try to type some cyrillic text to the message box of some npc in level editor, it clearly appears in the interface of the "Set message text" window. but when i test the level and try to interact with the npc i find the message box empty... or if it contains any english text, cyrillic text doesn't appear too.

what should i configure to make it work? thanks for help in advance!

Image

Image

Re: how to set up cyrillic text support?

Posted: Thu Jun 30, 2022 12:50 pm
by deice
unfortunately, the vanilla smbx text boxes do not support non-ascii characters (smbx-38a supports chinese characters but even there cyrillic won't work).
as you can see, the font is located in the folder for the script "textplus" which can be used for more advanced text-drawing capabilities, but requires familiarity with smbx2's scripting system.

if you are already familiar with it then you may view this page to get acquainted with the textplus library specifically.
if you aren't, some good tutorials can be found here and then for more specific things you can look here.

Re: how to set up cyrillic text support?

Posted: Thu Jun 30, 2022 12:57 pm
by qnr
thx for explanation. maybe i'll try to change all the english font .pngs to cyrillic ones. it will ruin the whole game but i have some really specific needs xdxd

Re: how to set up cyrillic text support?

Posted: Thu Jun 30, 2022 1:15 pm
by deice
qnr wrote:
Thu Jun 30, 2022 12:57 pm
thx for explanation. maybe i'll try to change all the english font .pngs to cyrillic ones. it will ruin the whole game but i have some really specific needs xdxd
changing anything inside the textplus folders will actually not affect vanilla textboxes at all. it will only ruin episodes that already use textplus.

Re: how to set up cyrillic text support?

Posted: Thu Jun 30, 2022 3:52 pm
by qnr
so if i am going to make an episode in the latest version of smbx - will it already use textplus?

Re: how to set up cyrillic text support?

Posted: Thu Jun 30, 2022 4:07 pm
by deice
qnr wrote:
Thu Jun 30, 2022 3:52 pm
so if i am going to make an episode in the latest version of smbx - will it already use textplus?
textplus is a basegame library and comes packaged with new versions of smbx2. however, it won't actually replace the textboxes with fancy stuff on it's own nor is it imported by default. it provides text rendering functionality and that's about it (for now at least); the hard labor falls on the end user.

there are some premade libraries (e.g. littledialogue) that do this heavy lifting for you, but i'm not sure if any of them come with unicode fonts that would display cyrillic characters, as it's a lot of work to create something like that. although, if they use a default font, it might not be too hard to tweak it to support the cyrillic built-in font.

Re: how to set up cyrillic text support?

Posted: Thu Jun 30, 2022 6:01 pm
by qnr
thank you SO MUCH for this lib! i made a custom cyrillic font for it and everything works fine. except i can't bind some letters to their actual keys on keyboard but it's not a problem for me

Added in 6 minutes 51 seconds:
i'll leave it here just in case

Image

also i changed glyphmap in font.ini for assigning [ and ] for Х and Ъ:

[glyphmap]
row1="ABCDEFGHIJKLMNOP"
row2="QRSTUVWXYZ!.-,?"
row3="abcdefghijklmnop"
row4="qrstuvwxyz#[]'• "
row5=":;/1234567890∞*$"

also "/" for a comma and "#" for a dot here