- const FontId fontId = *it;
- TextAbstraction::FontDescription fontDescription;
- fontClient.GetDescription( fontId, fontDescription );
-
- if( ( size == fontClient.GetPointSize( fontId ) ) &&
- ( description.weight == fontDescription.weight ) &&
- ( description.width == fontDescription.width ) &&
- ( description.slant == fontDescription.slant ) )
+ const CacheItem& item = *it;
+
+ if( ( ( TextAbstraction::FontWeight::NONE == description.weight ) || ( description.weight == item.description.weight ) ) &&
+ ( ( TextAbstraction::FontWidth::NONE == description.width ) || ( description.width == item.description.width ) ) &&
+ ( ( TextAbstraction::FontSlant::NONE == description.slant ) || ( description.slant == item.description.slant ) ) &&
+ ( size == fontClient.GetPointSize( item.fontId ) ) &&
+ ( description.family.empty() || ( description.family == item.description.family ) ) )