Author Topic: Fonts preparation pipeline (Mobile + Multisize(conditional retina) + Eastern)  (Read 11064 times)

artfabrique

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 45
    • View Profile
Hi there!
What is the best approach for fonts management/preparation/ui-architecture(NGUI) if we need this to be done:
1) We need to be able to display nicknames like "--=次访谈中WithFist=--". Mobile multiplayer multilengual game including arab, chinese,cyrillic & latin.
2) Fonts rendering should avoid trilenear smoothing and appear crisp&sharp and on iPhone4s and on iPhone 6s+ and on Nexus 5.
 - If it will be a bitmap font i guess there should be kind of UILabel wrapper that will switch between x1 x2 sized bitmap fonts. For ex. UILabel size: 24 should use MyFont_24 on iPhone4s but MyFont_48(or MyFont_24x2) on iPhone6s+
 - If it will be a dynamic font than why there is a size property there? Or dynamic means "set of characters will be baked during runtime but in specified size"? Or what exactly means "dynamic" in NGUI UIFont and why there is a size property (there is one already in ttf font import settings inspector(unity native))
 - If it will be a Unity font than we have a size property in the import setting of the TTF as well and we have no ability to use [bb] codes, which is bad

For now we see a problem with "per-glyph" font fallback.
For example we have nickname --=次访谈中WithFist=--. We can do something like break this into 3 UILabels and anchor them in chain. 1)--= 2)次访谈中 3)WithFist=-- But it becomes very complicated when you have this nickname inside a long text...
« Last Edit: February 04, 2016, 02:36:15 AM by artfabrique »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
If you want to include eastern languages, and you choose to use bitmap fonts, expect your generated font textures to be huge. 2048x2048 will work for a small font, but anything decently sized will fill up your 4096x4096 texture quickly. 4k textures won't work well if at all on older devices, plus they eat up a ton of memory. You can stick to dynamic fonts instead, which will mean that it will be up to Unity to manage memory for you based on whatever characters you need at the given time. That said, I don't know if all the issues with dynamic fonts have been resolved. There have been countless problems over the years.

Dynamic font's size property is a legacy Unity setting. It controls the size of the font for when you're printing it using Unity's 3D text.

You can use bbcode in dynamic font labels for things like italics, bold, hyperlinks, etc -- just not emoticons. Emoticons come from atlases, and dynamic font labels don't use atlases.

If you want to support emoticons as well and those emoticons will only be to the left or right of your text, I suggest using 2 labels instead. One for text, and another for emoticons.

artfabrique

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 45
    • View Profile
If you want to support emoticons as well and those emoticons will only be to the left or right of your text, I suggest using 2 labels instead. One for text, and another for emoticons.
We decided to go with dynamic fonts. As for emoticons.. if there is a way to get a single char-quad(unicode of emoji) position we can create some component that will listen OnChange of a label and if changed the child smiles took from pool/instantiated into right positions.

artfabrique

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 45
    • View Profile
You can use bbcode in dynamic font labels for things like italics, bold,
Nope. We can not, because bold and itallic are different fonts.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
It doesn't matter. NGUI labels don't need bold and italic fonts to print something in bold or italic.

artfabrique

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 45
    • View Profile
It doesn't matter. NGUI labels don't need bold and italic fonts to print something in bold or italic.
Lol  :) Any UI designer who is familiar with typography and importance of differences of regular/itallic/bold glyphs will shoot at you with a shotgun )))

But I understand that in most cases it's ok since most of games are not like Crusader Kings or EVE Online. This small differences are crucial when you have tons of text/tables etc and "readability" can really make this mess usable for player.