예제 #1
0
 internal virtual void Put(FontSelectorKey key, FontSelector fontSelector, FontSet fontSet)
 {
     if (fontSet == null)
     {
         Put(key, fontSelector);
     }
     else
     {
         FontSelectorCache.FontSetSelectors selectors = caches.Get(fontSet.GetId());
         if (selectors == null)
         {
             caches.Put(fontSet.GetId(), selectors = new FontSelectorCache.FontSetSelectors());
         }
         //update selectors and defaultSelectors to reset counter before pushing if needed.
         Update(selectors, fontSet);
         selectors.map.Put(key, fontSelector);
     }
 }
예제 #2
0
 internal virtual FontSelector Get(FontSelectorKey key, FontSet fontSet)
 {
     if (fontSet == null)
     {
         return(Get(key));
     }
     else
     {
         FontSelectorCache.FontSetSelectors selectors = caches.Get(fontSet.GetId());
         if (selectors == null)
         {
             caches.Put(fontSet.GetId(), selectors = new FontSelectorCache.FontSetSelectors());
         }
         if (Update(selectors, fontSet))
         {
             return(null);
         }
         else
         {
             return(selectors.map.Get(key));
         }
     }
 }