Author Topic: Blurry fonts caused by thin letters  (Read 5373 times)

sgonchar

  • Guest
Blurry fonts caused by thin letters
« on: July 11, 2012, 01:36:05 PM »
Hello,

We are running into a fun issue. Our fonts in text fields get blurred when we have thin letters in the string. Blur gets effected with every letter added to the string. If the words only have thicker letters "w" or the like we won't see the blurring.

Help and ideas much appreciated.

UILabel contained within a UIPanel that has half pixel offset checked. (otherwise all other art gets blurred).
UILabel is pixel aligned xy, but only because on average that seems to look better ... some textboxes endup looking better at half pixel alignments ... it really seems font rasterization doesn't work well. See attached.

Our NGUI is quite out of date, so if that got fixed in the last month or two please point us in the direction where it was fixed, we will be integrating newest NGUI in our builds shortly.

Currently we found that setting Line Width of a UILabel to half pixels works i.e. set to 100.5 instead of 100 ... that seems to average out the blur-ness so nothing is terribly sharp but nothing is awfully blurred ether.

Thank you.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Blurry fonts caused by thin letters
« Reply #1 on: July 11, 2012, 01:48:40 PM »
Select your label and hit Alt+Shift+P. Better yet, select your UIRoot and use the same key combination. It sounds like you aren't using pixel-perfect values there. Alt+Shift+P forces all objects underneath the selected one to be pixel-perfect.

sgonchar

  • Guest
Re: Blurry fonts caused by thin letters
« Reply #2 on: July 11, 2012, 02:09:48 PM »
Thank you for the quick reply!

Alt+Shift+P for us opens the UI Panel tool ... We're still on NGUI 1.6c.

I made a small test scene though with just UI and every possible xyz positions to zero. The only non zero numbers are the scale of the text field and scale of UIRoot (autoset by the script, currently 0.0003xx).

... no change, the UILabel still blurs/un-blurs based on content in the test scene.

PhilipC

  • Guest
Re: Blurry fonts caused by thin letters
« Reply #3 on: July 11, 2012, 02:26:02 PM »
Whats the scale of the textfield? is it the same as the font size?

sgonchar

  • Guest
Re: Blurry fonts caused by thin letters
« Reply #4 on: July 11, 2012, 02:38:54 PM »
The scale of the text field is 17x17 which is what the Widget Tool adds it at, we don't change it.

The font is actually exported in BMFont at 14pt, but the text file generated out of BM font says "lineHeight=17" (and "size=-14") that's probably why the text field is being scaled so (but I'm guessing here). We did not change BMFont or text files generated, etc, font pipeline is unchanged.

Are you thinking that something is being scaled not 1:1 and/or positioned non pixel perfect?

PhilipC

  • Guest
Re: Blurry fonts caused by thin letters
« Reply #5 on: July 11, 2012, 02:53:53 PM »
Yes thats exactly what i'm thinking. Even off by a little will sometimes cause blurriness. I would say update to the lastest NGUI and then follow the Alt+Shift+P as Mike suggested

sgonchar

  • Guest
Re: Blurry fonts caused by thin letters
« Reply #6 on: July 11, 2012, 03:03:32 PM »
Hey,
Updating to latest completely may is not practical right now, we're weeks away from ship and our "update-to-latest" will really be manually bringing over bug fixes and such ... so I was hoping this is fixed in later versions and I can just bring over the fix (first or just the fix, we may not need the rest).

I also made sure everything is pixel aligned ... there may be more going on. (possibly newer NGUI does have font rasterization different from our version). I'll be diffing packages shortly, I'll see if anything jumps out at me as font fixes.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Blurry fonts caused by thin letters
« Reply #7 on: July 12, 2012, 01:20:41 AM »
1.6 is roughly beginning of February, so it's very, very old. The issue may have very well been resolved. It has, after all, been 6 months of updates you're missing out on.

My suggestion is update before I push 2.1.0, as I've removed some long-deprecated functionality which will break some things when you update such an old project. The backwards compatibility code is still present in the current version (2.0.9).

sgonchar

  • Guest
Re: Blurry fonts caused by thin letters
« Reply #8 on: July 12, 2012, 07:28:30 AM »
Hey,
Ok, thank you for the info, we'll do what we can with the update.