我正在尝试使用嵌入在资源文件夹中的字体在 c# 中为水晶报表中的字段对象设置字体
`FieldObject field;
field = oRpt.ReportDefinition.ReportObjects["CouponCode3"] as FieldObject;
PrivateFontCollection pfc = new PrivateFontCollection();
pfc.AddFontFile("~/Resources/IDAutomationHC39M.ttf");
unsafe
{
fixed (byte* pFontData = Properties.Resources.IDAutomationHC39M)
{
uint dummy = 0;
pfc.AddMemoryFont((IntPtr)pFontData, Properties.Resources.IDAutomationHC39M.Length);
AddFontMemResourceEx((IntPtr)pFontData, (uint)Properties.Resources.IDAutomationHC39M.Length, IntPtr.Zero, ref dummy);
}
}
Font barcodeFont = new Font(pfc.Families[0], 12);
field.ApplyFont(barcodeFont);`