Midad is a high-performance text rasterization application that utilizes Vulkan compute shaders to shape and render text. It processes strings and curves from font files, producing both standard high-quality textures and quantized ASCII block-based representations directly on the GPU.
To build and run this project, you will need the following dependencies on your system:
- *Odin: Required to compile the main application.
- Slang Compiler: Required to compile the compute shaders into SPIR-V format.
Midad uses a simple bash script to compile the shaders and build the application. You can build it by simply running:
./build.shImportant Note on Slang: The build.sh script currently assumes you have installed the Slang compiler from the Arch User Repository (AUR) via the slang-shader-bin package. If you installed Slang differently or are on another distribution, you will likely need to edit build.sh and modify the PATH variable export to point to where your slangc binary is located.
After building, run the application by providing a text file as an argument:
./build/midad path/to/text_file.txtCurrently, the primary and monospaced fonts are hardcoded into the setup phase of the program. If you want to change the font being rasterized, you will need to open src/main.odin and modify the file paths passed directly to the load_font_embedded function calls.
When you run the program, it will generate 4 primary output files inside the build/ directory demonstrating the pipeline results:
out.png: The standard, high-quality rasterized text output.ascii_out.png: An image demonstrating the block-based quantized text representation based on an ASCII shading palette.ascii_output.txt: The raw text file containing the actual structural ASCII characters derived from the text rendering space grid.palette_out.png: The sequence of rendered ASCII characters serving as the quantization color palette for the secondary pass.