- if( 0u == glyphIndex )
- {
- // Get the point size of the current font. It will be used to get a default font id.
- pointSize = fontClient.GetPointSize( fontId );
+ // At this point the validated font supports the given character. However, characters
+ // common for all scripts, like white spaces or new paragraph characters, need to be
+ // processed differently.
+ //
+ // i.e. A white space can have assigned a DEVANAGARI script but the font assigned may not
+ // support none of the DEVANAGARI glyphs. This font can't be added to the cache as a valid
+ // font for the DEVANAGARI script but the COMMON one.
+ if( TextAbstraction::IsCommonScript( character ) )
+ {
+ validateFontsPerScript = *( validFontsPerScriptCacheBuffer + TextAbstraction::COMMON );
+
+ if( NULL == validateFontsPerScript )
+ {
+ validateFontsPerScript = new ValidateFontsPerScript();
+
+ *( validFontsPerScriptCacheBuffer + TextAbstraction::COMMON ) = validateFontsPerScript;
+ }
+ }