https://github.com/simulation-tree/text-rendering
https://github.com/simulation-tree/text-rendering
csharp dotnet fonts rendering text
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/simulation-tree/text-rendering
- Owner: simulation-tree
- Created: 2024-08-21T18:49:19.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-09-24T03:04:12.000Z (9 months ago)
- Last Synced: 2025-10-27T13:56:58.845Z (8 months ago)
- Topics: csharp, dotnet, fonts, rendering, text
- Language: C#
- Homepage:
- Size: 44.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Text Rendering
Definition of generated [meshes](https://github.com/simulation-tree/meshes) with UV coordinates pointing to glyphs from [fonts](https://github.com/simulation-tree/fonts).
### Usage
Text rendering happens in 3D space like rendering other meshes. Each of them require a text mesh, material
and a camera (similar to regular renderers). The text mesh itself requires a font and the text content.
```cs
using World world = new();
Font font = ...
TextMesh textMesh = new(world, "Hello, World!", font);
while (!textMesh.Is())
{
world.Submit(new DataUpdate());
world.Submit(new FontUpdate());
world.Submit(new RenderUpdate());
world.Poll();
}
Material textMaterial = ...
TextRenderer textRenderer = new(world, textMesh, textMaterial, camera);
Entity textRendererEntity = textRenderer;
```
> The material is expected to have a sampler2D at binding 0 for the font atlas. The remaining is up to you.