Alsing.Drawing.GDI.FontEnum.EnumFonts C# (CSharp) Method

EnumFonts() public method

public EnumFonts ( ) : ICollection
return ICollection
        public ICollection EnumFonts()
        {
            var bmp = new Bitmap(10, 10);
            Graphics g = Graphics.FromImage(bmp);

            IntPtr hDC = g.GetHdc();
            Fonts = new Hashtable();
            var lf = new LogFont {lfCharSet = 1};
            FONTENUMPROC callback = CallbackFunc;
            NativeMethods.EnumFontFamiliesEx(hDC, lf, callback, 0, 0);

            g.ReleaseHdc(hDC);
            g.Dispose();
            bmp.Dispose();
            return Fonts.Keys;
        }