Page 3 of 3

Re: Loading font with more than 127 Chars

Posted: Sat Aug 12, 2017 4:05 pm
by zorg
I mean, some games simply separate the "username" and "displayname", and only allow a restricted set like ascii or even just a-zA-Z0-9_ in usernames; that way you don't even have to cheat like that to have multiple Ben-s in the game...

Re: Loading font with more than 127 Chars

Posted: Sat Aug 12, 2017 4:27 pm
by raidho36
There isn't anything wrong with having multiple characters with same apparent name or even username. It only has to be different bit-wise.

Re: Loading font with more than 127 Chars

Posted: Sat Aug 12, 2017 4:31 pm
by MasterLee
But in games with search functionality latins B Town will be burned more often because people that seeks revenge against greek and cyrilic B Ben will fight latin B Ben.
But here is an list
http://www.unicode.org/Public/security/ ... sables.txt

Re: Loading font with more than 127 Chars

Posted: Sat Aug 12, 2017 11:05 pm
by ivan
BTW, lowercase Cyrillic В looks like this: в which is different than the Latin lowercase b.
In Cyrillic you can't write lowercase В as b...
depending on your font, b may look similar to the Cyrillic Ь or Ъ which are different letters altogether. :)
So it's not a good idea use these interchangeably despite how similar the uppercase versions may appear.

Re: Loading font with more than 127 Chars

Posted: Sun Aug 13, 2017 12:57 am
by Inny
Classic XY problem here.

If OP wants to just load a font they found and doesn't care about the extra characters, they should remove the excess characters from the image and load up the range of characters they need, bearing in mind the heavy complication with loading any character above 127.

If OP wants to make an old DOS like game, they should not use love.graphics.print for this, should use Quads and love.graphics.draw, and write their own string drawing algo. It's not very hard, though it has its pros and cons.

If OP actually wants multilingual characters, the image font it a poor choice, and they should look into a proper TTF font.

Re: Loading font with more than 127 Chars

Posted: Mon Aug 14, 2017 3:02 pm
by Wilma456
I'm making a ComputerCraft Emulator, so I must load the CC Font. The most is working now, but some CC programs need Chars who are higher than 127. You can find the current source code here: https://github.com/Wilma456/CCLite.

Re: Loading font with more than 127 Chars

Posted: Wed Aug 23, 2017 8:29 am
by bartbes
But that's not valid UTF-8. You can convert it to utf-8 by loading the utf8 library (require "utf8") and then using utf8.char, like string.char. That probably means you need to replace those values in input strings too, though.