How to remove System Fonts

Stimulsoft Reports.JS discussion
Post Reply
yurilima
Posts: 15
Joined: Wed Oct 11, 2023 10:11 am

How to remove System Fonts

Post by yurilima »

I wanna remove all system Fonts by default and leave only the custom.

At the moment this is how i am adding the custom, please feww free to say something to improve if its that the case.

Code: Select all

let fontNames = [
            'Arial.ttf',
            'Roboto-Black.ttf',
            'Roboto-BlackItalic.ttf',
            'Roboto-Bold.ttf',
            'Roboto-BoldItalic.ttf',
            'Roboto-Italic.ttf',
            'Roboto-Light.ttf',
            'Roboto-LightItalic.ttf',
            'Roboto-Medium.ttf',
            'Roboto-MediumItalic.ttf',
            'Roboto-Regular.ttf',
            'Roboto-Thin.ttf',
            'Roboto-ThinItalic.ttf'
        ];

        for (let i = 0; i < fontNames.length; i++) {
            stiReport.dictionary.resources.clear();
            let fileContent = Stimulsoft.System.IO.File.getFile(`${fontFolderPath}${fontNames[i]}`, true, "application/octet-stream", [], true, false, true);
            let resource = new Stimulsoft.Report.Dictionary.StiResource(
                fontNames[i], fontNames[i].split('.')[0], false, Stimulsoft.Report.Dictionary.StiResourceType.FontTtf, fileContent, false);
            stiReport.dictionary.resources.add(resource);
        }
Thank You
Lech Kulikowski
Posts: 6832
Joined: Tue Mar 20, 2018 5:34 am

Re: How to remove System Fonts

Post by Lech Kulikowski »

Hello,

Please try to use the showSystemFonts option:
https://www.stimulsoft.com/en/documenta ... ttings.htm

Thank you.
yurilima
Posts: 15
Joined: Wed Oct 11, 2023 10:11 am

Re: How to remove System Fonts

Post by yurilima »

that works, thank you Lech Kulikowski
Lech Kulikowski
Posts: 6832
Joined: Tue Mar 20, 2018 5:34 am

Re: How to remove System Fonts

Post by Lech Kulikowski »

Hello,

You are welcome.
Post Reply