Exemplo n.º 1
0
        private static void EnsureSystemFontCached(string fontSource)
        {
            FontResolver.EnsureSystemFontCache();
            bool useGdiFontNames1 = true;

            FontResolver.StoreFontLookup(FontResolver.gdiFontFamilyLookup, FontResolver.gdiFontFamilyToFontFileMap, fontSource, useGdiFontNames1);
            bool useGdiFontNames2 = false;

            FontResolver.StoreFontLookup(FontResolver.wpfFontFamilyLookup, FontResolver.wpfFontFamilyToFontFileMap, fontSource, useGdiFontNames2);
        }
Exemplo n.º 2
0
        private string ConvertFontName(string sourceName, Dictionary <string, string> systemFontNameMap, Dictionary <string, string> projectFontNameMap)
        {
            if (string.IsNullOrEmpty(sourceName))
            {
                return(sourceName);
            }
            FontResolver.EnsureSystemFontCache();
            string str;

            if (!systemFontNameMap.TryGetValue(sourceName, out str) && !projectFontNameMap.TryGetValue(sourceName, out str))
            {
                str = sourceName;
            }
            return(str);
        }