Author Topic: TMPro - Creating Large Custom Font Asset (Korean Characters)  (Read 10169 times)

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
In this video, I show how to create a custom font asset that include all 11172 Korean Hangul characters. I also demonstrate how to create a font asset that contains only certain characters which I copy / pasted from a website.

<a href="https://www.youtube.com/v/w0No_E9vqAk" target="_blank" class="new_win">https://www.youtube.com/v/w0No_E9vqAk</a>
« Last Edit: July 11, 2014, 12:31:35 AM by Stephan B. »

doktor3d

  • Beta User
  • Jr. Member
  • *
  • Posts: 54
Re: TMPro - Creating Large Custom Font Asset (Korean Characters)
« Reply #1 on: January 20, 2015, 02:30:55 PM »
I am having trouble getting usable quality rendering from a Korean font. Unfortunately I need all 11k glyphs in my font as I have dynamic/unknown strings in my application. Even at 4k x 4k and 32-bit SDF the characters appear significantly distorted from what they should appear.

What would be the optimal settings to ensure as high quality as possible rendering? I have tried a bunch of settings, but as these assets take time to generate, I have not tried an exhaustive list. Trying the settings as in your video don't result in high enough quality.

Thanks!

doktor3d

  • Beta User
  • Jr. Member
  • *
  • Posts: 54
Re: TMPro - Creating Large Custom Font Asset (Korean Characters)
« Reply #2 on: January 21, 2015, 06:32:54 AM »
More experimentation has led me to the following settings giving quite good results:
- size = 37
- padding = 2
- distance field = 32bit

I am continuing to play with the trade-off of size vs padding at the moment. Less than 2 padding allows a size increase to around 43 but quality is not high. Less than around 30 font size allows 4 padding, but again is not high quality. Currently building with 35/3/32bit and optimum packing, so will see how that goes.

I am trying to pack 11411 characters into a single 4k font. This appears to be just around on the threshold of acceptable rendering quality results! Quality is still MUCH better results than a bitmap font approach so very thankful to have a solution like TMPro!
« Last Edit: January 21, 2015, 06:34:29 AM by doktor3d »

mahdi_jeddi

  • Newbie
  • *
  • Posts: 4
Re: TMPro - Creating Large Custom Font Asset (Korean Characters)
« Reply #3 on: February 13, 2015, 01:24:58 AM »
I think the better approach for eastern languages is to include only the unique characters that are used in your game. That way you only need to add a few hundred characters vs. few thosands. But of course for that you have to first get the localization text, and everytime the text changes you have to recreate the font asset. Also, it depends on how much text you have. For an RPG game with lots of text it may not help that much.

doktor3d

  • Beta User
  • Jr. Member
  • *
  • Posts: 54
Re: TMPro - Creating Large Custom Font Asset (Korean Characters)
« Reply #4 on: March 19, 2015, 07:57:18 PM »
Stephan, what would it take to enable 8k sdf bitmaps. Being able to use an 8k x 4k (or even 8k x 8k) texture would solve our problems with large font assets.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Re: TMPro - Creating Large Custom Font Asset (Korean Characters)
« Reply #5 on: March 19, 2015, 08:08:16 PM »
Stephan, what would it take to enable 8k sdf bitmaps. Being able to use an 8k x 4k (or even 8k x 8k) texture would solve our problems with large font assets.

I haven't checked this in a while and it may have changed but the 4K limitation was on the Unity side. For mobile is has always been 2K. I'll check if this has changed lately.

doktor3d

  • Beta User
  • Jr. Member
  • *
  • Posts: 54
Re: TMPro - Creating Large Custom Font Asset (Korean Characters)
« Reply #6 on: March 19, 2015, 09:23:01 PM »
I'm successfully using 4k x 4k assets on android. 4k x 8k (or the full 8k) would really help us out!

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Re: TMPro - Creating Large Custom Font Asset (Korean Characters)
« Reply #7 on: March 20, 2015, 03:51:45 AM »
I'm successfully using 4k x 4k assets on android. 4k x 8k (or the full 8k) would really help us out!

I have added the ability to generate 8K X 8K Font Assets but be prepared for those Distance Field 16 and Distance Field 32 to take a while to compute.

You will need to use appropriate padding values to maintain a decent range on properties like Dilation, Outline, Underlay, etc... and to avoid the Grey Ghost outline. I am doing a test right now using the 3500 Commonly used Chinese characters in a 8K X 4K Font Asset. The results in a 64 point sampling which should produce a very nice font.

I'll post an example tomorrow since my computer is still computing the Distance Field 16. At these sizes, this feels like the early days of Ray Tracing on the Amiga 1000 with Sculpt 3D where I had to let it render over night to get a "checkered floor with a chrome ball" :)  I know that sort of dates me.


doktor3d

  • Beta User
  • Jr. Member
  • *
  • Posts: 54
Re: TMPro - Creating Large Custom Font Asset (Korean Characters)
« Reply #8 on: March 24, 2015, 04:35:44 AM »
This is awesome news, thanks Stephan! I'm upgrading my project now to check it out.