Jump to content


Photo

How to create custom font bam from ttf


  • Please log in to reply
1 reply to this topic

#1 lunar

lunar
  • Member
  • 1 posts

Posted 24 January 2023 - 04:45 AM

I learned to use this java file in this thread to create font files for bg2 original.

 

http://www.shsforums...onts-for-pt-pl/

 

 I understood and got it work. I can now create regular fonts in bam format for the old bg2 game. (arial, dejvu, helvetica vs. all work.)

However I can not make it create custom fonts from a fancy custom ttf file I want. I installed ttf file I wanted on my system, so it shows up in wordpad and the like. However when I put the command line with the custom font name, it does not work, it always creates the default font that the system falls back on.

Can you tell me how to mke it work with the custom ttf font I downloded?
My command line is:

java -jar fontb.jar -charset cp1250 -font "Fabada-18" -out C:\Users\user\tmp\normal.bam -useAA true -drawShadow false

 

This works if I swap Fabada with regular font like helvetica, but I want to create this Fabada font. Like I said I got it instlled on system, it shows up in wordpad as available. Wht do I need to do make java recognise this font?



#2 bzm

bzm
  • Member
  • 13 posts

Posted 05 March 2023 - 07:30 AM

Spoiler

 


Edit:

 

(linux)

First, copy ttf to /usr/share/fonts/truetype/yourfontdir/

Run: 

 

sudo fc-cache -f -v

 

 

To check if font is available in yours JVM:

 

https://community.ja...vailable-my-jvm

 

Then, it is best to run the command: 

 

java ListFonts >jvmfonts.txt

 

Where in txt search if there is your font.

 

Go with generator command, "Fabada 18". It should work.

 

For Windows you MUST Install chosen font FOR ALL USERS.

 

Coding:

Spoiler

 

In the attachment I will give you a .bam file.

 

Attached File  normal.bam   22.23K   47 downloads


Edited by bzm, 11 January 2024 - 09:41 AM.