diff options
| author | Ray <[email protected]> | 2021-09-02 00:35:55 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2021-09-02 00:35:55 +0200 |
| commit | 59e7275464f9323a617a0f8ce30a5b69746a1915 (patch) | |
| tree | 16ce6da425afebfae7751306b48cf81c9b9159f7 /examples/text/text_font_sdf.c | |
| parent | fa79ae8a3d06f8507724f8afffa5dcac1a5b5c8f (diff) | |
| download | raylib-59e7275464f9323a617a0f8ce30a5b69746a1915.tar.gz raylib-59e7275464f9323a617a0f8ce30a5b69746a1915.zip | |
REVIEWED: Glyphs
Diffstat (limited to 'examples/text/text_font_sdf.c')
| -rw-r--r-- | examples/text/text_font_sdf.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/text/text_font_sdf.c b/examples/text/text_font_sdf.c index 7de7986b..8a2c0d77 100644 --- a/examples/text/text_font_sdf.c +++ b/examples/text/text_font_sdf.c @@ -39,24 +39,24 @@ int main(void) // Default font generation from TTF font Font fontDefault = { 0 }; fontDefault.baseSize = 16; - fontDefault.charsCount = 95; + fontDefault.glyphCount = 95; // Loading font data from memory data - // Parameters > font size: 16, no chars array provided (0), chars count: 95 (autogenerate chars array) - fontDefault.chars = LoadFontData(fileData, fileSize, 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, &fontDefault.recs, 95, 16, 4, 0); + // Parameters > font size: 16, no glyphs array provided (0), glyphs count: 95 (autogenerate chars array) + fontDefault.glyphs = LoadFontData(fileData, fileSize, 16, 0, 95, FONT_DEFAULT); + // Parameters > glyphs count: 95, font size: 16, glyphs padding in image: 4 px, pack method: 0 (default) + Image atlas = GenImageFontAtlas(fontDefault.glyphs, &fontDefault.recs, 95, 16, 4, 0); fontDefault.texture = LoadTextureFromImage(atlas); UnloadImage(atlas); // SDF font generation from TTF font 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(fileData, fileSize, 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, &fontSDF.recs, 95, 16, 0, 1); + fontSDF.glyphCount = 95; + // Parameters > font size: 16, no glyphs array provided (0), glyphs count: 0 (defaults to 95) + fontSDF.glyphs = LoadFontData(fileData, fileSize, 16, 0, 0, FONT_SDF); + // Parameters > glyphs count: 95, font size: 16, glyphs padding in image: 0 px, pack method: 1 (Skyline algorythm) + atlas = GenImageFontAtlas(fontSDF.glyphs, &fontSDF.recs, 95, 16, 0, 1); fontSDF.texture = LoadTextureFromImage(atlas); UnloadImage(atlas); |
