internal static XFontSource GetOrCreateFromGdi(string typefaceKey, GdiFont gdiFont) { XFontSource result = null; FontLocalizator fl = new FontLocalizator(); string fullPath = fl.GetFontPath(gdiFont.Name, gdiFont.Style); if (fullPath != null) { BinaryReader br = new BinaryReader(File.OpenRead(fullPath)); byte[] buffer = br.ReadBytes((int)br.BaseStream.Length); result = GetOrCreateFrom(typefaceKey, buffer); br.Close(); return(result); } return(result); }