Page 1 of 1

Unable to add OTF font to StiFontCollection

Posted: Thu Aug 11, 2022 4:45 am
by JoshS
Hi,

Have tried a number of different ways to try and add an OTF font to StiFontCollection, eg.

StiFontCollection.AddFontFile($"/path/to/font.otf");
StiFontCollection.AddFontBytes();
StiFontCollection.AddResourceFont();

None of these add the font to the collection if it's an OTF (collection is empty).

If I switch to a TTF of the same font, it is added successfully when using all of the 3 methods above. This is using
Stimulsoft.Base, Version=2022.3.4.0 from stimulsoft.reports.engine.netcore\2022.3.4\lib\netstandard2.1\Stimulsoft.Base.dll

Here is an example font I am trying to use:
https://github.com/googlefonts/noto-cjk ... c-Bold.otf

Re: Unable to add OTF font to StiFontCollection

Posted: Thu Aug 11, 2022 8:53 pm
by Lech Kulikowski
Hello,

In version 2022.3.x a new build Stimulsoft.System.Drawing was added to our NetCore libraries.
This is an implementation of System.Drawing for non-Windows systems, as starting from Net6 this assembly is officially not supported (for non-Windows systems).
You can switch between this and the standard library using the Stimulsoft.Drawing.Graphics.GraphicsEngine property, possible values ImageSharp and Gdi.

Currently do not support OpenType fonts with CFF tables, will try to add in next builds.
For now the solution is only for Windows - set GraphicsEngine = Gdi;
for other systems, use TTF fonts.

Thank you.

Re: Unable to add OTF font to StiFontCollection

Posted: Sun Aug 14, 2022 11:33 pm
by JoshS
Thank you, look forward to seeing OTF support in future build if possible.

Re: Unable to add OTF font to StiFontCollection

Posted: Mon Aug 15, 2022 7:23 am
by Lech Kulikowski
Hello,

You are welcome.