Register the required resource in JavaScript so the report renders consistently in every environment.

Registering the resource. Load or register the external resource before rendering so the finished report remains portable across environments.
// Describe each custom font by name, style and file path
const myFontCollection = [
    { fontName: 'Long Cang',    fontStyle: 'Regular', fontPath: '../Fonts/LongCang-Regular.ttf' },
    { fontName: 'Noto Sans SC', fontStyle: 'Regular', fontPath: '../Fonts/NotoSansSC-Regular.ttf' },
    { fontName: 'Stick',        fontStyle: 'Regular', fontPath: '../Fonts/Stick-Regular.ttf' },
];

// Register the whole collection at once
Stimulsoft.Base.StiFontCollection.registerFontConfig(myFontCollection);

var designer = new Stimulsoft.Designer.StiDesigner(null, 'StiDesigner', false);
designer.renderHtml('content');

var report = new Stimulsoft.Report.StiReport();
designer.report = report;

registerFontConfig takes an array describing each font's name and file path, making all of them available to reports at once. This is convenient when your application ships a whole family of custom fonts.

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.