This PR adds support for emake fonts.
DONE:
* emake can now load fonts
* All fonts now go through the same code path regardless of if they're from the gmx, or added later using font_add / font_add_sprite
* LGM also now uses the same path as emake in-order to keep consistent rendering between builds
* I've fixed a regression where enigma was no longer compressing the font data
* All font data (excluding image data) is now written to source instead of tacked on the exe
TODO:
* I've added font finding functions but they depend on c++17 and could use more rigorous testing
* I've put a framework in place to load gmx fonts with pre-rendered texture atlases but I have no idea how the gmx attributes translate to our GlyphMetrics struct
* ~~font_add() and font_add_sprite() are completely untested and likely broken~~
* I've added a generic interface to the rect_packer that should be applied in texture_atlas.cpp
* We should be able to use one generic function for loading all compressed data on exe. I started one in fontinit.cpp but perhaps that can be continued in another PR
* ~~It seems my lastest changes to AssetArray have broken the default font~~
* I'm not sure how the line height / yoffset are calculated in GM so that bits likely wrong
NOTE:
* The compiler is now dependent on freetype to load fonts properly
RobertBColton
I'm getting an error when building my Project Mario game from LGM on this branch after a clean rebuild of everything. I get this same error with an empty game too.
Writing executable information and resources.
Writing modes and settings
Writing object switch
Writing resource names and maxima
Thread-4:
java.lang.Error: Invalid memory access
at com.sun.jna.Native.invokeInt(Native Method)
at com.sun.jna.Function.invoke(Function.java:383)
at com.sun.jna.Function.invoke(Function.java:315)
at com.sun.jna.Library$Handler.invoke(Library.java:212)
at com.sun.proxy.$Proxy0.compileEGMf(Unknown Source)
at org.enigma.EnigmaRunner$CompilerThread.run(EnigmaRunner.java:674)
```
I found the crash is because of static libgcc in `CompilerSource/Makefile` apparently. That is causing freetype to corrupt protobuf's memory somehow. If we just comment out static libgcc on Windows in that makefile, this pr works fine on Windows.
Leave a commentView this issue on GitHub
Please sign in to post comments, or you can view this issue on GitHub.