0
我想用我的嵌入式资源文件夹我[fieldObject] .ApplyFont(字体名)不工作
`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);`
机器上安装了字体吗? –
我不认为它会工作,除非字体安装在机器上。 –
不,我试图使用我已经嵌入在我的解决方案中的字体。 fyi,我正在开发一个Windows窗体应用程序 – JosephLYapcengcoJr