Integration method C# with Example



Integration method C# with Example

public static FontFamily GetResourceFontFamily(byte[] fontbytes) 
{ 
PrivateFontCollection pfc = new PrivateFontCollection(); 
IntPtr fontMemPointer = Marshal.AllocCoTaskMem(fontbytes.Length); 
Marshal.Copy(fontbytes, 0, fontMemPointer, fontbytes.Length); 
pfc.AddMemoryFont(fontMemPointer, fontbytes.Length); 
Marshal.FreeCoTaskMem(fontMemPointer); 
return pfc.Families[0]; 
} 

0 Comment's

Comment Form

Submit Comment