Is LOVE being able to use only 1byte font?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
ta_katsu
Prole
Posts: 2
Joined: Sun Feb 15, 2009 6:08 am

Is LOVE being able to use only 1byte font?

Post by ta_katsu » Sun Feb 15, 2009 6:24 am

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?

User avatar
rude
Administrator
Posts: 1051
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Is LOVE being able to use only 1byte font?

Post by rude » Sun Feb 15, 2009 1:09 pm

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.)

ta_katsu
Prole
Posts: 2
Joined: Sun Feb 15, 2009 6:08 am

Re: Is LOVE being able to use only 1byte font?

Post by ta_katsu » Mon Feb 16, 2009 1:38 pm

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.

User avatar
rude
Administrator
Posts: 1051
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Is LOVE being able to use only 1byte font?

Post by rude » Mon Feb 16, 2009 2:04 pm

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.

osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: Is LOVE being able to use only 1byte font?

Post by osuf oboys » Mon Feb 16, 2009 5:13 pm

How about sending the respective character the first time the it is needed and/or supporting only the basic character set?
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.

User avatar
Sardtok
Party member
Posts: 108
Joined: Thu Feb 21, 2008 2:37 pm
Location: Norway/Norge/諾威/挪威 (Yes, I'm teh back!)
Contact:

Re: Is LOVE being able to use only 1byte font?

Post by Sardtok » Sat Mar 07, 2009 9:55 am

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.
Take off every Zigg for great rapist.
Now, outgay that!

User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: Is LOVE being able to use only 1byte font?

Post by appleide » Sat Mar 07, 2009 12:46 pm

Sardtok: Don't we use FreeType already?

User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: Is LOVE being able to use only 1byte font?

Post by mike » Sat Mar 07, 2009 2:15 pm

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.
Now posting IN STEREO (where available)

User avatar
Sardtok
Party member
Posts: 108
Joined: Thu Feb 21, 2008 2:37 pm
Location: Norway/Norge/諾威/挪威 (Yes, I'm teh back!)
Contact:

Re: Is LOVE being able to use only 1byte font?

Post by Sardtok » Sun Mar 08, 2009 4:00 pm

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.
Take off every Zigg for great rapist.
Now, outgay that!

User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: Is LOVE being able to use only 1byte font?

Post by mike » Sun Mar 08, 2009 7:01 pm

Ok, let me try to understand what you're saying:
  1. Read a massive font-file for massive glyph usage (like Japanese characters or every variaton of OØÖÓ...)
  2. Make OpenGL textures of some of the glyphs, but not all
  3. 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
Now posting IN STEREO (where available)

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests