Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shenniger/textrenderer
Making rich text rendering in gfx engines less annoying and less slow (UTF-8 enabled)
https://github.com/shenniger/textrenderer
font games gfx unicode
Last synced: 18 days ago
JSON representation
Making rich text rendering in gfx engines less annoying and less slow (UTF-8 enabled)
- Host: GitHub
- URL: https://github.com/shenniger/textrenderer
- Owner: shenniger
- Created: 2019-05-24T07:26:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-24T07:32:42.000Z (over 5 years ago)
- Last Synced: 2024-11-13T07:47:28.431Z (about 2 months ago)
- Topics: font, games, gfx, unicode
- Language: C
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a text rendering system which is designed less for rigorous typographic
correctness and rather for speed and flexibility.# Features
When I say flexibility, I mean:
* Multi-line text/Word-wrap
* Mutiple fonts of different sizes in the same text block
* Support for rendering other textures and elements into text blocks
* UTF-8 support in simple cases like German umlaute, might also work for longer Unicode sequences# Control character syntax
All control sequences consist of three characters, of which the first one is always `0x11`.
The second character specifies the control command (see below table) and the third is an
argument to that command (referred to as `a`).| Character | Description |
| --------- | ---------------------------------------------------------------------------------------- |
| 'n' | Changes the font to `fonts[a-1]` |
| 'i' | Renders the texture `textures[a-1]` to the current location |
| 'u' | Saves the current position to `controls[a-1].{x,y}`, then jumps by `controls[a-1].{w,h}` |
| 'l' | Evaluates `loader(a-1)` and renders the result (useful for lazy evaluation of textures) |# Dependencies
* SDL2
* SDL2_ttf# To-Do
* Eliminate SDL2_ttf dependency and instead use Freetype directly.
* Improve Unicode support.
* Implement basic syllable division features for German and English.
* Render characters on demand.