mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-06 06:13:10 +00:00
Update text_font_sdf.c
This commit is contained in:
parent
29ce5d8aa9
commit
b16d14f5ed
@ -50,7 +50,7 @@ int main(void)
|
|||||||
|
|
||||||
// Loading font data from memory data
|
// Loading font data from memory data
|
||||||
// Parameters > font size: 16, no glyphs array provided (0), glyphs count: 95 (autogenerate chars array)
|
// 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);
|
fontDefault.glyphs = LoadFontData(fileData, fileSize, 16, 0, 95, FONT_DEFAULT, &fontDefault.glyphCount);
|
||||||
// Parameters > glyphs count: 95, font size: 16, glyphs padding in image: 4 px, pack method: 0 (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);
|
Image atlas = GenImageFontAtlas(fontDefault.glyphs, &fontDefault.recs, 95, 16, 4, 0);
|
||||||
fontDefault.texture = LoadTextureFromImage(atlas);
|
fontDefault.texture = LoadTextureFromImage(atlas);
|
||||||
@ -61,7 +61,8 @@ int main(void)
|
|||||||
fontSDF.baseSize = 16;
|
fontSDF.baseSize = 16;
|
||||||
fontSDF.glyphCount = 95;
|
fontSDF.glyphCount = 95;
|
||||||
// Parameters > font size: 16, no glyphs array provided (0), glyphs count: 0 (defaults to 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);
|
fontSDF.glyphs = LoadFontData(fileData, fileSize, 16, 0, 0, FONT_SDF, &
|
||||||
|
fontSDF.glyphCount);
|
||||||
// Parameters > glyphs count: 95, font size: 16, glyphs padding in image: 0 px, pack method: 1 (Skyline algorythm)
|
// 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);
|
atlas = GenImageFontAtlas(fontSDF.glyphs, &fontSDF.recs, 95, 16, 0, 1);
|
||||||
fontSDF.texture = LoadTextureFromImage(atlas);
|
fontSDF.texture = LoadTextureFromImage(atlas);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user