Author Topic: Fonts in Android  (Read 7526 times)

redhawk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 34
    • View Profile
Fonts in Android
« on: July 20, 2014, 08:51:02 PM »
My fonts look terrible on my devices.  I've pulled some nice fonts from dafont.com, used BMFont, imported in Unity, and created my fonts.  I'm trying to use 2 different devices.  One is an old Tablet (so I can test the view on tablets), and the other is an old Galaxy phone (so I can test on older phones).  The fonts look perfect on my computer.  They are very fuzzy on my devices.  Even if I use the Coalition font, it looks bad.  Mainly the fonts look bad on my buttons.

I'm obviously missing some step.  Maybe in my build settings.  Maybe .... I just don't know.

Any advice on what the settings should be?  I've watched a few videos, which made sense, but it still doesn't look good on my Android build.

Using Unity 4.3...blah, and the newest NGUI.  I do not want to upgrade to 4.5 yet.  The Unity version shouldn't really matter.  Maybe I need a different font, but that just seems odd.

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Re: Fonts in Android
« Reply #1 on: July 21, 2014, 03:35:30 AM »
If using BM font, I guess the texture format+ compression is ruining them on Android. Try settings and make sure the font chars a good size.

redhawk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 34
    • View Profile
Re: Fonts in Android
« Reply #2 on: July 29, 2014, 10:23:39 PM »
I figured out how to make this work (after lots of trial and error).  On the UI Labels I set them to Keep Crisp = Always.  This allows me to set the size to whatever looks nice in Unity, then when I play may game on any Android device, the font looks very nice.

Select a Label that you have.
The 3rd item below your Text is called Keep Crisp.  Set this to Always.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Fonts in Android
« Reply #3 on: July 30, 2014, 10:22:55 AM »
Keep crisp option is not a good option for mobiles as it causes fonts to be generated at the pixel-perfect size, which may not be what you want due to increased memory usage. It's best to stick to bitmap fonts, not dynamic fonts, which don't even have the "keep crisp" option. Make sure the font used by labels matched the default font size. If you try to shrink or grow the bitmap fonts, you won't get pleasing results. In all the games I've done I've always chosen 2-4 fonts at varying sizes and stuck to using those instead (for example: title font, large font, medium font, small font). You should also avoid "shrink to fit" option if the text doesn't fit, as it will also cause shrinkage, and thus reduced quality.

redhawk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 34
    • View Profile
Re: Fonts in Android
« Reply #4 on: July 30, 2014, 11:23:20 AM »
I will try this again with various sizes.  Maybe I am doing something wrong, because the only thing that looks good is the way I suggested.  I tested on a phone and tablet.

Orignally what I did was make a font sized to 30, but when I build and play, the font was very fuzzy which is why I had to change stuff.
« Last Edit: July 30, 2014, 11:45:44 AM by redhawk »

redhawk

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 34
    • View Profile
Re: Fonts in Android
« Reply #5 on: July 30, 2014, 12:28:16 PM »
Could you please tell me the steps for setting up the fonts as you mentioned.  From import to creating the sizes.

I want to use the below font from dafont.com.
http://www.dafont.com/crystal-radio-kit.font

I want sized 32 (or close), 24, 28, 60, and 20.

I even tried the fonts by the below Unity publisher with same results.
https://www.assetstore.unity3d.com/en/#!/publisher/1780

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Fonts in Android
« Reply #6 on: July 31, 2014, 10:43:49 AM »
1. Open the Font Maker and choose that TTF as the source.
2. Choose the desired target size, such as 32.
3. Choose where to add this font, if you want it to go into an atlas.
4. Hit the Create button.

That's it, you can now make labels with that font, and assuming the label size matches the exported size (shows as "default size"), it will be crisp. This all assumes UIRoot is set to Pixel Perfect, btw. If it's Fixed Size then you won't be able to get it to look crisp due to the nature of the Fixed Size approach.

When you need another font size, go through the 4 steps again.