C# 使用内存字体,无释放无安装
作者:admin 发布于:2012-9-15 10:18 Saturday 分类:.NET
PrivateFontCollection pfc = new PrivateFontCollection(); IntPtr MeAdd = Marshal.AllocHGlobal(Properties.Resources.TEC.Length); Marshal.Copy(Properties.Resources.TEC, 0, MeAdd, Properties.Resources.TEC.Length); pfc.AddMemoryFont(MeAdd, Properties.Resources.TEC.Length); Font f = new Font(pfc.Families[0], 15, FontStyle.Regular);
Application.SetCompatibleTextRenderingDefault(false);
标签: AddMemoryFont