Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

WebGL with Japanese and Chinese Font files won't run in Chrome

Discussion in 'WebGL' started by tmiller_vb, Jul 9, 2015.

  1. tmiller_vb

    tmiller_vb

    Joined:
    Dec 6, 2012
    Posts:
    19
    Hi there.

    I am in the process of localizing my app into multiple languages, and was doing absolutely fine until I built and ran the WebGL build. I am using Unity 5.0.2 on Mac OSX.

    My first attempt showed that Japanese and Chinese characters didn't show up at all, in any browser. It works in Unity, on iOS and Executable builds, and in WebPlayer mode, but not WebGL. In this case, I was using a regular font that could also display Japanese and Chinese characters.

    After that didn't work, I added in a couple of fonts that would respectively focus on Japanese and Chinese, and then I rebuilt for WebGL. It worked in Firefox perfectly. However, Chrome now crashes when the loading bar fills up.

    This crash occurs if I just happen to have the fonts in the Resources folder, even if I'm not referencing them anywhere in my app.

    I am very confused. Has anyone tried to use WebGL along with localization into Chinese or Japanese? Any help would be appreciated.
     
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    The need to add fonts to your project is expected. From the docs (http://docs.unity3d.com/Manual/class-Font.html):

    The crash in Chrome might be a memory issue, possibly caused by the bigger data file. If you provide a repro case (Ideally by reporting a bug and quoting the ticket number here), we can take a look.
     
  3. tmiller_vb

    tmiller_vb

    Joined:
    Dec 6, 2012
    Posts:
    19
    Thanks! It did turn out to be a memory issue. I didn't think a couple font files would add much, but it apparently did. I've reduced the file size and now it works as expected.