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); }
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); }