Skip to content

Commit

Permalink
Version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanrishatum committed Nov 9, 2019
1 parent 25fae75 commit 58b5e74
Show file tree
Hide file tree
Showing 15 changed files with 497 additions and 311 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ bin
*.lib
*.exp
*.obj
*.zip
test/output/*
native/hl/*
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,27 @@ See [`test/config.json`](test/config.json) for example config.
* `-printmissing` - enables printing of all characters that were not present in ttf files but were required by charsets.
* `-silent` - suppresses all logging.
* `-verbose` - enables all logging.
* `-help` - Prints [help](src/help.txt) file and exits.

### .fnt file additions
Tool adds extra line at the end of `.fnt` file describing used SDF method that would allow decoder to determine parameters that are required to render the font.
SDF descriptor presents itself as:
```
sdf mode=<mode> size=<dfSize>
```
It is put at the end of file, because some parsers depend on ordering of lines and may break if inserted between `page` and `chars` blocks.
It is put at the end of file, because some parsers depend on ordering of lines and may break if inserted between `info` and `chars` blocks.

## Compilation

TODO: More detailed
* Haxe Libraries:
* [ammer](https://github.com/Aurel300/ammer/)
* [hxtruetype](https://github.com/cambiata/HxTrueType/)
* bin-packing (Haxelib version)
* Use MSVC in x86 mode, because ammer/hl don't like x64.
* Compile msdfgen in `native/msdfgen`
Windows note: when using `cmake` it may fail at finding `freetype` lib. It's includes and .lib files are located in `native/msdfgen/freetype/` directory.
* Compile ammer library in `native`
Mac/Linux note: Makefile is not valid, as it should also point at compiled `msdfgen.so/dylib` and `freetype.so/dylib`.
Mac/Linux note: Makefile is not valid, as it should also point at compiled `msdfgen.so/dylib` and `freetype.so/dylib`. Feel free to PR fixes, as I'm not using those OS ;)
* Run `build-hl.hxml` to compile hdll and the tool.
Windows note: Make sure you are running in msvc envrionment, sicne ammer needs it to compile .hdll file.
Ammer note: You probably will need to point at hashlink includes and lib files with `-D ammer.hl.hlInclude=<path-to-hashlink>/include -D ammer.hl.hlLibrary=<path-to-hashlink>`, see ammer lib for more details.
Expand Down
2 changes: 2 additions & 0 deletions build-cpp.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
common.hxml
-cpp bin/cpp
4 changes: 4 additions & 0 deletions build-hlc.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
common.hxml
-D ammer.hl.build=native/hl
-D ammer.hl.output=bin/
-hl bin/hlc/fontgen.c
2 changes: 1 addition & 1 deletion common.hxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-lib ammer
-lib hxtruetype
-lib bin-packing
--resource src/help.txt@help
-D analyzer-optimize
-D ammer.lib.msdfgen.include=native
-D ammer.lib.msdfgen.library=native
Expand Down
5 changes: 5 additions & 0 deletions compile-hlc.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@ECHO off
haxe build-hlc.hxml -D ammer.hl.hlInclude=E:/HaxeToolkit/hl/include -D ammer.hl.hlLibrary=E:/HaxeToolkit/hl
pushd bin\hlc
cl /Ox fontgen.c -I . -I E:\HaxeToolkit\hl\include E:\HaxeToolkit\hl\libhl.lib ..\..\native\hl\ammer_msdfgen.hl.lib
popd
2 changes: 1 addition & 1 deletion native/Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ msdfgen.dll: msdfgen.obj
cl /LD /MD msdfgen.obj "msdfgen\msdfgen.lib" "msdfgen\freetype\win32\freetype.lib"

msdfgen.obj: msdfgen.cpp
cl /c /MD msdfgen.cpp /I .
cl /c /MD msdfgen.cpp /I . /I "msdfgen\freetype\include" /I "msdfgen\include"

.PHONY: all
Loading

0 comments on commit 58b5e74

Please sign in to comment.