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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

WebGL arial font rendering

Discussion in 'WebGL' started by Mloren, Jan 7, 2016.

  1. Mloren

    Mloren

    Joined:
    Aug 20, 2011
    Posts:
    83
    I have some UI elements using the Canvas system, they currently use the default Arial font.
    When I export to WebGL, the font's look considerably different to when viewed in the editor:

    (Editor on left, WebGL on right)
    fonts.png

    My main issue is the bold text in the word "Awake". WebGL is putting the letters very close together and it's not as bold.

    I found an example of bold arial font on a webpage so I could make sure my browser wasn't just rendering the font differently and on a normal website it looks fine, just like the editor version.

    I haven't tested yet whether putting my own font in will also suffer this problem, but it seems odd that the font would be rendered that differently in WebGL.
     
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Unity WebGL does not have access to system fonts. Basically you need to provide your own fonts to have the WebGL build to be consistent with what you see in the Editor
     
    ga_ptit likes this.
  3. sonxoans2

    sonxoans2

    Joined:
    Apr 17, 2015
    Posts:
    25
    How to import system fonts for WebGL..
    Help me, please!
     
  4. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    You need to import your own font into the project. See here and for more details.
     
  5. sonxoans2

    sonxoans2

    Joined:
    Apr 17, 2015
    Posts:
    25
    Thank you for reply!
     
  6. miirriim1994

    miirriim1994

    Joined:
    Nov 8, 2018
    Posts:
    1
    I have same problem. in WebGL build i cant see "Armenian" text
     
  7. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
    How did you solve the issue? please mention the answer
     
    GubaLord likes this.