Esempio n. 1
0
        /// <summary>
        /// Look up the font mapping data for a typeface.
        /// </summary>
        private TypefaceMap Lookup(Typeface key)
        {
            TypefaceMap typefaceMap = _sizeLimitedCache.Get(key);

            if (typefaceMap == null)
            {
                typefaceMap = new TypefaceMap(
                    key.FontFamily,
                    key.FallbackFontFamily,
                    key.CanonicalStyle,
                    key.CanonicalWeight,
                    key.CanonicalStretch,
                    key.NullFont
                    );

                _sizeLimitedCache.Add(
                    key,
                    typefaceMap,
                    false   // is not permanent in the cache.
                    );
            }

            return(typefaceMap);
        }
Esempio n. 2
0
        /// <summary>
        /// Look up the font mapping data for a typeface. 
        /// </summary>
        private TypefaceMap Lookup(Typeface key) 
        { 
            TypefaceMap typefaceMap = _sizeLimitedCache.Get(key);
            if (typefaceMap == null) 
            {
                typefaceMap = new TypefaceMap(
                    key.FontFamily,
                    key.FallbackFontFamily, 
                    key.CanonicalStyle,
                    key.CanonicalWeight, 
                    key.CanonicalStretch, 
                    key.NullFont
                    ); 

                _sizeLimitedCache.Add(
                    key,
                    typefaceMap, 
                    false   // is not permanent in the cache.
                    ); 
            } 

            return typefaceMap; 
        }