Using the Same Label for Multiple Fonts
Our sample projects and report templates can help you learn the basics of working with our products.A single font label can map to several physical font files (regular, bold, …) by registering a font configuration before the designer or report loads.
Register a font configuration.
How it works. One logical font name resolves to the correct file per style, so bold and regular text render from separate
Register a font configuration.
var myFontCollection = [
{ fontName: 'MyFont', fontStyle: 'Regular', fontPath: '../Fonts/Arial.ttf' },
{ fontName: 'MyFont', fontStyle: 'Bold', fontPath: '../Fonts/Ariblk.ttf' },
];
Stimulsoft.Base.StiFontCollection.registerFontConfig(myFontCollection);StiFontCollection.registerFontConfig(config)— maps onefontNameto different files perfontStyle.- The report then references the single label
MyFont; the engine picks the right file for each style.
How it works. One logical font name resolves to the correct file per style, so bold and regular text render from separate
.ttf files under a shared label.