With regards to #359 “Suggestion: Support distance field based text rendering” https://github.com/jMonkeyEngine/jmonkeyengine/issues/359
Here is a simple implementation that builds upon the existing BitmapText:
- As extra feature, it allows to set outline for the text.
- For now, I have created a new repo. See, if you would like it as PR to master.
- Currently, the material DFont.j3md is a copy of Unshaded, modified. Unneeded functionality can be removed from them.
- DText extends BitmapText. If you can come up with a better name, feel free to suggest.
- Atm, it uses a bit of reflection since BitmapText has private fields, which can be removed and made into protected onces once PR is ready.
- DFontLoader is a copy of BitmapFontLoader, with few modification. BitmapFontLoader used textures with no mipmaps. I enabled mipmaps in DFontLoader. Do you have an opinion on this one?
- BitmapFontLoader ignores “padding” in .fnt files, left and right padding was included in DFontLoader
- DFontLoader: extension atm: “.dfnt”
- Distance field bitmap can be created by Heiro (https://github.com/libgdx/libgdx/wiki/Hiero) , guide here(https://github.com/libgdx/libgdx/wiki/Distance-field-fonts)
- TestCase: https://github.com/TehLeo/jme3DFont/blob/master/src/jme3test/gui/TestDFont.java
And lastly feel free to try it and give a like if you like it .