ZDaemon Forum Index ZDaemon
Client/Server DOOM
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help with displaying images with custom fonts.

 
Post new topic   Reply to topic    ZDaemon Forum Index -> Wad Editing
View previous topic :: View next topic  
Author Message
EarthQuake
Wicked Sick!


Joined: 02 Apr 2004
Location: Athens, Ohio. Dieblieber gonna getcha!

PostPosted: Thu Jul 16, 2015 7:37 pm    Post subject: Help with displaying images with custom fonts. Reply with quote

I've been wracking my brain over this for a couple days now.

Currently, it's possible to display images using SetFont() along with a custom font in FON2 format. I've seen this done in several wads, and would like to use this feature for myself.

I have a Doom-palette indexed bitmap here with my custom graphic. Index color 0 from the palette is being used for transparency, and index 255 is the color used for the box that surrounds my graphic.

The script I use for ImageTool is as follows:
Code:
load "source.bmp";
transparentcolor 0;
font "MYFONT.lmp";

This does not raise any errors, and ImageTool tells me so-and-so pixels were processed.

In my ACS, I am using the following:
Code:
SetFont("MYFONT");
Print(s:"A");


Slade3 recognizes the file as a FON2 font, and I even inserted a custom font that was used in someone else's wad, just as a control test. I cannot get any of these custom fonts to display. I've used the HudMessage() function as well, but the results are the same. Am I just not printing the correct characters or am I doing something fundamentally wrong here? I don't have access to the scripts in wads where this is actually used successfully.

I really don't know where to obtain any more information...
Back to top
View user's profile Send private message Send e-mail
Krawa
There is a limit


Joined: 23 Nov 2008
Location: #SDA

PostPosted: Thu Jul 16, 2015 8:04 pm    Post subject: Reply with quote

I used font on kill_em_all6 created with imagetool. The source pcx file (-ARROW) is also in the wad. The arrows are number 1 to 7.
Maybe that helps you.
Back to top
View user's profile Send private message Visit poster's website
EarthQuake
Wicked Sick!


Joined: 02 Apr 2004
Location: Athens, Ohio. Dieblieber gonna getcha!

PostPosted: Thu Jul 16, 2015 10:20 pm    Post subject: Reply with quote

For anyone reading this, Krawa helped me figure it out.

All fonts, regardless of format can contain up to 256 characters. Each of those character slots can have a graphic. The CONFONT format (FON1) automatically splits these up into 256 slots, but with the BIGFONT format (FON2), you have to define the slots yourself by surrounding each character graphic in a box using color index 255.

My problem was that I only had one slot defined: one graphic with one box around it. The first character slot is not printable as I discovered, but the next slot is (which corresponds to "!"). It looks like an empty space character (" "), but it seems to be some null character instead. Krawa remedied this by putting a blank character (surrounded by it's own box) just before my graphic's box.

Also, instead of using a script with ImageTool, I just used the command line instead:
Code:
imagetool.exe font "myfont.bmp" "myfont.fon2"
Back to top
View user's profile Send private message Send e-mail
Maikl_Russia
has entered the game!


Joined: 18 Jul 2005
Location: RU

PostPosted: Tue May 31, 2016 6:24 pm    Post subject: Reply with quote

Cool. Thanx guys! All works fine. Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ZDaemon Forum Index -> Wad Editing All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group