Merge branch 'master' of https://bitbucket.org/4coder/4coder
commit
b39c479902
|
@ -283,6 +283,7 @@ internal int LinuxHandleToFD(Plat_Handle);
|
|||
|
||||
internal void LinuxStringDup(String*, void*, size_t);
|
||||
internal void LinuxToggleFullscreen(Display*, Window);
|
||||
internal void LinuxFatalErrorMsg(const char* msg);
|
||||
|
||||
internal Sys_Acquire_Lock_Sig(system_acquire_lock);
|
||||
internal Sys_Release_Lock_Sig(system_release_lock);
|
||||
|
|
|
@ -69,6 +69,16 @@ linux_font_load(Partition *part, Render_Font *rf, char *name, i32 pt_size, i32 t
|
|||
#endif
|
||||
|
||||
if (filename != 0){
|
||||
struct stat st;
|
||||
if(stat(filename, &st) == -1 || S_ISDIR(st.st_mode)){
|
||||
char buff[1024];
|
||||
|
||||
// NOTE(inso): if/when you can load fonts from anywhere, the message should be changed.
|
||||
snprintf(buff, sizeof(buff), "Unable to load font '%s'. Make sure this file is in the same directory as the '4ed' executable.", filename);
|
||||
LinuxFatalErrorMsg(buff);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
result = font_load_freetype(part, rf, filename, pt_size, tab_width, use_hinting);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue