diff --git a/bin/assets/colorschemes/colorschemes.conf b/bin/assets/colorschemes/colorschemes.conf index 19b5a5914..b9282f248 100644 --- a/bin/assets/colorschemes/colorschemes.conf +++ b/bin/assets/colorschemes/colorschemes.conf @@ -71,14 +71,14 @@ minimap_highlight = #FFFF0080 normal = #cfcfcf symbol = #cfcfcf comment = #cd8b00 -keyword = #8a98ff,shadow -keyword2 = #8abdff,shadow -keyword3 = #cfcfcf,shadow +keyword = #8a98ff,bold +keyword2 = #8abdff,bold +keyword3 = #cfcfcf,bold number = #f0ad6d literal = #ffcd8b string = #ffcd8b operator = #cfbfad -function = #76c0d0,shadow +function = #76c0d0,bold link = #5ccfcf link_hover = transparent,shadow,underline diff --git a/bin/assets/fonts/DejaVuSansMono-Bold.ttf b/bin/assets/fonts/DejaVuSansMono-Bold.ttf new file mode 100644 index 000000000..8184ced8c Binary files /dev/null and b/bin/assets/fonts/DejaVuSansMono-Bold.ttf differ diff --git a/bin/assets/fonts/DejaVuSansMono-BoldOblique.ttf b/bin/assets/fonts/DejaVuSansMono-BoldOblique.ttf new file mode 100644 index 000000000..754dca732 Binary files /dev/null and b/bin/assets/fonts/DejaVuSansMono-BoldOblique.ttf differ diff --git a/bin/assets/fonts/DejaVuSansMono-Oblique.ttf b/bin/assets/fonts/DejaVuSansMono-Oblique.ttf new file mode 100644 index 000000000..4c858d401 Binary files /dev/null and b/bin/assets/fonts/DejaVuSansMono-Oblique.ttf differ diff --git a/include/eepp/graphics.hpp b/include/eepp/graphics.hpp index d02d3d63a..af47c8a71 100644 --- a/include/eepp/graphics.hpp +++ b/include/eepp/graphics.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/include/eepp/graphics/font.hpp b/include/eepp/graphics/font.hpp index 5e2342d62..9c9002987 100644 --- a/include/eepp/graphics/font.hpp +++ b/include/eepp/graphics/font.hpp @@ -47,6 +47,8 @@ class EE_API Font { struct Info { std::string family; ///< The font family + std::string fontpath; ///< The directory path of the font + std::string filename; ///< The file name }; static inline Uint32 getHorizontalAlign( const Uint32& flags ) { diff --git a/include/eepp/graphics/fontfamily.hpp b/include/eepp/graphics/fontfamily.hpp new file mode 100644 index 000000000..6e9f6a6b6 --- /dev/null +++ b/include/eepp/graphics/fontfamily.hpp @@ -0,0 +1,21 @@ +#ifndef EE_GRAPHICS_FONTFAMILY_HPP +#define EE_GRAPHICS_FONTFAMILY_HPP + +#include + +namespace EE { namespace Graphics { + +class EE_API FontFamily { + public: + static void loadFromRegular( FontTrueType* font ); + private: + static std::string findType( const std::string& fontpath, const std::string& fontname, + const std::string& ext, const std::vector& names ); + + static FontTrueType* setFont( FontTrueType* font, const std::string& fontpath, + const std::string& fontType ); +}; + +}} // namespace EE::Graphics + +#endif // FONTFAMILY_HPP diff --git a/include/eepp/graphics/fonttruetype.hpp b/include/eepp/graphics/fonttruetype.hpp index 56e93736e..d5c89a508 100644 --- a/include/eepp/graphics/fonttruetype.hpp +++ b/include/eepp/graphics/fonttruetype.hpp @@ -117,6 +117,12 @@ class EE_API FontTrueType : public Font { virtual bool hasBoldItalic() { return isBoldItalic() || mFontBoldItalic; } + FontTrueType* getBoldFont() const { return mFontBold; } + + FontTrueType* getItalicFont() const { return mFontItalic; } + + FontTrueType* getBoldItalicFont() const { return mFontBoldItalic; } + void setBoldFont( FontTrueType* fontBold ); void setItalicFont( FontTrueType* fontItalic ); diff --git a/include/eepp/graphics/glyphdrawable.hpp b/include/eepp/graphics/glyphdrawable.hpp index 39150fa91..2627deda0 100644 --- a/include/eepp/graphics/glyphdrawable.hpp +++ b/include/eepp/graphics/glyphdrawable.hpp @@ -58,6 +58,10 @@ class EE_API GlyphDrawable : public DrawableResource { void setDrawMode( const DrawMode& drawMode ); + bool isItalic() const { return mIsItalic; } + + void setIsItalic( bool isItalic ); + protected: Texture* mTexture; Rectf mSrcRect; @@ -65,6 +69,7 @@ class EE_API GlyphDrawable : public DrawableResource { Float mPixelDensity; Vector2f mGlyphOffset; DrawMode mDrawMode{ DrawMode::Image }; + bool mIsItalic{ false }; }; }} // namespace EE::Graphics diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index 5a45c8017..8bbc0fec7 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -86,6 +86,7 @@ true 0 + false @@ -935,6 +936,7 @@ 2 + false %{buildDir}/../../bin/eepp-test-debug eepp-test-debug ProjectExplorer.CustomExecutableRunConfiguration @@ -959,6 +961,7 @@ 2 + false %{buildDir}/../../bin/eepp-test eepp-test-release ProjectExplorer.CustomExecutableRunConfiguration @@ -983,13 +986,13 @@ 2 + false %{buildDir}/../../bin/eepp-physics-demo-debug eepp-physics-debug ProjectExplorer.CustomExecutableRunConfiguration true false - false true false %{buildDir}../../../bin/ @@ -1007,13 +1010,13 @@ 2 + false %{buildDir}/../../bin/eepp-http-request-debug eepp-http-request-debug ProjectExplorer.CustomExecutableRunConfiguration true false - false true false %{buildDir}../../../bin/ @@ -1031,13 +1034,13 @@ 2 + false %{buildDir}../../../bin/eeiv-debug eeiv-debug ProjectExplorer.CustomExecutableRunConfiguration true false - false true false %{buildDir}../../../bin/ @@ -1055,6 +1058,7 @@ 2 + false %{buildDir}/../../bin/eepp-TextureAtlasEditor-debug eepp-TextureAtlasEditor-debug ProjectExplorer.CustomExecutableRunConfiguration @@ -1079,6 +1083,7 @@ 2 + false %{buildDir}/../../bin/eepp-MapEditor-debug eepp-MapEditor-debug ProjectExplorer.CustomExecutableRunConfiguration @@ -1104,6 +1109,7 @@ 2 + false %{buildDir}/../../bin/eepp-UIEditor-debug eepp-UIEditor-debug ProjectExplorer.CustomExecutableRunConfiguration @@ -1129,13 +1135,13 @@ 2 + false %{buildDir}/../../bin/eepp-ui-hello-world-debug eepp-ui-hello-world-debug ProjectExplorer.CustomExecutableRunConfiguration true false - false true false %{buildDir}../../../bin/ @@ -1153,6 +1159,7 @@ 2 + false %{buildDir}/../../bin/eepp-TexturePacker-debug eepp-TexturePacker-debug ProjectExplorer.CustomExecutableRunConfiguration @@ -1178,6 +1185,7 @@ 2 + false %{buildDir}/../../bin/eepp-ui-perf-test-debug eepp-ui-perf-test-debug ProjectExplorer.CustomExecutableRunConfiguration @@ -1202,13 +1210,14 @@ 2 + false %{buildDir}/../../bin/ecode-debug ecode-debug ProjectExplorer.CustomExecutableRunConfiguration - true + 0 false - false + 1 false false %{buildDir}/../../bin @@ -1226,6 +1235,7 @@ 2 + false %{buildDir}/../../bin/eepp-empty-window-debug eepp-empty-window-debug ProjectExplorer.CustomExecutableRunConfiguration @@ -1250,6 +1260,7 @@ 2 + false %{buildDir}/../../bin/eterm-debug eterm-debug ProjectExplorer.CustomExecutableRunConfiguration @@ -1274,6 +1285,7 @@ 2 + false %{buildDir}/../../bin/eepp-empty-window eepp-empty-window-release ProjectExplorer.CustomExecutableRunConfiguration @@ -1298,13 +1310,13 @@ 2 + false %{buildDir}/../../bin/eepp-external-shader-debug eepp-external-shader-debug ProjectExplorer.CustomExecutableRunConfiguration true false - false true false %{buildDir}../../../bin/ @@ -1322,13 +1334,13 @@ 2 + false %{buildDir}/../../bin/eepp-external-shader eepp-external-shader-release ProjectExplorer.CustomExecutableRunConfiguration true false - false true false %{buildDir}../../../bin/ @@ -1346,13 +1358,13 @@ 2 + false %{buildDir}/../../bin/eepp-sound-debug eepp-sound-debug ProjectExplorer.CustomExecutableRunConfiguration true false - false true true %{buildDir}../../../bin/ @@ -1370,13 +1382,13 @@ 2 + false %{buildDir}/../../bin/eepp-sprites-debug eepp-sprites-debug ProjectExplorer.CustomExecutableRunConfiguration true false - false true false %{buildDir}../../../bin/ @@ -1394,14 +1406,15 @@ 2 + false %{buildDir}/../../bin/eepp-fonts-debug eepp-fonts-debug ProjectExplorer.CustomExecutableRunConfiguration - true + 0 false - false - true + 1 + false false %{buildDir}../../../bin/ @@ -1418,13 +1431,13 @@ 2 + false %{buildDir}/../../bin/eepp-vbo-fbo-batch-debug eepp-vbo-fbo-batch-debug ProjectExplorer.CustomExecutableRunConfiguration true false - false true false %{buildDir}../../../bin/ diff --git a/projects/linux/ee.files b/projects/linux/ee.files index fb07cccb0..54a6de1aa 100644 --- a/projects/linux/ee.files +++ b/projects/linux/ee.files @@ -59,6 +59,7 @@ ../../include/eepp/graphics/drawablesearcher.hpp ../../include/eepp/graphics/fontbmfont.hpp ../../include/eepp/graphics/font.hpp +../../include/eepp/graphics/fontfamily.hpp ../../include/eepp/graphics/fontmanager.hpp ../../include/eepp/graphics/fontsprite.hpp ../../include/eepp/graphics/fontstyleconfig.hpp @@ -543,6 +544,7 @@ ../../src/eepp/graphics/drawablesearcher.cpp ../../src/eepp/graphics/fontbmfont.cpp ../../src/eepp/graphics/font.cpp +../../src/eepp/graphics/fontfamily.cpp ../../src/eepp/graphics/fontmanager.cpp ../../src/eepp/graphics/fontsprite.cpp ../../src/eepp/graphics/fonttruetype.cpp diff --git a/src/eepp/graphics/fontfamily.cpp b/src/eepp/graphics/fontfamily.cpp new file mode 100644 index 000000000..9c32df8af --- /dev/null +++ b/src/eepp/graphics/fontfamily.cpp @@ -0,0 +1,60 @@ +#include +#include + +namespace EE { namespace Graphics { + +void FontFamily::loadFromRegular( FontTrueType* font ) { + if ( font == nullptr || font->getInfo().fontpath.empty() || font->getInfo().filename.empty() ) + return; + + std::string ext( FileSystem::fileExtension( font->getInfo().filename ) ); + if ( ext.empty() ) + return; + + std::string fontname( FileSystem::fileRemoveExtension( font->getInfo().filename ) ); + if ( String::endsWith( fontname, "-Regular" ) ) { + auto pos( fontname.find_last_of( '-' ) ); + fontname.resize( pos ); + } + + setFont( font, findType( font->getInfo().fontpath, fontname, ext, { "Bold", "bold" } ), + "bold" ); + + setFont( font, + findType( font->getInfo().fontpath, fontname, ext, + { "Italic", "Oblique", "italic", "oblique", "It", "it" } ), + "italic" ); + + setFont( font, + findType( font->getInfo().fontpath, fontname, ext, { "BoldItalic", "BoldOblique" } ), + "bolditalic" ); +} + +std::string FontFamily::findType( const std::string& fontpath, const std::string& fontname, + const std::string& ext, const std::vector& names ) { + std::string path; + for ( const auto& name : names ) { + path = fontpath + fontname + "-" + name + "." + ext; + if ( FileSystem::fileExists( path ) ) + return path; + } + return ""; +} + +FontTrueType* FontFamily::setFont( FontTrueType* font, const std::string& fontpath, + const std::string& fontType ) { + if ( fontpath.empty() ) + return nullptr; + FontTrueType* loadedFont = FontTrueType::New( font->getName() + "-" + fontType, fontpath ); + if ( fontType == "bold" ) + font->setBoldFont( loadedFont ); + else if ( fontType == "italic" ) + font->setItalicFont( loadedFont ); + else if ( fontType == "bolditalic" ) + font->setBoldItalicFont( loadedFont ); + loadedFont->setBoldAdvanceSameAsRegular( font->getBoldAdvanceSameAsRegular() ); + loadedFont->setEnableDynamicMonospace( font->getEnableDynamicMonospace() ); + return loadedFont; +} + +}} // namespace EE::Graphics diff --git a/src/eepp/graphics/fonttruetype.cpp b/src/eepp/graphics/fonttruetype.cpp index f94f0b52a..f968bcc0f 100644 --- a/src/eepp/graphics/fonttruetype.cpp +++ b/src/eepp/graphics/fonttruetype.cpp @@ -129,6 +129,9 @@ bool FontTrueType::loadFromFile( const std::string& filename ) { return false; } + mInfo.fontpath = FileSystem::fileRemoveFileName( filename ); + mInfo.filename = FileSystem::fileNameFromPath( filename ); + return setFontFace( face ); } @@ -214,15 +217,17 @@ bool FontTrueType::loadFromPack( Pack* pack, std::string filePackPath ) { if ( NULL == pack ) return false; - bool Ret = false; + bool ret = false; mMemCopy.clear(); - if ( pack->isOpen() && pack->extractFileToMemory( filePackPath, mMemCopy ) ) { - Ret = loadFromMemory( mMemCopy.get(), mMemCopy.length(), false ); - } + if ( pack->isOpen() && pack->extractFileToMemory( filePackPath, mMemCopy ) ) + ret = loadFromMemory( mMemCopy.get(), mMemCopy.length(), false ); - return Ret; + mInfo.fontpath = FileSystem::fileRemoveFileName( filePackPath ); + mInfo.filename = FileSystem::fileNameFromPath( filePackPath ); + + return ret; } bool FontTrueType::setFontFace( void* _face ) { @@ -339,18 +344,18 @@ const Glyph& FontTrueType::getGlyph( Uint32 codePoint, unsigned int characterSiz if ( bold && italic && mFontBoldItalic != nullptr && 0 != mFontBoldItalic->getGlyphIndex( codePoint ) ) { - return mFontBoldItalic->getGlyph( codePoint, characterSize, false, false, outlineThickness, + return mFontBoldItalic->getGlyph( codePoint, characterSize, true, true, outlineThickness, getPage( characterSize ), maxWidth ); } if ( bold && !italic && mFontBold != nullptr && 0 != mFontBold->getGlyphIndex( codePoint ) ) { - return mFontBold->getGlyph( codePoint, characterSize, false, false, outlineThickness, + return mFontBold->getGlyph( codePoint, characterSize, true, false, outlineThickness, getPage( characterSize ), maxWidth ); } if ( italic && !bold && mFontItalic != nullptr && 0 != mFontItalic->getGlyphIndex( codePoint ) ) { - return mFontItalic->getGlyph( codePoint, characterSize, false, false, outlineThickness, + return mFontItalic->getGlyph( codePoint, characterSize, false, true, outlineThickness, getPage( characterSize ), maxWidth ); } @@ -417,6 +422,7 @@ GlyphDrawable* FontTrueType::getGlyphDrawable( Uint32 codePoint, unsigned int ch Uint32 glyphIndex = 0; Uint32 tGlyphIndex = 0; Uint32 fontInternalId = mFontInternalId; + bool isItalic = false; if ( mEnableEmojiFallback && Font::isEmojiCodePoint( codePoint ) && !mIsColorEmojiFont && !mIsEmojiFont ) { @@ -449,6 +455,26 @@ GlyphDrawable* FontTrueType::getGlyphDrawable( Uint32 codePoint, unsigned int ch glyphIndex = getGlyphIndex( codePoint ); } + if ( bold && italic && mFontBoldItalic != nullptr && + ( tGlyphIndex = mFontBoldItalic->getGlyphIndex( codePoint ) ) ) { + glyphIndex = tGlyphIndex; + fontInternalId = mFontBoldItalic->getFontInternalId(); + isItalic = true; + } + + if ( bold && !italic && mFontBold != nullptr && + ( tGlyphIndex = mFontBold->getGlyphIndex( codePoint ) ) ) { + glyphIndex = tGlyphIndex; + fontInternalId = mFontBold->getFontInternalId(); + } + + if ( italic && !bold && mFontItalic != nullptr && + ( tGlyphIndex = mFontItalic->getGlyphIndex( codePoint ) ) ) { + glyphIndex = tGlyphIndex; + fontInternalId = mFontItalic->getFontInternalId(); + isItalic = true; + } + if ( 0 == glyphIndex && mEnableFallbackFont && FontManager::instance()->getFallbackFont() != nullptr && FontManager::instance()->getFallbackFont()->getType() == FontType::TTF ) { @@ -473,44 +499,19 @@ GlyphDrawable* FontTrueType::getGlyphDrawable( Uint32 codePoint, unsigned int ch if ( it != drawables.end() ) { return it->second; } else { - GlyphDrawable* region = nullptr; - const Glyph* glyph = nullptr; + const Glyph& glyph = + getGlyph( codePoint, characterSize, bold, italic, outlineThickness, maxWidth ); + GlyphDrawable* region = GlyphDrawable::New( + page.texture, glyph.textureRect, glyph.size, + String::format( "%s_%d_%u", mFontName.c_str(), characterSize, codePoint ) ); - if ( bold && italic && mFontBoldItalic != nullptr && - 0 != mFontBoldItalic->getGlyphIndex( codePoint ) ) { - glyph = &mFontBoldItalic->getGlyph( codePoint, characterSize, false, false, - outlineThickness, maxWidth ); - region = GlyphDrawable::New( page.texture, glyph->textureRect, glyph->size, - String::format( "%s_%d_%u_bold_italic", mFontName.c_str(), - characterSize, codePoint ) ); - } else if ( bold && !italic && mFontBold != nullptr && - 0 != mFontBold->getGlyphIndex( codePoint ) ) { - glyph = &mFontBold->getGlyph( codePoint, characterSize, false, false, outlineThickness, - maxWidth ); - region = GlyphDrawable::New( - page.texture, glyph->textureRect, glyph->size, - String::format( "%s_%d_%u_bold", mFontName.c_str(), characterSize, codePoint ) ); - } else if ( italic && !bold && mFontItalic != nullptr && - 0 != mFontItalic->getGlyphIndex( codePoint ) ) { - glyph = &mFontItalic->getGlyph( codePoint, characterSize, false, false, - outlineThickness, maxWidth ); - region = GlyphDrawable::New( - page.texture, glyph->textureRect, glyph->size, - String::format( "%s_%d_%u_italic", mFontName.c_str(), characterSize, codePoint ) ); - } else { - glyph = &getGlyph( codePoint, characterSize, bold, italic, outlineThickness, maxWidth ); - region = GlyphDrawable::New( - page.texture, glyph->textureRect, glyph->size, - String::format( "%s_%d_%u", mFontName.c_str(), characterSize, codePoint ) ); - } + region->setGlyphOffset( { glyph.bounds.Left - outlineThickness, + characterSize + glyph.bounds.Top - outlineThickness } ); - if ( region != nullptr ) { - region->setGlyphOffset( { glyph->bounds.Left - outlineThickness, - characterSize + glyph->bounds.Top - outlineThickness } ); + region->setIsItalic( isItalic ); - drawables[key] = region; - return region; - } + drawables[key] = region; + return region; } return nullptr; } @@ -731,7 +732,7 @@ fontSetRenderOptions( FT_Library library, FontAntialiasing antialiasing, FontHin return FT_RENDER_MODE_NORMAL; } -Glyph FontTrueType::loadGlyph( Uint32 index, unsigned int characterSize, bool bold, bool italic, +Glyph FontTrueType::loadGlyph( Uint32 index, unsigned int characterSize, bool bold, bool /*italic*/, Float outlineThickness, Page& page, const Float& maxWidth ) const { // The glyph to return Glyph glyph; @@ -782,7 +783,7 @@ Glyph FontTrueType::loadGlyph( Uint32 index, unsigned int characterSize, bool bo FT_Pos weight = 1 << 6; bool outline = ( glyphDesc->format == FT_GLYPH_FORMAT_OUTLINE ); if ( outline ) { - if ( bold ) { + if ( bold && !mIsBold ) { FT_OutlineGlyph outlineGlyph = (FT_OutlineGlyph)glyphDesc; FT_Outline_EmboldenXY( &outlineGlyph->outline, 1 << 5, weight ); } @@ -803,7 +804,7 @@ Glyph FontTrueType::loadGlyph( Uint32 index, unsigned int characterSize, bool bo // Apply bold if necessary -- fallback technique using bitmap (lower quality) if ( !outline ) { - if ( bold ) + if ( bold && !mIsBold ) FT_Bitmap_Embolden( static_cast( mLibrary ), &bitmap, weight, weight ); if ( outlineThickness != 0 && !mIsColorEmojiFont ) diff --git a/src/eepp/graphics/glyphdrawable.cpp b/src/eepp/graphics/glyphdrawable.cpp index 2a90a7d80..acd2e2deb 100644 --- a/src/eepp/graphics/glyphdrawable.cpp +++ b/src/eepp/graphics/glyphdrawable.cpp @@ -41,7 +41,7 @@ void GlyphDrawable::draw( const Vector2f& position, const Sizef& size ) { mSrcRect.Top + mSrcRect.Bottom ); if ( mDrawMode == DrawMode::Image ) { BR->batchQuad( position.x, position.y, size.getWidth(), size.getHeight() ); - } else if ( mDrawMode == DrawMode::TextItalic ) { + } else if ( mDrawMode == DrawMode::TextItalic && !mIsItalic ) { Float x = position.x + mGlyphOffset.x; Float y = position.y + mGlyphOffset.y; Float italic = 0.208f * size.getWidth(); // 12 degrees @@ -63,7 +63,7 @@ void GlyphDrawable::drawIntoVertexBuffer( VertexBuffer* vbo, const Vector2u& gri Sizef size( mDestSize != Sizef::Zero ? mDestSize : Sizef( mSrcRect.Right, mSrcRect.Bottom ) ); if ( mDrawMode == DrawMode::Image ) { vbo->setQuad( gridPos, pos, size, mColor ); - } else if ( mDrawMode == DrawMode::TextItalic ) { + } else if ( mDrawMode == DrawMode::TextItalic && !mIsItalic ) { Float x = pos.x + mGlyphOffset.x; Float y = pos.y + mGlyphOffset.y; Float italic = 0.208f * size.getWidth(); // 12 degrees @@ -119,4 +119,8 @@ void GlyphDrawable::setDrawMode( const DrawMode& drawMode ) { mDrawMode = drawMode; } +void GlyphDrawable::setIsItalic( bool isItalic ) { + mIsItalic = isItalic; +} + }} // namespace EE::Graphics diff --git a/src/tools/ecode/ecode.cpp b/src/tools/ecode/ecode.cpp index f682b3baa..2b015ac02 100644 --- a/src/tools/ecode/ecode.cpp +++ b/src/tools/ecode/ecode.cpp @@ -13,6 +13,7 @@ #include "version.hpp" #include #include +#include #include #include #if EE_PLATFORM == EE_PLATFORM_LINUX @@ -287,6 +288,7 @@ void App::openFontDialog( std::string& fontPath, bool loadingMonoFont ) { mFontMono = fontMono; mFontMono->setEnableDynamicMonospace( true ); mFontMono->setBoldAdvanceSameAsRegular( true ); + FontFamily::loadFromRegular( mFontMono ); if ( mSplitter ) { mSplitter->forEachEditor( [this]( UICodeEditor* editor ) { editor->setFont( mFontMono ); } ); @@ -3193,6 +3195,7 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe if ( mFontMono ) { mFontMono->setEnableDynamicMonospace( true ); mFontMono->setBoldAdvanceSameAsRegular( true ); + FontFamily::loadFromRegular( mFontMono ); } loadFont( "NotoEmoji-Regular", "fonts/NotoEmoji-Regular.ttf" ); @@ -3213,6 +3216,15 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe mTerminalFont = loadFont( "monospace-nerdfont", mConfig.ui.terminalFont, "fonts/DejaVuSansMonoNerdFontComplete.ttf" ); + if ( ( nullptr != mTerminalFont && mTerminalFont->getInfo().family == "DejaVuSansMono NF" && + mFontMono->getInfo().family == "DejaVu Sans Mono" ) || + mTerminalFont->getInfo().family == mFontMono->getInfo().family ) { + mTerminalFont->setBoldFont( mFontMono->getBoldFont() ); + mTerminalFont->setItalicFont( mFontMono->getItalicFont() ); + mTerminalFont->setBoldItalicFont( mFontMono->getBoldItalicFont() ); + } else { + FontFamily::loadFromRegular( mTerminalFont ); + } mFallbackFont = loadFont( "fallback-font", "fonts/DroidSansFallbackFull.ttf" ); if ( mFallbackFont )