diff --git a/.gitignore b/.gitignore
index 10fca2d7f0..e9f029335a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,6 +40,7 @@ config/
changelog
*.gif
/core/assets/saves/
+/out/
version.properties
diff --git a/build.gradle b/build.gradle
index fba440efbe..33a37cd50c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -299,6 +299,7 @@ project(":tools"){
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
compile "org.reflections:reflections:0.9.11"
+ compile "org.apache.pdfbox:fontbox:2.0.0"
compile arcModule("backends:backend-sdl")
}
diff --git a/core/assets-raw/fontgen/config.json b/core/assets-raw/fontgen/config.json
new file mode 100644
index 0000000000..d34436ac6b
--- /dev/null
+++ b/core/assets-raw/fontgen/config.json
@@ -0,0 +1,78 @@
+{
+ "name": "",
+ "css_prefix_text": "icon-",
+ "css_use_suffix": false,
+ "hinting": true,
+ "units_per_em": 1000,
+ "ascent": 850,
+ "glyphs": [
+ {
+ "uid": "d7271d490b71df4311e32cdacae8b331",
+ "css": "home",
+ "code": 59392,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "c08a1cde48d96cba21d8c05fa7d7feb1",
+ "css": "doc-text-inv",
+ "code": 61788,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "178053298e3e5b03551d754d4b9acd8b",
+ "css": "doc-inv",
+ "code": 61787,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "5408be43f7c42bccee419c6be53fdef5",
+ "css": "doc-text",
+ "code": 61686,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "ce06b5805120d0c2f8d60cd3f1a4fdb5",
+ "css": "play",
+ "code": 59393,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "555ef8c86832e686fef85f7af2eb7cde",
+ "css": "left-big",
+ "code": 59394,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "ad6b3fbb5324abe71a9c0b6609cbb9f1",
+ "css": "right-big",
+ "code": 59395,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "95376bf082bfec6ce06ea1cda7bd7ead",
+ "css": "up-big",
+ "code": 59396,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "1c4068ed75209e21af36017df8871802",
+ "css": "down-big",
+ "code": 59397,
+ "src": "fontawesome"
+ },
+ {
+ "uid": "6f880cbd94039674f0de065ffb57c250",
+ "css": "icon-distribution-transparent.png",
+ "code": 59398,
+ "src": "custom_icons",
+ "selected": true,
+ "svg": {
+ "path": "M0 0L0 50 0 100 0 150 0 200 0 250 0 300 0 350 0 400 0 450 0 500 0 550 0 600 0 650 0 700 0 750 0 800 0 850 0 900 0 950 0 1000 50 1000 100 1000 100 950 100 850 100 750 100 650 100 550 100 450 100 350 100 250 100 150 100 50 100 0 50 0 0 0ZM900 0L900 50 900 150 900 250 900 350 900 450 900 550 900 650 900 750 900 850 900 950 900 1000 950 1000 1000 1000 1000 950 1000 900 1000 850 1000 800 1000 750 1000 700 1000 650 1000 600 1000 550 1000 500 1000 450 1000 400 1000 350 1000 300 1000 250 1000 200 1000 150 1000 100 1000 50 1000 0 950 0 900 0ZM500 106.3C487.5 106.3 475 108.3 462.5 112.5 437.5 120.8 416.7 133.3 400 150L350 200C333.3 216.7 325 233.3 325 250 325 266.7 337.5 279.2 362.5 287.5 387.5 295.8 416.7 300 450 300L550 300C597.6 293.9 649.1 300.5 675 250 675 233.3 666.7 216.7 650 200L600 150C583.3 133.3 562.5 120.8 537.5 112.5 525 108.3 512.5 106.3 500 106.3ZM500 406.3C487.5 406.3 475 408.3 462.5 412.5 437.5 420.8 416.7 433.3 400 450L350 500C333.3 516.7 325 533.3 325 550 325 566.7 337.5 579.2 362.5 587.5 387.5 595.8 416.7 600 450 600L550 600C583.3 600 612.5 595.8 637.5 587.5 662.5 579.2 675 566.7 675 550 675 533.3 666.7 516.7 650 500L600 450C583.3 433.3 562.5 420.8 537.5 412.5 525 408.3 512.5 406.3 500 406.3ZM500 706.3C487.5 706.3 475 708.3 462.5 712.5 437.5 720.8 416.7 733.3 400 750L350 800C333.3 816.7 325 833.3 325 850 325 866.7 337.5 879.2 362.5 887.5 387.5 895.8 416.7 900 450 900L550 900C583.3 900 612.5 895.8 637.5 887.5 662.5 879.2 675 866.7 675 850 675 833.3 666.7 816.7 650 800L600 750C583.3 733.3 562.5 720.8 537.5 712.5 525 708.3 512.5 706.3 500 706.3Z",
+ "width": 1000
+ },
+ "search": [
+ "icon-distribution-transparent.png"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/core/assets-raw/fontgen/icons/distribution.svg b/core/assets-raw/fontgen/icons/distribution.svg
new file mode 100644
index 0000000000..f60b2f7251
--- /dev/null
+++ b/core/assets-raw/fontgen/icons/distribution.svg
@@ -0,0 +1,60 @@
+
+
+
+
diff --git a/core/assets-raw/fontgen/merge.pe b/core/assets-raw/fontgen/merge.pe
new file mode 100755
index 0000000000..2dfaf77598
--- /dev/null
+++ b/core/assets-raw/fontgen/merge.pe
@@ -0,0 +1,3 @@
+Open("core/assets/fonts/font.ttf")
+MergeFonts("core/assets-raw/fontgen/out/font.ttf")
+Generate("core/assets/fonts/font.ttf")
diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties
index 620de654c2..f60c7c291c 100644
--- a/core/assets/bundles/bundle.properties
+++ b/core/assets/bundles/bundle.properties
@@ -424,7 +424,7 @@ filter.option.percentile = Percentile
width = Width:
height = Height:
menu = Menu
-play = \uE800 Play
+play = Play
campaign = Campaign
load = Load
save = Save
diff --git a/core/assets/fonts/font.ttf b/core/assets/fonts/font.ttf
index b6790b88ec..1671e7ee39 100644
Binary files a/core/assets/fonts/font.ttf and b/core/assets/fonts/font.ttf differ
diff --git a/core/assets/fonts/fontello.ttf b/core/assets/fonts/fontello.ttf
deleted file mode 100644
index e7aeec0f89..0000000000
Binary files a/core/assets/fonts/fontello.ttf and /dev/null differ
diff --git a/gradle.properties b/gradle.properties
index 091723c9aa..413e5f7462 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
-archash=2be8dfe555b6aa4e5307ce56a92e24d8fee39a0b
+archash=28ea91ea741417c01f0beb3b9dc320dc3f42ff25
diff --git a/tools/build.gradle b/tools/build.gradle
index 033040e96d..6e7bc66d95 100644
--- a/tools/build.gradle
+++ b/tools/build.gradle
@@ -303,19 +303,6 @@ task pack(dependsOn: classes){
workingDir = genFolder
}
- //upscale icon sprites using different method, which requires an OpenGL context
- javaexec{
- if(System.getProperty("os.name").toLowerCase().contains("mac")){
- jvmArgs "-XstartOnFirstThread"
- }
-
- jvmArgs("-Djava.awt.headless=true")
- main = "mindustry.tools.Upscaler"
- classpath = sourceSets.main.runtimeClasspath
- standardInput = System.in
- workingDir = "../core/assets-raw/sprites_out/ui/icons"
- }
-
copy{
from "../core/assets-raw/sprites_out/ui/icons"
into "../core/assets-raw/sprites_out/ui/"
diff --git a/tools/src/mindustry/tools/FontGenerator.java b/tools/src/mindustry/tools/FontGenerator.java
new file mode 100644
index 0000000000..bcc34a27c9
--- /dev/null
+++ b/tools/src/mindustry/tools/FontGenerator.java
@@ -0,0 +1,51 @@
+package mindustry.tools;
+
+import arc.*;
+import arc.files.*;
+import arc.util.*;
+import arc.util.io.*;
+
+import java.io.*;
+
+/* icon font pipeline:
+ 1. take set of pre-defined icons and SVGs
+ 2. use Fontello API to get a font with these
+ 3. combine fontello font and standard font, get output font
+ 4. use apache ttf API to generate a file with constants for every icon size+type (during annotation processing)
+ */
+public class FontGenerator{
+
+ public static void main(String[] args){
+ Net net = Core.net = new Net();
+ net.setBlock(true);
+ Fi folder = Fi.get("core/assets-raw/fontgen/out/");
+ folder.mkdirs();
+
+ Log.info("Session...");
+
+ OS.exec("curl", "--fail", "--output", "core/assets-raw/fontgen/out/session", "--form", "config=@core/assets-raw/fontgen/config.json", "http://fontello.com");
+
+ Log.info("Zip...");
+
+ String session = folder.child("session").readString();
+ net.httpGet("http://fontello.com/" + session + "/get", result -> {
+ try{
+ Streams.copyStream(result.getResultAsStream(), folder.child("font.zip").write());
+ }catch(IOException e){
+ throw new RuntimeException(e);
+ }
+ }, Log::err);
+
+ Log.info("Icon font...");
+
+ ZipFi zip = new ZipFi(folder.child("font.zip"));
+ Fi dest = folder.child("font.ttf");
+ zip.list()[0].child("font").child("fontello.ttf").copyTo(dest);
+
+ Log.info("Merge...");
+
+ OS.exec("fontforge", "-script", "core/assets-raw/fontgen/merge.pe");
+
+ Log.info("Done.");
+ }
+}
diff --git a/tools/src/mindustry/tools/ImagePacker.java b/tools/src/mindustry/tools/ImagePacker.java
index 74ff81e9b0..84e6674ef9 100644
--- a/tools/src/mindustry/tools/ImagePacker.java
+++ b/tools/src/mindustry/tools/ImagePacker.java
@@ -1,10 +1,10 @@
package mindustry.tools;
import arc.*;
-import arc.struct.*;
import arc.files.*;
import arc.graphics.g2d.*;
import arc.graphics.g2d.TextureAtlas.*;
+import arc.struct.*;
import arc.util.*;
import arc.util.Log.*;
import mindustry.*;
@@ -18,7 +18,7 @@ public class ImagePacker{
static ObjectMap regionCache = new ObjectMap<>();
static ObjectMap imageCache = new ObjectMap<>();
- public static void main(String[] args){
+ public static void main(String[] args) throws Exception{
Vars.headless = true;
Log.setLogger(new NoopLogHandler());
diff --git a/tools/src/mindustry/tools/SquareMarcher.java b/tools/src/mindustry/tools/SquareMarcher.java
index 2261260b46..0caf7642ff 100644
--- a/tools/src/mindustry/tools/SquareMarcher.java
+++ b/tools/src/mindustry/tools/SquareMarcher.java
@@ -1,14 +1,11 @@
package mindustry.tools;
-import arc.Core;
-import arc.files.Fi;
-import arc.graphics.Color;
-import arc.graphics.Pixmap;
-import arc.graphics.g2d.Draw;
-import arc.graphics.g2d.Fill;
-import arc.graphics.gl.FrameBuffer;
-import arc.util.ScreenUtils;
-import arc.util.Tmp;
+import arc.*;
+import arc.files.*;
+import arc.graphics.*;
+import arc.graphics.g2d.*;
+import arc.graphics.gl.*;
+import arc.util.*;
public class SquareMarcher{
final int resolution;
diff --git a/tools/src/mindustry/tools/Upscaler.java b/tools/src/mindustry/tools/Upscaler.java
index de83fad5c0..a2771e1e73 100644
--- a/tools/src/mindustry/tools/Upscaler.java
+++ b/tools/src/mindustry/tools/Upscaler.java
@@ -8,6 +8,7 @@ import arc.graphics.g2d.*;
import arc.util.*;
import mindustry.ui.*;
+//TODO remove
public class Upscaler{
public static void main(String[] args){
new SdlApplication(new ApplicationListener(){