What are different kind of Unity fonts and how to create non ttf ones? (.tex, etc.)

How to translate the files of a game
ToTheMadness
Posts: 6
Joined: Sun Jul 21, 2019 7:29 am

What are different kind of Unity fonts and how to create non ttf ones? (.tex, etc.)

Post by ToTheMadness »

I was able to import text in some games and change the fonts, thanks to the unity tools. but changing only the ttf fonts didnt work on some games. I noticed that there are other font types, for example one with .tex format.
Is there any other font type beside .tex? I saw a .spritefont too.
And how to create this non ttf fonts?
(also extra question, didn't wanted to create another topic for it, how can i edit raw or dump fonts (and also other file types) extracted by UABE? currently I'm using UnityEx for fonts and UABE for language files.)
akintos
Posts: 88
Joined: Tue May 08, 2018 7:48 pm

Re: What are different kind of Unity fonts and how to create non ttf ones? (.tex, etc.)

Post by akintos »

Sadly, UABE does not support modifying Font asset type.

But you still can export it raw, replace font data with hex editor and import it raw. It will be very... inconvenient though.

I recommend using UnityEx until UABE supports it or someone makes a plugin for it.


For other font types, I don't understand what .tex font you said means.

Texture assets are just font atlas images. There must be some kind of font information asset that stores glyph data, mostly in MonoBehaviour type.


For example, TextMeshPro fonts have three asset components (Material, Texture, MonoBehaviour)

Most of the time Material asset is empty so you don't have to change it.

Image

Image
yusuf0808
Posts: 41
Joined: Thu Jun 29, 2017 10:46 am

Re: What are different kind of Unity fonts and how to create non ttf ones? (.tex, etc.)

Post by yusuf0808 »

akintos wrote:Sadly, UABE does not support modifying Font asset type.

But you still can export it raw, replace font data with hex editor and import it raw. It will be very... inconvenient though.

I recommend using UnityEx until UABE supports it or someone makes a plugin for it.


For other font types, I don't understand what .tex font you said means.

Texture assets are just font atlas images. There must be some kind of font information asset that stores glyph data, mostly in MonoBehaviour type.


For example, TextMeshPro fonts have three asset components (Material, Texture, MonoBehaviour)

Most of the time Material asset is empty so you don't have to change it.

Image

Image


Hello @akintos.

Do you have any easy way to edit a TextMeshPro font? Other than adding every glyph one by one to the atlas texture and editing and testing the glyph parameters.
akintos
Posts: 88
Joined: Tue May 08, 2018 7:48 pm

Re: What are different kind of Unity fonts and how to create non ttf ones? (.tex, etc.)

Post by akintos »

yusuf0808 wrote:Hello @akintos.

Do you have any easy way to edit a TextMeshPro font? Other than adding every glyph one by one to the atlas texture and editing and testing the glyph parameters.


Create a Unity game project, make a TextMesh Pro font that has glyphs you need, build the game, extract your font from game asset files, import it into the game you want to translate.
yusuf0808
Posts: 41
Joined: Thu Jun 29, 2017 10:46 am

Re: What are different kind of Unity fonts and how to create non ttf ones? (.tex, etc.)

Post by yusuf0808 »

akintos wrote:
yusuf0808 wrote:Hello @akintos.

Do you have any easy way to edit a TextMeshPro font? Other than adding every glyph one by one to the atlas texture and editing and testing the glyph parameters.


Create a Unity game project, make a TextMesh Pro font that has glyphs you need, build the game, extract your font from game asset files, import it into the game you want to translate.


First of all thank you for helping. I had a problem with that.

When I import the atlas and the monobehaviour file my font doesn't show up. I think it is a problem with the monobehaviour file because when I import and then try to extract it from the changed file only these lines show up;

Image

I wanted to add Turkish characters to Crayawn font. Can you help me?

Here is the game's data files (Only resources.assets needs to change so I uploaded only that with Managed folder.):

https://drive.google.com/open?id=1fqSwXxrM6rucsmu7vb2KhyjKkAqcXrB6

Here is the font with Turkish characters:

https://drive.google.com/open?id=10q315hCkvG1T0tigdn_p1_k91aVBIcny

And here is the decimal range for all the characters needed:

32-126,160,199,212-214,220,231,246,252,286-287,304-305,350-351

I would be so grateful if you can help me.
ToTheMadness
Posts: 6
Joined: Sun Jul 21, 2019 7:29 am

Re: What are different kind of Unity fonts and how to create non ttf ones? (.tex, etc.)

Post by ToTheMadness »

akintos wrote:
yusuf0808 wrote:Hello @akintos.

Do you have any easy way to edit a TextMeshPro font? Other than adding every glyph one by one to the atlas texture and editing and testing the glyph parameters.


Create a Unity game project, make a TextMesh Pro font that has glyphs you need, build the game, extract your font from game asset files, import it into the game you want to translate.

Thank you! for both of the replies.
I found the atlas and glyph info file and a tool for creating the fonts from the BMFont but I couldn't figure it out.
Here is the link to the post:
viewtopic.php?f=12&t=3430
and the download link to the tool which is called UnityFont:
https://yadi.sk/d/5QLHXNafgpdFs

EDIT:
It worked by testing some other games glyph data. looks like it's not fully compatible with all of the games.