Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (582)
Games in Android Showcase (163)
games submitted by our members
Games in WIP (633)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  FontPacker - Pack TrueType fonts into your game  (Read 11086 times)
0 Members and 1 Guest are viewing this topic.
Offline davedes
« Reply #30 - Posted 2013-07-25 11:43:00 »

Does gdx-freetype support supersampling? If not, is there any freetype2 docs on it? I'd like to add it to my own tool.

Offline SHC
« Reply #31 - Posted 2013-07-25 15:50:44 »


Can you test the new beta 2? The binaries are here. I've updated to .Net Framework 3 to access the new font related classes.

Offline SHC
« Reply #32 - Posted 2013-07-25 15:53:44 »


I don't know of libGDX. I'm not using it.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Sammidysam
« Reply #33 - Posted 2013-07-25 18:51:12 »

Window ran fine again.  Last time I actually didn't test exporting the font which I really should have done.  Sorry.  This time I did, and I got a weird error.  I also got an exported file, however.  The error and the exported file are in the Pastebin links below.

The Error:
The Export:

I'll keep the file until you review the error, as Fedora's Pastebin does not have a never expire option.   Cranky  But calling "cat blah | fpaste" to upload makes it worth it.
Offline Nate

« JGO Bitwise Duke »

Medals: 164
Projects: 4
Exp: 14 years

Esoteric Software

« Reply #34 - Posted 2013-07-25 20:12:00 »

Does gdx-freetype support supersampling? If not, is there any freetype2 docs on it? I'd like to add it to my own tool.
Cool, I'll link your tool and the OP's tool on the wiki. Smiley Any chance you want to take over Hiero? Cheesy For supersampling, render at a high resolution, then scale down. You can change the high resolution and how you sample when scaling down as a way to get varying levels of antialiasing.

Offline SHC
« Reply #35 - Posted 2013-07-26 02:57:04 »


That exception is thrown by Mono itself. It failed to display the message box. The font file is fully generated and worked for me when tested. Can you say what version of mono you have? It's running fine on Mono 2.8 for windows.

Can you try to export in the previous version?

Offline SHC
« Reply #36 - Posted 2013-07-26 03:11:53 »


Thanks for adding this tool to your wiki. But you've written "The FontPacker tool uses Java's font rendering." which is incorrect. It uses the .Net Framework's classes
classes. The project is written in C#.

Offline SHC
« Reply #37 - Posted 2013-07-26 04:14:55 »


These lines in the error you've posted

Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.

Shows that there's an error in your mono installation probably. Could you reinstall mono and try again?

Offline Nate

« JGO Bitwise Duke »

Medals: 164
Projects: 4
Exp: 14 years

Esoteric Software

« Reply #38 - Posted 2013-07-26 11:04:11 »

Oops! Sorry, it slipped my mind that it was .NET. Fixing!

Offline SHC
« Reply #39 - Posted 2013-07-26 13:09:25 »

Hurray! It's finally rendering italic fonts perfectly! Here's the screenshot

I'll upload this version after testing with other fonts.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Sammidysam
« Reply #40 - Posted 2013-07-26 14:56:39 »

My Mono version is 2.10.8, as listed here.  It could be that my version is too old or that I do not have a Mono package installed that manages these fonts.  I'm not sure which one it could be though.  I have a lot of available mono packages.  They are here.  I'd rather not install them all if I don't need them, so are there any you want me to try to install and see if they make it work?
Offline SHC
« Reply #41 - Posted 2013-07-26 15:25:14 »


Probably mono cannot create messagebox from background worker. Moved the messagebox outside the background thread in the new beta 3. The link is

If you get that error again, reopen the application and test the generated font file.

Thanks for testing. I'll change the main post tomorrow morning.

Offline Sammidysam
« Reply #42 - Posted 2013-07-26 17:21:58 »

The error is now gone and it works completely fine.
Offline SHC
« Reply #43 - Posted 2013-07-27 03:29:10 »


It's because mono can only create controls or dialogs only on the starting thread. Glad it's working fine. Thanks for testing.

Offline SHC
« Reply #44 - Posted 2013-07-27 04:42:29 »

Could anybody recommend me of an opensource licence for this?

I'd like this tool to be used even in commercial apps for free.

Offline SHC
« Reply #45 - Posted 2013-07-27 06:10:11 »

I've licenced it with LGPL v3. Also written a Readme for GitHub. See the changes.

Offline kpars

JGO Kernel

Medals: 146
Projects: 3
Exp: 4 years

// No Comment.

« Reply #46 - Posted 2013-07-27 06:52:37 »

Use the GNU General Public License v3.

    Check out my website!  |   Use the Mercury game library!   |  Follow me on Twitter!      |          |

Offline SHC
« Reply #47 - Posted 2013-07-27 13:13:20 »

I had rewritten FontTester in Swing. Here's the screen shot.

Offline SHC
« Reply #48 - Posted 2013-07-29 15:05:30 »

Could anyone point me on a tutorial on how to pack bitmaps into texture atlases? I don't want to load another library (like apache commons codec) to decode the images.

Offline davedes
« Reply #49 - Posted 2013-07-29 16:28:44 »

Simple algorithm for rectangle packing:

Offline Herjan
« Reply #50 - Posted 2013-07-31 15:00:37 »

So, can I use this with LibGDX, or not? An XML file oO?

Offline SHC
« Reply #51 - Posted 2013-08-01 12:40:45 »


You can for sure use this with libGDX. Download the source from GitHub and compile the
library. It requires
Apache Commons Codec
in your classpath to compile and run. Then you can use it like

// Construct a PackedFont
PackedFont font = new PackedFont("MyPackedFont.fntpack");

// Get the glyph for a character i.e., the character to render on screen.
java.awt.Image glyph = font.getGlyph('A');

// After rendering, move the x-coordinate by the advance width of that char.
xpos += font.getAdvanceWidth('A');

The only requirements are that you need to convert the
to an OpenGL 2D texture and include Apache Commons Codec.

Offline SHC
« Reply #52 - Posted 2013-08-02 08:08:19 »


You can use these fonts without any other dependancies. See the article Using FontPacker with libGdx

Offline SHC
« Reply #53 - Posted 2013-08-02 15:50:33 »

Now also exports in BMFont text format. Here's the new screenshot.

I'll update the source and binaries shortly.

Offline SHC
« Reply #54 - Posted 2013-12-22 07:49:57 »

I'm currently testing it on Mac OSX. Here are the screenshots.

In MONO 3.2.3

In WINE with Microsoft's .NET 4.5

I don't know why the preview pane is not working in WINE version (But FontTester is working).

Offline Drenius
« Reply #55 - Posted 2013-12-22 14:55:18 »

What about adding the ability to add your own .ttf files?
Pages: 1 [2]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Ralphanese (18 views)
2015-05-29 13:07:55

Gibbo3771 (15 views)
2015-05-29 06:54:17

Ralphanese (23 views)
2015-05-28 16:52:52

theagentd (31 views)
2015-05-27 22:21:17

theagentd (36 views)
2015-05-27 22:21:08

CopyableCougar4 (25 views)
2015-05-27 19:24:50

MrMapcom (24 views)
2015-05-23 20:26:16

MrMapcom (33 views)
2015-05-23 20:23:34

Waterwolf (37 views)
2015-05-20 15:01:45

chrislo27 (44 views)
2015-05-20 03:42:21
Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!