mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-10-01 18:50:16 +03:00
Initial support for fallback fonts.
Minor fix in TerminalDisplay.
This commit is contained in:
@@ -118,6 +118,8 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) {
|
||||
args::Flag fb( parser, "framebuffer", "Use frame buffer (more memory usage, less CPU usage)",
|
||||
{ "fb", "framebuffer" } );
|
||||
args::ValueFlag<std::string> fontPath( parser, "fontpath", "Font path", { 'f', "font" } );
|
||||
args::ValueFlag<std::string> fallbackFontPathF( parser, "fallback-fontpath",
|
||||
"Fallback Font path", { "fallback-font" } );
|
||||
args::ValueFlag<Float> fontSize( parser, "fontsize", "Font size (in dp)", { 's', "fontsize" },
|
||||
11 );
|
||||
args::ValueFlag<Float> width( parser, "winwidth", "Window width (in dp)", { "width" }, 1280 );
|
||||
@@ -212,6 +214,13 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) {
|
||||
->loadFromFile( resPath + "fonts/NotoEmoji-Regular.ttf" );
|
||||
}
|
||||
|
||||
std::string fallbackFontPath( fallbackFontPathF.Get() );
|
||||
if ( FileSystem::fileExists( fallbackFontPath ) ) {
|
||||
FontTrueType* fallbackFont = FontTrueType::New( "fallback-font" );
|
||||
if ( fallbackFont->loadFromFile( fallbackFontPath ) )
|
||||
FontManager::instance()->setFallbackFont( fallbackFont );
|
||||
}
|
||||
|
||||
Float realMaxFPS = maxFPS.Get() ? maxFPS.Get() : currentDisplay->getRefreshRate();
|
||||
frameTime = benchmarkMode ? Time::Zero : Milliseconds( 1000.f / realMaxFPS );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user