-/**
- * @brief Merges the font descriptions to retrieve the font Id for each character.
- *
- * @param[in] fontDescriptions The font descriptions.
- * @param[out] fontIds The font id for each character.
- * @param[in] defaultFontDescription The default font description.
- * @param[in] defaultPointSize The default font size.
- */
-void MergeFontDescriptions( const Vector<FontDescriptionRun>& fontDescriptions,
- Vector<FontId>& fontIds,
- const TextAbstraction::FontDescription& defaultFontDescription,
- TextAbstraction::PointSize26Dot6 defaultPointSize )
-{
- // Get the handle to the font client.
- TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
-
- // Pointer to the font id buffer.
- FontId* fontIdsBuffer = fontIds.Begin();
-
- // Traverse all the characters.
- const Length numberOfCharacters = fontIds.Count();
- for( CharacterIndex index = 0u; index < numberOfCharacters; ++index )
- {
- // The default font description and font point size.
- TextAbstraction::FontDescription fontDescription = defaultFontDescription;
- TextAbstraction::PointSize26Dot6 fontSize = defaultPointSize;
- bool defaultFont = true;
-
- // Traverse all the font descriptions.
- for( Vector<FontDescriptionRun>::ConstIterator it = fontDescriptions.Begin(),
- endIt = fontDescriptions.End();
- it != endIt;
- ++it )
- {
- // Check whether the character's font is modified by the current font description.
- const FontDescriptionRun& fontRun = *it;
- if( ( index >= fontRun.characterRun.characterIndex ) &&
- ( index < fontRun.characterRun.characterIndex + fontRun.characterRun.numberOfCharacters ) )
- {
- if( fontRun.familyDefined )
- {
- fontDescription.family = std::string( fontRun.familyName, fontRun.familyLength );
- defaultFont = false;
- }
- if( fontRun.weightDefined )
- {
- fontDescription.weight = fontRun.weight;
- defaultFont = false;
- }
- if( fontRun.widthDefined )
- {
- fontDescription.width = fontRun.width;
- defaultFont = false;
- }
- if( fontRun.slantDefined )
- {
- fontDescription.slant = fontRun.slant;
- defaultFont = false;
- }
- if( fontRun.sizeDefined )
- {
- fontSize = fontRun.size;
- defaultFont = false;
- }
- }
- }
-
- // Get the font id if is not the default font.
- if( !defaultFont )
- {
- *( fontIdsBuffer + index ) = fontClient.GetFontId( fontDescription, fontSize );
- }
- }
-}
-
-/**
- * @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 )