What gives with character support in L2D? [SOLVED]

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
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: What gives with character support in L2D? [SOLVED]

Post by raidho36 »

The purpose of fallback fonts is to render something (that isn't a square or a question mark) when your main font doesn't have appropriate characters in it - not to render something pretty and with the same style and dimensions as your main font. This also means that you can use fallback font for all of your text rendering if you make your main font blank - or if there's none altogether.

That said, if you hard-code your text layout so that it works with one specific font but not with any other, you're already doing it wrong. Especially if you hard-code it for a fallback font and not the one you ship with the game.
Last edited by raidho36 on Wed Mar 14, 2018 1:30 am, edited 1 time in total.
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: What gives with character support in L2D? [SOLVED]

Post by zorg »

Besides, most games include their own font anyway, for the reasons that have been mentioned. Whether or not you use an imagefont (or more) or ttf/odf formats, the size isn't really a problem either nowadays.

That said, if you want to be a smart sneak about it, you could do a thing: manually compose kanjis from building radicals; japanese has around 241 radicals only, so addressing them with a byte is good enough. Plus placement info.
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: What gives with character support in L2D? [SOLVED]

Post by raidho36 »

Yeah well no one's gonna do it, not for all the 60-something thousand kanji glyphs and god knows how many chinese glyphs. Besides it's not just about hieroglyphical writing systems, there's also hebrew writing, cyrillic, arabic, hindi, etc., not to mention emojis. They all need support and any half-decent software is expected to have it. You can't possibly make a custom font supporting all of these, you need fallback fonts for this, there's just no way around it.
hasen
Party member
Posts: 157
Joined: Sat Jan 20, 2018 2:01 pm

Re: What gives with character support in L2D?

Post by hasen »

bartbes wrote: Tue Mar 13, 2018 6:37 pm
hasen wrote: Tue Mar 13, 2018 9:55 am It seems strange that Love2d has a default font which must be on the device's system
Love includes a font. It doesn't use system fonts at all.
Oh really? I wonder why this is exactly. Web browsers use onboard fonts no problem. If you use 'Arial' for example then it's gonna look the same on all devices. Especially if you set the size in pixels as well.
hasen
Party member
Posts: 157
Joined: Sat Jan 20, 2018 2:01 pm

Re: What gives with character support in L2D? [SOLVED]

Post by hasen »

zorg wrote: Wed Mar 14, 2018 1:30 am That said, if you want to be a smart sneak about it, you could do a thing: manually compose kanjis from building radicals; japanese has around 241 radicals only, so addressing them with a byte is good enough. Plus placement info.
That's possible but would be rather hard to program. Considering how big Chinese fonts are it would be simpler to use images of text, unless you needed huge amounts of content that is. Why is it we don't get access to the onboard fonts? The 'usual suspects' are always there like Tahoma, Verdana, Helvetica, Arial etc. Plus at least one Chinese and Japanese font are present so as to avoid question marks appearing.

Even if it would cause issues, it would be nice to have the choice.
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: What gives with character support in L2D? [SOLVED]

Post by zorg »

raidho36 wrote: Wed Mar 14, 2018 1:37 am Yeah well no one's gonna do it, not for all the 60-something thousand kanji glyphs and god knows how many chinese glyphs. Besides it's not just about hieroglyphical writing systems, there's also hebrew writing, cyrillic, arabic, hindi, etc., not to mention emojis. They all need support and any half-decent software is expected to have it. You can't possibly make a custom font supporting all of these, you need fallback fonts for this, there's just no way around it.
Generally speaking, i do agree with you, Raidho; even though some people might not like how Unicode handles kanjis (the han unification thing specifically) but at least that is still something that lists all or most characters you would ever need to use.

I'm talking about something more specific; for certain kinds of things, games, that you'd want to have a small footprint, there are ways. And not just with kanjis, some other systems can also be made combineable.
Last edited by zorg on Wed Mar 14, 2018 3:44 am, edited 1 time in total.
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
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: What gives with character support in L2D?

Post by zorg »

hasen wrote: Wed Mar 14, 2018 3:28 am
bartbes wrote: Tue Mar 13, 2018 6:37 pm
hasen wrote: Tue Mar 13, 2018 9:55 am It seems strange that Love2d has a default font which must be on the device's system
Love includes a font. It doesn't use system fonts at all.
Oh really? I wonder why this is exactly. Web browsers use onboard fonts no problem. If you use 'Arial' for example then it's gonna look the same on all devices. Especially if you set the size in pixels as well.
Again, the issue is that IF for some reason, the computer wouldn't have the font you assumed everything had, it will need to fall back to something, literally breaking spacing in-game (think dialogue overflowing and such stuff)
zorg wrote: Wed Mar 14, 2018 3:43 am
hasen wrote: Wed Mar 14, 2018 3:34 am
zorg wrote: Wed Mar 14, 2018 1:30 am That said, if you want to be a smart sneak about it, you could do a thing: manually compose kanjis from building radicals; japanese has around 241 radicals only, so addressing them with a byte is good enough. Plus placement info.
That's possible but would be rather hard to program. Considering how big Chinese fonts are it would be simpler to use images of text, unless you needed huge amounts of content that is. Why is it we don't get access to the onboard fonts? The 'usual suspects' are always there like Tahoma, Verdana, Helvetica, Arial etc. Plus at least one Chinese and Japanese font are present so as to avoid question marks appearing.

Even if it would cause issues, it would be nice to have the choice.
Wouldn't necessarily be that hard, just tedious; there are a lot of kanjis, but a textual combinatorical representation for the graphics of them can still be smaller than an imagefont (or a ttf)
Last edited by zorg on Wed Mar 14, 2018 3:43 am, edited 1 time in total.
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.
hasen
Party member
Posts: 157
Joined: Sat Jan 20, 2018 2:01 pm

Re: What gives with character support in L2D?

Post by hasen »

zorg wrote: Wed Mar 14, 2018 3:36 am Again, the issue is that IF for some reason, the computer wouldn't have the font you assumed everything had, it will need to fall back to something, literally breaking spacing in-game (think dialogue overflowing and such stuff)
Well you'd just fall back on the font that is included with Love if it really came to that. Web browsers do it like this, they fall back on more common fonts. At the end of the day, if your device is missing the most common fonts like Arial, Verdana etc you'll probably have text display problems all over the place anyway.

Again, it's just about having the choice to use them or not. It's like saying don't offer gamepad support at all because someone might have a gamepad that you don't support.
zorg wrote: Wed Mar 14, 2018 3:43 am Wouldn't necessarily be that hard, just tedious; there are a lot of kanjis, but a textual combinatorical representation for the graphics of them can still be smaller than an imagefont (or a ttf)
Ok, not really sure what your idea is about how to do that. Surely you'd have to program something that literally could understand Japanese/Chinese? How would you write a word in Chinese in the program to have it displayed and how would the program turn that into the correct character?
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: What gives with character support in L2D?

Post by zorg »

hasen wrote: Wed Mar 14, 2018 4:32 am
zorg wrote: Wed Mar 14, 2018 3:43 am Wouldn't necessarily be that hard, just tedious; there are a lot of kanjis, but a textual combinatorical representation for the graphics of them can still be smaller than an imagefont (or a ttf)
Ok, not really sure what your idea is about how to do that. Surely you'd have to program something that literally could understand Japanese/Chinese? How would you write a word in Chinese in the program to have it displayed and how would the program turn that into the correct character?
Not talking about IMEs or input in general, just a way to convert an unicode codepoint (or rather, runs of them, since we don't want to store the codepoints themselves) into the visual glyphs using a custom radical-combiner function/library, that only stores the radicals; ~200 glyphs vs. 50000+ glyphs.
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.
hasen
Party member
Posts: 157
Joined: Sat Jan 20, 2018 2:01 pm

Re: What gives with character support in L2D?

Post by hasen »

zorg wrote: Wed Mar 14, 2018 4:55 am Not talking about IMEs or input in general, just a way to convert an unicode codepoint (or rather, runs of them, since we don't want to store the codepoints themselves) into the visual glyphs using a custom radical-combiner function/library, that only stores the radicals; ~200 glyphs vs. 50000+ glyphs.
So you mean write the characters in Chinese in the code and this program will display them using combinations of radicals?
zorg wrote: Wed Mar 14, 2018 3:35 am I'm talking about something more specific; for certain kinds of things, games, that you'd want to have a small footprint, there are ways. And not just with kanjis, some other systems can also be made combineable.
If you wanted a small footprint then just using the system fonts, at least for Chinese characters would be a simple way to go. If you want it to look really pretty or different then sure, add a Chinese font (or several) that is bigger than your whole game, but otherwise I think we should have the choice to use the system fonts to reduce game file size. I just don't see what harm is done by having the choice to go this way.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 9 guests