Skip to content
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

Fix font loading #37919

Merged
merged 4 commits into from
Feb 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed data/font/terminus-bold.fon
Binary file not shown.
5 changes: 3 additions & 2 deletions src/sdltiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3865,20 +3865,21 @@ CachedTTFFont::CachedTTFFont( const int w, const int h, std::string typeface, in
: Font( w, h )
, fontblending( fontblending )
{
const std::string original_typeface = typeface;
int faceIndex = 0;
if( const cata::optional<std::string> sysfnt = find_system_font( typeface, faceIndex ) ) {
typeface = *sysfnt;
dbg( D_INFO ) << "Using font [" + typeface + "] found in the system.";
}
if( !file_exist( typeface ) ) {
faceIndex = 0;
typeface = PATH_INFO::user_font() + typeface + ".ttf";
typeface = PATH_INFO::user_font() + original_typeface + ".ttf";
dbg( D_INFO ) << "Using compatible font [" + typeface + "] found in user font dir.";
}
//make fontdata compatible with wincurse
if( !file_exist( typeface ) ) {
faceIndex = 0;
typeface = PATH_INFO::fontdir() + typeface + ".ttf";
typeface = PATH_INFO::fontdir() + original_typeface + ".ttf";
dbg( D_INFO ) << "Using compatible font [" + typeface + "] found in font dir.";
}
//different default font with wincurse
Expand Down