Page 2 of 4
Re: What gives with character support in L2D? [SOLVED]
Posted: Wed Mar 14, 2018 1:25 am
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.
Re: What gives with character support in L2D? [SOLVED]
Posted: Wed Mar 14, 2018 1:30 am
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.
Re: What gives with character support in L2D? [SOLVED]
Posted: Wed Mar 14, 2018 1:37 am
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.
Re: What gives with character support in L2D?
Posted: Wed Mar 14, 2018 3:28 am
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.
Re: What gives with character support in L2D? [SOLVED]
Posted: Wed Mar 14, 2018 3:34 am
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.
Re: What gives with character support in L2D? [SOLVED]
Posted: Wed Mar 14, 2018 3:35 am
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.
Re: What gives with character support in L2D?
Posted: Wed Mar 14, 2018 3:36 am
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)
Re: What gives with character support in L2D?
Posted: Wed Mar 14, 2018 4:32 am
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?
Re: What gives with character support in L2D?
Posted: Wed Mar 14, 2018 4:55 am
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.
Re: What gives with character support in L2D?
Posted: Wed Mar 14, 2018 6:34 am
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.