Author Topic: UIFont artifacts  (Read 6224 times)

filippopotamus

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 31
    • View Profile
UIFont artifacts
« on: October 03, 2012, 04:35:58 PM »
My fonts seem to be getting artifacts and I am not sure why. I scaled on a lot just to show the artifacts better:



Any thoughts? Fonts were created using GlyphDesigner

mtoivo

  • Guest
Re: UIFont artifacts
« Reply #1 on: October 03, 2012, 05:18:36 PM »
Are the artifacts visible on the png you create with GlyphDesigner, or do they show up only after using the font in NGUI? If they're not visible after GlyphDesign export, check the the NGUI-atlas you imported the font into. To me it looks like it might be GlyphDesigner -issue, but hard to say before you check those details.
« Last Edit: October 03, 2012, 05:26:16 PM by mtoivo »

filippopotamus

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 31
    • View Profile
Re: UIFont artifacts
« Reply #2 on: October 03, 2012, 05:31:49 PM »
I looked at the exported bitmap from GlyphDesigner and it looked perfectly fine.
I went ahead and added 1 pixel of spacing for each Glyph and then re-exported. That seemed to have fixed it for this font. I will do the others and report back.
Thanks for the help! :)

filippopotamus

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 31
    • View Profile
Re: UIFont artifacts
« Reply #3 on: October 03, 2012, 05:50:35 PM »
Yup. That did it. Adding 1 pixel of spacing in GlyphDesigner did the trick. It is worth nothing however, that GlyphDesigner did not export the artifacts. It seems that NGUI was getting a little bit of the adjacent letters.

dlewis

  • Guest
Re: UIFont artifacts
« Reply #4 on: October 03, 2012, 06:21:38 PM »
I find that happens most often in the game view if it's not displaying 1:1 pixel size.

ie. My game window is running 1536*2048 (iPad3) yet the game window is scaled to 686*915 (Screen not big enough to be full res) and the font has the rendering issue. As soon as I run it on the decide there is no issue.

filippopotamus

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 31
    • View Profile
Re: UIFont artifacts
« Reply #5 on: October 03, 2012, 06:35:55 PM »
It is entirely possible that this issue does not happen on the device for me either. Thanks for that observation.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIFont artifacts
« Reply #6 on: October 03, 2012, 08:15:50 PM »
It's how texture filtering works. When the pixel size of the texture is bigger than the pixel of the screen, neighbour pixels get sampled to "fill the gap". Adding some padding is indeed the right way, and is something BMFont does by default.