FontTrueType: Allow disable emoji fallback.

Vector2: Added round, roundUp, roundDown.
KeyEvent: Now sends also the scancode.
GlyphDrawable force glyph offset to be an integer value.
TerminalDisplay: Allow emoji fonts. Fixed minor bugs. Added events callback.
TerminalEmulator: Added clearHistory.
eterm: Implemented title updates.
This commit is contained in:
Martín Lucas Golini
2022-06-27 02:05:26 -03:00
parent 919b9145d7
commit d949667eaf
18 changed files with 184 additions and 57 deletions
+11
View File
@@ -93,10 +93,21 @@ EE_MAIN_FUNC int main( int, char*[] ) {
FontTrueType* fontMono = FontTrueType::New( "monospace" );
fontMono->loadFromFile( "assets/fonts/DejaVuSansMonoNerdFontComplete.ttf" );
fontMono->setEnableEmojiFallback( false );
if ( FileSystem::fileExists( "assets/fonts/NotoColorEmoji.ttf" ) ) {
FontTrueType::New( "emoji-color" )->loadFromFile( "assets/fonts/NotoColorEmoji.ttf" );
} else if ( FileSystem::fileExists( "assets/fonts/NotoEmoji-Regular.ttf" ) ) {
FontTrueType::New( "emoji-font" )->loadFromFile( "assets/fonts/NotoEmoji-Regular.ttf" );
}
if ( !terminal || terminal->hasTerminated() ) {
terminal = TerminalDisplay::create( win, fontMono, PixelDensity::dpToPx( 11 ),
win->getSize().asFloat() );
terminal->pushEventCallback( [&]( const TerminalDisplay::Event& event ) {
if ( event.type == TerminalDisplay::EventType::TITLE )
win->setTitle( "eterm - " + event.eventData );
} );
}
win->getInput()->pushCallback( &inputCallback );