Add Text rendering

- Add FreeType as dependency
- Add MsdfGen as dependency
- Add MsdfAtlasGen as dependency
This commit is contained in:
Thraix
2023-05-08 22:12:19 +02:00
parent ad69293faa
commit 4e466a1fce
190 changed files with 44693 additions and 46 deletions
@@ -0,0 +1,25 @@
#pragma once
#include <msdfgen.h>
#include "GlyphGeometry.h"
#include "AtlasGenerator.h"
#define MSDF_ATLAS_GLYPH_FILL_RULE msdfgen::FILL_NONZERO
namespace msdf_atlas {
// Glyph bitmap generator functions
/// Generates non-anti-aliased binary image of the glyph using scanline rasterization
void scanlineGenerator(const msdfgen::BitmapRef<float, 1> &output, const GlyphGeometry &glyph, const GeneratorAttributes &attribs);
/// Generates a true signed distance field of the glyph
void sdfGenerator(const msdfgen::BitmapRef<float, 1> &output, const GlyphGeometry &glyph, const GeneratorAttributes &attribs);
/// Generates a signed pseudo-distance field of the glyph
void psdfGenerator(const msdfgen::BitmapRef<float, 1> &output, const GlyphGeometry &glyph, const GeneratorAttributes &attribs);
/// Generates a multi-channel signed distance field of the glyph
void msdfGenerator(const msdfgen::BitmapRef<float, 3> &output, const GlyphGeometry &glyph, const GeneratorAttributes &attribs);
/// Generates a multi-channel and alpha-encoded true signed distance field of the glyph
void mtsdfGenerator(const msdfgen::BitmapRef<float, 4> &output, const GlyphGeometry &glyph, const GeneratorAttributes &attribs);
}