From 8053bd9ed4d6917434bb082931abf30e2d96bcdb Mon Sep 17 00:00:00 2001 From: Victor Cebollada Date: Thu, 16 Jul 2015 08:14:33 +0100 Subject: [PATCH] Function added to check if a script may have ligatures that need to be broken. Change-Id: I92c9d23b76c174f47057a75fa071e19aa23a7676 Signed-off-by: Victor Cebollada --- text/dali/devel-api/text-abstraction/script.cpp | 6 ++++++ text/dali/devel-api/text-abstraction/script.h | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/text/dali/devel-api/text-abstraction/script.cpp b/text/dali/devel-api/text-abstraction/script.cpp index 6629a211b..2b534f8b0 100644 --- a/text/dali/devel-api/text-abstraction/script.cpp +++ b/text/dali/devel-api/text-abstraction/script.cpp @@ -597,6 +597,12 @@ bool IsCommonScript( Character character ) IsNewParagraph( character ) ); } +bool HasLigatureMustBreak( Script script ) +{ + return ( ( LATIN == script ) || + ( ARABIC == script ) ); +} + } // namespace TextAbstraction } // namespace Dali diff --git a/text/dali/devel-api/text-abstraction/script.h b/text/dali/devel-api/text-abstraction/script.h index c8939c6bd..ee08ab2cd 100644 --- a/text/dali/devel-api/text-abstraction/script.h +++ b/text/dali/devel-api/text-abstraction/script.h @@ -215,6 +215,17 @@ DALI_IMPORT_API bool IsThinSpace( Character character ); */ DALI_IMPORT_API bool IsCommonScript( Character character ); +/** + * @brief Whether the script contains ligatures that must be 'broken' for selection or cursor position. + * + * i.e The latin script has the 'ff' or 'fi' ligatures that need to be broken to position the cursor + * between the two characters. Equally the arabic script has the 'ï»»' ligature that needs to be broken. + * + * @param[in] script The script. + * + * @return @e true if the script has ligatures that must be 'broken'. + */ +DALI_IMPORT_API bool HasLigatureMustBreak( Script script ); } // namespace TextAbstraction } // namespace Dali -- 2.34.1