Future features

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
alxs
Prole
Posts: 31
Joined: Fri Feb 29, 2008 5:22 pm

Re: Future features

Post by alxs » Fri Feb 29, 2008 11:33 pm

Oh, I thought you were both equal "partners" here :)

Ok, let's wait for the Big Boss and see what he has to say...
Alex

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

Re: Future features

Post by mike » Fri Feb 29, 2008 11:50 pm

alxs wrote:Oh, I thought you were both equal "partners" here :)
Are you being condescending? I'll have you know that without me, rude would be stuck without buggy text-rendering! So there!
Now posting IN STEREO (where available)

User avatar
alxs
Prole
Posts: 31
Joined: Fri Feb 29, 2008 5:22 pm

Re: Future features

Post by alxs » Sat Mar 01, 2008 12:42 am

Oh, so this was your major contribution to the project! :)

Users like me, who will spend countless hours trying to find your precious, hidden treasure-bugs will certainly appreciate your effort! Ah, little surprises... Keep it up!

BTW, I guess you didn't use Windows fonts, right? Because of portability?

I also didn't notice where you specify kerning pairs for fonts. The fonts don't look like fixed-width ones, but where are all the values?
Alex

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

Re: Future features

Post by mike » Sat Mar 01, 2008 12:59 am

alxs wrote:Oh, so this was your major contribution to the project! :)
Yes. No. Maybe.
alxs wrote:Users like me, who will spend countless hours trying to find your precious, hidden treasure-bugs will certainly appreciate your effort! Ah, little surprises... Keep it up!
My snide comment detector is flaring.
alxs wrote:BTW, I guess you didn't use Windows fonts, right? Because of portability?
Not sure.. I think it was something about not being sued by Microsoft for distributing their precious fonts for free.
alxs wrote:I also didn't notice where you specify kerning pairs for fonts. The fonts don't look like fixed-width ones, but where are all the values?
Kerning pairs? Fixed-widht? Please elaborate.
Now posting IN STEREO (where available)

User avatar
alxs
Prole
Posts: 31
Joined: Fri Feb 29, 2008 5:22 pm

Re: Future features

Post by alxs » Sat Mar 01, 2008 1:16 am

No, I meant using Windows fonts, like Tahoma, Verdana to draw text...

About kerning pairs - well, to be short - each character in complex fonts has its own width. That's set of values A. Then, some characters change their position, based on combination with another character. That's set of values B. There are even more sets, but these two are the most important. Look at how fonts are done in PopCap framework.

In love I didn't see all the values (OMG, this name is certainly the endless source of puns!). This one is almost poetry :)

So how did you managed to create a font which doesn't look like fixed-width one (all the characters have the same width) without defining at least two of those sets of values?

And I don't know about Norway, but on my planet it's very, very late. Or very, very early. It depends. So, see you tomorrow... Hopefully I will also have a chance to put some major bugs in love...
Alex

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

Re: Future features

Post by rude » Sat Mar 01, 2008 3:01 am

I'll post a meaningful answer tomorrow, but for now; sleep time. 8-)

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: Future features

Post by Sardtok » Sun Mar 02, 2008 1:40 am

I believe the font works like this, please correct me if I'm wrong though:

You have a bitmap, where one colour is specified as the colour separating two characters, so there's a line of that colour.
There are no specified kerning pairs though, nor does it have whatever it's called again when two characters turn into one:
Like et, fi, ti and so on.
Take off every Zigg for great rapist.
Now, outgay that!

User avatar
alxs
Prole
Posts: 31
Joined: Fri Feb 29, 2008 5:22 pm

Re: Future features

Post by alxs » Sun Mar 02, 2008 2:00 am

Sardtok wrote:You have a bitmap, where one colour is specified as the colour separating two characters, so there's a line of that colour.
So what about the quotation mark (")? :)
Will it count as 2 characters? Plus there can be other characters, consisting of two and more parts...

Otherwise - quite clever solution as a rough approximation...
Alex

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

Re: Future features

Post by mike » Sun Mar 02, 2008 2:09 am

Sardtok wrote:I believe the font works like this, please correct me if I'm wrong though:

You have a bitmap, where one colour is specified as the colour separating two characters, so there's a line of that colour.
There are no specified kerning pairs though, nor does it have whatever it's called again when two characters turn into one:
Like et, fi, ti and so on.
This is how ImageFont works, by specifying a color (which isn't transparent and isn't anywhere in the actual font) that separates each character. You could fool the system by having a character that looks like this:
"beeeeee" to be the character 'b'.
alxs wrote: So what about the quotation mark (")? :)
Will it count as 2 characters? Plus there can be other characters, consisting of two and more parts...

Otherwise - quite clever solution as a rough approximation...
Even if " is (in essence) two separate symbols, in the bitmap image they are separated from each other by transparent pixels and separated from other characters by a "spacer color" which designates them as a single character, as so:
|A|B|C| ... |"|¨|%|
(the | characters symbolize the spacer color)

I hope this makes a little sense.. ImageFont is not an exact science and the normal (vectorized) fonts are a mystery to me as I just followed instructions from the FreeType website and some tutorials on NeHe.
Now posting IN STEREO (where available)

User avatar
alxs
Prole
Posts: 31
Joined: Fri Feb 29, 2008 5:22 pm

Re: Future features

Post by alxs » Sun Mar 02, 2008 2:22 am

Oh, I got it. Even more clever.

For my purposes I wrote a small class that loads fonts, created by PopCap utilities.
Since their tool handles all the trouble of calculating widths and kerning pairs, loading is easy.

And their tool is very flexible - it creates a raster image from vector fonts, installed in Windows, plus a text file with all the values.
Alex

Post Reply

Who is online

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