Search Unity

Issue with Font Names in Font Importing

Discussion in 'Web' started by DukeRoderick, Apr 20, 2017.

  1. DukeRoderick

    DukeRoderick

    Joined:
    Dec 25, 2015
    Posts:
    15
    Hi,

    We have an application that supports multiple languages. We need to support Chinese characters, and we have fonts that support them. I can even make a text field with the font specifically set to the Chinese font and have the characters appear on WebGL. The problem I'm having is that I can't seem to get our Latin character based font to fallback to the Chinese character font. When we switch languages we're just switching the characters in the fields to the new language, not changing the font set on the object. My understanding is that if we put the name of our Chinese font in the Font Names field of our Latin based font that when Unity encounters a Chinese character itshould know to fallback to the Chinese font that was set, correct? Right now we just get nothing to appear when the language is set to Chinese. I've noticed that the "References to other fonts in project" will show the text "No references to other fonts in project." if I deselect the font and reselect it. When I'm setting the Font Names and I have the "References to other fonts in project" open I can see Unity find the Chinese fonts. Could this potentially be a bug causing the grief?

    Thanks!
     
  2. svolders

    svolders

    Joined:
    Jan 17, 2017
    Posts:
    2
    Hi Duke

    I don't know if you're still monitoring this thread, but I've found a solution. We're running with text assets and meta files, so I could manually inspect the "ttf.meta" file of the font you want to create a fallback for with a text editor (as long as it's not a binary file). It seems that this isn't being serialized out properly. You can manually stitch the reference in by adding a new line under "fallbackFontReferences" you should be able to copy an existing line there and replace the guid with the font you want to fall back with.

    This was on Unity 5.5.3.f1 btw.

    Hope this helps you, or someone else in the future.
    Sean.
     
    ilmario and KevinGelking like this.
  3. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    This does sound like it might be a bug. Could you submit a bug report with a repro case and post the case number here?
     
  4. svolders

    svolders

    Joined:
    Jan 17, 2017
    Posts:
    2
    Sorry I didn't see your message till now, we've been super busy with a platform submission. I've had some time while making a build to create a sample project. The project I experienced this in is a massive commercial one with a tonne of moving parts so I've tried to create a simplified project to reproduce this in, and you can definitely see the editor/inspector acting strangely.

    I submitted this bug twice, actually. But the first time I mistyped my email address, so if you see it twice that's why.

    Here's the case number: 918923
     
  5. KevinGelking

    KevinGelking

    Joined:
    Jul 17, 2014
    Posts:
    15
    I'd just like to bump this once as it affects our project as well, using Unity 5.6.3p1.
    Also, thanks @svolders for describing your workaround. It seems to work for us as well to manually edit the meta files to set up the fallbacks.
     
  6. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Thanks for the bug report. It looks like we already fixed it internally, so in a future release it should work as expected (2017.3 and 2017.2)
     
    Last edited: Aug 31, 2017
  7. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    You can follow the status of the bug at this issue tracker.
     
  8. flashmandv

    flashmandv

    Joined:
    Mar 26, 2015
    Posts:
    156
    Is there any patch for this?
    Unity 2017.2 and 2017.3 is screwing my project's shadows and light very badly.
    I don't want to upgrade.
    I wonder if all these releases are adding more stuff or breaking more stuff..
    Big thanks to @svolders which solution seems to work (but only for one of my fonts.)
    Does anyone know what is fileID field supposed to mean and how do I find the correct value?
     
  9. KevinGelking

    KevinGelking

    Joined:
    Jul 17, 2014
    Posts:
    15
    Fixed in 2017.2 - a version we cannot upgrade to due to end of our perpetual licenses. The workaround described is definitiely cheaper than a multi-thousand $$$ update with tons of breaking scripts. :)

    Will the issue tracker get updated as well when fixes are cherry picked upstream to older versions? The issue emerged in 5.5, I'd assume it should be fixed up to that version as well.