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

Android Localization

Discussion in 'Android' started by erica.sampson, Dec 14, 2010.

  1. erica.sampson

    erica.sampson

    Joined:
    Jul 9, 2009
    Posts:
    158
    I noticed this morning that dynamic fonts are not supported when building for android - which doesn't really surprise me, however it made me wonder how one might go about setting up Localization.

    If, as the the error below suggests, only the default ASCII set of characters are imported, how might I go about implementing a multilingual application that supports both English and Chinese language selections?

    error :"Dynamic Fonts are not supported on this build platform. The font Assets/Fonts/MyriadPro-Bold-30pt.otf will be imported with the default ASCII set instead."
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Chinese will not work on mobile, independent of how you do. Generally any asian and asian letter amount language won't. The only way to make them work is create special fonts that cover exactly the letter you need so they can fit onto a single texture ...

    all other languages can basically be covered by setting the font to UTF8 and providing a font that covers more than ASCII
     
  3. George S

    George S

    Joined:
    Jul 28, 2009
    Posts:
    54
    Any idea is there will be support in the future for Chinese? It is a fairly large market after all.
     
  4. etoiles

    etoiles

    Joined:
    May 13, 2008
    Posts:
    216
    So is our only option right now for Chinese localization to 'bake' all text into images? Or is there a more elegant way to handle this?
    thx
     
  5. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    You can create a chinese font that contains all "letters" you need and then let unity create a font image from it.
    But if you need more letters than fit into the max texture space, as any full font for asian will normally do, then you have no way writing around your own bitmap font system with multi font texture support.

    this holds for iOS and Android by the way as dynamic fonts are not supported on either.


    @George: the problem is not about supporting it, the problem is that the sheer amount of letters just don't fit onto a single texture and you thus will fail if you don't have a game specific font that covers the letters you need
     
  6. radheshyam

    radheshyam

    Joined:
    Aug 21, 2010
    Posts:
    58
    @Dreamora: when Chinese will be supported in Mobile (Android iOS) ??
     
  7. Tseng

    Tseng

    Joined:
    Nov 29, 2010
    Posts:
    1,217
    Probably when the devices get powerful enough to create dynamic fonts on the fly without a performance hit? So in like 5-10 years.

    The problem is, fonts for mobile phones games are converted into a texture. Every letter is "drawn" on one texture and that texture is used to display it. That's the reason why you can't change the font size, formatting (bold, italic etc.).

    A font gets converted into an image like this:


    You see a normal font with 256 characters fits on a 512x512 texture, that's 32x32 pixel for each character. Chinese has 87.000 different characters. For the same of simplicity, let's assume 65.536 letters. If you want to put tis on a texture, with 32x32 pixel (which is very low resolution for chinese letters imho), then you'd need a texture with 256x256 characters each 32x32 pixels.

    that's a 8192x8192 texture. This is a huge performance impact on every Smartphone. Just as a side note, that's 256 MB Bitmap file. There is no smartphone which could handle such an texture. even most PC Graphic cards won't such huge textures (most graphic cards can only read 4096x4096 textures). Even compressed, that image is 64 MB in size.
     
  8. FWCorey

    FWCorey

    Joined:
    Feb 2, 2011
    Posts:
    40
    It's too bad we can't create static text strings for those platforms so the compiler would know which letters or glyphs are used and as part of the optimization only include those in the texture it creates. That would allow for reasonably sized textures for Chinese fonts as well as smaller textures for standard ASCII fonts. It would, of course add a bit of complexity to localization on the developer end, but not much.