From: Paul Wisbey
Covered: " . + $coverage_ref->{"covered_lines"} . "
" . + "
Uncovered: " . + $coverage_ref->{"uncovered_lines"} . "
"; + } + } + else + { + print ""; + my $span=0; + if($suffix eq ".cpp" || $suffix eq ".c" || $suffix eq ".h") + { + print ""; + $span=1; + } + print "No coverage found"; + print "" if $span; + } + print "
"; + + for my $patch (@$patchref) + { + my $hunkstr="Hunk: " . $patch->[0]; + if( $patch->[1] > 1 ) + { + $hunkstr .= " - " . ($patch->[0]+$patch->[1]-1); + } + print "" . $hunkstr . "
"; + + print "";
+ for(my $i = 0; $i < $patch->[1]; $i++ )
+ {
+ my $line = $i + $patch->[0];
+ my $num_line_digits=log($line)/log(10);
+ for $i (0..(6-$num_line_digits-1))
+ {
+ print " ";
+ }
+ print "$line ";
+
+ if($coverage_ref)
+ {
+ my $color;
+ if($coverage_ref->{"covered"}->{$line})
+ {
+ print("");
+ }
+ elsif($coverage_ref->{"uncovered"}->{$line})
+ {
+ print("");
+ }
+ else
+ {
+ #print("");
+ }
+ my $src=$coverage_ref->{"src"}->{$line};
+ chomp($src);
+ #print $color, "$src\n", RESET;
+ print "$src\n";
+ }
+ else
+ {
+ # We don't have coverage data, so print it from the patch instead.
+ my $src = $b_lines_ref->{$line};
+ print "$src\n";
+ }
+ }
+ print "<\pre>\n";
+ }
+ }
+
+ print $filehandle "
\n\n\n";
+ close $filehandle;
+ select $OUTPUT_FH;
+}
+
+
################################################################################
## MAIN ##
################################################################################
@@ -492,30 +607,82 @@ chdir "build/tizen";
my @cmd=('--no-pager','diff','--no-ext-diff','-U0','--no-color');
my $status = $repo->command("status", "-s");
-if( $status eq "" )
+if( $status eq "" && !scalar(@ARGV))
{
- # There are no changes in the index or working tree. Use the last patch instead
+ # There are no changes in the index or working tree, and
+ # no diff arguments to append. Use the last patch instead.
push @cmd, ('HEAD~1','HEAD');
}
-elsif($opt_cached) # TODO: Remove this option. Instead, need full diff
+else
{
- push @cmd, "--cached";
+ # detect if there are only cached changes or only working tree changes
+ my $cached = 0;
+ my $working = 0;
+ for my $fstat ( split(/\n/, $status) )
+ {
+ if(substr( $fstat, 0, 1 ) ne " "){ $cached++; }
+ if(substr( $fstat, 1, 1 ) ne " "){ $working++; }
+ }
+ if($cached > 0 )
+ {
+ if($working == 0)
+ {
+ push @cmd, "--cached";
+ }
+ else
+ {
+ die "Both cached & working files - cannot get correct patch from git\n";
+ # Would have to diff from separate clone.
+ }
+ }
}
push @cmd, @ARGV;
my $filesref = run_diff(@cmd);
-my $percent = calc_patch_coverage_percentage($filesref);
-if( ! $opt_quiet )
+chdir $cwd;
+
+# Check how many actual source files there are in the patch
+my $filecount = 0;
+foreach my $file (keys(%$filesref))
+{
+ my ($name, $path, $suffix) = fileparse($file, qr{\.[^.]*$});
+ next if($path !~ /^dali/);
+ next if($suffix ne ".cpp" && $suffix ne ".c" && $suffix ne ".h");
+ $filecount++;
+}
+if( $filecount == 0 )
+{
+ print "No source files found\n";
+ exit 0; # Exit with no error.
+}
+
+my $percentref = calc_patch_coverage_percentage($filesref);
+if($percentref->[0] == 0)
+{
+ print "No coverable lines found\n";
+ exit 0;
+}
+my $percent = $percentref->[1];
+
+my $color=BOLD RED;
+if($opt_output)
+{
+ print "Outputing to $opt_output\n" if $debug;
+ patch_html_output($filesref);
+}
+elsif( ! $opt_quiet )
{
patch_output($filesref);
- my $color=BOLD RED;
if($percent>=90)
{
$color=GREEN;
}
- printf("Percentage of change covered: $color %5.2f%\n" . RESET, $percent);
+ print RESET;
}
+
+printf("Percentage of change covered: %5.2f%\n", $percent);
+
exit($percent<90);
diff --git a/automated-tests/src/dali-adaptor-internal/utc-Dali-FontClient.cpp b/automated-tests/src/dali-adaptor-internal/utc-Dali-FontClient.cpp
index fdb1df5b4..0134b9bbe 100644
--- a/automated-tests/src/dali-adaptor-internal/utc-Dali-FontClient.cpp
+++ b/automated-tests/src/dali-adaptor-internal/utc-Dali-FontClient.cpp
@@ -27,40 +27,61 @@ using namespace Dali;
int UtcDaliFontClient(void)
{
- const int ORDERED_VALUES[] = { 50, 63, 75, 87, 100, 113, 125, 150, 200 };
+ const int ORDERED_VALUES[] = { -1, 50, 63, 75, 87, 100, 113, 125, 150, 200 };
const unsigned int NUM_OF_ORDERED_VALUES = sizeof( ORDERED_VALUES ) / sizeof( int );
TestApplication application;
- int preciseIndex = 0;
int result=0;
- tet_infoline("UtcDaliFontClient center range");
- preciseIndex = 4;
- result = TextAbstraction::Internal::ValueToIndex( ORDERED_VALUES[preciseIndex], ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( preciseIndex, result, TEST_LOCATION );
+ tet_infoline("UtcDaliFontClient No table");
+ result = TextAbstraction::Internal::ValueToIndex( 100, NULL, 0u );
+ DALI_TEST_EQUALS( -1, result, TEST_LOCATION );
- tet_infoline("UtcDaliFontClient start of range");
- preciseIndex = 0;
- result = TextAbstraction::Internal::ValueToIndex( ORDERED_VALUES[preciseIndex], ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( preciseIndex, result, TEST_LOCATION );
-
- tet_infoline("UtcDaliFontClient end of range");
- preciseIndex = 8;
- result = TextAbstraction::Internal::ValueToIndex( ORDERED_VALUES[preciseIndex], ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( preciseIndex, result, TEST_LOCATION );
+ tet_infoline("UtcDaliFontClient Non defined values");
+ result = TextAbstraction::Internal::ValueToIndex( -1, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 0, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( -3, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 0, result, TEST_LOCATION );
- tet_infoline("UtcDaliFontClient below of range");
+ tet_infoline("UtcDaliFontClient Between non defined and first of range.");
+ result = TextAbstraction::Internal::ValueToIndex( 0, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
result = TextAbstraction::Internal::ValueToIndex( 30, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 0, result, TEST_LOCATION );
+ DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 49, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
- tet_infoline("UtcDaliFontClient below of range");
- result = TextAbstraction::Internal::ValueToIndex( 220, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ tet_infoline("UtcDaliFontClient Defined in range");
+ for( unsigned int index = 1u; index < NUM_OF_ORDERED_VALUES; ++index )
+ {
+ result = TextAbstraction::Internal::ValueToIndex( ORDERED_VALUES[index], ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( index, result, TEST_LOCATION );
+ }
+
+ tet_infoline("UtcDaliFontClient Non defined in range");
+ result = TextAbstraction::Internal::ValueToIndex( 51, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 55, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 1, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 62, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 2, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 64, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 2, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 151, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
DALI_TEST_EQUALS( 8, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 175, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 176, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 199, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
- tet_infoline("UtcDaliFontClient zero ");
- result = TextAbstraction::Internal::ValueToIndex( 0, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
- DALI_TEST_EQUALS( 0, result, TEST_LOCATION );
+ tet_infoline("UtcDaliFontClient above of range");
+ result = TextAbstraction::Internal::ValueToIndex( 220, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
+ result = TextAbstraction::Internal::ValueToIndex( 500, ORDERED_VALUES, NUM_OF_ORDERED_VALUES - 1u );
+ DALI_TEST_EQUALS( 9, result, TEST_LOCATION );
END_TEST;
}
diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.cpp b/automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.cpp
index 467bb5262..b50f50648 100644
--- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.cpp
+++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.cpp
@@ -337,3 +337,51 @@ BufferImage CreateBufferImage()
{
return CreateBufferImage(4, 4, Color::WHITE);
}
+
+namespace Test
+{
+
+struct ObjectDestructionFunctor
+{
+ // Create a ObjectDestructionFunctor passing in a Dali::RefObject* to be monitored and a bool variable.
+ // Create ObjectRegistry instance and connect to the ObjectDestroyedSignal passing in the above functor for the callback.
+ // Get the ObjectPointer (Actor::GetObjectPtr) of the Actor to be checked for destruction and assign it to the Dali::RefObject*
+ // Check the bool variable which would be true when object destroyed.
+ ObjectDestructionFunctor( Dali::RefObject* objectPtr, bool& refObjectDestroyed )
+ : refObjectPointerToCheck( objectPtr ),
+ refObjectDestroyedBoolean( refObjectDestroyed )
+ {
+ refObjectDestroyed = false;
+ }
+
+ void operator()( const Dali::RefObject* objectPointer )
+ {
+ if ( refObjectPointerToCheck == objectPointer )
+ {
+ refObjectDestroyedBoolean = true;
+ }
+ }
+
+ Dali::RefObject* refObjectPointerToCheck;
+ bool& refObjectDestroyedBoolean;
+};
+
+ObjectDestructionTracker::ObjectDestructionTracker()
+ :mRefObjectDestroyed( false)
+{
+}
+
+void ObjectDestructionTracker::Start( Actor actor )
+{
+ ObjectDestructionFunctor destructionFunctor( actor.GetObjectPtr(), mRefObjectDestroyed );
+
+ ObjectRegistry objectRegistry = Stage::GetCurrent().GetObjectRegistry();
+ objectRegistry.ObjectDestroyedSignal().Connect( this, destructionFunctor );
+}
+
+bool ObjectDestructionTracker::IsDestroyed()
+{
+ return mRefObjectDestroyed;
+}
+
+} // namespace Test
diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.h b/automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.h
index 7f81872e1..8cefb7c53 100644
--- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.h
+++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/dali-test-suite-utils.h
@@ -499,4 +499,45 @@ struct DefaultFunctionCoverage
BufferImage CreateBufferImage();
BufferImage CreateBufferImage(int width, int height, const Vector4& color);
+// Test namespace to prevent pollution of Dali namespace, add Test helper functions here
+namespace Test
+{
+/**
+ * @brief
+ *
+ * Helper to check object destruction occurred
+ * 1) In main part of code create an ObjectDestructionTracker
+ * 2) Within sub section of main create object Actor test and call Start with Actor to test for destruction
+ * 3) Perform code which is expected to destroy Actor
+ * 4) Back in main part of code use IsDestroyed() to test if Actor was destroyed
+ */
+class ObjectDestructionTracker : public ConnectionTracker
+{
+public:
+
+ /**
+ * @brief Call in main part of code
+ */
+ ObjectDestructionTracker();
+
+ /**
+ * @brief Call in sub bock of code where the Actor being checked is still alive.
+ *
+ * @param[in] actor Actor to be checked for destruction
+ */
+ void Start( Actor actor );
+
+ /**
+ * @brief Call to check if Actor alive or destroyed.
+ *
+ * @return bool true if Actor was destroyed
+ */
+ bool IsDestroyed();
+
+private:
+ bool mRefObjectDestroyed;
+};
+
+} // namespace Test
+
#endif // __DALI_TEST_SUITE_UTILS_H__
diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-trace-call-stack.cpp b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-trace-call-stack.cpp
index 3f2e6e5fe..0054e59f3 100644
--- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-trace-call-stack.cpp
+++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-trace-call-stack.cpp
@@ -130,6 +130,18 @@ bool TraceCallStack::FindMethodAndParams(std::string method, const NamedParams&
return FindIndexFromMethodAndParams( method, params ) > -1;
}
+bool TraceCallStack::FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const
+{
+ for( size_t i = startIndex; i < mCallStack.size(); ++i )
+ {
+ if( ( mCallStack[i].method.compare( method ) == 0 ) && ( mCallStack[i].paramList.compare( params ) == 0 ) )
+ {
+ startIndex = i;
+ return true;
+ }
+ }
+ return false;
+}
/**
* Search for a method in the stack with the given parameter list
diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-trace-call-stack.h b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-trace-call-stack.h
index 137bfafef..e1882ea0e 100644
--- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-trace-call-stack.h
+++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-trace-call-stack.h
@@ -101,6 +101,19 @@ public:
*/
bool FindMethodAndParams(std::string method, const NamedParams& params) const;
+ /**
+ * Search for a method in the stack with the given parameter list.
+ * The search is done from a given index.
+ * This allows the order of methods and parameters to be checked.
+ * @param[in] method The name of the method
+ * @param[in] params A comma separated list of parameter values
+ * @param[in/out] startIndex The method index to start looking from.
+ * This is updated if a method is found so subsequent
+ * calls can search for methods occuring after this one.
+ * @return True if the method was in the stack
+ */
+ bool FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const;
+
/**
* Search for a method in the stack with the given parameter list
* @param[in] method The name of the method
diff --git a/automated-tests/src/dali-adaptor/utc-Dali-Application.cpp b/automated-tests/src/dali-adaptor/utc-Dali-Application.cpp
index daaee0b07..829997deb 100644
--- a/automated-tests/src/dali-adaptor/utc-Dali-Application.cpp
+++ b/automated-tests/src/dali-adaptor/utc-Dali-Application.cpp
@@ -610,3 +610,14 @@ int UtcDaliApplicationMemoryLowSignalN(void)
END_TEST;
}
+
+int UtcDaliApplicationGetResourcePathP(void)
+{
+ Application application = Application::New();
+ std::string result ("**invalid path**"); // Calling GetResourcePath should replace this with a system dependent path or "".
+ result = application.GetResourcePath();
+ DALI_TEST_CHECK( result !="**invalid path**" );
+
+ END_TEST;
+}
+
diff --git a/build/tizen/adaptor-uv/Makefile.am b/build/tizen/adaptor-uv/Makefile.am
index f05baca2b..4e8e1d7d2 100644
--- a/build/tizen/adaptor-uv/Makefile.am
+++ b/build/tizen/adaptor-uv/Makefile.am
@@ -234,6 +234,32 @@ endif # WAYLAND
endif
+# IVI
+if IVI_PROFILE
+
+adaptor_internal_src_files += $(adaptor_common_internal_src_files) \
+ $(adaptor_common_internal_mobile_profile_src_files) \
+ $(adaptor_tizen_internal_src_files) \
+ $(static_libraries_libunibreak_src_files)
+
+if WAYLAND
+if USE_ECORE_WAYLAND
+adaptor_internal_src_files += $(adaptor_ecore_wayland_tizen_internal_src_files)
+else
+adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files)
+endif # USE_ECORE_WAYLAND
+
+adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files)\
+ $(adaptor_tizen_internal_native_image_src_files)
+
+else
+adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \
+ $(adaptor_common_internal_egl_extension_src_files)
+endif # WAYLAND
+
+endif # IVI_PROFILE
+
+
# Node JS support for using an external libuv main loop. If not enabled then just use e-core as normal
# Used for things like callbacks, file-monintors, x input handling
if LIB_UV_EVENT_LOOP
@@ -330,6 +356,7 @@ libdali_adaptor_uv_la_CXXFLAGS = \
-DFONT_DOWNLOADED_PATH="\"${fontDownloadedPath}\"" \
-DFONT_APPLICATION_PATH="\"${fontApplicationPath}\"" \
-DFONT_CONFIGURATION_FILE="\"${fontConfigurationFile}\"" \
+ -DTIZEN_PLATFORM_CONFIG_SUPPORTED=${tizenPlatformConfigSupported} \
-DNON_POWER_OF_TWO_TEXTURES \
-DDALI_COMPILATION -DDALI_ADAPTOR_COMPILATION \
-Werror -Wall -lgcc \
@@ -392,7 +419,10 @@ libdali_adaptor_uv_la_LIBADD += $(ELEMENTARY_LIBS) \
else
-if MOBILE_PROFILE
+libdali_adaptor_uv_la_CXXFLAGS += $(ECORE_WAYLAND_CFLAGS)
+libdali_adaptor_uv_la_LIBADD += $(ECORE_WAYLAND_LIBS)
+
+if IVI_PROFILE
libdali_adaptor_uv_la_CXXFLAGS += $(ECORE_WAYLAND_CFLAGS)
libdali_adaptor_uv_la_LIBADD += $(ECORE_WAYLAND_LIBS)
endif
@@ -457,6 +487,19 @@ libdali_adaptor_uv_la_CXXFLAGS += $(HAPTIC_CFLAGS)
libdali_adaptor_uv_la_LIBADD +=
endif
+if IVI_PROFILE
+libdali_adaptor_uv_la_CXXFLAGS += \
+ $(DEVICED_CFLAGS) \
+ $(EFL_ASSIST_CFLAGS) \
+ $(NATIVE_BUFFER_CFLAGS) \
+ $(NATIVE_BUFFER_POOL_CFLAGS)
+
+libdali_adaptor_uv_la_LIBADD += \
+ $(EFL_ASSIST_LIBS) \
+ $(NATIVE_BUFFER_LIBS) \
+ $(NATIVE_BUFFER_POOL_LIBS)
+endif
+
if UBUNTU_PROFILE
libdali_adaptor_uv_la_LIBADD += -ljpeg
CFLAGS += -fPIC
diff --git a/build/tizen/adaptor-uv/configure.ac b/build/tizen/adaptor-uv/configure.ac
index dad8f61e3..e61fccfb6 100644
--- a/build/tizen/adaptor-uv/configure.ac
+++ b/build/tizen/adaptor-uv/configure.ac
@@ -189,13 +189,13 @@ AC_ARG_WITH([tizen-2-2-compatibility],
# Tizen Profile options
AC_ARG_ENABLE([profile],
- [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,UBUNTU],
+ [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,IVI,UBUNTU],
[Select the variant of tizen])],
[enable_profile=$enableval],
[enable_profile=UBUNTU])
# Ensure valid profile selected
-if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xUBUNTU"; then
+if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xIVI" -a "x$enable_profile" != "xUBUNTU"; then
AC_MSG_ERROR([$enable_profile is an invalid profile])
fi
@@ -210,6 +210,7 @@ AM_CONDITIONAL([COMMON_PROFILE], [test x$enable_profile = xCOMMON])
AM_CONDITIONAL([MOBILE_PROFILE], [test x$enable_profile = xMOBILE])
AM_CONDITIONAL([WEARABLE_PROFILE], [test x$enable_profile = xWEARABLE])
AM_CONDITIONAL([TV_PROFILE], [test x$enable_profile = xTV])
+AM_CONDITIONAL([IVI_PROFILE], [test x$enable_profile = xIVI])
AM_CONDITIONAL([UBUNTU_PROFILE], [test x$enable_profile = xUBUNTU])
AM_CONDITIONAL([WAYLAND], [test x$enable_wayland = xyes])
AM_CONDITIONAL([USE_EFL], [test x$enable_efl = xyes])
@@ -242,6 +243,10 @@ if test "x$enable_profile" = "xTV"; then
PKG_CHECK_MODULES(OPENGLES20, glesv2)
fi
+if test "x$enable_profile" = "xIVI"; then
+PKG_CHECK_MODULES(OPENGLES20, glesv2)
+fi
+
if test "x$enable_profile" = "xUBUNTU"; then
PKG_CHECK_MODULES(OPENGLES20, glesv2 egl)
else
@@ -284,9 +289,10 @@ fi
else
-# dali-adaptor-uv for MOBILE profile needs ecore-wayland even if enable_efl==no
-# because adaptors/mobile/pixmap-render-surface-factory.cpp uses it.
-if test "x$enable_profile" = "xMOBILE"; then
+# For adaptors/mobile/native-render-surface-factory.cpp
+PKG_CHECK_MODULES(ECORE_WAYLAND, ecore-wayland)
+
+if test "x$enable_profile" = "xIVI"; then
PKG_CHECK_MODULES(ECORE_WAYLAND, ecore-wayland)
fi
@@ -326,11 +332,18 @@ if test x$FONT_CONFIGURATION_FILE != x; then
fontConfigurationFile=$FONT_CONFIGURATION_FILE
fi
+if test x$TIZEN_PLATFORM_CONFIG_SUPPORTED != x; then
+ tizenPlatformConfigSupported=$TIZEN_PLATFORM_CONFIG_SUPPORTED
+else
+ tizenPlatformConfigSupported=0
+fi
+
AC_SUBST(dataReadWriteDir)
AC_SUBST(dataReadOnlyDir)
AC_SUBST(DALI_ADAPTOR_CFLAGS)
AC_SUBST(DALI_PROFILE_CFLAGS)
AC_SUBST(fontConfigurationFile)
+AC_SUBST(tizenPlatformConfigSupported)
# Specify the include directory for development headers
#devincludepath=${includedir}/dali/internal
@@ -368,7 +381,9 @@ Configuration
Font config file: $fontConfigurationFile
Building with EFL Libraries: $enable_efl
Using Tizen APP FW libraries: $enable_appfw
- OpenGL ES version: $enable_gles"
+ OpenGL ES version: $enable_gles
+ Tizen Platform Config supported: $tizenPlatformConfigSupported
+"
# optional output of node.js source path if we're building with libuv
if test "x$build_for_libuv" != "xno"; then
echo " LibUV header path $with_libuv"
diff --git a/build/tizen/adaptor/Makefile.am b/build/tizen/adaptor/Makefile.am
index cf80ebd2f..86701578b 100644
--- a/build/tizen/adaptor/Makefile.am
+++ b/build/tizen/adaptor/Makefile.am
@@ -185,10 +185,12 @@ adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files)
endif # USE_ECORE_WAYLAND
adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \
- $(adaptor_tizen_internal_native_image_src_files)
+ $(adaptor_tizen_internal_native_image_src_files) \
+ $(adaptor_common_internal_wayland_mobile_profile_src_files)
else
adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \
- $(adaptor_common_internal_egl_extension_src_files)
+ $(adaptor_common_internal_egl_extension_src_files) \
+ $(adaptor_common_internal_x_mobile_profile_src_files)
endif # WAYLAND
endif # MOBILE_PROFILE
@@ -210,10 +212,12 @@ endif # USE_ECORE_WAYLAND
adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \
$(adaptor_tizen_internal_native_image_src_files) \
- $(adaptor_internal_wearable_profile_src_files)
+ $(adaptor_internal_wearable_profile_src_files) \
+ $(adaptor_common_internal_wayland_mobile_profile_src_files)
else
adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \
- $(adaptor_common_internal_egl_extension_src_files)
+ $(adaptor_common_internal_egl_extension_src_files) \
+ $(adaptor_common_internal_x_mobile_profile_src_files)
endif # WAYLAND
endif # WEARABLE
@@ -245,6 +249,33 @@ endif # WAYLAND
endif
+# IVI
+if IVI_PROFILE
+
+adaptor_internal_src_files += $(adaptor_common_internal_src_files) \
+ $(adaptor_common_internal_mobile_profile_src_files) \
+ $(adaptor_tizen_internal_src_files) \
+ $(static_libraries_libunibreak_src_files)
+
+if WAYLAND
+
+if USE_ECORE_WAYLAND
+adaptor_internal_src_files += $(adaptor_ecore_wayland_tizen_internal_src_files)
+else
+adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files)
+endif # USE_ECORE_WAYLAND
+
+adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \
+ $(adaptor_tizen_internal_native_image_src_files)
+else
+adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \
+ $(adaptor_common_internal_egl_extension_src_files)
+endif # WAYLAND
+
+endif # IVI_PROFILE
+
+
+
# Node JS support for using an external libuv main loop. If not enabled then just use e-core as normal
# Used for things like callbacks, file-monintors, x input handling
if LIB_UV_EVENT_LOOP
@@ -344,6 +375,7 @@ libdali_adaptor_la_CXXFLAGS = \
-DFONT_DOWNLOADED_PATH="\"${fontDownloadedPath}\"" \
-DFONT_APPLICATION_PATH="\"${fontApplicationPath}\"" \
-DFONT_CONFIGURATION_FILE="\"${fontConfigurationFile}\"" \
+ -DTIZEN_PLATFORM_CONFIG_SUPPORTED=${tizenPlatformConfigSupported} \
-DNON_POWER_OF_TWO_TEXTURES \
-DDALI_COMPILATION -DDALI_ADAPTOR_COMPILATION \
-Werror -Wall -lgcc \
@@ -466,6 +498,19 @@ libdali_adaptor_la_CXXFLAGS += $(HAPTIC_CFLAGS)
libdali_adaptor_la_LIBADD +=
endif
+if IVI_PROFILE
+libdali_adaptor_la_CXXFLAGS += \
+ $(DEVICED_CFLAGS) \
+ $(EFL_ASSIST_CFLAGS) \
+ $(NATIVE_BUFFER_CFLAGS) \
+ $(NATIVE_BUFFER_POOL_CFLAGS)
+
+libdali_adaptor_la_LIBADD += \
+ $(EFL_ASSIST_LIBS) \
+ $(NATIVE_BUFFER_LIBS) \
+ $(NATIVE_BUFFER_POOL_LIBS)
+endif
+
if UBUNTU_PROFILE
libdali_adaptor_la_LIBADD += -ljpeg
CFLAGS += -fPIC
diff --git a/build/tizen/adaptor/configure.ac b/build/tizen/adaptor/configure.ac
index 6764320c2..f008052d2 100644
--- a/build/tizen/adaptor/configure.ac
+++ b/build/tizen/adaptor/configure.ac
@@ -189,13 +189,13 @@ AC_ARG_WITH([tizen-2-2-compatibility],
# Tizen Profile options
AC_ARG_ENABLE([profile],
- [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,UBUNTU],
+ [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV,IVI,UBUNTU],
[Select the variant of tizen])],
[enable_profile=$enableval],
[enable_profile=UBUNTU])
# Ensure valid profile selected
-if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xUBUNTU"; then
+if test "x$enable_profile" != "xCOMMON" -a "x$enable_profile" != "xMOBILE" -a "x$enable_profile" != "xWEARABLE" -a "x$enable_profile" != "xTV" -a "x$enable_profile" != "xIVI" -a "x$enable_profile" != "xUBUNTU"; then
AC_MSG_ERROR([$enable_profile is an invalid profile])
fi
@@ -210,6 +210,7 @@ AM_CONDITIONAL([COMMON_PROFILE], [test x$enable_profile = xCOMMON])
AM_CONDITIONAL([MOBILE_PROFILE], [test x$enable_profile = xMOBILE])
AM_CONDITIONAL([WEARABLE_PROFILE], [test x$enable_profile = xWEARABLE])
AM_CONDITIONAL([TV_PROFILE], [test x$enable_profile = xTV])
+AM_CONDITIONAL([IVI_PROFILE], [test x$enable_profile = xIVI])
AM_CONDITIONAL([UBUNTU_PROFILE], [test x$enable_profile = xUBUNTU])
AM_CONDITIONAL([WAYLAND], [test x$enable_wayland = xyes])
AM_CONDITIONAL([USE_EFL], [test x$enable_efl = xyes])
@@ -251,6 +252,10 @@ if test "x$enable_profile" = "xTV"; then
PKG_CHECK_MODULES(OPENGLES20, glesv2)
fi
+if test "x$enable_profile" = "xIVI"; then
+PKG_CHECK_MODULES(OPENGLES20, glesv2)
+fi
+
if test "x$enable_profile" = "xUBUNTU"; then
PKG_CHECK_MODULES(OPENGLES20, glesv2 egl)
#PKG_CHECK_MODULES(OPENGLES20, gl egl)
@@ -328,6 +333,12 @@ else
dataReadOnlyDir=${prefix}/share/dali/
fi
+if test x$TIZEN_PLATFORM_CONFIG_SUPPORTED != x; then
+ tizenPlatformConfigSupported=$TIZEN_PLATFORM_CONFIG_SUPPORTED
+else
+ tizenPlatformConfigSupported=0
+fi
+
if test x$FONT_CONFIGURATION_FILE != x; then
fontConfigurationFile=$FONT_CONFIGURATION_FILE
fi
@@ -337,6 +348,7 @@ AC_SUBST(dataReadOnlyDir)
AC_SUBST(DALI_ADAPTOR_CFLAGS)
AC_SUBST(DALI_PROFILE_CFLAGS)
AC_SUBST(fontConfigurationFile)
+AC_SUBST(tizenPlatformConfigSupported)
# Specify the include directory for development headers
#devincludepath=${includedir}/dali/internal
@@ -376,6 +388,7 @@ Configuration
Building with EFL Libraries: $enable_efl
Using Tizen APP FW libraries: $enable_appfw
OpenGL ES version: $enable_gles
+ Tizen Platform Config supported $tizenPlatformConfigSupported
TizenVR Engine: $enable_tizenvr
TizenVR Engine Dir: $with_tizenvr_dir
"
diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec
index 2c77b5657..96ed70b1b 100644
--- a/packaging/dali-adaptor.spec
+++ b/packaging/dali-adaptor.spec
@@ -14,7 +14,7 @@
Name: dali-adaptor
Summary: The DALi Tizen Adaptor
-Version: 1.1.45
+Version: 1.2.5
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-2-Clause and MIT
@@ -27,7 +27,8 @@ Requires: giflib
#need libtzplatform-config for directory if tizen version is 3.x
-%if "%{tizen_version_major}" == "3"
+%if "%{tizen_version_major}" >= "3"
+%define tizen_platform_config_supported 1
BuildRequires: pkgconfig(libtzplatform-config)
%endif
@@ -67,6 +68,15 @@ BuildRequires: pkgconfig(appcore-watch)
%define gles_requirement_setup 1
%endif
+%if "%{profile}" == "ivi"
+%define dali_profile IVI
+%define dali_feedback_plugin 0
+%define dali_videoplayer_plugin 1
+%define shaderbincache_flag DISABLE
+BuildRequires: pkgconfig(glesv2)
+%define gles_requirement_setup 1
+%endif
+
%if "%{profile}" == "common"
%define dali_profile COMMON
%define dali_feedback_plugin 0
@@ -219,22 +229,22 @@ VideoPlayer plugin to play a video file for Dali
%prep
%setup -q
-#Use TZ_PATH when tizen version is 3.x
+#Use TZ_PATH when tizen version is 3.x or greater
-%if "%{tizen_version_major}" == "2"
-%define dali_data_rw_dir /usr/share/dali/
-%define dali_data_ro_dir /usr/share/dali/
-%define font_preloaded_path /usr/share/fonts/
-%define font_downloaded_path /opt/share/fonts/
-%define font_application_path /usr/share/app_fonts/
-%define font_configuration_file /opt/etc/fonts/conf.avail/99-slp.conf
-%else
+%if "%{tizen_version_major}" >= "3"
%define dali_data_rw_dir %TZ_SYS_RO_SHARE/dali/
%define dali_data_ro_dir %TZ_SYS_RO_SHARE/dali/
%define font_preloaded_path %TZ_SYS_RO_SHARE/fonts/
%define font_downloaded_path %TZ_SYS_SHARE/fonts/
%define font_application_path %TZ_SYS_RO_SHARE/app_fonts/
%define font_configuration_file %TZ_SYS_ETC/fonts/conf.avail/99-slp.conf
+%else
+%define dali_data_rw_dir /usr/share/dali/
+%define dali_data_ro_dir /usr/share/dali/
+%define font_preloaded_path /usr/share/fonts/
+%define font_downloaded_path /opt/share/fonts/
+%define font_application_path /usr/share/app_fonts/
+%define font_configuration_file /opt/etc/fonts/conf.avail/99-slp.conf
%endif
%define user_shader_cache_dir %{dali_data_ro_dir}/core/shaderbin/
@@ -274,6 +284,9 @@ FONT_PRELOADED_PATH="%{font_preloaded_path}" ; export FONT_PRELOADED_PATH
FONT_DOWNLOADED_PATH="%{font_downloaded_path}" ; export FONT_DOWNLOADED_PATH
FONT_APPLICATION_PATH="%{font_application_path}" ; export FONT_APPLICATION_PATH
FONT_CONFIGURATION_FILE="%{font_configuration_file}" ; export FONT_CONFIGURATION_FILE
+%if 0%{?tizen_platform_config_supported}
+TIZEN_PLATFORM_CONFIG_SUPPORTED="%{tizen_platform_config_supported}" ; export TIZEN_PLATFORM_CONFIG_SUPPORTED
+%endif
# Default to GLES 2.0 if not specified.
%{!?target_gles_version: %define target_gles_version 20}
diff --git a/platform-abstractions/tizen/image-loaders/loader-gif.cpp b/platform-abstractions/tizen/image-loaders/loader-gif.cpp
index 9bb365706..8f8481cc9 100644
--- a/platform-abstractions/tizen/image-loaders/loader-gif.cpp
+++ b/platform-abstractions/tizen/image-loaders/loader-gif.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -259,13 +259,16 @@ bool HandleImageDescriptionRecordType( Bitmap& bitmap, GifFileType* gifInfo, uns
bool HandleExtensionRecordType( GifFileType* gifInfo )
{
SavedImage image;
- image.ExtensionBlocks = NULL;
- image.ExtensionBlockCount = 0;
GifByteType *extensionByte( NULL );
#ifdef LIBGIF_VERSION_5_1_OR_ABOVE
+ ExtensionBlock extensionBlocks;
+ image.ExtensionBlocks = &extensionBlocks;
+ image.ExtensionBlockCount = 1;
int *extensionBlockTypePointer = &image.ExtensionBlocks->Function;
#else
+ image.ExtensionBlocks = NULL;
+ image.ExtensionBlockCount = 0;
int *extensionBlockTypePointer = &image.Function;
#endif
diff --git a/text/dali/devel-api/text-abstraction/font-client.cpp b/text/dali/devel-api/text-abstraction/font-client.cpp
index 048a6f291..e8fba7f2b 100644
--- a/text/dali/devel-api/text-abstraction/font-client.cpp
+++ b/text/dali/devel-api/text-abstraction/font-client.cpp
@@ -93,14 +93,21 @@ PointSize26Dot6 FontClient::GetPointSize( FontId id )
return GetImplementation(*this).GetPointSize( id );
}
-FontId FontClient::FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor )
+FontId FontClient::FindDefaultFont( Character charcode,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor )
{
- return GetImplementation(*this).FindDefaultFont( charcode, requestedPointSize, preferColor );
+ return GetImplementation(*this).FindDefaultFont( charcode,
+ requestedPointSize,
+ preferColor );
}
-FontId FontClient::FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor )
+FontId FontClient::FindFallbackFont( Character charcode,
+ const FontDescription& preferredFontDescription,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor )
{
- return GetImplementation(*this).FindFallbackFont( preferredFont, charcode, requestedPointSize, preferColor );
+ return GetImplementation(*this).FindFallbackFont( charcode, preferredFontDescription, requestedPointSize, preferColor );
}
FontId FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
diff --git a/text/dali/devel-api/text-abstraction/font-client.h b/text/dali/devel-api/text-abstraction/font-client.h
index 326622cb6..885fe6c5b 100644
--- a/text/dali/devel-api/text-abstraction/font-client.h
+++ b/text/dali/devel-api/text-abstraction/font-client.h
@@ -132,36 +132,36 @@ public:
/**
* @brief Retrieve the list of default fonts supported by the system.
*
- * @param[out] defaultFonts A list of default font paths, family & style strings.
+ * @param[out] defaultFonts A list of default font paths, family, width, weight and slant.
*/
void GetDefaultFonts( FontList& defaultFonts );
/**
- * @brief Retrieve the active default font from the system
+ * @brief Retrieve the active default font from the system.
*
- * @param[out] fontDescription font structure describing the default font
+ * @param[out] fontDescription font structure describing the default font.
*/
void GetDefaultPlatformFontDescription( FontDescription& fontDescription );
/**
* @brief Retrieve the list of fonts supported by the system.
*
- * @param[out] systemFonts A list of font paths, family & style strings.
+ * @param[out] systemFonts A list of font paths, family, width, weight and slant.
*/
void GetSystemFonts( FontList& systemFonts );
/**
* @brief Retrieves the font description of a given font @p id.
*
- * @param[in] id The font id.
- * @param[out] fontDescription The path, family & style describing the font.
+ * @param[in] id The font identifier.
+ * @param[out] fontDescription The path, family & style (width, weight and slant) describing the font.
*/
void GetDescription( FontId id, FontDescription& fontDescription );
/**
* @brief Retrieves the font point size of a given font @p id.
*
- * @param[in] id The font id.
+ * @param[in] id The font identifier.
*
* @return The point size in 26.6 fractional points.
*/
@@ -172,10 +172,12 @@ public:
*
* This is useful when localised strings are provided for multiple languages
* i.e. when a single default font does not work for all languages.
+ *
* @param[in] charcode The character for which a font is needed.
* @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
- * @param[in] preferColor True if a color font is preferred.
- * @return A valid font ID, or zero if the font does not exist.
+ * @param[in] preferColor @e true if a color font is preferred.
+ *
+ * @return A valid font identifier, or zero if the font does not exist.
*/
FontId FindDefaultFont( Character charcode,
PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
@@ -186,15 +188,17 @@ public:
*
* This is useful when localised strings are provided for multiple languages
* i.e. when a single default font does not work for all languages.
- * @param[in] preferredFont The preferred font which may not provide a glyph for charcode.
- * The fallback-font will be the closest match to preferredFont, which does support the required glyph.
+ *
* @param[in] charcode The character for which a font is needed.
+ * @param[in] preferredFontDescription Description of the preferred font which may not provide a glyph for @p charcode.
+ * The fallback-font will be the closest match to @p preferredFontDescription, which does support the required glyph.
* @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
- * @param[in] preferColor True if a color font is preferred.
- * @return A valid font ID, or zero if the font does not exist.
+ * @param[in] preferColor @e true if a color font is preferred.
+ *
+ * @return A valid font identifier, or zero if the font does not exist.
*/
- FontId FindFallbackFont( FontId preferredFont,
- Character charcode,
+ FontId FindFallbackFont( Character charcode,
+ const FontDescription& preferredFontDescription,
PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
bool preferColor = false );
@@ -204,23 +208,24 @@ public:
* @param[in] path The path to a font file.
* @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
* @param[in] faceIndex The index of the font face (optional).
- * @return A valid font ID, or zero if the font does not exist.
+ *
+ * @return A valid font identifier, or zero if the font does not exist.
*/
FontId GetFontId( const FontPath& path,
PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
FaceIndex faceIndex = 0 );
/**
- * @brief Retrieve the unique identifier for a font.
+ * @brief Retrieves a unique font identifier for a given description.
*
- * @note It the font style is not empty, it will be used instead the font weight and font slant slant.
- *
- * @param[in] fontDescription A font description.
+ * @param[in] preferredFontDescription Description of the preferred font.
+ * The font will be the closest match to @p preferredFontDescription.
* @param[in] requestedPointSize The point size in 26.6 fractional points; the default point size is 12*64.
* @param[in] faceIndex The index of the font face (optional).
- * @return A valid font ID, or zero if the font does not exist.
+ *
+ * @return A valid font identifier, or zero if no font is found.
*/
- FontId GetFontId( const FontDescription& fontDescription,
+ FontId GetFontId( const FontDescription& preferredFontDescription,
PointSize26Dot6 requestedPointSize = DEFAULT_POINT_SIZE,
FaceIndex faceIndex = 0 );
@@ -269,7 +274,7 @@ public:
/**
* @brief Query the metrics for a font.
*
- * @param[in] fontId The ID of the font for the required glyph.
+ * @param[in] fontId The identifier of the font for the required glyph.
* @param[out] metrics The font metrics.
*/
void GetFontMetrics( FontId fontId, FontMetrics& metrics );
@@ -277,8 +282,9 @@ public:
/**
* @brief Retrieve the glyph index for a UTF-32 character code.
*
- * @param[in] fontId The ID of the font for the required glyph.
+ * @param[in] fontId The identifier of the font for the required glyph.
* @param[in] charcode The UTF-32 character code.
+ *
* @return The glyph index, or zero if the character code is undefined.
*/
GlyphIndex GetGlyphIndex( FontId fontId, Character charcode );
@@ -287,20 +293,22 @@ public:
* @brief Retrieve the metrics for a series of glyphs.
*
* @param[in,out] array An array of glyph-info structures with initialized FontId & GlyphIndex values.
- * It may contain the advance and an offset set into the bearing from the shaping tool.
- * On return, the glyph's size value will be initialized. The bearing value will be updated by adding the font's glyph bearing to the one set by the shaping tool.
+ * It may contain the advance and an offset set into the bearing from the shaping tool.
+ * On return, the glyph's size value will be initialized. The bearing value will be updated by adding the font's glyph bearing to the one set by the shaping tool.
* @param[in] size The size of the array.
* @param[in] type The type of glyphs used for rendering; either bitmaps or vectors.
* @param[in] horizontal True for horizontal layouts (set to false for vertical layouting).
- * @return True if all of the requested metrics were found.
+ *
+ * @return @e true if all of the requested metrics were found.
*/
bool GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal = true );
/**
* @brief Create a bitmap representation of a glyph.
*
- * @param[in] fontId The ID of the font.
+ * @param[in] fontId The identifier of the font.
* @param[in] glyphIndex The index of a glyph within the specified font.
+ *
* @return A valid BufferImage, or an empty handle if the glyph could not be rendered.
*/
PixelData CreateBitmap( FontId fontId, GlyphIndex glyphIndex );
@@ -309,7 +317,7 @@ public:
* @brief Create a vector representation of a glyph.
*
* @note This feature requires highp shader support and is not available on all platforms
- * @param[in] fontId The ID of the font.
+ * @param[in] fontId The identifier of the font.
* @param[in] glyphIndex The index of a glyph within the specified font.
* @param[out] blob A blob of data; this is owned by FontClient and should be copied by the caller of CreateVectorData().
* @param[out] blobLength The length of the blob data, or zero if the blob creation failed.
diff --git a/text/dali/devel-api/text-abstraction/font-list.h b/text/dali/devel-api/text-abstraction/font-list.h
index 46e2438d7..9170941dc 100644
--- a/text/dali/devel-api/text-abstraction/font-list.h
+++ b/text/dali/devel-api/text-abstraction/font-list.h
@@ -39,6 +39,7 @@ namespace FontWidth
*/
enum Type
{
+ NONE, ///< Means not defined. Will use what is set as default, currently NORMAL.
ULTRA_CONDENSED,
EXTRA_CONDENSED,
CONDENSED,
@@ -47,7 +48,21 @@ namespace FontWidth
SEMI_EXPANDED,
EXPANDED,
EXTRA_EXPANDED,
- ULTRA_EXPANDED,
+ ULTRA_EXPANDED
+ };
+
+ const char* const Name[] =
+ {
+ "NONE",
+ "ULTRA_CONDENSED",
+ "EXTRA_CONDENSED",
+ "CONDENSED",
+ "SEMI_CONDENSED",
+ "NORMAL",
+ "SEMI_EXPANDED",
+ "EXPANDED",
+ "EXTRA_EXPANDED",
+ "ULTRA_EXPANDED"
};
} // namespace FontWidth
@@ -58,6 +73,7 @@ namespace FontWeight
*/
enum Type
{
+ NONE, ///< Means not defined. Will use what is set as default, currently NORMAL.
THIN,
ULTRA_LIGHT,
EXTRA_LIGHT = ULTRA_LIGHT,
@@ -77,6 +93,22 @@ namespace FontWeight
HEAVY = BLACK,
EXTRA_BLACK = BLACK
};
+
+ const char* const Name[] =
+ {
+ "NONE",
+ "THIN",
+ "ULTRA_LIGHT",
+ "LIGHT",
+ "DEMI_LIGHT",
+ "BOOK",
+ "NORMAL",
+ "MEDIUM",
+ "DEMI_BOLD",
+ "BOLD",
+ "ULTRA_BOLD",
+ "BLACK"
+ };
}
namespace FontSlant
@@ -86,11 +118,20 @@ namespace FontSlant
*/
enum Type
{
+ NONE, ///< Means not defined. Will use what is set as default, currently NORMAL.
NORMAL,
ROMAN = NORMAL,
ITALIC,
OBLIQUE
};
+
+ const char* const Name[] =
+ {
+ "NONE",
+ "NORMAL",
+ "ITALIC",
+ "OBLIQUE"
+ };
} // namespace FontSlant
struct FontDescription
@@ -98,9 +139,9 @@ struct FontDescription
FontDescription()
: path(),
family(),
- width( FontWidth::NORMAL ),
- weight( FontWeight::NORMAL ),
- slant( FontSlant::NORMAL )
+ width( FontWidth::NONE ),
+ weight( FontWeight::NONE ),
+ slant( FontSlant::NONE )
{}
~FontDescription()
diff --git a/text/dali/devel-api/text-abstraction/script.cpp b/text/dali/devel-api/text-abstraction/script.cpp
index 2b534f8b0..265e9aa5e 100644
--- a/text/dali/devel-api/text-abstraction/script.cpp
+++ b/text/dali/devel-api/text-abstraction/script.cpp
@@ -51,24 +51,87 @@ bool IsRightToLeftScript( Script script )
Script GetCharacterScript( Character character )
{
- // Latin script:
+ // Latin script: It contains punctuation characters and symbols which are not part of the latin script. https://en.wikipedia.org/wiki/Latin_script_in_Unicode
// 0x0000 - 0x007f C0 Controls and Basic Latin
+ //
+ // ASCII digits (not part of LATIN script):
+ // 0x0030 - 0x0039
+ //
+ // ASCII punctuation and symbols (not part of LATIN script):
+ // 0x0020 - 0x002F
+ // 0x003A - 0x0040
+ // 0x005B - 0x0060
+ // 0x007B - 0x007E
+ //
+ // Controls (not part of LATIN script):
+ // 0x007F
+ //
// 0x0080 - 0x00ff C1 Controls and Latin-1 Supplement
+ //
+ // Controls (not part of LATIN script):
+ // 0x0080 - 0x009F
+ //
+ // Punctuations and symbols (not part of LATIN script):
+ // 0x00A0 - 0x00BF
+ //
+ // Mathematical operators (not part of LATIN script):
+ // 0x00D7
+ // 0x00F7
+ //
// 0x0100 - 0x017f Latin Extended-A
// 0x0180 - 0x024f Latin Extended-B
// 0x0250 - 0x02af IPA Extensions
// 0x02b0 - 0x02ff Spacing Modifier Letters
+ //
+ // Punctuation (not part of LATIN script):
+ // 0x02B9 - 0x02BF
+ //
// 0x1d00 - 0x1d7f Phonetic Extensions
+ //
+ // Uralic Phonetic (not part of LATIN script):
+ // 0x1D26 - 0x1D2B
+ //
+ // Subscripts and superscripts
+ // 0x1D5D - 0x1D61
+ // 0x1D66 - 0x1D6A
+ // 0x1D78
+ //
// 0x1d80 - 0x1dbf Phonetic Extensions Supplement
+ //
+ // 0x1DBF (subscript or superscript. Not part of LATIN script )
+ //
// 0x1e00 - 0x1eff Latin Extended Additional
// 0x2070 - 0x209f Superscripts and Subscripts
- // 0x2100 - 0x214f Letterlike symbols
- // 0x2150 - 0x218f Number Forms
+ //
+ // 0x2070 (not part of LATIN script)
+ // 0x2074 - 0x207E (not part of LATIN script)
+ //
+ // 0x2100 - 0x214f Letterlike symbols (not part of LATIN script)
+ //
+ // 0x212A - 0x212B (are part of LATIN script)
+ // 0x2132 (are part of LATIN script)
+ // 0x214E (are part of LATIN script)
+ //
+ // 0x2150 - 0x2189 Number Forms
+ //
+ // 0x2150 - 0x215F Fractions (not part of LATIN script)
+ // 0x2189 Fractions (not part of LATIN script)
+ //
// 0x2c60 - 0x2c7f Latin Extended-C
// 0xa720 - 0xa7ff Latin Extended-D
+ //
+ // 0xA720 - 0xA721 Uralic Phonetic (not part of LATIN script)
+ // 0xA788 (not part of LATIN script)
+ // 0xA789 - 0xA78A Budu (not part of LATIN script)
+ //
// 0xab30 - 0xab6f Latin Extended-E
+ //
// 0xfb00 - 0xfb06 Latin Alphabetic Presentation Forms
// 0xff00 - 0xffef Halfwidth and Fullwidth Forms
+ //
+ // 0xFF00 - 0xFF20 HWFW Symbols (not part of LATIN script)
+ // 0xFF3B - 0xFF40 HWFW Symbols (not part of LATIN script)
+ // 0xFF5B - 0xFFEF HWFW Symbols (not part of LATIN script)
// Brahmic scripts:
// 0x0900 - 0x097f Devanagari
@@ -172,6 +235,19 @@ Script GetCharacterScript( Character character )
// 6b. Additional transport and map symbols ( 1F681 - 1F6C5 )
// 6c. Other additional symbols ( 1F30D - 1F567 )
+ // Symbols. Work around for these symbols.
+ // 0x25cb
+ // 0x25cf
+ // 0x25a1
+ // 0x25a0
+ // 0x2664
+ // 0x2661
+ // 0x2662
+ // 0x2667
+ // 0x2606
+ // 0x25aa
+ // 0x262a
+
if( IsCommonScript( character ) )
{
return COMMON;
@@ -183,16 +259,63 @@ Script GetCharacterScript( Character character )
{
if( character <= 0x077f )
{
- if( character == 0x00A9 )
+ if( ( 0x0030 <= character ) && ( character <= 0x0039 ) )
+ {
+ return ASCII_DIGITS;
+ }
+ if( character <= 0x007E )
{
- return EMOJI; // 5. Uncategorized: copyright sign
+ if( ( 0x0020 <= character ) && ( character <= 0x002F ) )
+ {
+ return ASCII_PS;
+ }
+ if( ( 0x003A <= character ) && ( character <= 0x0040 ) )
+ {
+ return ASCII_PS;
+ }
+ if( ( 0x005B <= character ) && ( character <= 0x0060 ) )
+ {
+ return ASCII_PS;
+ }
+ if( ( 0x007B <= character ) && ( character <= 0x007E ) )
+ {
+ return ASCII_PS;
+ }
}
- if( character == 0x00AE )
+ if( ( 0x007F <= character ) && ( character <= 0x009F ) )
{
- return EMOJI; // 5. Uncategorized: registered sign
+ // 0x007F is actually part of C0 Controls and Basic Latin. However, is the last and only control character of its block
+ // and the following characters of the next block are consecutive.
+ return C1_CONTROLS;
+ }
+ if( ( 0x00A0 <= character ) && ( character <= 0x00BF ) )
+ {
+ if( character == 0x00A9 )
+ {
+ return EMOJI; // 5. Uncategorized: copyright sign
+ }
+ if( character == 0x00AE )
+ {
+ return EMOJI; // 5. Uncategorized: registered sign
+ }
+
+ return C1_PS;
+ }
+ if( character == 0x00D7 )
+ {
+ return C1_MATH;
+ }
+ if( character == 0x00F7 )
+ {
+ return C1_MATH;
}
if( character <= 0x02ff )
{
+ if( ( 0x02B9 <= character ) && ( character <= 0x02BF ) )
+ {
+ return SML_P;
+ }
+
return LATIN;
}
if( ( 0x0370 <= character ) && ( character <= 0x03ff ) )
@@ -318,6 +441,27 @@ Script GetCharacterScript( Character character )
}
if( ( 0x1d00 <= character ) && ( character <= 0x1eff ) )
{
+ if( ( 0x1D26 <= character ) && ( character <= 0x1D2B ) )
+ {
+ return PHONETIC_U;
+ }
+ if( ( 0x1D5D <= character ) && ( character <= 0x1D61 ) )
+ {
+ return PHONETIC_SS;
+ }
+ if( ( 0x1D66 <= character ) && ( character <= 0x1D6A ) )
+ {
+ return PHONETIC_SS;
+ }
+ if( character == 0x1D78 )
+ {
+ return PHONETIC_SS;
+ }
+ if( character == 0x1DBF)
+ {
+ return PHONETIC_SS;
+ }
+
return LATIN;
}
}
@@ -337,6 +481,15 @@ Script GetCharacterScript( Character character )
}
if( ( 0x2070 <= character ) && ( character <= 0x209f ) )
{
+ if( character == 0x2070 )
+ {
+ return NUMERIC_SS;
+ }
+ if( ( 0x2074 <= character ) && ( character <= 0x207E ) )
+ {
+ return NUMERIC_SS;
+ }
+
return LATIN;
}
if( character == 0x20e3 )
@@ -351,10 +504,69 @@ Script GetCharacterScript( Character character )
{
return EMOJI; // 5. Uncategorized: information source
}
- if( ( 0x2100 <= character ) && ( character <= 0x218f ) )
- {
+ if( ( 0x2100 <= character ) && ( character <= 0x2189 ) )
+ {
+ if( ( 0x2100 <= character ) && ( character <= 0x214f ) )
+ {
+ if( ( 0x212A <= character ) && ( character <= 0x212B ) )
+ {
+ return LATIN;
+ }
+ if( character == 0x2132 )
+ {
+ return LATIN;
+ }
+ if( character == 0x214E )
+ {
+ return LATIN;
+ }
+
+ return LETTER_LIKE;
+ }
+ if( ( 0x2150 <= character ) && ( character <= 0x215F ) )
+ {
+ return FRACTIONS_NF;
+ }
+ if( character == 0x2189 )
+ {
+ return FRACTIONS_NF;
+ }
+
return LATIN;
}
+
+ // Symbols
+ if( ( 0x25cb == character ) ||
+ ( 0x25cf == character ) ||
+ ( 0x25a1 == character ) )
+ {
+ return SYMBOLS1;
+ }
+
+ if( 0x25a0 == character )
+ {
+ return SYMBOLS2;
+ }
+
+ if( ( 0x2664 == character ) ||
+ ( 0x2661 == character ) ||
+ ( 0x2662 == character ) ||
+ ( 0x2667 == character ) )
+ {
+ return SYMBOLS3;
+ }
+
+ if( ( 0x2606 == character ) ||
+ ( 0x25aa == character ) )
+ {
+ return SYMBOLS4;
+ }
+
+ if( 0x262a == character )
+ {
+ return SYMBOLS5;
+ }
+
// U+2194 5. Uncategorized: left right arrow
// U+2B55 5. Uncategorized: heavy large circle
if( ( 0x2194 <= character ) && ( character <= 0x2B55 ) )
@@ -441,6 +653,27 @@ Script GetCharacterScript( Character character )
}
if( ( 0xa720 <= character ) && ( character <= 0xa7ff ) )
{
+ if( character == 0xA720 )
+ {
+ return PHONETIC_U;
+ }
+ if( character == 0xA721 )
+ {
+ return PHONETIC_U;
+ }
+ if( character == 0xA788 )
+ {
+ return NON_LATIN_LED;
+ }
+ if( character == 0xA789 )
+ {
+ return NON_LATIN_LED;
+ }
+ if( character == 0xA78A )
+ {
+ return NON_LATIN_LED;
+ }
+
return LATIN;
}
if( ( 0xa960 <= character ) && ( character <= 0xa97f ) )
@@ -484,6 +717,19 @@ Script GetCharacterScript( Character character )
}
if( ( 0xff00 <= character ) && ( character <= 0xffef ) )
{
+ if( ( 0xFF00 <= character ) && ( character <= 0xFF20 ) )
+ {
+ return HWFW_S;
+ }
+ if( ( 0xFF3B <= character ) && ( character <= 0xFF40 ) )
+ {
+ return HWFW_S;
+ }
+ if( ( 0xFF5B <= character ) && ( character <= 0xFFEF ) )
+ {
+ return HWFW_S;
+ }
+
return LATIN;
}
if( ( 0x1ee00 <= character ) && ( character <= 0x1eeff ) )
diff --git a/text/dali/devel-api/text-abstraction/script.h b/text/dali/devel-api/text-abstraction/script.h
index ee08ab2cd..753563e15 100644
--- a/text/dali/devel-api/text-abstraction/script.h
+++ b/text/dali/devel-api/text-abstraction/script.h
@@ -36,84 +36,134 @@ namespace TextAbstraction
*/
enum Script
{
- COMMON, ///< Valid for all scripts. i.e white space or '\n'.
-
- CYRILLIC, ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
- GREEK, ///< The Greek script. Used by Greek.
- LATIN, ///< The latin script. Used by many western languages and others around the world.
-
- ARABIC, ///< The arabic script. Used by Arab and Urdu among others.
- HEBREW, ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic.
-
- ARMENIAN, ///< The Armenian script. Used by Armenian.
- GEORGIAN, ///< The Georgian script. Used by Georgian.
-
- CJK, ///< The CJK script. Used by Chinese, Japanese, Korean and Vietnamese(old writing system).
- HANGUL, ///< The Hangul jamo script. Used by Korean.
- HIRAGANA, ///< The Hiragana script. Used by the Japanese.
- KATAKANA, ///< The Katakana script. Used by the Japanese.
- BOPOMOFO, ///< The Bopomofo script. Also called Zhuyin fuhao or Zhuyin. A phonetic notation used for the transcription of spoken Chinese.
-
- BENGALI, ///< The Bengali script. Used by Bangla, Assamese, Bishnupriya Manipuri, Daphla, Garo, Hallam, Khasi, Mizo, Munda, Naga, Rian, and Santali.
- BURMESE, ///< The Burmese script. Used by the Burmese (Myanmar) language.
- DEVANAGARI, ///< The devanagari script. Used by Hindi, Marathi, Sindhi, Nepali and Sanskrit.
- GUJARATI, ///< The Gujarati script. Used by Gujarati.
- GURMUKHI, ///< The Gurmukhi script. Used by Punjabi.
- KANNADA, ///< The Kannada script. Used by Kannada and Tulu.
- MALAYALAM, ///< The Malayalam script. Used by Malayalam.
- ORIYA, ///< The Oriya script. Used by Oriya (Odia), Khondi, and Santali.
- SINHALA, ///< The Sinhala script. Used by Sinhala and Pali.
- TAMIL, ///< The Tamil script. Used by Tamil, Badaga, and Saurashtra.
- TELUGU, ///< The Telugu script. Used by Telugu, Gondi, and Lambadi.
-
- LAO, ///< The Lao script. Used by the Lao language.
- THAI, ///< The Thai script. Used by the Thai language
- KHMER, ///< The Khmer script. Used by the Khmer language.
-
- EMOJI, ///< The Emoji which map to standardized Unicode characters.
-
- UNKNOWN ///< The script is unknown.
+ COMMON, ///< Valid for all scripts. i.e white space or '\n'.
+
+ ASCII_DIGITS, ///< ASCII digits.
+ ASCII_PS, ///< ASCII punctuation and symbols.
+
+ C1_CONTROLS, ///< Controls of the C1 Controls and Latin-1 Supplement unicode block.
+ C1_PS, ///< Punctuation and symbols of the C1 Controls and Latin-1 Supplement unicode block.
+ C1_MATH, ///< Math symbols of the C1 Controls and Latin-1 Supplement unicode block.
+
+ SML_P, ///< Punctuation symbols of the Spacing Modifier Letters unicode block.
+ PHONETIC_U, ///< Uralic phonetic symbols of the Phonetic Extensions unicode block.
+ PHONETIC_SS, ///< Subscripts and superscripts of the Phonetic Extensions unicode block.
+
+ NUMERIC_SS, ///< Numeric subscripts and superscripts.
+
+ LETTER_LIKE, ///< Symbols of the Letterlike unicode block.
+ NUMBER_FORMS, ///< Number Forms unicode block.
+ FRACTIONS_NF, ///< Numeric fraction symbols of the Number Forms unicode block.
+ NON_LATIN_LED, ///< Non latin symbols within the Latin Extended D unicode block.
+ HWFW_S, ///< Non latin symbols within the Halfwidth and fullwidth unicode block.
+
+ CYRILLIC, ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
+ GREEK, ///< The Greek script. Used by Greek.
+ LATIN, ///< The latin script. Used by many western languages and others around the world.
+
+ ARABIC, ///< The arabic script. Used by Arab and Urdu among others.
+ HEBREW, ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic.
+
+ ARMENIAN, ///< The Armenian script. Used by Armenian.
+ GEORGIAN, ///< The Georgian script. Used by Georgian.
+
+ CJK, ///< The CJK script. Used by Chinese, Japanese, Korean and Vietnamese(old writing system).
+ HANGUL, ///< The Hangul jamo script. Used by Korean.
+ HIRAGANA, ///< The Hiragana script. Used by the Japanese.
+ KATAKANA, ///< The Katakana script. Used by the Japanese.
+ BOPOMOFO, ///< The Bopomofo script. Also called Zhuyin fuhao or Zhuyin. A phonetic notation used for the transcription of spoken Chinese.
+
+ BENGALI, ///< The Bengali script. Used by Bangla, Assamese, Bishnupriya Manipuri, Daphla, Garo, Hallam, Khasi, Mizo, Munda, Naga, Rian, and Santali.
+ BURMESE, ///< The Burmese script. Used by the Burmese (Myanmar) language.
+ DEVANAGARI, ///< The devanagari script. Used by Hindi, Marathi, Sindhi, Nepali and Sanskrit.
+ GUJARATI, ///< The Gujarati script. Used by Gujarati.
+ GURMUKHI, ///< The Gurmukhi script. Used by Punjabi.
+ KANNADA, ///< The Kannada script. Used by Kannada and Tulu.
+ MALAYALAM, ///< The Malayalam script. Used by Malayalam.
+ ORIYA, ///< The Oriya script. Used by Oriya (Odia), Khondi, and Santali.
+ SINHALA, ///< The Sinhala script. Used by Sinhala and Pali.
+ TAMIL, ///< The Tamil script. Used by Tamil, Badaga, and Saurashtra.
+ TELUGU, ///< The Telugu script. Used by Telugu, Gondi, and Lambadi.
+
+ LAO, ///< The Lao script. Used by the Lao language.
+ THAI, ///< The Thai script. Used by the Thai language
+ KHMER, ///< The Khmer script. Used by the Khmer language.
+
+ EMOJI, ///< The Emoji which map to standardized Unicode characters.
+
+ SYMBOLS1, ///< Some symbols.
+ SYMBOLS2, ///< Some symbols.
+ SYMBOLS3, ///< Some symbols.
+ SYMBOLS4, ///< Some symbols.
+ SYMBOLS5, ///< Some symbols.
+
+ UNKNOWN ///< The script is unknown.
};
const char* const ScriptName[] =
{
- "COMMON", ///< Valid for all scripts. i.e white space or '\n'.
-
- "CYRILLIC", ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
- "GREEK", ///< The Greek script. Used by Greek.
- "LATIN", ///< The latin script. Used by many western languages and others around the world.
-
- "ARABIC", ///< The arabic script. Used by Arab and Urdu among others.
- "HEBREW", ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic.
-
- "ARMENIAN", ///< The Armenian script. Used by Armenian.
- "GEORGIAN", ///< The Georgian script. Used by Georgian.
-
- "CJK", ///< The CJK script. Used by Chinese, Japanese, Korean and Vietnamese(old writing system).
- "HANGUL", ///< The Hangul jamo script. Used by Korean.
- "HIRAGANA", ///< The Hiragana script. Used by the Japanese.
- "KATAKANA", ///< The Katakana script. Used by the Japanese.
- "BOPOMOFO", ///< The Bopomofo script. Also called Zhuyin fuhao or Zhuyin. A phonetic notation used for the transcription of spoken Chinese.
-
- "BENGALI", ///< The Bengali script. Used by Bangla, Assamese, Bishnupriya Manipuri, Daphla, Garo, Hallam, Khasi, Mizo, Munda, Naga, Rian, and Santali.
- "BURMESE", ///< The Burmese script. Used by the Burmese (Myanmar) language.
- "DEVANAGARI", ///< The devanagari script. Used by Hindi, Marathi, Sindhi, Nepali and Sanskrit.
- "GUJARATI", ///< The Gujarati script. Used by Gujarati.
- "GURMUKHI", ///< The Gurmukhi script. Used by Punjabi.
- "KANNADA", ///< The Kannada script. Used by Kannada and Tulu.
- "MALAYALAM", ///< The Malayalam script. Used by Malayalam.
- "ORIYA", ///< The Oriya script. Used by Oriya (Odia), Khondi, and Santali.
- "SINHALA", ///< The Sinhala script. Used by Sinhala and Pali.
- "TAMIL", ///< The Tamil script. Used by Tamil, Badaga, and Saurashtra.
- "TELUGU", ///< The Telugu script. Used by Telugu, Gondi, and Lambadi.
-
- "LAO", ///< The Lao script. Used by the Lao language.
- "THAI", ///< The Thai script. Used by the Thai language
- "KHMER", ///< The Khmer script. Used by the Khmer language.
-
- "EMOJI", ///< The Emoji which map to standardized Unicode characters.
-
- "UNKNOWN" ///< The script is unknown.
+ "COMMON", ///< Valid for all scripts. i.e white space or '\n'.
+
+ "ASCII_DIGITS", ///< ASCII digits.
+ "ASCII_PS", ///< ASCII punctuation and symbols.
+
+ "C1_CONTROLS", ///< Controls of the C1 Controls and Latin-1 Supplement unicode block.
+ "C1_PS", ///< Punctuation and symbols of the C1 Controls and Latin-1 Supplement unicode block.
+ "C1_MATH", ///< Math symbols of the C1 Controls and Latin-1 Supplement unicode block.
+
+ "SML_P", ///< Punctuation symbols of the Spacing Modifier Letters unicode block.
+ "PHONETIC_U", ///< Uralic phonetic symbols of the Phonetic Extensions unicode block.
+ "PHONETIC_SS", ///< Subscripts and superscripts of the Phonetic Extensions unicode block.
+
+ "NUMERIC_SS", ///< Numeric subscripts and superscripts.
+
+ "LETTER_LIKE", ///< Symbols of the Letterlike unicode block.
+ "NUMBER_FORMS", ///< Number Forms unicode block.
+ "FRACTIONS_NF", ///< Numeric fraction symbols of the Number Forms unicode block.
+ "NON_LATIN_LED", ///< Non latin symbols within the Latin Extended D unicode block.
+ "HWFW_S", ///< Non latin symbols within the Halfwidth and fullwidth unicode block.
+
+ "CYRILLIC", ///< The Cyrillic script. Used by Russian, Bulgarian, Ukrainian, Macedonian, ...
+ "GREEK", ///< The Greek script. Used by Greek.
+ "LATIN", ///< The latin script. Used by many western languages and others around the world.
+
+ "ARABIC", ///< The arabic script. Used by Arab and Urdu among others.
+ "HEBREW", ///< The Hebrew script. Used by the Hebrew, Yiddish, Ladino, and Judeo-Arabic.
+
+ "ARMENIAN", ///< The Armenian script. Used by Armenian.
+ "GEORGIAN", ///< The Georgian script. Used by Georgian.
+
+ "CJK", ///< The CJK script. Used by Chinese, Japanese, Korean and Vietnamese(old writing system).
+ "HANGUL", ///< The Hangul jamo script. Used by Korean.
+ "HIRAGANA", ///< The Hiragana script. Used by the Japanese.
+ "KATAKANA", ///< The Katakana script. Used by the Japanese.
+ "BOPOMOFO", ///< The Bopomofo script. Also called Zhuyin fuhao or Zhuyin. A phonetic notation used for the transcription of spoken Chinese.
+
+ "BENGALI", ///< The Bengali script. Used by Bangla, Assamese, Bishnupriya Manipuri, Daphla, Garo, Hallam, Khasi, Mizo, Munda, Naga, Rian, and Santali.
+ "BURMESE", ///< The Burmese script. Used by the Burmese (Myanmar) language.
+ "DEVANAGARI", ///< The devanagari script. Used by Hindi, Marathi, Sindhi, Nepali and Sanskrit.
+ "GUJARATI", ///< The Gujarati script. Used by Gujarati.
+ "GURMUKHI", ///< The Gurmukhi script. Used by Punjabi.
+ "KANNADA", ///< The Kannada script. Used by Kannada and Tulu.
+ "MALAYALAM", ///< The Malayalam script. Used by Malayalam.
+ "ORIYA", ///< The Oriya script. Used by Oriya (Odia), Khondi, and Santali.
+ "SINHALA", ///< The Sinhala script. Used by Sinhala and Pali.
+ "TAMIL", ///< The Tamil script. Used by Tamil, Badaga, and Saurashtra.
+ "TELUGU", ///< The Telugu script. Used by Telugu, Gondi, and Lambadi.
+
+ "LAO", ///< The Lao script. Used by the Lao language.
+ "THAI", ///< The Thai script. Used by the Thai language
+ "KHMER", ///< The Khmer script. Used by the Khmer language.
+
+ "EMOJI", ///< The Emoji which map to standardized Unicode characters.
+
+ "SYMBOLS1", ///< Some symbols.
+ "SYMBOLS2", ///< Some symbols.
+ "SYMBOLS3", ///< Some symbols.
+ "SYMBOLS4", ///< Some symbols.
+ "SYMBOLS5", ///< Some symbols.
+
+ "UNKNOWN" ///< The script is unknown.
};
/**
diff --git a/text/dali/internal/text-abstraction/font-client-helper.cpp b/text/dali/internal/text-abstraction/font-client-helper.cpp
index d7e3e1642..d84e4ded2 100644
--- a/text/dali/internal/text-abstraction/font-client-helper.cpp
+++ b/text/dali/internal/text-abstraction/font-client-helper.cpp
@@ -42,8 +42,13 @@ int ValueToIndex( int value, const int* const table, unsigned int maxIndex )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->FontClient::Plugin::ValueToIndex value(%d)\n", value);
- if( ( NULL == table ) ||
- ( value <= table[0] ) )
+ if( NULL == table )
+ {
+ // Return an invalid index if there is no table.
+ return -1;
+ }
+
+ if( value <= table[0] )
{
return 0;
}
@@ -53,14 +58,14 @@ int ValueToIndex( int value, const int* const table, unsigned int maxIndex )
return maxIndex;
}
- for( unsigned int index = 0u; index < maxIndex; )
+ for( unsigned int index = 0u; index < maxIndex; ++index )
{
const int v1 = table[index];
- const unsigned int indexPlus = ++index;
+ const unsigned int indexPlus = index + 1u;
const int v2 = table[indexPlus];
if( ( v1 < value ) && ( value <= v2 ) )
{
- const int result = ( ( value - v1 ) < ( v2 - value ) ) ? index : indexPlus;
+ const int result = ( ( v1 > 0 ) && ( ( value - v1 ) < ( v2 - value ) ) ) ? index : indexPlus;
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "FontClient::Plugin::ValueToIndex result(%d)\n", result );
return result;
}
diff --git a/text/dali/internal/text-abstraction/font-client-impl.cpp b/text/dali/internal/text-abstraction/font-client-impl.cpp
index 42a2a8ad0..040c557be 100644
--- a/text/dali/internal/text-abstraction/font-client-impl.cpp
+++ b/text/dali/internal/text-abstraction/font-client-impl.cpp
@@ -128,18 +128,28 @@ void FontClient::GetSystemFonts( FontList& systemFonts )
mPlugin->GetSystemFonts( systemFonts );
}
-FontId FontClient::FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor )
+FontId FontClient::FindDefaultFont( Character charcode,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor )
{
CreatePlugin();
- return mPlugin->FindDefaultFont( charcode, requestedPointSize, preferColor );
+ return mPlugin->FindDefaultFont( charcode,
+ requestedPointSize,
+ preferColor );
}
-FontId FontClient::FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor )
+FontId FontClient::FindFallbackFont( Character charcode,
+ const FontDescription& preferredFontDescription,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor )
{
CreatePlugin();
- return mPlugin->FindFallbackFont( preferredFont, charcode, requestedPointSize, preferColor );
+ return mPlugin->FindFallbackFont( charcode,
+ preferredFontDescription,
+ requestedPointSize,
+ preferColor );
}
bool FontClient::IsScalable( const FontPath& path )
diff --git a/text/dali/internal/text-abstraction/font-client-impl.h b/text/dali/internal/text-abstraction/font-client-impl.h
index 783147ccc..555fca861 100644
--- a/text/dali/internal/text-abstraction/font-client-impl.h
+++ b/text/dali/internal/text-abstraction/font-client-impl.h
@@ -98,12 +98,17 @@ public:
/**
* @copydoc Dali::FontClient::FindDefaultFont()
*/
- FontId FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor );
+ FontId FindDefaultFont( Character charcode,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor );
/**
* @copydoc Dali::FontClient::FindFallbackFont()
*/
- FontId FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor );
+ FontId FindFallbackFont( Character charcode,
+ const FontDescription& preferredFontDescription,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor );
/**
* @copydoc Dali::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
diff --git a/text/dali/internal/text-abstraction/font-client-plugin-impl.cpp b/text/dali/internal/text-abstraction/font-client-plugin-impl.cpp
index feaec0546..56e297ceb 100644
--- a/text/dali/internal/text-abstraction/font-client-plugin-impl.cpp
+++ b/text/dali/internal/text-abstraction/font-client-plugin-impl.cpp
@@ -55,6 +55,7 @@ const bool FONT_FIXED_SIZE_BITMAP( true );
// http://www.freedesktop.org/software/fontconfig/fontconfig-user.html
+// NONE -1 --> DEFAULT_FONT_WIDTH (NORMAL) will be used.
// ULTRA_CONDENSED 50
// EXTRA_CONDENSED 63
// CONDENSED 75
@@ -64,9 +65,10 @@ const bool FONT_FIXED_SIZE_BITMAP( true );
// EXPANDED 125
// EXTRA_EXPANDED 150
// ULTRA_EXPANDED 200
-const int FONT_WIDTH_TYPE_TO_INT[] = { 50, 63, 75, 87, 100, 113, 125, 150, 200 };
+const int FONT_WIDTH_TYPE_TO_INT[] = { -1, 50, 63, 75, 87, 100, 113, 125, 150, 200 };
const unsigned int NUM_FONT_WIDTH_TYPE = sizeof( FONT_WIDTH_TYPE_TO_INT ) / sizeof( int );
+// NONE -1 --> DEFAULT_FONT_WEIGHT (NORMAL) will be used.
// THIN 0
// ULTRA_LIGHT, EXTRA_LIGHT 40
// LIGHT 50
@@ -78,13 +80,14 @@ const unsigned int NUM_FONT_WIDTH_TYPE = sizeof( FONT_WIDTH_TYPE_TO_INT ) / size
// BOLD 200
// ULTRA_BOLD, EXTRA_BOLD 205
// BLACK, HEAVY, EXTRA_BLACK 210
-const int FONT_WEIGHT_TYPE_TO_INT[] = { 0, 40, 50, 55, 75, 80, 100, 180, 200, 205, 210 };
+const int FONT_WEIGHT_TYPE_TO_INT[] = { -1, 0, 40, 50, 55, 75, 80, 100, 180, 200, 205, 210 };
const unsigned int NUM_FONT_WEIGHT_TYPE = sizeof( FONT_WEIGHT_TYPE_TO_INT ) / sizeof( int );
-// NORMAL, ROMAN 0
-// ITALIC 100
-// OBLIQUE 110
-const int FONT_SLANT_TYPE_TO_INT[] = { 0, 100, 110 };
+// NONE -1 --> DEFAULT_FONT_SLANT (NORMAL) will be used.
+// NORMAL, ROMAN 0
+// ITALIC 100
+// OBLIQUE 110
+const int FONT_SLANT_TYPE_TO_INT[] = { -1, 0, 100, 110 };
const unsigned int NUM_FONT_SLANT_TYPE = sizeof( FONT_SLANT_TYPE_TO_INT ) / sizeof( int );
} // namespace
@@ -158,11 +161,11 @@ FontClient::Plugin::FontIdCacheItem::FontIdCacheItem( FontDescriptionId validate
{
}
-FontClient::Plugin::CacheItem::CacheItem( FT_Face ftFace,
- const FontPath& path,
- PointSize26Dot6 requestedPointSize,
- FaceIndex face,
- const FontMetrics& metrics )
+FontClient::Plugin::FontFaceCacheItem::FontFaceCacheItem( FT_Face ftFace,
+ const FontPath& path,
+ PointSize26Dot6 requestedPointSize,
+ FaceIndex face,
+ const FontMetrics& metrics )
: mFreeTypeFace( ftFace ),
mPath( path ),
mRequestedPointSize( requestedPointSize ),
@@ -175,13 +178,13 @@ FontClient::Plugin::CacheItem::CacheItem( FT_Face ftFace,
{
}
-FontClient::Plugin::CacheItem::CacheItem( FT_Face ftFace,
- const FontPath& path,
- PointSize26Dot6 requestedPointSize,
- FaceIndex face,
- const FontMetrics& metrics,
- float fixedWidth,
- float fixedHeight )
+FontClient::Plugin::FontFaceCacheItem::FontFaceCacheItem( FT_Face ftFace,
+ const FontPath& path,
+ PointSize26Dot6 requestedPointSize,
+ FaceIndex face,
+ const FontMetrics& metrics,
+ float fixedWidth,
+ float fixedHeight )
: mFreeTypeFace( ftFace ),
mPath( path ),
mRequestedPointSize( requestedPointSize ),
@@ -408,12 +411,11 @@ FontId FontClient::Plugin::FindFontForCharacter( const FontList& fontList,
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "FontClient::Plugin::FindFontForCharacter\n");
- FontId fontId(0);
- bool foundColor(false);
+ FontId fontId = 0u;
+ bool foundColor = false;
// Traverse the list of fonts.
- // Check for each default font if supports the character.
-
+ // Check for each font if supports the character.
for( FontList::const_iterator it = fontList.begin(), endIt = fontList.end();
it != endIt;
++it )
@@ -467,7 +469,7 @@ FontId FontClient::Plugin::FindFontForCharacter( const FontList& fontList,
}
}
- // Keep going unless we prefer a different (color) font
+ // Keep going unless we prefer a different (color) font.
if( !preferColor || foundColor )
{
FcPatternDestroy( match );
@@ -499,6 +501,7 @@ FontId FontClient::Plugin::FindDefaultFont( Character charcode,
fontDescription.width = IntToWidthType( DEFAULT_FONT_WIDTH );
fontDescription.weight = IntToWeightType( DEFAULT_FONT_WEIGHT );
fontDescription.slant = IntToSlantType( DEFAULT_FONT_SLANT );
+
SetFontList( fontDescription, mDefaultFonts );
}
@@ -509,8 +512,8 @@ FontId FontClient::Plugin::FindDefaultFont( Character charcode,
return fontId;
}
-FontId FontClient::Plugin::FindFallbackFont( FontId preferredFont,
- Character charcode,
+FontId FontClient::Plugin::FindFallbackFont( Character charcode,
+ const FontDescription& preferredFontDescription,
PointSize26Dot6 requestedPointSize,
bool preferColor )
{
@@ -518,7 +521,12 @@ FontId FontClient::Plugin::FindFallbackFont( FontId preferredFont,
FontId fontId = 0u;
FontDescription fontDescription;
- GetDescription( preferredFont, fontDescription );
+
+ // Fill the font description with the preferred font description and complete with the defaults.
+ fontDescription.family = preferredFontDescription.family.empty() ? DEFAULT_FONT_FAMILY_NAME : preferredFontDescription.family;
+ fontDescription.weight = ( ( FontWeight::NONE == preferredFontDescription.weight ) ? IntToWeightType( DEFAULT_FONT_WEIGHT ) : preferredFontDescription.weight );
+ fontDescription.width = ( ( FontWidth::NONE == preferredFontDescription.width ) ? IntToWidthType( DEFAULT_FONT_WIDTH ) : preferredFontDescription.width );
+ fontDescription.slant = ( ( FontSlant::NONE == preferredFontDescription.slant ) ? IntToSlantType( DEFAULT_FONT_SLANT ) : preferredFontDescription.slant );
// Check first if the font's description has been queried before.
FontList* fontList( NULL );
@@ -529,7 +537,7 @@ FontId FontClient::Plugin::FindFallbackFont( FontId preferredFont,
SetFontList( fontDescription, *fontList );
// Add the font-list to the cache.
- mFallbackCache.push_back( FallbackCacheItem(fontDescription, fontList) );
+ mFallbackCache.push_back( FallbackCacheItem( fontDescription, fontList ) );
}
if( fontList )
@@ -683,7 +691,7 @@ void FontClient::Plugin::GetFontMetrics( FontId fontId,
if( ( fontId > 0 ) &&
( fontId - 1u < mFontCache.size() ) )
{
- const CacheItem& font = mFontCache[fontId-1];
+ const FontFaceCacheItem& font = mFontCache[fontId-1];
metrics = font.mMetrics;
@@ -754,7 +762,7 @@ bool FontClient::Plugin::GetBitmapMetrics( GlyphInfo* array,
if( fontId > 0 &&
fontId-1 < mFontCache.size() )
{
- const CacheItem& font = mFontCache[fontId-1];
+ const FontFaceCacheItem& font = mFontCache[fontId-1];
FT_Face ftFace = font.mFreeTypeFace;
@@ -842,7 +850,7 @@ bool FontClient::Plugin::GetVectorMetrics( GlyphInfo* array,
if( fontId > 0 &&
fontId-1 < mFontCache.size() )
{
- CacheItem& font = mFontCache[fontId-1];
+ FontFaceCacheItem& font = mFontCache[fontId-1];
if( ! font.mVectorFontId )
{
@@ -942,7 +950,7 @@ void FontClient::Plugin::CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex,
if( fontId > 0 &&
fontId-1 < mFontCache.size() )
{
- CacheItem& font = mFontCache[fontId-1];
+ FontFaceCacheItem& font = mFontCache[fontId-1];
if( ! font.mVectorFontId )
{
@@ -1056,6 +1064,7 @@ bool FontClient::Plugin::MatchFontDescriptionToPattern( FcPattern* pattern, Dali
fontDescription.width = IntToWidthType( width );
fontDescription.weight = IntToWeightType( weight );
fontDescription.slant = IntToSlantType( slant );
+
// destroyed the matched pattern
FcPatternDestroy( match );
ret = true;
@@ -1073,9 +1082,30 @@ FcPattern* FontClient::Plugin::CreateFontFamilyPattern( const FontDescription& f
// add a property to the pattern for the font family
FcPatternAddString( fontFamilyPattern, FC_FAMILY, reinterpret_cast( fontDescription.family.c_str() ) );
- FcPatternAddInteger( fontFamilyPattern, FC_WIDTH, FONT_WIDTH_TYPE_TO_INT[fontDescription.width] );
- FcPatternAddInteger( fontFamilyPattern, FC_WEIGHT, FONT_WEIGHT_TYPE_TO_INT[fontDescription.weight] );
- FcPatternAddInteger( fontFamilyPattern, FC_SLANT, FONT_SLANT_TYPE_TO_INT[fontDescription.slant] );
+ int width = FONT_WIDTH_TYPE_TO_INT[fontDescription.width];
+ if( width < 0 )
+ {
+ // Use default.
+ width = DEFAULT_FONT_WIDTH;
+ }
+
+ int weight = FONT_WEIGHT_TYPE_TO_INT[fontDescription.weight];
+ if( weight < 0 )
+ {
+ // Use default.
+ weight = DEFAULT_FONT_WEIGHT;
+ }
+
+ int slant = FONT_SLANT_TYPE_TO_INT[fontDescription.slant];
+ if( slant < 0 )
+ {
+ // Use default.
+ slant = DEFAULT_FONT_SLANT;
+ }
+
+ FcPatternAddInteger( fontFamilyPattern, FC_WIDTH, width );
+ FcPatternAddInteger( fontFamilyPattern, FC_WEIGHT, weight );
+ FcPatternAddInteger( fontFamilyPattern, FC_SLANT, slant );
// Add a property of the pattern, to say we want to match TrueType fonts
FcPatternAddString( fontFamilyPattern , FC_FONTFORMAT, reinterpret_cast( FONT_FORMAT.c_str() ) );
@@ -1197,7 +1227,7 @@ FontId FontClient::Plugin::CreateFont( const FontPath& path,
0.0f,
0.0f );
- mFontCache.push_back( CacheItem( ftFace, path, requestedPointSize, faceIndex, metrics, fixedWidth, fixedHeight ) );
+ mFontCache.push_back( FontFaceCacheItem( ftFace, path, requestedPointSize, faceIndex, metrics, fixedWidth, fixedHeight ) );
id = mFontCache.size();
if( cacheDescription )
@@ -1242,7 +1272,7 @@ FontId FontClient::Plugin::CreateFont( const FontPath& path,
static_cast< float >( ftFace->underline_position ) * FROM_266,
static_cast< float >( ftFace->underline_thickness ) * FROM_266 );
- mFontCache.push_back( CacheItem( ftFace, path, requestedPointSize, faceIndex, metrics ) );
+ mFontCache.push_back( FontFaceCacheItem( ftFace, path, requestedPointSize, faceIndex, metrics ) );
id = mFontCache.size();
if( cacheDescription )
@@ -1311,12 +1341,12 @@ bool FontClient::Plugin::FindFont( const FontPath& path,
FontId& fontId ) const
{
fontId = 0u;
- for( std::vector::const_iterator it = mFontCache.begin(),
+ for( std::vector::const_iterator it = mFontCache.begin(),
endIt = mFontCache.end();
it != endIt;
++it, ++fontId )
{
- const CacheItem& cacheItem = *it;
+ const FontFaceCacheItem& cacheItem = *it;
if( cacheItem.mRequestedPointSize == requestedPointSize &&
cacheItem.mFaceIndex == faceIndex &&
@@ -1524,9 +1554,9 @@ void FontClient::Plugin::CacheFontPath( FT_Face ftFace, FontId id, PointSize26Do
FontDescription description;
description.path = path;
description.family = FontFamily( ftFace->family_name );
- description.weight = FontWeight::NORMAL;
- description.width = FontWidth::NORMAL;
- description.slant = FontSlant::NORMAL;
+ description.weight = FontWeight::NONE;
+ description.width = FontWidth::NONE;
+ description.slant = FontSlant::NONE;
// Note FreeType doesn't give too much info to build a proper font style.
if( ftFace->style_flags & FT_STYLE_FLAG_ITALIC )
diff --git a/text/dali/internal/text-abstraction/font-client-plugin-impl.h b/text/dali/internal/text-abstraction/font-client-plugin-impl.h
index 4f191a660..aad7d54b1 100644
--- a/text/dali/internal/text-abstraction/font-client-plugin-impl.h
+++ b/text/dali/internal/text-abstraction/font-client-plugin-impl.h
@@ -91,27 +91,27 @@ struct FontClient::Plugin
FontDescriptionId validatedFontId; ///< Index to the vector with font descriptions.
PointSize26Dot6 requestedPointSize; ///< The font point size.
- FontId fontId; ///< The font id.
+ FontId fontId; ///< The font identifier.
};
/**
* @brief Caches the FreeType face and font metrics of the triplet 'path to the font file name, font point size and face index'.
*/
- struct CacheItem
+ struct FontFaceCacheItem
{
- CacheItem( FT_Face ftFace,
- const FontPath& path,
- PointSize26Dot6 requestedPointSize,
- FaceIndex face,
- const FontMetrics& metrics );
-
- CacheItem( FT_Face ftFace,
- const FontPath& path,
- PointSize26Dot6 requestedPointSize,
- FaceIndex face,
- const FontMetrics& metrics,
- float fixedWidth,
- float fixedHeight );
+ FontFaceCacheItem( FT_Face ftFace,
+ const FontPath& path,
+ PointSize26Dot6 requestedPointSize,
+ FaceIndex face,
+ const FontMetrics& metrics );
+
+ FontFaceCacheItem( FT_Face ftFace,
+ const FontPath& path,
+ PointSize26Dot6 requestedPointSize,
+ FaceIndex face,
+ const FontMetrics& metrics,
+ float fixedWidth,
+ float fixedHeight );
FT_Face mFreeTypeFace; ///< The FreeType face.
FontPath mPath; ///< The path to the font file name.
@@ -161,7 +161,7 @@ struct FontClient::Plugin
/**
* @copydoc Dali::FontClient::SetDefaultFont()
*/
- void SetDefaultFont( const FontDescription& fontDescription );
+ void SetDefaultFont( const FontDescription& preferredFontDescription );
/**
* @copydoc Dali::FontClient::GetDefaultPlatformFontDescription()
@@ -189,7 +189,14 @@ struct FontClient::Plugin
PointSize26Dot6 GetPointSize( FontId id );
/**
- * @copydoc Dali::FontClient::FindFontForCharacter()
+ * @brief Finds within the @p fontList a font which support the @p carcode.
+ *
+ * @param[in] fontList A list of font paths, family, width, weight and slant.
+ * @param[in] charcode The character for which a font is needed.
+ * @param[in] requestedPointSize The point size in 26.6 fractional points.
+ * @param[in] preferColor @e true if a color font is preferred.
+ *
+ * @return A valid font identifier, or zero if no font is found.
*/
FontId FindFontForCharacter( const FontList& fontList,
Character charcode,
@@ -199,12 +206,17 @@ struct FontClient::Plugin
/**
* @copydoc Dali::FontClient::FindDefaultFont()
*/
- FontId FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor );
+ FontId FindDefaultFont( Character charcode,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor );
/**
* @copydoc Dali::FontClient::FindFallbackFont()
*/
- FontId FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor );
+ FontId FindFallbackFont( Character charcode,
+ const FontDescription& preferredFontDescription,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor );
/**
* @see Dali::FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
@@ -219,7 +231,9 @@ struct FontClient::Plugin
bool cacheDescription = true );
/**
- * @copydoc Dali::FontClient::GetFontId( const FontDescription& fontDescription, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
+ * @see Dali::FontClient::GetFontId( const FontDescription& preferredFontDescription, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
+ *
+ * @param[in] actualPointSize The actual point size. In case of emojis the @p requestedPointSize is used to build the metrics and cache the font and the @p actualPointSize is used to load the glyph.
*/
FontId GetFontId( const FontDescription& fontDescription,
PointSize26Dot6 requestedPointSize,
@@ -351,7 +365,7 @@ private:
* @param[in] faceIndex A face index.
* @param[in] cacheDescription Whether to cache the font description.
*
- * @return The font id.
+ * @return The font identifier.
*/
FontId CreateFont( const FontPath& path,
PointSize26Dot6 requestedPointSize,
@@ -368,12 +382,12 @@ private:
/**
* @brief Finds in the cache if there is a triplet with the path to the font file name, the font point size and the face index.
- * If there is one , if writes the font id in the param @p fontId.
+ * If there is one , if writes the font identifier in the param @p fontId.
*
* @param[in] path Path to the font file name.
* @param[in] requestedPointSize The font point size.
* @param[in] faceIndex The face index.
- * @param[out] fontId The font id.
+ * @param[out] fontId The font identifier.
*
* @return @e true if there triplet is found.
*/
@@ -401,12 +415,12 @@ private:
FontList*& fontList );
/**
- * @brief Finds in the cache a pair 'validated font id and font point size'.
- * If there is one it writes the font id in the param @p fontId.
+ * @brief Finds in the cache a pair 'validated font identifier and font point size'.
+ * If there is one it writes the font identifier in the param @p fontId.
*
* @param[in] validatedFontId Index to the vector with font descriptions.
* @param[in] requestedPointSize The font point size.
- * @param[out] fontId The font id.
+ * @param[out] fontId The font identifier.
*
* @return @e true if the pair is found.
*/
@@ -462,10 +476,10 @@ private:
std::vector mFallbackCache; ///< Cached fallback font lists.
- std::vector mFontCache; ///< Caches the FreeType face and font metrics of the triplet 'path to the font file name, font point size and face index'.
+ std::vector mFontCache; ///< Caches the FreeType face and font metrics of the triplet 'path to the font file name, font point size and face index'.
std::vector mValidatedFontCache; ///< Caches indices to the vector of font descriptions for a given font.
FontList mFontDescriptionCache; ///< Caches font descriptions for the validated font.
- std::vector mFontIdCache; ///< Caches font ids for the pairs of font point size and the index to the vector with font descriptions of the validated fonts.
+ std::vector mFontIdCache; ///< Caches font identifiers for the pairs of font point size and the index to the vector with font descriptions of the validated fonts.
VectorFontCache* mVectorFontCache; ///< Separate cache for vector data blobs etc.
diff --git a/text/dali/internal/text-abstraction/shaping-impl.cpp b/text/dali/internal/text-abstraction/shaping-impl.cpp
index ccdf4bc1f..ae87d9448 100644
--- a/text/dali/internal/text-abstraction/shaping-impl.cpp
+++ b/text/dali/internal/text-abstraction/shaping-impl.cpp
@@ -47,6 +47,22 @@ const hb_script_t SCRIPT_TO_HARFBUZZ[] =
{
HB_SCRIPT_COMMON,
+ HB_SCRIPT_COMMON, // ASCII_DIGITS
+ HB_SCRIPT_COMMON, // ASCII_PS
+
+ HB_SCRIPT_COMMON, // C1_CONTROLS
+ HB_SCRIPT_COMMON, // C1_PS
+ HB_SCRIPT_COMMON, // C1_MATH
+ HB_SCRIPT_COMMON, // SML_P
+ HB_SCRIPT_COMMON, // PHONETIC_U
+ HB_SCRIPT_COMMON, // PHONETIC_SS
+ HB_SCRIPT_COMMON, // NUMERIC_SS
+ HB_SCRIPT_COMMON, // LETTER_LIKE
+ HB_SCRIPT_COMMON, // NUMBER_FORMS
+ HB_SCRIPT_COMMON, // FRACTIONS_NF
+ HB_SCRIPT_COMMON, // NON_LATIN_LED
+ HB_SCRIPT_COMMON, // HWFW_S
+
HB_SCRIPT_CYRILLIC,
HB_SCRIPT_GREEK,
HB_SCRIPT_LATIN,
@@ -80,6 +96,11 @@ const hb_script_t SCRIPT_TO_HARFBUZZ[] =
HB_SCRIPT_KHMER,
HB_SCRIPT_UNKNOWN, // EMOJI
+ HB_SCRIPT_UNKNOWN, // SYMBOLS1
+ HB_SCRIPT_UNKNOWN, // SYMBOLS2
+ HB_SCRIPT_UNKNOWN, // SYMBOLS3
+ HB_SCRIPT_UNKNOWN, // SYMBOLS4
+ HB_SCRIPT_UNKNOWN, // SYMBOLS5
HB_SCRIPT_UNKNOWN
};