-/**
- * @brief Retrieves the font Id from the font run for a given character's @p index.
- *
- * If the character's index exceeds the current font run it increases the iterator to get the next one.
- *
- * @param[in] index The character's index.
- * @param[in,out] fontRunIt Iterator to the current font run.
- * @param[in] fontRunEndIt Iterator to one after the last font run.
- *
- * @return The font id.
- */
-FontId GetFontId( Length index,
- Vector<FontRun>::ConstIterator& fontRunIt,
- const Vector<FontRun>::ConstIterator& fontRunEndIt )
-{
- FontId fontId = 0u;
-
- if( fontRunIt != fontRunEndIt )
- {
- const FontRun& fontRun = *fontRunIt;
-
- if( ( index >= fontRun.characterRun.characterIndex ) &&
- ( index < fontRun.characterRun.characterIndex + fontRun.characterRun.numberOfCharacters ) )
- {
- fontId = fontRun.fontId;
- }
-
- if( index + 1u == fontRun.characterRun.characterIndex + fontRun.characterRun.numberOfCharacters )
- {
- // All the characters of the current run have been traversed. Get the next one for the next iteration.
- ++fontRunIt;
- }
- }
-
- return fontId;
-}
-
-/**
- * @brief Retrieves the script Id from the script run for a given character's @p index.
- *
- * If the character's index exceeds the current script run it increases the iterator to get the next one.
- *
- * @param[in] index The character's index.
- * @param[in,out] scriptRunIt Iterator to the current font run.
- * @param[in] scriptRunEndIt Iterator to one after the last script run.
- *
- * @return The script.
- */
-Script GetScript( Length index,
- Vector<ScriptRun>::ConstIterator& scriptRunIt,
- const Vector<ScriptRun>::ConstIterator& scriptRunEndIt )
-{
- Script script = TextAbstraction::UNKNOWN;
-
- if( scriptRunIt != scriptRunEndIt )
- {
- const ScriptRun& scriptRun = *scriptRunIt;
-
- if( ( index >= scriptRun.characterRun.characterIndex ) &&
- ( index < scriptRun.characterRun.characterIndex + scriptRun.characterRun.numberOfCharacters ) )
- {
- script = scriptRun.script;
- }
-
- if( index + 1u == scriptRun.characterRun.characterIndex + scriptRun.characterRun.numberOfCharacters )
- {
- // All the characters of the current run have been traversed. Get the next one for the next iteration.
- ++scriptRunIt;
- }
- }
-
- return script;
-}
-
-/**
- * @brief Whether the character is valid for all scripts. i.e. the white space.
- *
- * @param[in] character The character.
- *
- * @return @e true if the character is valid for all scripts.
- */
-bool IsValidForAllScripts( Character character )
-{
- return ( TextAbstraction::IsWhiteSpace( character ) ||
- TextAbstraction::IsZeroWidthNonJoiner( character ) ||
- TextAbstraction::IsZeroWidthJoiner( character ) ||
- TextAbstraction::IsZeroWidthSpace( character ) ||
- TextAbstraction::IsLeftToRightMark( character ) ||
- TextAbstraction::IsRightToLeftMark( character ) ||
- TextAbstraction::IsThinSpace( character ) );
-}
-