Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / using own fonts?

Author
Message
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 26th Aug 2013 00:14
Hi, I found a neat program that allows you to create a png from a windows ttf, if anyone is interested it can be found here
but how do I implement the generated png into agk? My png I created is here

Hail to the king, baby!

http://davidjohnwheeler.blogspot.co.uk
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 26th Aug 2013 01:08 Edited at: 26th Aug 2013 01:09
If you are using a non-fixed font (or not including all the characters listed later in this post), then you need to create a sub images file that defines where, in the main file, each letter is.

The subimages file is named '<font file name> subimages.txt'. Substitute the name of the file that has the font images for '<font file image>' and leave the space in (I hate spaces in the file names, but this is how AppGameKit is set up).

The image file probably should have the characters in the order as follows: space !"#%&'()*+,-./0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

The subimages file looks something like this:


The first value is the ASCII code for the character. The second is the x offset for the start of the character in the font file. The third is the y offset. The fourth is the width. And the fifth is the height.

If your file does not have the full set of characters, then the subimages file should only have definitions for the one in the actual file.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 26th Aug 2013 01:11 Edited at: 26th Aug 2013 01:14
The easiest way to use bitmap fonts in AppGameKit requires that you have a fontmap text file ("fontname subimages.txt") that describes the coordinates of each character in the image. I don't think the program you linked to does that.

There are actually a few free font generators that other AppGameKit users have created that do a nice job and export a text file that is compatible with AGK. I've used both of the ones below:

http://forum.thegamecreators.com/?m=forum_view&t=189225&b=41

http://forum.thegamecreators.com/?m=forum_view&t=188359&b=41

P.S., Check out the Text - CustomText example included with AppGameKit to understand the syntax (along with AL's explanation).
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 26th Aug 2013 01:51
ok thanks, the first link is perfect xCept, creates the txt file needed!

Hail to the king, baby!

http://davidjohnwheeler.blogspot.co.uk

Login to post a reply

Server time is: 2024-05-09 07:25:55
Your offset time is: 2024-05-09 07:25:55