Author Topic: Bad pixel clipping and font kerning on some Android devices?  (Read 2744 times)

vexe

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 153
    • View Profile
Bad pixel clipping and font kerning on some Android devices?
« on: November 14, 2016, 04:39:56 PM »
Greetings,

we're getting weird/bad looking font and clipped sprites on some of our devices but not all.

Details:
- We're using bitmap fonts, Arial_12, Arial_14 (Don't want to use Dynamic fonts)
- All our UI is in one atlas, including the font
- UIRoot has "Constrained on mobile" with 480x270 (both with 'Fit' checked)
- Devices it looks bad on: Samsung Galaxy S7 Edge 1080p, and Samsung Galaxy View 18.4" 1080p
- Devices it looks good on: Samsung Galaxy Note 4, Samsung Galaxy S5
- UI Atlas texture filtering is set to Point, Wrap Mode is Clamp, Alpha Is Transparency is checked
- Using Unity 5.4.1f1

Comparison:
GOOD:




BAD:




What I've tried but didn't do anything:
- Disabling 'Fit' in the UIRoot
- Enabling/Disabling Anti-aliasing in the quality settings
- Changing filter mode in atlas texture

Really appreciate any tips/pointers as to what's going on here.

Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Bad pixel clipping and font kerning on some Android devices?
« Reply #1 on: November 15, 2016, 09:21:36 AM »
What's the actual reported screen size on all of those devices? Print Debug.Log(Screen.width + " " + Screen.height);

Also, are your sprites that get cut sides set to be anchored in a way that can cause them to shrink?

Lastly, I hope the compression on your atlas is off?

vexe

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 153
    • View Profile
Re: Bad pixel clipping and font kerning on some Android devices?
« Reply #2 on: November 15, 2016, 03:06:40 PM »
Resolutions:
- Ones that were bad:
--Samsung Galaxy S7 Edge: 2560x1440
--Samsung Galaxy View 18.4": 1920x1080

- Ones that were good:
--Samsung Galaxy Note 4: 2560 x1440
--Samsung Galaxy S5: 1920x1080

Atlas settings, set to True Color there shouldn't be any compression:


- Those labels/sprites are not anchored themselves. The only thing we anchor is positions. So we have a Top-Left, Top-Right, Center etc anchors that we position things to. Nothing should be stretched by those anchors as far as I know. Because pretty much all other screens/subscreens in the game are messed up, even ones that have no anchors (at least font wise)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Bad pixel clipping and font kerning on some Android devices?
« Reply #3 on: November 19, 2016, 06:51:58 AM »
Yeah, that's an odd one. I am not seeing any consistency. Do the bad devices have a visible bar of any kind? I assume the resolution values you reported are actual Screen.width and height printed from within the game, not the actual hardware resolution? Often mobile devices tend to leave some screen space for UI elements containing home and back buttons. I hope you're also using built-in anchoring rather than legacy anchors. Did you try printing the widget's local position to see if they are using whole integer numbers correctly?

vexe

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 153
    • View Profile
Re: Bad pixel clipping and font kerning on some Android devices?
« Reply #4 on: November 19, 2016, 10:33:02 AM »
Fixed it. We had some large textures in our Atlas, removed those took the size of it down and it's fine now. Seem if atlas exceeds a certain size things get screwed.