4

I am using StimulSoft software for showing reports in my asp.net mvc project.
In my report all of things is OK, but In print preview my font haven't be applied.
I attached my font in report.cshtml file by using font-face.
How can I solve this problem?

Majid Basirati
  • 2,665
  • 3
  • 24
  • 46

4 Answers4

8

In old versions; as @Abbas-Mirzaei said, you have to install fonts on server. stimulsoft reports.net doesn't support import or embed fonts before 2016 versions. but in newer version you can add fonts.

Stimulsoft.Base.StiFontCollection.AddFontFile(@"d:\Work\Resources\glyphicons-halflings-regular.ttf");
2

Add font in project for example(fonts folder) then add this code into your service

Stimulsoft.Base.StiFontCollection.AddFontFile(Server.MapPath("~/fonts/my-font/font-name.ttf"));

Then add your fonts to server font folder too!

RainyTears
  • 171
  • 4
1

Add font in Controller for load in Razor pages:

Stimulsoft.Base.StiFontCollection.AddFontFile(@"d:\Work\Resources\glyphicons-halflings- 
regular.ttf");
Mojtaba Nava
  • 858
  • 7
  • 17
0

I had this issue too...you can add your fonts to server font folder if you access to it...(c:\windows\fonts)

  • No, I don't access to server! – Majid Basirati Jul 10 '17 at 07:43
  • you know..you should add font to windows because stimulsoft dosent read from your app font it reads from windows font – Abbas Mirzaei Jul 11 '17 at 06:08
  • Tell your Server Administrator that install your font and check it....or use 'Tahoma' or other default font in your report.... – Abbas Mirzaei Jul 11 '17 at 06:10
  • I have added my font to font folder in my system. but my font haven't be shown in "stimul report print preview" in local too! – Majid Basirati Jul 11 '17 at 06:24
  • which version of stimulsoft did you use?and which dll of stimul did you add to your project? – Abbas Mirzaei Aug 08 '17 at 05:31
  • I have added my font (B Nazanin) to font folder in my server. but my font haven't be shown in "stimul report print preview" in server! (but in local it works). my stimulsoft version is 2019.3.5 and my dlls in bin folder are Stimulsoft.Base.dll, Stimulsoft.Report.dll, Stimulsoft.Report.Mvc.dll and Stimulsoft.Report.Web.dll – alite Dec 28 '19 at 12:21
  • Was your problem fixed? @MajidBasirati – Hamed Naeemaei Jul 17 '21 at 07:11