An immediate mode font rendering system in C.
 
 
Go to file
cosmonaut ab238503a3
continuous-integration/drone/push Build is passing Details
MSDF Rewrite (#1)
- Wellspring is now a MSDF font rendering library, accepting output from msdf-atlas-gen for this purpose
- Renamed Wellspring_Draw to Wellspring_AddToTextBatch
- TextBounds and AddToTextBatch no longer accept position and depth values
- Removed Packer
- Removed CreatePacker, PackFontRanges, and GetPixelDataPointer. Font packing is now handled by msdf-atlas-gen
- Removed visualc solution in favor of CMake everywhere

Reviewed-on: #1
2023-12-15 18:30:00 +00:00
include MSDF Rewrite (#1) 2023-12-15 18:30:00 +00:00
lib MSDF Rewrite (#1) 2023-12-15 18:30:00 +00:00
src MSDF Rewrite (#1) 2023-12-15 18:30:00 +00:00
.drone.yml drone CI 2022-04-13 15:20:54 -07:00
.gitignore add visualc solution 2022-04-13 09:57:32 -07:00
CMakeLists.txt MSDF Rewrite (#1) 2023-12-15 18:30:00 +00:00
LICENSE update LICENSE 2022-04-12 20:02:20 -07:00
README.md MSDF Rewrite (#1) 2023-12-15 18:30:00 +00:00

README.md

This is Wellspring, an immediate mode multiple-channel signed distance field font rendering system in C.

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. This means that you can integrate it easily using the graphics library of your choice.

Wellspring uses JSON output from msdf-atlas-gen to generate buffers. It also uses stb_truetype 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:

msdf-atlas-gen -yorigin top -font ~/mygame/myfont.otf -imageout ~/mygame/content/forgotten_dream.png -json ~/mygame/content/forgotten_dream.json

Dependencies

Wellspring depends on the C runtime, but SDL2 can be optionally depended upon instead if your application prefers it by defining USE_SDL2.

Building Wellspring

For *nix platforms, use CMake:

$ 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.

License

Wellspring is licensed under the zlib license. See LICENSE for details.