mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-28 17:16:29 +03:00
Added more tests.
This commit is contained in:
BIN
bin/unit_tests/assets/fontrendering/eepp-textedit-arabic.webp
Normal file
BIN
bin/unit_tests/assets/fontrendering/eepp-textedit-arabic.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
bin/unit_tests/assets/fontrendering/eepp-textedit-hebrew.webp
Normal file
BIN
bin/unit_tests/assets/fontrendering/eepp-textedit-hebrew.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -21,4 +21,4 @@ How much is this?: كم سعره؟
|
||||
Where is the bathroom?: أين الحمام؟
|
||||
Help!: المساعدة!
|
||||
Stop!: توقف!
|
||||
Call the police!: اتصل بالشرطة!
|
||||
Call the police!: اتصل بالشرطة!
|
||||
24
bin/unit_tests/assets/textfiles/test-hebrew.uext
Normal file
24
bin/unit_tests/assets/textfiles/test-hebrew.uext
Normal file
@@ -0,0 +1,24 @@
|
||||
Hello: שלום
|
||||
Good morning: בוקר טוב
|
||||
Good night: לילה טוב
|
||||
Thank you: תודה
|
||||
You're welcome: בשמחה
|
||||
Yes / No: כן / לא
|
||||
Please: בבקשה
|
||||
Excuse me / Sorry: סליחה / מצטער
|
||||
How are you?: מה שלומך?
|
||||
I'm fine. And you?: אני בסדר. ואתה?
|
||||
What's your name?: מה שמך?
|
||||
My name is...: שמי...
|
||||
Nice to meet you: נעים לפגוש אותך
|
||||
Where are you from?: מאיפה אתה?
|
||||
I'm from...: אני מ...
|
||||
Do you speak English?: אתה מדבר אנגלית?
|
||||
I don't understand: אני לא מבין.
|
||||
Please speak more slowly: בבקשה דבר לאט יותר.
|
||||
Please write it down: בבקשה כתוב את זה.
|
||||
How much is this?: כמה זה עולה?
|
||||
Where is the bathroom?: איפה השירותים?
|
||||
Help!: עזרה!
|
||||
Stop!: עצור!
|
||||
Call the police!: תתקשר למשטרה!
|
||||
@@ -168,16 +168,16 @@ EE_MAIN_FUNC int main( int, char*[] ) {
|
||||
editor->setFontSize( PixelDensity::dpToPx( 12 ) );
|
||||
FontManager::instance()->addFallbackFont(
|
||||
FontTrueType::New( "arabic", "unit_tests/assets/fonts/NotoNaskhArabic-Regular.ttf" ) );
|
||||
FontManager::instance()->addFallbackFont( FontTrueType::New(
|
||||
"NotoSerifBengali-Regular", "unit_tests/assets/fonts/NotoSansBengali-Regular.ttf" ) );
|
||||
// FontManager::instance()->addFallbackFont( FontTrueType::New(
|
||||
// "NotoSerifBengali-Regular", "unit_tests/assets/fonts/NotoSansBengali-Regular.ttf" ) );
|
||||
// editor->setLineWrapMode( LineWrapMode::Word );
|
||||
editor->setFont( FontManager::instance()->getByName( "monospace" ) );
|
||||
// editor->loadFromFile( "unit_tests/assets/textfiles/test-arabic-simple.uext" );
|
||||
// editor->loadFromFile( "unit_tests/assets/textfiles/test-arabic.uext" );
|
||||
editor->loadFromFile( "unit_tests/assets/textfiles/test-arabic.uext" );
|
||||
// editor->loadFromFile( "unit_tests/assets/textfiles/test-bengali.uext" );
|
||||
// editor->loadFromFile( "unit_tests/assets/textfiles/test-flags.uext" );
|
||||
// editor->loadFromFile( "unit_tests/assets/textformat/english.utf8.lf.nobom.txt" );
|
||||
editor->loadFromFile( "unit_tests/assets/textfiles/test-arabic-mixed.uext" );
|
||||
// editor->loadFromFile( "unit_tests/assets/textfiles/test-arabic-mixed.uext" );
|
||||
// editor->getDocument().textInput( "اسمي..." );
|
||||
// editor->getDocument().textInput( " হ্যাঁ " );
|
||||
// editor->getDocument().textInput( "I'm from...: আমি ... থেকে এসেছি।" );
|
||||
|
||||
@@ -426,6 +426,46 @@ UTEST( FontRendering, textEditBengaliTest ) {
|
||||
compareImages( utest_state, utest_result, app.getWindow(), "eepp-textedit-bengali" );
|
||||
}
|
||||
|
||||
UTEST( FontRendering, textEditArabicTest ) {
|
||||
BoolScopedOp op( Text::TextShaperEnabled, true );
|
||||
UIApplication app(
|
||||
WindowSettings( 1024, 650, "eepp - TextEdit Arabic", WindowStyle::Default,
|
||||
WindowBackend::Default, 32, {}, 1, false, true ),
|
||||
UIApplication::Settings( Sys::getProcessPath() + ".." + FileSystem::getOSSlash(), 1.5f ) );
|
||||
FileSystem::changeWorkingDirectory( Sys::getProcessPath() );
|
||||
FontTrueType* arabicFont =
|
||||
FontTrueType::New( "NotoNaskhArabic-Regular", "assets/fonts/NotoNaskhArabic-Regular.ttf" );
|
||||
FontManager::instance()->addFallbackFont( arabicFont );
|
||||
UTEST_PRINT_STEP( "Text Shaper enabled" );
|
||||
auto* editor = UITextEdit::New();
|
||||
// editor->setFontSize( PixelDensity::dpToPx( 12 ) );
|
||||
editor->setPixelsSize( app.getUI()->getPixelsSize() );
|
||||
editor->loadFromFile( "assets/textfiles/test-arabic.uext" );
|
||||
SceneManager::instance()->update();
|
||||
SceneManager::instance()->draw();
|
||||
compareImages( utest_state, utest_result, app.getWindow(), "eepp-textedit-arabic" );
|
||||
}
|
||||
|
||||
UTEST( FontRendering, textEditHebrewTest ) {
|
||||
BoolScopedOp op( Text::TextShaperEnabled, true );
|
||||
UIApplication app(
|
||||
WindowSettings( 1024, 650, "eepp - TextEdit Hebrew", WindowStyle::Default,
|
||||
WindowBackend::Default, 32, {}, 1, false, true ),
|
||||
UIApplication::Settings( Sys::getProcessPath() + ".." + FileSystem::getOSSlash(), 1.5f ) );
|
||||
FileSystem::changeWorkingDirectory( Sys::getProcessPath() );
|
||||
FontTrueType* hebrewFont =
|
||||
FontTrueType::New( "NotoSansHebrew-Regular", "assets/fonts/NotoSansHebrew-Regular.ttf" );
|
||||
FontManager::instance()->addFallbackFont( hebrewFont );
|
||||
UTEST_PRINT_STEP( "Text Shaper enabled" );
|
||||
auto* editor = UITextEdit::New();
|
||||
// editor->setFontSize( PixelDensity::dpToPx( 12 ) );
|
||||
editor->setPixelsSize( app.getUI()->getPixelsSize() );
|
||||
editor->loadFromFile( "assets/textfiles/test-hebrew.uext" );
|
||||
SceneManager::instance()->update();
|
||||
SceneManager::instance()->draw();
|
||||
compareImages( utest_state, utest_result, app.getWindow(), "eepp-textedit-hebrew" );
|
||||
}
|
||||
|
||||
UTEST( FontRendering, textSizes ) {
|
||||
auto win = Engine::instance()->createWindow(
|
||||
WindowSettings( 1024, 650, "eepp - Text Sizes", WindowStyle::Default,
|
||||
|
||||
Reference in New Issue
Block a user