mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-10-25 23:57:53 +03:00
Merge branch 'develop' into text-shape
This commit is contained in:
@@ -150,6 +150,8 @@ class EE_API FontTrueType : public Font {
|
||||
|
||||
void clearCache();
|
||||
|
||||
Uint32 getGlyphIndex( const Uint32& codePoint ) const;
|
||||
|
||||
protected:
|
||||
friend class Text;
|
||||
friend class TextLayouter;
|
||||
@@ -194,8 +196,6 @@ class EE_API FontTrueType : public Font {
|
||||
bool bold, bool italic, Float outlineThickness,
|
||||
Page& page ) const;
|
||||
|
||||
Uint32 getGlyphIndex( const Uint32& codePoint ) const;
|
||||
|
||||
Glyph loadGlyphByIndex( Uint32 codePoint, unsigned int characterSize, bool bold, bool italic,
|
||||
Float outlineThickness, Page& page ) const;
|
||||
|
||||
|
||||
@@ -18,7 +18,8 @@ class EE_API UIApplication {
|
||||
|
||||
Settings( std::optional<std::string> basePath, std::optional<Float> pixelDensity = {},
|
||||
bool loadBaseResources = true, Font* baseFont = nullptr,
|
||||
std::optional<std::string> baseStyleSheetPath = {}, Font* emojiFont = nullptr );
|
||||
std::optional<std::string> baseStyleSheetPath = {}, Font* emojiFont = nullptr,
|
||||
Font* fallbackFont = nullptr );
|
||||
|
||||
//! By default it will use the current process path as the base path. This will set the
|
||||
//! default working directory.
|
||||
@@ -37,9 +38,13 @@ class EE_API UIApplication {
|
||||
//! The style sheet path is the path of the base UI theme stylesheet ( will look at
|
||||
//! "assets/ui/breeze.css" by default )
|
||||
std::optional<std::string> baseStyleSheetPath;
|
||||
//! The default emoji font for the UI. If not provided it will load NotoEmoji-Regular ( will
|
||||
//! look at "assets/fonts/NotoEmoji-Regular.ttf" )
|
||||
//! The default emoji font for the UI. If not provided it will load Noto Color Emoji ( it
|
||||
//! will look at "assets/fonts/NotoColorEmoji.ttf" ) otherwise it will try NotoEmoji-Regular
|
||||
//! ( it will look at "assets/fonts/NotoEmoji-Regular.ttf" )
|
||||
Font* emojiFont{ nullptr };
|
||||
//! The default fallback font for the UI. If not provided it will load Droid Sans Fallback
|
||||
//! Full ( it will look at "assets/fonts/DroidSansFallbackFull.ttf" )
|
||||
Font* fallbackFont{ nullptr };
|
||||
};
|
||||
|
||||
UIApplication( const WindowSettings& windowSettings, const Settings& appSettings = Settings(),
|
||||
|
||||
@@ -67,8 +67,16 @@ UIApplication::UIApplication( const WindowSettings& windowSettings, const Settin
|
||||
FontFamily::loadFromRegular( static_cast<FontTrueType*>( monospaceFont ) );
|
||||
}
|
||||
|
||||
if ( appSettings.emojiFont == nullptr )
|
||||
FontTrueType::New( "NotoEmoji-Regular", "assets/fonts/NotoEmoji-Regular.ttf" );
|
||||
if ( appSettings.emojiFont == nullptr ) {
|
||||
if ( FileSystem::fileExists( "assets/fonts/NotoColorEmoji.ttf" ) )
|
||||
FontTrueType::New( "NotoColorEmoji", "assets/fonts/NotoColorEmoji.ttf" );
|
||||
else if ( FileSystem::fileExists( "assets/fonts/NotoEmoji-Regular.ttf" ) )
|
||||
FontTrueType::New( "NotoEmoji-Regular", "assets/fonts/NotoEmoji-Regular.ttf" );
|
||||
}
|
||||
|
||||
if ( appSettings.fallbackFont == nullptr &&
|
||||
FileSystem::fileExists( "assets/fonts/DroidSansFallbackFull.ttf" ) )
|
||||
FontTrueType::New( "DroidSansFallbackFull", "assets/fonts/DroidSansFallbackFull.ttf" );
|
||||
|
||||
mUISceneNode->getUIThemeManager()->setDefaultFont( font );
|
||||
mUISceneNode->getRoot()->addClass( "appbackground" );
|
||||
@@ -120,13 +128,14 @@ int UIApplication::run() {
|
||||
UIApplication::Settings::Settings( std::optional<std::string> basePath,
|
||||
std::optional<Float> pixelDensity, bool loadBaseResources,
|
||||
Font* baseFont, std::optional<std::string> baseStyleSheetPath,
|
||||
Font* emojiFont ) :
|
||||
Font* emojiFont, Font* fallbackFont ) :
|
||||
basePath( basePath ),
|
||||
pixelDensity( pixelDensity ),
|
||||
loadBaseResources( loadBaseResources ),
|
||||
baseFont( baseFont ),
|
||||
baseStyleSheetPath( baseStyleSheetPath ),
|
||||
emojiFont( emojiFont ) {}
|
||||
emojiFont( emojiFont ),
|
||||
fallbackFont( fallbackFont ) {}
|
||||
|
||||
void UIApplication::setShowMemoryManagerResult( bool show ) {
|
||||
mShowMemoryManagerResult = show;
|
||||
|
||||
@@ -1415,7 +1415,7 @@ int utest_main(int argc, const char *const argv[]) {
|
||||
size_t skipped_testcases_length = 0;
|
||||
const char *filter = UTEST_NULL;
|
||||
utest_uint64_t ran_tests = 0;
|
||||
int enable_mixed_units = 0;
|
||||
int enable_mixed_units = 1;
|
||||
int random_order = 0;
|
||||
utest_uint32_t seed = 0;
|
||||
|
||||
@@ -1437,7 +1437,7 @@ int utest_main(int argc, const char *const argv[]) {
|
||||
/* Test config switches */
|
||||
const char filter_str[] = "--filter=";
|
||||
const char output_str[] = "--output=";
|
||||
const char enable_mixed_units_str[] = "--enable-mixed-units";
|
||||
const char enable_mixed_units_str[] = "--disable-mixed-units";
|
||||
const char random_order_str[] = "--random-order";
|
||||
const char random_order_with_seed_str[] = "--random-order=";
|
||||
|
||||
@@ -1451,7 +1451,7 @@ int utest_main(int argc, const char *const argv[]) {
|
||||
"names can be passed to --filter.\n");
|
||||
printf(" --output=<output> Output an xunit XML file to the file "
|
||||
"specified in <output>.\n"
|
||||
" --enable-mixed-units Enable the per-test output to contain "
|
||||
" --disable-mixed-units Disable the per-test output to contain "
|
||||
"mixed units (s/ms/us/ns).\n"
|
||||
" --random-order[=<seed>] Randomize the order that the tests are "
|
||||
"ran in. If the optional <seed> argument is not provided, then a "
|
||||
@@ -1472,7 +1472,7 @@ int utest_main(int argc, const char *const argv[]) {
|
||||
return 0;
|
||||
} else if (0 == UTEST_STRNCMP(argv[index], enable_mixed_units_str,
|
||||
strlen(enable_mixed_units_str))) {
|
||||
enable_mixed_units = 1;
|
||||
enable_mixed_units = 0;
|
||||
} else if (0 == UTEST_STRNCMP(argv[index], random_order_with_seed_str,
|
||||
strlen(random_order_with_seed_str))) {
|
||||
seed =
|
||||
|
||||
Reference in New Issue
Block a user