Author Topic: [Solved] Need some help on ipad retina and fonts  (Read 11222 times)

Legna

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
[Solved] Need some help on ipad retina and fonts
« on: February 21, 2013, 07:04:18 AM »
Hello,

I have a problem with the rendering of the fonts on an ipad retina.

I use an Helvetica font, and extracted it in many resolutions with BM fonts to try to get something nice (20 and 84 to get the .25 ration of the UD font).

When i try to use the font with an atlas which have pixel set to 1 (for the 20px font for SD) or .25 (for the 84px font for UD), with pixel perfect clicked, the font looks nice in the editor, but not when i launch the in unity.
So i tried to compile and run on ipad retina, and, in the 2 cases the texts looks like they where "chopped" at the top or the bottom of the letters.

Did i missed something ?

Thank you for your answer.
« Last Edit: February 25, 2013, 04:24:24 AM by Legna »

Legna

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Need some help on ipad retina and fonts
« Reply #1 on: February 21, 2013, 08:31:58 AM »
I did some more search, tried to get it nice, used high quality and such, but the text still looks not good.

Here's a screenshot of the result on ipad retina.

Thank you a ton for your help.


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Need some help on ipad retina and fonts
« Reply #2 on: February 21, 2013, 09:06:49 PM »
How is 20 25% of 84?

Legna

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Need some help on ipad retina and fonts
« Reply #3 on: February 22, 2013, 01:07:50 AM »
84 was a test for a 21 PX font size, but anyway any resolution was glitch in the clipped plane when sliding.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Need some help on ipad retina and fonts
« Reply #4 on: February 22, 2013, 03:34:00 AM »
20 / 0.25 = 80.
Math

Legna

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Need some help on ipad retina and fonts
« Reply #5 on: February 22, 2013, 04:37:53 AM »
Yeah, thanks guy for this obvious answer...  ::)

Whatever 80 (for 20px results) or 84 (for 21px), the font keeps glitchy when scrolling on ipad and so far you high mathematics skills does not help me in any mean...

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Need some help on ipad retina and fonts
« Reply #6 on: February 22, 2013, 07:20:22 AM »
OK, so a non-smartass answer then. :)

Look at the texture for the font. is it using MipMapping? Try disabling that.

Look at the quality settings, is it fastest? Use something else, like Good.

It looks like the fot is using a smaller version of the texture, and that would be potential causes of that.

Legna

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Need some help on ipad retina and fonts
« Reply #7 on: February 22, 2013, 07:46:35 AM »
I already  set the quality on high but I'll take a try with the map mapping.

Thank you,  I'll post the results.

Legna

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Need some help on ipad retina and fonts
« Reply #8 on: February 22, 2013, 09:14:16 AM »
Well, no texture is mipmapped nore compressed. I tried different filter mode (point, bilinear and trilinear) and wrap mode. But i still have some issue on the S characters especially.

To be more explicite, the text is in a clipped panel (a copy of the demo given with ngui) and everything is a 1:1 size and placed on a integer of 2 local position. I use a UIGrid to place it perfectly (uigrid still place it in an integer position) with (or without for tests) a UICenterOnChld.

I tried differents version of BMFont (as i roamed the board to find a solution, i saw the admin said the 1.13 could have some problems) and different fonts. It still looks like if the first line of the texts, but only in certain cases, was missing.

As you can see on this screenshot, the bottom (and sometimes the upper) line is missing.



Thank you for your help.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Need some help on ipad retina and fonts
« Reply #9 on: February 22, 2013, 10:11:25 AM »
Look at your scroll list, that will likely be some float as position when you scroll it. You will have to round that to avoid the potential weird filtering when ending a scroll. Momentum does almost always end on some odd fraction, which will make it do something like that.

Legna

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Need some help on ipad retina and fonts
« Reply #10 on: February 22, 2013, 10:46:19 AM »
Thank you for your help again Nicki, but i used UICenterOnChild to be sure the momentum will lead after movement to a rounded value.

I modified the UICenterOnChild working way to be called by the UIDraggablePanel only when momentum stops (and not at the end of drag action). The result is the clippling plane is well put at a rounded value, but i still have the glitch... (even before my modification)...

Legna

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Need some help on ipad retina and fonts
« Reply #11 on: February 23, 2013, 11:41:07 AM »
An update message : i got better results with a 3d ui camera, but its still far to perfect.

Could an admin give me some support ? It would be cool, especially as the asset is not free, something else than "20x4 isn't 84" would be very welcome.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Need some help on ipad retina and fonts
« Reply #12 on: February 23, 2013, 04:41:26 PM »
Look as hard as I may, I couldn't spot the issue there... what's cut off? Half a pixel off the bottom? If so, then you need to export your font with some padding. BMFont's default export has padding set to 0 all around. Change it to 1 before exporting.

Legna

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Need some help on ipad retina and fonts
« Reply #13 on: February 25, 2013, 04:23:05 AM »
Well, i finally put a 2px padding exporting my 80px font, used photoshop to uncrisp it with a gaussian blur of 1px.
I set "pixel perfect" to the 2D Cam with 1536px resolution, updated UIDraggablePanel to put the panel clipping only in an multiple of 2 pixel count while moving and made it use Recenter() after a momentum and spring to command UICenterOnChild.

I now have something readable and clear with no pixel lost while moving or at stop...

Thank you Nicky for your ideas and Arenmook for your mails.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: [Solved] Need some help on ipad retina and fonts
« Reply #14 on: February 25, 2013, 08:19:19 AM »
I'm glad you figured it out. :)