We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2468

Summary: SDL2_TTF TTF_OpenFont couldn't load font file: Fedora 19
Product: SDL_ttf Reporter: voidtype
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: yohann.ferreira
Version: unspecified   
Hardware: x86_64   
OS: Linux   

Description voidtype 2014-03-28 21:01:16 UTC
Hoping that I've just made a silly mistake in my code. Trying to open up a TTF file, lazy.ttf on Fedora 19. 

if(TTF_Init() == -1)
   std::cout << "TTF failed to initialize." << std::endl;
TTF_Font *f = TTF_OpenFont("lazy.ttf", 22);
if(f == nullptr)
   std::cout << TTF_GetError() << std::endl;

This code works for me fine on Windows 8, however it doesn't work for me on Fedora 19, giving me the error "Couldn't load font file.". I have the font file in the correct directory and I've scoured the internet in an attempt to find a solution to no avail. My project is in codeblocks and everything is linked correctly to my knowledge. 

Sorry if this isn't a bug and is just a mistake on my end.

Thanks
Comment 1 Yohann Ferreira 2014-12-19 10:14:46 UTC
Hi there,

For info, this bug looks similar to: https://bugzilla.libsdl.org/show_bug.cgi?id=2127

It seems the following patch may have fixed the problem:
http://hg.libsdl.org/SDL_ttf/rev/86aa91bce20c

Hopefully this will help you.

Best regards,
Comment 2 Sam Lantinga 2017-09-10 05:55:04 UTC
If this is the font you're trying to load, this works fine with the latest SDL_ttf release:
http://www.dafont.com/lazy.font

If not, please reopen the bug and attach the font for diagnosis.

Thanks!