Page 2 of 3

Re: Love2D - Font Messed Up!

Posted: Tue Oct 09, 2012 8:37 pm
by kikito
Triplenox wrote: Here is the code I have for the fonts:
I think he was referring to a .love file showing the error. With the font included. So we can see it for ourselves.

Regarding the screenshot, I still don't know what's wrong with it. Some letters are "not aligned" with the rest, but I guessed that was the way the font was.

Re: Love2D - Font Messed Up!

Posted: Tue Oct 09, 2012 8:50 pm
by FrogsFriend
If you zoom in on the font it's clear that all the straight edges are very crisp, but the curves are blurred.

Is that the problem?
Is that the way the font is supposed to be?

Re: Love2D - Font Messed Up!

Posted: Tue Oct 09, 2012 8:53 pm
by Robin
FrogsFriend wrote:If you zoom in on the font it's clear that all the straight edges are very crisp, but the curves are blurred.
Isn't that just anti-aliasing?

And yeah, Triplenox, without a .love we can't really help. We can only stand around and talk about stuff vaguely related to your problem.

Re: Love2D - Font Messed Up!

Posted: Tue Oct 09, 2012 10:40 pm
by Jasoco
Triplenox wrote: This isn't the full code for my love.load and love.draw, but it's everything to do with text, hope this helps, some how :p

Kind Regards,

-Triplenox (I'm feeling like a retard now!)
Problem is we also need the font file. Because we can all just use another font but it would look right to us. We need the gf.ttf font in order to compare it exactly to what you have.

It might just be what fonts look like on your system.

Re: Love2D - Font Messed Up!

Posted: Tue Oct 09, 2012 10:53 pm
by the_leg
Just google harabara for the font file. GIMP renders the text almost the same as LOVE does, so I don't think this is a LOVE issue. You might want to try the font out in other programs, and see how they render it, or change fonts.

Re: Love2D - Font Messed Up!

Posted: Tue Oct 09, 2012 11:19 pm
by pk
Okay, I'm a bit of a font nerd.

*ahem*

The article I linked to on page one (this) explains the problem you are seeing with the fonts. Grayscale anti-aliasing is going to look blurred compared to subpixel anti-aliasing. Basically, horizontal and vertical lines will look okay, but everything else just blurs horribly. Read the first few paragraphs, you won't find a much more succinct plain English explanation. You can stop when it starts going into Windows specifics.

Broadly, there are two types of fonts: print fonts and screen fonts. Print fonts are designed to be printed on high quality media at high dpi. Screen fonts are optimized to work on a computer display, which up until recently have been very low resolution in comparison. Apple's retina display is encroaching upon the dpi that professional designers are used to seeing in their posters and brochures.

A basic overview of print vs screen fonts can be found here.

There are lots of programmers here, so some of you should be familiar with bitmap fonts. Bitmap fonts such as the Proggy fonts are a no brainer for low resolution displays. The pixels are either on or off, so they always look sharp and crisp, no need for any anti-aliasing. But... they don't scale up or down automatically. If you make a font at 9pt, and someone wants to use the same font at 12pt, you have to redraw every single glyph at the larger size. Good old Courier on Windows is an example of this; you can only use it at 10, 12, and 15 point because those are the only sizes it was drawn in.

Sometime around the early '80s a few font foundries started creating fonts that where optimized for screens, or that could work equally well for print and screen. Hinting is what made this possible.

Bigelow and Holmes, for example, created the kick ass Lucida family of fonts that Microsoft and Apple have both been using for almost two decades. If you've ever read an O'Reily book with source code listings, you're probably looking at TheSansMono which was designed by the same guy who made Consolas. Bitstream Vera is a newer free font that works quite well at low resolution, even with grayscale anti-aliasing.

-----

Fonts can be confusing. Hopefully this helped some and you guys can stop standing around scratching your heads.

@Triplenox: Harabara looks like it works best as a print font to me. The font is full of small curves that don't work well at anything other than retina dpi levels. My advice is either 1) stick with the font and hope nobody else notices, or 2) search for a free screen font that works better. It's my experience that your average computer user is utterly clueless about font quality, so I think you can safely get away with option 1.

Somebody on Mac or Linux (Linux with RGB subpixels rendering enabled), download this font, load it up in Gedit/TextEdit/whatever, and post it here. You'll be able to tell the difference when Harabara is rendered with subpixel anti-aliasing turned on.

I *think* LOVE uses FreeType, and I *think* FreeType can render fonts using different levels of subpixel anti-aliasing. Why LOVE is configured out of the box for grayscale, I don't know. You'd have to ask someone else.

Re: Love2D - Font Messed Up!

Posted: Wed Oct 10, 2012 3:51 am
by substitute541
pk wrote: I *think* LOVE uses FreeType, and I *think* FreeType can render fonts using different levels of subpixel anti-aliasing. Why LOVE is configured out of the box for grayscale, I don't know. You'd have to ask someone else.
Love2D uses TrueType, and grayscale anti-aliasing. It's either the font, or Love2D. If you don't know what (btw talking to the one who is asking a question) subpixel rendering is, it adds red, green, and blue to the edges of the font. The result is much smoother compared to grayscale rendering. Try print-screening this page, and copy it to Paint, then zoom in on the text.

Re: Love2D - Font Messed Up!

Posted: Thu Oct 11, 2012 6:10 am
by bartbes
substitute541 wrote:Love2D uses TrueType
Freetype.


Anyway, am I right in thinking that if he really wants this font, and he wants it do be crips, he could also render it somewhere else and then use it as ImageFont?

Re: Love2D - Font Messed Up!

Posted: Thu Oct 11, 2012 7:41 am
by Boolsheet
Sure he can. The question is does he care for displays with reversed or vertical pixel arrangement (or even CRTs) and can he bothered to write a menu that asks the player what he wants (because it's easier to implement than the whole querying-the-OS thing)?

And then there's FSAA that backstabs us anyway. :P

I like that FreeType defaults to something portable and predictable. More options for the font renderering would be nice, however. Not sure why there's no issue for that on the tracker yet.

Re: Love2D - Font Messed Up!

Posted: Fri Oct 12, 2012 4:15 am
by Jasoco
bartbes wrote:
substitute541 wrote:Love2D uses TrueType
Freetype.


Anyway, am I right in thinking that if he really wants this font, and he wants it do be crips, he could also render it somewhere else and then use it as ImageFont?
It wouldn't have any Kerning if you turn it into an image font.