Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Eng>Vietnamese [Vi] trouble With the “.fnt font file”

A topic by Menurva created 36 days ago Views: 162 Replies: 8
Viewing posts 1 to 3

Hello, and good day to you all. We really have some trouble during the process of switching font for this game. Technically, all the text in game were run in the “.fnt font type” and sadly it doesn’t support Vietnamese translation. We tried to find another Vietnamese friendly “.fnt font” out there but it seems to be no luck. Now our only hope was to convert a “.ttf font into .fnt”. I have made a test this afternoon but failed to run the game. Please help because this is our first time joining Locjam and I was so confused 🥹

moved this topic to Community help
(+2)

You can use fontbm to convert a ttf font to the required format, it's what I used to make the fonts for the game (I'm one of the authors). The font should be a pixel font and ideally a similar size to the one already there (although the engine will allow any size). There are some subtleties regarding the outlined version of the font (which I recommend having for legibility): when you create the font with fontbm you should add 1 pixel of padding in all directions, so that you can edit the resulting image to add a 1 pixel border. I made a script to do the outline for me, so I can help if needed.

One other thing to keep in mind is that the font should also support english text, otherwise the source will need to be modified to allow changing between fonts depending on the language chosen at the beginning.

Thank you Mr. Apicici,  I have succesfuly converted the ttf file to fnt, but there was a new problem that occured sir, the game, it doesn't read the font file, and everything just went black. I don't know if I have to change anything in the source code  for this to work out, or not,  could you please guilde me through? 

(+1)

If I remeber correctly, others have been implementing alternative fonts. Maybe they can share their experience too?

Yes, you are right, I have search for a similar post about font issues, and I can see there is a a friend coame from Thailand seem to have the same problem as I do, but they also seem to know how to figure it out

(+1)

Are you able to access the javascript console of your browser? That would allow you to get the error message from the browser so we can figure out what the problem is. If you don't know how to do that you can upload your project to itch and send me the link, so I can take a look at it for you.

(+1)

Hi apicici,

I got the font working, but with outline = 1 on bmfont, the outline is barely visible in-game. Increasing to 2 introduce black smudges, which is worse. Maybe some manual editing of the fnt font is needed?

(+1)

i use photoshop to set it  outline, the result was positive, maybe you could try to edit the font png file manually. notice that this may required you to spend a lot of time editting each letters from the font. That's what I do to deal with this issues

That's what I did to make the outline (and the reason why I said to add the padding), but I created a script to do it for me instead of having to edit manually.

A way to make the outline manually that's easy is to create 8 copies of the font omg, offset by 1 pixel in all directions (including diagonally), make them all black and merge them, then add the original on top.