Smallfont help from PNG?

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Post Reply
SuperAble
Posts: 38
Joined: Tue Jan 02, 2018 9:04 pm

Smallfont help from PNG?

Post by SuperAble »

Hi, been planning a mod that uses the in-game font style from the Sega CD version of The Terminator that I've extracted,but the only thing is which program should I use to turn this image into a lmp that can be use as either a BIGFONT or SMALLFONT?
Looking through the DoomCrap bundle and looked at the font generator and batch image tool but not sure of these are the right programs to do so. If anyone would like to help me out, it would be a pleasure.
Last edited by SuperAble on Mon Mar 02, 2020 11:47 pm, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Smallfont help from PNG?

Post by Graf Zahl »

With the new font setup you do not really need to convert it to a binary font file. Just create a directory fonts/SmallFont inside the PK3 and put each character in there with a 4 digit name matching each character's ASCII value in Hex.

If you only need to use it with a fixed pitch like in your image it will become even easier because you can use that image as-is with a little added setup.
SuperAble
Posts: 38
Joined: Tue Jan 02, 2018 9:04 pm

Re: Smallfont help from PNG?

Post by SuperAble »

Graf Zahl wrote:With the new font setup you do not really need to convert it to a binary font file. Just create a directory fonts/SmallFont inside the PK3 and put each character in there with a 4 digit name matching each character's ASCII value in Hex.

If you only need to use it with a fixed pitch like in your image it will become even easier because you can use that image as-is with a little added setup.
So, make a folder named Fonts, then make a subfolder named SMALLFONT, then import each character with the file names corresponding to a letter/number/symbol i.e. a png of "A" should be A.png, etc...?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Smallfont help from PNG?

Post by Graf Zahl »

No. You need the numeric code for each character in hexadecimal. A is 0041.png, for example, Z is 005A.png. You'll find the numbers when googling for "ASCII".
SuperAble
Posts: 38
Joined: Tue Jan 02, 2018 9:04 pm

Re: Smallfont help from PNG?

Post by SuperAble »

Graf Zahl wrote:No. You need the numeric code for each character in hexadecimal. A is 0041.png, for example, Z is 005A.png. You'll find the numbers when googling for "ASCII".
Now what about spacing?
Talon1024
 
 
Posts: 374
Joined: Mon Jun 27, 2016 7:26 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Contact:

Re: Smallfont help from PNG?

Post by Talon1024 »

If you make a file named "font.inf" in the same folder where your font character PNGs are, you can specify spacing, kerning, etc in that file.

To make spaces 4 pixels wide, put this in your font.inf:

Code: Select all

SpaceWidth 4
Other directives you can add to this file include:

Code: Select all

Kerning <int> // Space between each character

Scale <decimal>[, <decimal>] // Scale (size factor) for each font character

FontHeight <int> // How tall should lines be

CellSize <int>, <int> // Width and Height for each character. MONOSPACE FONTS ONLY!

TranslationType console // I have no idea what exactly this directive does
OR
TranslationType standard // default
SuperAble
Posts: 38
Joined: Tue Jan 02, 2018 9:04 pm

Re: Smallfont help from PNG?

Post by SuperAble »

I'm more into wanting to know on how to make a font lmp similar to ones seen in the PSXDoom TC where it's like a row of letter/character graphics:
FontsSlade.PNG
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Smallfont help from PNG?

Post by Enjay »

Originally they were done with imagetool.
SuperAble
Posts: 38
Joined: Tue Jan 02, 2018 9:04 pm

Re: Smallfont help from PNG?

Post by SuperAble »

Enjay wrote:Originally they were done with imagetool.
Is there a certain character layout I have to use?
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Smallfont help from PNG?

Post by Enjay »

The text file inside the zip explains the layout. The only thing that (from memory) that it is silent about is the fact that a double-width line between characters means "the glyph is blank" and a blank character is inserted at that point. So watch for double width frames around some of the characters.

I think, for example, there is a double line after the ? in bigfont.pcx meaning that the space for the next character (I think it's @) is accounted for even though there is no graphic for it.

[edit] There's another one between % and ' and the missing character in this case is &. [/edit]
SuperAble
Posts: 38
Joined: Tue Jan 02, 2018 9:04 pm

Re: Smallfont help from PNG?

Post by SuperAble »

problem solved.
Last edited by SuperAble on Mon Mar 02, 2020 11:48 pm, edited 1 time in total.
User avatar
Kappes Buur
 
 
Posts: 4120
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Re: Smallfont help from PNG?

Post by Kappes Buur »

If you want to use BHS's font generator, then maybe this tutorial will help. :)
SuperAble
Posts: 38
Joined: Tue Jan 02, 2018 9:04 pm

Re: Smallfont help from PNG?

Post by SuperAble »

Kappes Buur wrote:If you want to use BHS's font generator, then maybe this tutorial will help. :)
Followed their steps, yet I'm not getting the .lmp file. Just only a brief second of the cmd prompt popping up and closes twice with no finalized product whatsoever.
User avatar
Kappes Buur
 
 
Posts: 4120
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Re: Smallfont help from PNG?

Post by Kappes Buur »

I couldn't make the font work from your image file either, so I downloaded a font, Gamer.ttf, which is pretty close, and ran it through BHS's FG, following the above tutorial,
Spoiler:
Post Reply

Return to “Assets (and other stuff)”