Generates Font Awesome icon images in Java. Tested to work with Font Awesome 6 to generate over 1K+ images (including aliases).
This is a simple Java command-line program that generates high quality image files (like png or gif) using the insanely awesome Font Awesome icon library. If you don't have Java, you can download it from the OpenJDK website. (Tested to work with OpenJDK 20, but should also be compatible with future JDK versions.)
- Download Font Awesome Free for the Desktop and unzip it
- Place
FontAwesome.java
in thefontawesome-free-x.x.x-desktop
folder - Open up a command prompt or terminal shell, navigate to the folder, and run the command
javac FontAwesome.java
to compile
You can create regular icons, transparent icons, or stacked icons.
- Run
java FontAwesome [styles] [icons] [size] [color] [padding]
- Example
java FontAwesome all all 128 FF0000 1/8
- Generates 128px red (FF0000) png icon images with a padding of 1/8 the size (48 * 1/8 = 6px)
- Run
java FontAwesome [styles] [icons] [size] transparent [padding] [bgcolor]
- Example
java FontAwesome all all 128 transparent 1/8 FFFFFF
- Generates 128px transparent png icon images with a background color of white (FFFFFF) and a padding of 1/8 the size (48 * 1/8 = 6px)
- Run
java FontAwesome [size] [color] [padding] [format] [sicon] [ssize] [scolor]
- Example
java FontAwesome 24 ffffff 0 png square 48 0
- Generates images that have a 24px white icon stacked on top of a 48px black square with no padding
- [styles] - Can be
all
,brands
,regular
,solid
,light
, or any combination of the four delimited by commas e.g.brands,regular
- [icons] - Can be
all
or a list of icon names delimited by commas e.g.plus-circle,minus-circle
- [color] - Can be a hex triplet format like
FF69B4
(pink) or0
(black) ortransparent
- Use bigger image sizes for better quality when stacking icons
- Enter colors in hex triplet format like
ff69b4
(pink) or0
(black) - Enter padding as a fraction of the image size like
1/16
or0
for none (1/8
recommended) - Add more padding if a particularly wide or tall icon is not able to fit in the desired image size
- Images will be saved in a newly made
images
folder
If you still need to generate icons for older versions, you can find them in the past commits, but please note that these versions are no longer officially supported.
MIT
Font Awesome To Image
Copyright © 2020 Roy Six