Пример #1
0
        internal static XFontSource GetOrCreateFromGdi(string typefaceKey, GdiFont gdiFont)
        {
            var fullPath = fl.GetFontPath(gdiFont.Name, gdiFont.Style);

            if (fullPath != null)
            {
                var buffer = File.ReadAllBytes(fullPath);

                return(GetOrCreateFrom(typefaceKey, buffer));
            }

            return(null);
        }
Пример #2
0
        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);
        }