Font¶
It can handle four bitmap fonts as one of the font texture.
When you convert these four bitmaps, it uses the A channel of the bitmap file. Four A channels are mapped to each channel(R,G,B,A) of a single texture.
If the number of bitmap exceeds 4, it can’t be handled as a single font data.
Created as a resource data¶
Make a FontResource folder under the “Assets/KsSoft/” folder.
You put the text file and bitmap files that are named with FiveCC under the folder.
If you want to create a font named “cfn20”, you need to prepare the files such as follows.And you place these in this location.
cfn20.fnt
cfn20_0.png
cfn20_1.png
cfn20_2.png
cfn20_3.png
You highlight the “cfn20.txt”, and choose the [Right-click]→[Export]. Files such as the following are generated under the “Resources” folder.
cfn20.font
cfn20.tex
By these steps,your application can use the “cfn20” as a font data.
Created as an asset bundle data¶
Make a Fonts folder under the “Assets/KsSoft/” folder.
You put the text file and bitmap files that are named with FiveCC under the folder.
If you want to create a font named “fn16”, you need to prepare the files such as follows. And you place these in this location.
000_001_00000/fn16/fn16.fnt
000_001_00000/fn16/fn16_0.png
000_001_00000/fn16/fn16_1.png
000_001_00000/fn16/fn16_2.png
000_001_00000/fn16/fn16_3.png
Also, when you want to use multiple fonts, put the number required by the same procedure.
If you are ready, run the [Tools]->[KsSoft]->[Export Fonts].
The following asset bundles are generated.
assetbundles/Windows/000_001_00000.unity3d
Within this asset bundles are stored all font data required.
Note
When you want to change the default value, please reference here .
Multilingual¶
Depending on the language your app is using, you can swap bitmap fonts.
The default bitmap fonts load from 000_001_00000.unity3d.
Depending on the locale at startup, the corresponding 000 _ 001 _ XXXXX.unity3d, if present, is preferentially read.
The locale and asset bundle IDs are mapped as follows:.
000_001_00000 |
Default |
|
000_001_00001 |
AR |
Arabic |
000_001_00002 |
EU |
Basque |
000_001_00003 |
BE |
Belarusian |
000_001_00004 |
BG |
Bulgarian |
000_001_00005 |
CA |
Catalan |
000_001_00006 |
ZH |
Chinese |
000_001_00007 |
CS |
Czech |
000_001_00008 |
DA |
Danish |
000_001_00009 |
NL |
Dutch |
000_001_00010 |
EN |
English |
000_001_00011 |
ET |
Estonian |
000_001_00013 |
FI |
Finnish |
000_001_00014 |
FR |
French |
000_001_00015 |
DE |
German |
000_001_00016 |
EL |
Greek |
000_001_00017 |
HE |
Hebrew |
000_001_00018 |
HU |
Hungarian |
000_001_00019 |
IS |
Icelandic |
000_001_00020 |
ID |
Indonesian |
000_001_00021 |
IT |
Italian |
000_001_00022 |
JA |
Japanese |
000_001_00023 |
KO |
Korean |
000_001_00024 |
LV |
Latvian |
000_001_00025 |
LT |
Lithuanian |
000_001_00026 |
NO |
Norwegian |
000_001_00027 |
PL |
Polish |
000_001_00028 |
PT |
Portuguese |
000_001_00029 |
RO |
Romanian |
000_001_00030 |
RU |
Russian |
000_001_00031 |
HR |
SerboCroatian |
000_001_00033 |
SL |
Slovenian |
000_001_00034 |
ES |
Spanish |
000_001_00035 |
SV |
Swedish |
000_001_00036 |
TH |
Thai |
000_001_00037 |
TR |
Turkish |
000_001_00038 |
UK |
Ukrainian |
000_001_00039 |
VE |
Vietnamese |
000_001_00040 |
ZS |
ChineseSimplified |
000_001_00041 |
ZT |
ChineseTraditional |
000_001_00100 |
AF |
Afrikaans |
The font data generating method of BMFont¶
Introduce a method of making bitmap fonts by the BMFont(Bitmap Font Generator).
Creating a bitmap font¶
Font Settings
First, select the font you want to use. Select the [Options]→[Font Settings] from the menu.
Then select the font type and font size.
Put a check in the [Match char height].
Put 100 to [Hieght%].
Export Options
Next, to set the Export. Select the [Options] → [Export Options] from the menu.
You change the value of the part of the following red frame.
Select the character that you want to include
Then you select characters included in the bitmap font.
confirmation
Ensure that you are correctly output along the items set. Select [Options] → [Visualize] from the menu, you can preview.
Make sure that bitmap number is within four.
If the bitmap number is one, almost always it may be possible to reduce the data size. You try to adjust the texture size that the bitmap number may be four.
Output
This configuration is complete.
Select the [Options] → [Save bitmap font as …] from the menu, and then output bitmaps.
You need to save the file using a FiveCC .
Finally, you need to change the “fnt” extension to “fnt”.