Author Topic: Font Color with Android Split Application Binary  (Read 2414 times)

vvuono01

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Font Color with Android Split Application Binary
« on: March 31, 2015, 03:52:41 PM »
Hi, I'm developing a project using NGUI 3.8.0, and I'm running into a frustrating problem. My Android .apk file is over 50 MB in size, so I'm using Unity's Split Application Binary to generate a .obb file. On my preloader screen, I have code in place to check if the .obb file is present, and if it's not, a UILabel with a message will be displayed asking the user if they want to download the .obb file now. However, the problem that I'm running into is that no matter what settings I have in place, the text for this message is displayed as black text. I know it's not my settings, because if I force this popup to appear when the .obb file IS present, it displays correctly (as white). So whatever code is responsible for coloring text must be present in the .obb file itself. Everything else with NGUI works correctly when the .obb is absent (or at least, everything else I need - localization, displaying text at all, displaying sprites, tweening) but the text will not change color. Is there any way to force the color to change somehow, or force that code to be included in the .obb? Has anyone else ever seen this problem?

EDIT: My labels' fonts are dynamic. I discovered that switching to UIFonts fixed the coloring problem; however, I can't actually switch all my fonts to UIFonts because one of my fonts has lots of special characters for other languages, and NGUI's font building system does not seem to support that. I need a way to make this work with dynamic fonts.
« Last Edit: March 31, 2015, 04:37:38 PM by vvuono01 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Font Color with Android Split Application Binary
« Reply #1 on: April 01, 2015, 11:23:06 PM »
Dynamic fonts suffer from a lot of issues that Unity never bothered fixing, so you've just ran into one of many.

NGUI's font system supports all characters you tell it to include, assuming the font itself actually includes those characters. Keep in mind Unity's dynamic font system falls back to Arial font if the font you're using to display a character doesn't actually have it. NGUI won't do that. That's the only difference. So make sure the font has the glyphs you need and then specify all the glyphs you need in the Custom field when creating the font.