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
Unable to add OTF font to StiFontCollection
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: Unable to add OTF font to StiFontCollection
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.
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
Thank you, look forward to seeing OTF support in future build if possible.
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: Unable to add OTF font to StiFontCollection
Hello,
You are welcome.
You are welcome.