Page 1 of 1

How to remove System Fonts

Posted: Fri Apr 26, 2024 11:25 am
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

Re: How to remove System Fonts

Posted: Mon Apr 29, 2024 7:35 am
by Lech Kulikowski
Hello,

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

Thank you.

Re: How to remove System Fonts

Posted: Mon Apr 29, 2024 11:59 am
by yurilima
that works, thank you Lech Kulikowski

Re: How to remove System Fonts

Posted: Mon Apr 29, 2024 12:27 pm
by Lech Kulikowski
Hello,

You are welcome.