Some minor fixes and improvements to FontTrueType.

This commit is contained in:
Martín Lucas Golini
2022-02-10 01:38:26 -03:00
parent 623490bc72
commit 5440a2ef77
5 changed files with 81 additions and 42 deletions

View File

@@ -179,8 +179,9 @@ void App::openFontDialog( std::string& fontPath ) {
std::string absoluteFontPath( fontPath );
if ( isRelativePath( absoluteFontPath ) )
absoluteFontPath = mResPath + fontPath;
UIFileDialog* dialog = UIFileDialog::New( UIFileDialog::DefaultFlags, "*.ttf; *.otf; *.wolff; *.otb",
FileSystem::fileRemoveFileName( absoluteFontPath ) );
UIFileDialog* dialog =
UIFileDialog::New( UIFileDialog::DefaultFlags, "*.ttf; *.otf; *.wolff; *.otb",
FileSystem::fileRemoveFileName( absoluteFontPath ) );
ModelIndex index = dialog->getMultiView()->getListView()->findRowWithText(
FileSystem::fileNameFromPath( fontPath ), true, true );
if ( index.isValid() )
@@ -2057,6 +2058,10 @@ void App::init( const std::string& file, const Float& pidelDensity ) {
if ( mFontMono )
mFontMono->setBoldAdvanceSameAsRegular( true );
#if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN
loadFont( "NotoColorEmoji", "assets/fonts/NotoColorEmoji.ttf" );
#endif
FontTrueType* iconFont =
FontTrueType::New( "icon", mResPath + "assets/fonts/remixicon.ttf" );