Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
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 8264 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 »

@Sammidysam

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 »

@davades

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: http://pastebin.com/DDBeWEJ0
The Export: http://paste.fedoraproject.org/27922/78384137

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 Kernel


Medals: 149
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 »

@Sammidysam

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 »

@Nate

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
TextRenderer
,
FontFamily
and
Graphics
classes. The project is written in C#.

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

@Sammidysam

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 Kernel


Medals: 149
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 »

@Sammidysam

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

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 »

@Sammidysam

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 Wizard


Medals: 96
Projects: 4
Exp: 3 years


Extreme Typist.


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

Use the GNU General Public License v3.

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:
http://www.blackpawn.com/texts/lightmaps/

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 »

@Herjan

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

1  
2  
3  
4  
5  
6  
7  
8  
// 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
java.awt.Image
to an OpenGL 2D texture and include Apache Commons Codec.

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

@Herjan

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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (43 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (66 views)
2014-10-14 00:35:47

TehJavaDev (59 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
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

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org 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‑gaming.org
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!