Loading font with more than 127 Chars

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
zorg
Party member
Posts: 3441
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Loading font with more than 127 Chars

Post 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...
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Loading font with more than 127 Chars

Post 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.
MasterLee
Party member
Posts: 141
Joined: Tue Mar 07, 2017 4:03 pm
Contact:

Re: Loading font with more than 127 Chars

Post 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
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Loading font with more than 127 Chars

Post 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.
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Loading font with more than 127 Chars

Post 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.
User avatar
Wilma456
Prole
Posts: 12
Joined: Mon Jul 03, 2017 2:27 pm
Location: Germany

Re: Loading font with more than 127 Chars

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Loading font with more than 127 Chars

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 77 guests