Wellspring/README.md

38 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

This is Wellspring, an immediate mode multiple-channel signed distance field font rendering system in C.
2022-04-13 03:00:50 +00:00
About Wellspring
----------------
Wellspring is inspired by the design of Dear ImGui.
It outputs buffer data that you can upload and render anytime in your 3D application.
2022-04-13 03:00:50 +00:00
This means that you can integrate it easily using the graphics library of your choice.
Wellspring uses JSON output from [msdf-atlas-gen](https://github.com/Chlumsky/msdf-atlas-gen) to generate buffers. It also uses [stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h) for additional kerning support. At render time, bind the image data from msdf-atlas-gen with buffers generated by Wellspring for beautiful MSDF font rendering.
Using msdf-atlas-gen
--------------
A full explanation of msdf-atlas-gen is beyond the scope of this project, but note that Wellspring only accepts MSDF atlas types with JSON output.
Your atlas generation might look like this:
```sh
msdf-atlas-gen -yorigin top -font ~/mygame/myfont.otf -imageout ~/mygame/content/forgotten_dream.png -json ~/mygame/content/forgotten_dream.json
```
2022-04-13 03:00:50 +00:00
Dependencies
------------
2022-04-13 16:57:32 +00:00
Wellspring depends on the C runtime, but SDL2 can be optionally depended upon instead if your application prefers it by defining USE_SDL2.
2022-04-13 03:00:50 +00:00
Building Wellspring
-------------------
2022-04-13 16:57:32 +00:00
For *nix platforms, use CMake:
2022-04-13 03:00:50 +00:00
$ mkdir build/
$ cd build
$ cmake ../
$ make
For Windows, you can use cmake-gui to generate a Visual Studio solution or use VSCode with the CMake and C/C++ Tools extensions.
2022-04-13 16:57:32 +00:00
2022-04-13 03:00:50 +00:00
License
-------
Wellspring is licensed under the zlib license. See LICENSE for details.