Dali 3D User Interface Engine
List of all members | Public Member Functions | Static Public Member Functions
Dali::Toolkit::Text::MultilanguageSupport Class Reference

Sets the character's scripts to the model and validates the fonts set by the user or assigns default ones. More...

#include <multi-language-support.h>

Inheritance diagram for Dali::Toolkit::Text::MultilanguageSupport:
Inheritance graph
[legend]
Collaboration diagram for Dali::Toolkit::Text::MultilanguageSupport:
Collaboration graph
[legend]

Public Member Functions

 MultilanguageSupport ()
 Create an uninitialized MultilanguageSupport handle. More...
 
 ~MultilanguageSupport ()
 Destructor. More...
 
DALI_INTERNAL MultilanguageSupport (Internal::MultilanguageSupport *implementation)
 This constructor is used by MultilanguageSupport::Get(). More...
 
void SetScripts (const Vector< Character > &text, Vector< ScriptRun > &scripts)
 Sets the scripts of the whole text. More...
 
void ValidateFonts (const Vector< Character > &text, const Vector< ScriptRun > &scripts, const Vector< FontDescriptionRun > &fontDescriptions, FontId defaultFontId, Vector< FontRun > &fonts)
 Validates the character's font of the whole text. More...
 
- Public Member Functions inherited from Dali::BaseHandle
 BaseHandle (Dali::BaseObject *handle)
 This constructor is used by Dali New() methods. More...
 
 BaseHandle ()
 This constructor provides an uninitialized Dali::BaseHandle. More...
 
 ~BaseHandle ()
 Dali::BaseHandle is intended as a base class. More...
 
 BaseHandle (const BaseHandle &handle)
 This copy constructor is required for (smart) pointer semantics. More...
 
BaseHandleoperator= (const BaseHandle &rhs)
 This assignment operator is required for (smart) pointer semantics. More...
 
template<class T >
bool ConnectSignal (ConnectionTrackerInterface *connectionTracker, const std::string &signalName, const T &functor)
 Connects a void() functor to a specified signal. More...
 
bool DoAction (const std::string &actionName, const Property::Map &attributes)
 Perform action on this object with the given action name and attributes. More...
 
const std::string & GetTypeName () const
 Returns the type name for the Handle. More...
 
bool GetTypeInfo (Dali::TypeInfo &info) const
 Returns the type info for the Handle. More...
 
BaseObjectGetBaseObject ()
 Retrieve the internal Dali resource. More...
 
const BaseObjectGetBaseObject () const
 Retrieve the internal Dali resource. More...
 
void Reset ()
 Resets the handle. More...
 
 operator BooleanType () const
 Converts an handle to a BooleanType. More...
 
bool operator== (const BaseHandle &rhs) const
 Equality operator overload. More...
 
bool operator!= (const BaseHandle &rhs) const
 Inequality operator overload. More...
 
Dali::RefObjectGetObjectPtr () const
 Get the reference counted object pointer. More...
 

Static Public Member Functions

static MultilanguageSupport Get ()
 Retrieve a handle to the MultilanguageSupport instance. More...
 

Additional Inherited Members

- Public Types inherited from Dali::BaseHandle
typedef void(BaseHandle::* BooleanType )() const
 Pointer-to-member type. More...
 
- Protected Member Functions inherited from Dali::BaseHandle
void ThisIsSaferThanReturningVoidStar () const
 Used by the safe bool idiom. More...
 

Detailed Description

Sets the character's scripts to the model and validates the fonts set by the user or assigns default ones.

Definition at line 49 of file multi-language-support.h.

Constructor & Destructor Documentation

Dali::Toolkit::Text::MultilanguageSupport::MultilanguageSupport ( )

Create an uninitialized MultilanguageSupport handle.

Definition at line 33 of file multi-language-support.cpp.

Dali::Toolkit::Text::MultilanguageSupport::~MultilanguageSupport ( )

Destructor.

This is non-virtual since derived Handle types must not contain data or virtual methods.

Definition at line 37 of file multi-language-support.cpp.

Dali::Toolkit::Text::MultilanguageSupport::MultilanguageSupport ( Internal::MultilanguageSupport implementation)
explicit

This constructor is used by MultilanguageSupport::Get().

Parameters
[in]implementationA pointer to the internal multi-language support object.

Definition at line 41 of file multi-language-support.cpp.

Member Function Documentation

MultilanguageSupport Dali::Toolkit::Text::MultilanguageSupport::Get ( )
static
void Dali::Toolkit::Text::MultilanguageSupport::SetScripts ( const Vector< Character > &  text,
Vector< ScriptRun > &  scripts 
)

Sets the scripts of the whole text.

Scripts are used to validate and set default fonts and to shape the text in further steps.

Some characters (like white spaces) are valid for many scripts. The rules to set a script for them are:

  • If they are at the begining of a paragraph they get the script of the first character with a defined script. If they are at the end, they get the script of the last one.
  • If they are between two scripts with the same direction, they get the script of the previous character with a defined script. If the two scripts have different directions, they get the script of the first character of the paragraph with a defined script.
Parameters
[in]textVector of UTF-32 characters.
[out]scriptsVector containing the script runs for the whole text.

Definition at line 51 of file multi-language-support.cpp.

References Dali::Toolkit::Text::GetImplementation(), and Dali::Toolkit::Text::Internal::MultilanguageSupport::SetScripts().

Referenced by anonymous_namespace{utc-Dali-Text-MultiLanguage.cpp}::ScriptsTest(), Dali::Toolkit::Text::Controller::Impl::UpdateModel(), and anonymous_namespace{utc-Dali-Text-MultiLanguage.cpp}::ValidateFontTest().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Toolkit::Text::MultilanguageSupport::ValidateFonts ( const Vector< Character > &  text,
const Vector< ScriptRun > &  scripts,
const Vector< FontDescriptionRun > &  fontDescriptions,
FontId  defaultFontId,
Vector< FontRun > &  fonts 
)

Validates the character's font of the whole text.

This method ensures all characters are going to be rendered using an appropriate font. Provided a valid font exists in the platform.

For those characters with no font set, it sets a default one.

If a font has been set by the application developer, this method checks if the font supports the character. If it doesn't, this method replaces it by a default one.

Parameters
[in]textVector of UTF-32 characters.
[in]scriptsVector containing the script runs for the whole text.
[in]fontDescriptionsThe fonts set by the application developers.
[in]defaultFontIdThe default font's id.
[out]fontsThe validated fonts.

Definition at line 58 of file multi-language-support.cpp.

References Dali::Toolkit::Text::GetImplementation(), and Dali::Toolkit::Text::Internal::MultilanguageSupport::ValidateFonts().

Referenced by Dali::Toolkit::Text::Controller::Impl::UpdateModel(), and anonymous_namespace{utc-Dali-Text-MultiLanguage.cpp}::ValidateFontTest().

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali