Added a new example a fix to an issue with font loading when not counting the whitespace
This commit is contained in:
parent
7ef114d1da
commit
87a6fa34a2
1 changed files with 29 additions and 5 deletions
24
examples/text/text_font_custom_characters.c
Normal file
24
examples/text/text_font_custom_characters.c
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#include "raylib.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
const int screenWidth = 800;
|
||||
const int screenHeight = 450;
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [text] example - font custom characters");
|
||||
SetTargetFPS(60);
|
||||
|
||||
int chars[126 - 33];
|
||||
for (int i = 0; i < 126 - 33; i++) chars[i] = 33 + i;
|
||||
|
||||
Font font = LoadFontEx("resources/KAISG.ttf", 64, chars, 126 - 33);
|
||||
|
||||
while (!WindowShouldClose())
|
||||
{
|
||||
BeginDrawing();
|
||||
ClearBackground(WHITE);
|
||||
|
||||
DrawTexture(font.texture, 0, 0, BLACK);
|
||||
EndDrawing();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue