Page 1 of 2
Is LOVE being able to use only 1byte font?
Posted: Sun Feb 15, 2009 6:24 am
by ta_katsu
Hi,
My name is Katsu. I accesses from Japan.
LOVE is a wonderful development tool.
I want to wirite Japanese text on screen.
but I don't wirite Japanese text on screen.
The Japanese text characters are garbled.
Is LOVE being able to use only 1byte font?
Re: Is LOVE being able to use only 1byte font?
Posted: Sun Feb 15, 2009 1:09 pm
by rude
Yeah, I'm afraid so. If you need kanji/kana, you have to fake it with
ImageFont. (Example image seems to be removed. Will fix it ASAP.)
Re: Is LOVE being able to use only 1byte font?
Posted: Mon Feb 16, 2009 1:38 pm
by ta_katsu
Hi,rude.
Thank you for getting the answer from you.
Moreover, we wish to express our gratitude for your support.
In the next version, two byte font is expected to be able to be used.
Re: Is LOVE being able to use only 1byte font?
Posted: Mon Feb 16, 2009 2:04 pm
by rude
ta_katsu wrote:In the next version, two byte font is expected to be able to be used.
I'm afraid that won't happen. Font works by send each glyph to the GPU as a texture. There are way too many japanese characters for load-times to be feasible.
Re: Is LOVE being able to use only 1byte font?
Posted: Mon Feb 16, 2009 5:13 pm
by osuf oboys
How about sending the respective character the first time the it is needed and/or supporting only the basic character set?
Re: Is LOVE being able to use only 1byte font?
Posted: Sat Mar 07, 2009 9:55 am
by Sardtok
You might want to look at FreeType, which supports rendering of unicode fonts, it dynamically generates glyph bitmaps as needed, like osuf oboys suggestion.
So only the glyphs that are actually used are ever put into memory, not sure what it does if a huge number of characters is used.
Anyway, you might want to handle it the same way, or change to FreeType for font rendering.
Just be aware that there are some patent issues if you want perfect rendering. Some fonts might get garbled if the patented Apple rendering algorithms are not used.
Re: Is LOVE being able to use only 1byte font?
Posted: Sat Mar 07, 2009 12:46 pm
by appleide
Sardtok: Don't we use FreeType already?
Re: Is LOVE being able to use only 1byte font?
Posted: Sat Mar 07, 2009 2:15 pm
by mike
appleide wrote:Sardtok: Don't we use FreeType already?
Yes, we do. I was a little puzzled by what he said since it seems like we could use FreeType to render fonts as well as read them. Then again, the font handling is OLD AND BROKEN and will be replaced with epicness when we get around to it.
Re: Is LOVE being able to use only 1byte font?
Posted: Sun Mar 08, 2009 4:00 pm
by Sardtok
It's not like I pay attention to what libraries you use, and which you don't.
If you render glyphs to some texture in memory, you could just use a simple discard system when a the number of glyphs gets too big and overwrite the old glyph.
It would require that you set up some kind of collection to keep an eye on what glyph is in what opengl texture and order it by usage, moving a glyph to the front/top whenever it is used and shifting all the others back, might be slower than the current version, but it could be turned on/off to avoid all the shifting in apps that don't need a lot of glyphs.
Re: Is LOVE being able to use only 1byte font?
Posted: Sun Mar 08, 2009 7:01 pm
by mike
Ok, let me try to understand what you're saying:
- Read a massive font-file for massive glyph usage (like Japanese characters or every variaton of OØÖÓ...)
- Make OpenGL textures of some of the glyphs, but not all
- Change which glyphs are textured in real-time, based on the history of usage of those glyphs
Yeah, that seems only
slightly slower than the current version