Search Unity

Missing font characters on iOS 8.2

Discussion in 'Editor & General Support' started by Richard-Coen, Mar 12, 2015.

  1. Richard-Coen

    Richard-Coen

    Joined:
    Mar 17, 2013
    Posts:
    2
    We are currently using Unity 4.3 and have hit an issue where our Japanese, Korean and Russian text is not appearing on iOS 8.2.

    We've seen it's been fixed in 4.6...

    http://issuetracker.unity3d.com/issues/text-not-visible-with-ios-8-dot-2-beta

    Unfortunately we can't easily upgrade to 4.6 at the moment so does anyone have a work around to the issue above? Any help would be appreciated.

    Cheers,
    Rick.
     
    Last edited: Mar 13, 2015
  2. F.Salka

    F.Salka

    Joined:
    Dec 13, 2013
    Posts:
    43
    Exactly the same issue here. It's serious and also affects English text with the old GUI system (frame rate counter no longer shows), it also affects the store version.
     
  3. F.Salka

    F.Salka

    Joined:
    Dec 13, 2013
    Posts:
    43
    It seems related to how unity handles system font file location on iOS. From the 4.6.1 update notes:
    "iOS: Use new font file location on iOS 8.2."
     
  4. Richard-Coen

    Richard-Coen

    Joined:
    Mar 17, 2013
    Posts:
    2
    Basically if the game can't find a specific character in the text it falls back to using a system font but since the folder location has changed in iOS 8.2 it can no longer do this and ends up displaying nothing.

    The only thing we can think to do is to supply a fallback font of our own. This does mean the application size increases and we can't fully guarantee all languages will be supported, currently trying Arial Unicode MS as this seems to support Russian, Korean and Japanese which were the affect languages.

    I've not tried this solution yet but I'll post back if it works.
     
  5. F.Salka

    F.Salka

    Joined:
    Dec 13, 2013
    Posts:
    43
    I ended up updating to Unity 4.6 to solve this issue. It took me 1 day to rebuild the Xcode project but it was totally worth it. Older versions of Unity have serious issues with iPhone 6/6Plus.

    Looking at the new UnityAppController.mm in the Xcode project, i found the following extra lines of code:

    extern "C" const char* const* UnityFontDirs()
    {
    static const char* const dirs[] = {
    "/System/Library/Fonts/Cache", // before iOS 8.2
    "/System/Library/Fonts/AppFonts", // iOS 8.2
    "/System/Library/Fonts/Core", // iOS 8.2
    "/System/Library/Fonts/Extra", // iOS 8.2
    NULL
    };
    return dirs;
    }

    This method is located at the end of the file (last lines). I don't know from where this function is being called.
     
  6. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    639
    Someone from Unity, can you please give us exact directions to fix this font issue, without upgrading to a higher version of Unity? Like @F.Salka posted, is modifying that all that needs to be done, or is there another spot as well?

    Thanks! Hopefully I can get a quick response so I can get an update out, starting to get a lot of emails on this.
     
  7. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    This is fixed in 4.6.1, so the directions are "upgrade to 4.6.1". There isn't a fix for previous versions. When we learned that Apple had changed the font handling in iOS8.2 we added a fix into the next release. 4.6.1 was released over 3 months ago...
     
  8. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    639
    As much as I understand how easy it is for you to say "just upgrade from 4.5 to 4.6", I don't want to rush out a new build assuming 4.6 didn't break something else in my game.

    If the font specific fix is just changing a few lines of code in the Xcode project, I don't know why you couldn't just give us those exact instructions.

    Basically, if it ain't broke don't fix it. Nothing else in my game with v4.5 is broke now except font, so why upgrade, introducing a lot of new stuff with v4.6, and risk breaking it, if there's a quick 2 minute copy and paste fix for just the font issue?
     
  9. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    4.6.1 added a new call out from the runtime into the code that @F.Salka mentioned. No previous version of Unity had this call. So the check for the font location only arrived once Apple changed the font locations. There is no change to the Xcode project that will solve this in your 4.5 version. And we have no plans to release patch versions with this change in.

    I wouldn't say "upgrade to 4.6.1" if there was an easier Xcode fix for you to make. There isn't a 2 minute copy and paste fix for just the font issue.
     
  10. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    639
    OK, thank you very much for the explanation Graham, I wasn't sure if just a couple Xcode functions could be updated, which is what I was hoping for, but unfortunately not.

    I will be updating then! Thanks for your time.
     
  11. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Obviously if there was a simple fix I'd have presented it.
     
  12. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    639
    Ok, sorry for assuming you were just trying to say upgrade and move on instead of posting a viable solution without a full version upgrade. I should know better that you guys would go above and beyond to help us out than just blow us off with a "just upgrade already" attitude.

    Thanks again, and sorry for the misunderstanding.

    :)
     
  13. Nickjd331

    Nickjd331

    Joined:
    Aug 22, 2014
    Posts:
    29
    Thanks Richard, your message gave me the answer I needed, as I also just discovered I was suffering from this issue.

    I just imported a basic system font from my computer into the unity project as a dynamic font, and then assigned it to my GUI:

    public Font newFont;
    GUI.skin.font = newFont;

    This fortunately means I don't need to upgrade my project to the newer 4.6.1 version of Unity, which would have meant I needed to rewrite a significant portion of my iOS specific code.
     
  14. thingiebox

    thingiebox

    Joined:
    Feb 23, 2013
    Posts:
    21
    Reviving this thread, we are using Unity 5.1.1 over here, on iOS 9 beta, we are seeing app freezes when displaying Japanese, Simplified Chinese, Traditional Chinese, Korean, Russian, Hindi, Bengali, Thai. We are using dynamic font to display the text.

    Saw 5.1.3 release note there has been fixes that are related "(706601) - iOS: Fixed a regression that caused very poor performance of trying to load non-existing system fonts. " We upgraded to 5.1.3f1, now we get black screen sometimes; characters sometimes get displayed, sometimes don't. It seems rather unstable. We are also seeing character issues now on iOS 8 too, which used to work fine with 5.1.1f1.

    Any insight how to fix?

    Thanks!
     
    Last edited: Sep 1, 2015