Jump to content

Problem with handling Unicode


Soamp
 Share

Recommended Posts

in fact I want to implement right to left language, according to thispage

my fonts converted using fontstudio, and I could load them correctly, but I don't access to characters between 0600 to 06ff as unicode characters in LUA.

eg. by using this line:

DrawText("\1586",200,200)

it will write "06" which is wrong character.

 

any suggestions please?

Link to comment
Share on other sites

You need to define a cross-reference table which associates unicode characters (value > 255) with ASCII characters. I've done that already for C++, and I could also add Lua version. Note that the arabic text is a right-to-left font and writing (it even reverses the cursor left and right keys in VS):

http://leadwerks.com/werkspace/index.php?/topic/1338-make-cyrrilic-font-in-le-solved/page__view__findpost__p__12508

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

well.. I checked that, but I could not get correct result.

I currently have unicode string for my character, just don't know how to define this strings as a unicode.

for example in python you can use this syntax to define a unicode:

U"65248" 

do you know how can I define this in LUA?

Link to comment
Share on other sites

You shouldn't need to define any codes, but just write the text as it is. You can write unicode russian, arabic, hebrew, etc...

Then you just give your string as a parameter to a function like str16to8() and it will convert it to ascii characters which are matching the Font Studio dds file.

When I wrote the arabic text, I had no idea or need to know what codes they actually are, I just wrote the text in english and used google translator to translate it to arabic.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...