diff options
| author | Ray <[email protected]> | 2018-09-06 16:56:21 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2018-09-06 16:56:21 +0200 |
| commit | dfb8837c466ea89ccdfa27b9c92700128d826353 (patch) | |
| tree | 28f64fbc860a71ec4cabff8d8975bae4c1d72bea /examples/text | |
| parent | 1fcb3c0317e694a72ed4b6ed6601839cbf674809 (diff) | |
| download | raylib-dfb8837c466ea89ccdfa27b9c92700128d826353.tar.gz raylib-dfb8837c466ea89ccdfa27b9c92700128d826353.zip | |
Support aliased font texture generation
Useful for bitmaps pixelated fonts where anti-aliasing is not desired!
Change also enables additional font generation mechanisms in a future (cleartype, hinting...).
Diffstat (limited to 'examples/text')
| -rw-r--r-- | examples/text/text_font_sdf.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/text/text_font_sdf.c b/examples/text/text_font_sdf.c index c23a1e2e..755b642d 100644 --- a/examples/text/text_font_sdf.c +++ b/examples/text/text_font_sdf.c @@ -29,19 +29,18 @@ int main() fontDefault.baseSize = 16; fontDefault.charsCount = 95; // Parameters > font size: 16, no chars array provided (0), chars count: 95 (autogenerate chars array) - fontDefault.chars = LoadFontData("resources/AnonymousPro-Bold.ttf", 16, 0, 95, false); + fontDefault.chars = LoadFontData("resources/AnonymousPro-Bold.ttf", 16, 0, 95, FONT_DEFAULT); // Parameters > chars count: 95, font size: 16, chars padding in image: 4 px, pack method: 0 (default) Image atlas = GenImageFontAtlas(fontDefault.chars, 95, 16, 4, 0); fontDefault.texture = LoadTextureFromImage(atlas); UnloadImage(atlas); // SDF font generation from TTF font - // NOTE: SDF chars data is generated with LoadFontData(), it's just a bool option Font fontSDF = { 0 }; fontSDF.baseSize = 16; fontSDF.charsCount = 95; // Parameters > font size: 16, no chars array provided (0), chars count: 0 (defaults to 95) - fontSDF.chars = LoadFontData("resources/AnonymousPro-Bold.ttf", 16, 0, 0, true); + fontSDF.chars = LoadFontData("resources/AnonymousPro-Bold.ttf", 16, 0, 0, FONT_SDF); // Parameters > chars count: 95, font size: 16, chars padding in image: 0 px, pack method: 1 (Skyline algorythm) atlas = GenImageFontAtlas(fontSDF.chars, 95, 16, 0, 1); fontSDF.texture = LoadTextureFromImage(atlas); |
