How to Get Distance field fonts in LibGDX using Hiero, and finding an updated version of Hiero


Distance fields are used in LibGDX for being able to make fonts clearer when resizing them, which allows you to have clearer text using just one font size on all devices instead of needing to include several (or have low quality looking text)

LibGDX Wiki Instructions, or what not to do

The LibGDX official wiki does a good job of explaining what and how to use distance field for clearer font in LibGDX:, but seems to be unbelievably vague about using the Hiero font tool, with links to 2012 pre- “distance field” versions of hiero, and no apparent way to find or run a version that works. They even so far as to suggest use github to download the entire LibGDX source project, re-compiling it to get access to from the gdx-tools project.

I installed the windows version to connect to github, cloned the repository and downloaded the 1GB source, changed my workspace in eclipse, and tried to compile the source, only to be met with 1000s of compiling errors, hours into getting it to work, and no closer to running a “version of Hiero that supports distance fields”.

How to actually get a supported version of Hiero

Luckily I was able to find an article written by Packt Publishing on how to run Hiero(

But it’s actually somewhat simple:

  1. Download the latest stable version of LibGDX from their site (not through Maven/ Gradle/ GitHub/ Google Code/ flavor of the week, but through the link they say “We strongly discourage using these old release builds….”):
  2. Unzip that into a temp folder (or just copy it from the zip into the folder in the next step)
  3. Create a folder where you want to run Hiero from- prob just a folder in your working directory called “hiero”
  4. Copy the following files into that folder:
    • gdx.jar
    • gdx-backend-lwjgl.jar
    • gdx-backend-lwjgl-natives.jar
    • gdx-natives.jar
    • gdx-tools.jar
  5. Now Right click in the folder, create a new text document, and rename it to: Hiero.bat (Make sure you can see the .jar on the other files in the folder, or you have to turn off “hide extensions for known file types” in windows folder options)
  6. Open the Hiero.bat by right clicking on it, and opening it with a text editor(right click and hit edit)
  7. Inside the text document put this: java -cp gdx.jar;gdx-natives.jar;gdx-backend-lwjgl.jar;gdx-backend-lwjgl-natives.jar;gdx-tools.jar
  8. Close the text editor and double click on the Hiero.bat, and it should run Hiero! (you should see ‘Distance field’ on the bottom of the effects section on the right side)

Now the LibGDX Wiki can be helpful again!

Now that we actually have a version of Hiero running that we can follow along with the wiki article, the article becomes useful again. Follow the directions under:
Generating the font

I found that this works reasonable for generating fonts down to size 18, with the same values that the wiki uses (spread=4, padding =4 for all, x, y =-8, but scale looked best for me at 24, probably because I used a smaller font size)

The rest of the article was pretty straight forward for me, and I was able to get distance fields working pretty well in the game (low distortion at larger or smaller font size, with minimal artifacts around lowercase t’s, but overall much better than normal scaling).

The only real disadvantage is that I was using Hiero to generate drop shadows to make text more readable before, but distance fields don’t allow you to export it with Hiero (have to clear all effects aside from distance field). The article hints at being able to add directional drop shadows “using the texture’s gradient”, but offers no additional information.

Let me know if you find a way to get drop shadows or other effects working! Text isn’t the central focus of games, but is necessary for a lot of communication, and for now I just put a black transparent box behind any text field to allow it to be readable without drop shadows.

Back from a long hiatus!

I haven’t been very active on the blog lately for two reasons.

1) The website was going down daily because host gator, and now Linode was detecting too much disk access (from people trying to hack the server)- I guess any site that has been around long enough will have hundreds of bots brute forcing trying to get control of the server O_o

So I reinstalled linux, and re-setup everything, but the website database was broken because akismet plugin filters out spam comments, but at the cost of bloating the database up to insane sizes, making it completely unusable.

2) Been working full time on my games, trying to pay rent, and buy food. Basically working all the time. We’ve release several games so far, and it has been a learning process because neither me nor my wife had worked at any game companies beforehand (and even they require significant experience before you can work there XD ). So we saw that mobile games were starting to boom, and took a chance at working on them. I’ve been mainly using LibGDX these days, and have created several games. But now that Unity Basic is free, and much faster to actually get your game done (instead of spending weeks creating usable UI, without actually working on gameplay), I’ll be using that more instead.

But I was able to fix the SQL for the database, and get the site live again, so I’ll be posting more tutorials, or at least help for other developers when I run into problems with no existing information out there, or gaping holes in the information they give.

I hope to help many more people get started with creating their own games and applications! It’s difficult to get in without any help, but once you start, you can gain momentum and create the things you’ve dreamed about! (although at 1/10000000 the scope 😉

Getting Started with IntelliJ IDEA Book Review

If you’re looking for a resource to help you navigate and understand the IntelliJ interface, and are looking for a good reference based on the topics you can see in the table of contents, you’ll find this book helpful. It’s very thorough, and also gives you some information for adapting to IntelliJ if you are coming from a different IDE. But the book will be more helpful to you if you’re looking for more information on the topics it covers in each chapter, as opposed to trying to read it straight through.

You can pick it up now if you’re interested at:

Android Studio Application Development Book Review Giveaway!

I recently reviewed “Android Studio Application Development”, and Packt Publishing has been gracious enough to allow me to raffle off 3 e-copies of the book!

Comment, and let me know why you would be interested in the book, and I’ll use a random number generator to select 3 people! So then check back (or leave your email address and name and I’ll contact you if you won, and forward the info to Packt Pub for them to add the book to your account)!

Tutorial links fixed!

The tutorials links were recently missing when I changed hosts.

To make it easier when I update articles, I have all the links for a tutorial series in one file that gets included via php.

My old host, I wasn’t able to use relative links, so used absolute HTTP links. My new one (with default php settings), disables absolute include links (HTTP), which seems to be a security issue (someone could hack you page and have it include a php file from their server).

So, I went through, and they should all be updated and linking correctly (showing all parts in a tutorial series, at the end, and under the tutorial category page).

Hope that makes it easier to go through a tutorial again!

Great deal on technical books at PacktPub for a limited time(till January 3rd)!

$5 ebook Bonanza2
PackPub $5 Everything deal!

Awesome news for anyone looking to learn some new topics this holiday season! Pack Publishing is offering ALL of their e-books AND video tutorials for only $5 a piece!

For game development related topics, and for general computer/ technology tutorials/ books, they seem to have the most, and up to date content. If you’ve been thinking of learning LibGDX, Java, C#, Unity, HTML5, Web development, whatever, all the books are only $5!
Only until Jan 3rd, so hurry and pick out your favorite Christmas presents! 😀

You can pick them up here:

Pickup a great LibGDX tutorial book that I was one of the technical reviewers for!

Learning LibGDX Game Development is a great LibGDX tutorial book that I have the pleasure to be associated with 😀

I mainly just double checked everything, made sure it was easy enough to follow, but the author did a surprisingly concise, yet well thought out series of tutorials, culminating in having a finished “runner” type game, using LibGDX, so you can deploy to Android, PC, Linux, Mac, even iOS now.

I learned some things about Scene2d, and I can say if you’re interested in saving some time trying to learn al; by yourself, this will give you an enormous head start.

I got a copy of the book, and my name on it, but don’t get anything else for being a technical reviewer, but I would have bought the book based on the content. Check out the table of contents for an idea of the awesome stuff it covers, you’re pretty much guarenteed to learn a lot from it.

You can pick it up from their website now at:

Android Studio Application Development Book Review

I was able to get a chance to read from packt publishing, and wanted to share my review.

My overview is that it is useful for understanding the interface of Android studio, and learning the basics of how to use it.

The book explains the how to setup a project, configure Android studio, and steps you through how you would do common things that you would need to be able to do when setting up an app, changing the design, and compiling and debugging it. The book does not give you a complete tutorial of creating an application using Android Studio, but just how to actually use Android studio, and getting you comfortable/ understanding the interface. If you are new to Android development, this book will walk you through the interface, but will not teach you how to create different types of apps. If you are an existing developer using eclipse, this book will give you a head start on understanding the interface, and where to find things that you are used to using.

You can pick it up now if you’re interested at:

Awesome destructible terrain demo using Box2d on Emanuele Feronato’s site!!

Check out this awesome demo, making destructible terrain in Box2s on Emanuele’s site! Does anyone remember “Scorched Earth”? It was a freeware game from the 90’s that pre-dated worms, with similar gameplay, that allowed multiplayer, same screen battles that I used to play with my sister for hours.

I’d love to make a Android version of this, if for nothing else but the nostalgic, awesome gameplay!

Unity basic for Android and iOS now free!

Good news for all you other indie developers out there- Unity basic for Android and iOS is now free!

Unity basic seems like it would be more than sufficient for the needs of most indie developers. This means that there will be a lot more people trying out Unity, publishing games, and making the platform stronger. Plus, the Unity developers will probably still make a good amount of money from additional purchases in the asset store.

I had been holding off developing in Unity until my current games could be generating enough income to easily justify the purchase, or for when I started going towards more 3d games, but I think I will try to publish a Unity game within the next couple months, to really test out the platform.