Skip to content

Commit 63e2f1b

Browse files
author
ChrisDill
committed
Updated text_font_sdf example.
- Requires changes to GenImageFontAtlas and LoadFontData. Using IntPtr for chars and recs. Uses a ref to the IntPtr for recs which I think is okay.
1 parent 9fad011 commit 63e2f1b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Examples/text/text_font_sdf.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ public static int Main()
3838
fontDefault.charsCount = 95;
3939
// Parameters > font size: 16, no chars array provided (0), chars count: 95 (autogenerate chars array)
4040
// TODO: fix conversion
41-
fontDefault.chars = LoadFontData("resources/AnonymousPro-Bold.ttf", 16, null, 95, (int)FontType.FONT_DEFAULT);
41+
fontDefault.chars = LoadFontData("resources/AnonymousPro-Bold.ttf", 16, null, 95, FontType.FONT_DEFAULT);
4242
// Parameters > chars count: 95, font size: 16, chars padding in image: 4 px, pack method: 0 (default)
43-
Image atlas = GenImageFontAtlas(fontDefault.chars, 95, 16, 4, 0);
43+
Image atlas = GenImageFontAtlas(fontDefault.chars, ref fontDefault.recs, 95, 16, 4, 0);
4444
fontDefault.texture = LoadTextureFromImage(atlas);
4545
UnloadImage(atlas);
4646

@@ -52,7 +52,7 @@ public static int Main()
5252
// Parameters > font size: 16, no chars array provided (0), chars count: 0 (defaults to 95)
5353
fontSDF.chars = LoadFontData("resources/AnonymousPro-Bold.ttf", 16, null, 0, (int)FontType.FONT_DEFAULT);
5454
// Parameters > chars count: 95, font size: 16, chars padding in image: 0 px, pack method: 1 (Skyline algorythm)
55-
atlas = GenImageFontAtlas(fontSDF.chars, 95, 16, 0, 1);
55+
atlas = GenImageFontAtlas(fontSDF.chars, ref fontSDF.recs, 95, 16, 0, 1);
5656
fontSDF.texture = LoadTextureFromImage(atlas);
5757
UnloadImage(atlas);
5858

0 commit comments

Comments
 (0)