- // 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 )