Skip to content

[rtext] isGpuReady flag in ExportFontAsCode #4894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
hatkidchan opened this issue Apr 15, 2025 · 1 comment
Closed
4 tasks done

[rtext] isGpuReady flag in ExportFontAsCode #4894

hatkidchan opened this issue Apr 15, 2025 · 1 comment

Comments

@hatkidchan
Copy link
Contributor

Please, before submitting a new issue verify and check:

  • I tested it on latest raylib version from master branch
  • I checked there is no similar issue already reported
  • I checked the documentation on the wiki
  • My code has no errors or misuse of raylib

Issue description

Since 4c9282b, ExportFontAsCode function also uses isGpuReady flag, which is not available publicly.
When using exported font (by #includeing it and calling LoadFont_XXX()), you can't even compile the file that's using the #included font.

As a workaround you can add const bool isGpuReady = true; before the #include.

Environment

N/A

Issue Screenshot

N/A

Code Example

#include <stdlib.h>
#include <raylib.h>

int main(void) {
  InitWindow(0, 0, "");
  Font font = LoadFontEx("font.ttf", 16, 0, 256);
  ExportFontAsCode(font, "font.h");
  UnloadFont(font);
}

And observe font.h

@raysan5
Copy link
Owner

raysan5 commented Apr 15, 2025

@hatkidchan Good catch! Actually that function shouldn't be checking if isGpuReady... That mechanism was a bad idea, I need to review it in some other way.

@raysan5 raysan5 closed this as completed Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants