Fonts can be embedded into a report as resources so it renders identically everywhere. This example adds a TrueType font to the report dictionary.

Registering the resource. Load or register the external resource before rendering so the finished report remains portable across environments.
var report = new Stimulsoft.Report.StiReport();

var fontFileContent = Stimulsoft.System.IO.File.getFile("../reports/Roboto-Black.ttf", true);
var resource = new Stimulsoft.Report.Dictionary.StiResource(
    "Roboto-Black", "Roboto-Black", false,
    Stimulsoft.Report.Dictionary.StiResourceType.FontTtf, fontFileContent);
report.dictionary.resources.add(resource);

var dataText = new Stimulsoft.Report.Components.StiText();
dataText.font = new Stimulsoft.System.Drawing.Font("Roboto-Black");
report.pages.getByIndex(0).components.add(dataText);
The font file is read and added as a StiResource of type FontTtf. Once in the dictionary it travels with the report, so text using that font renders and exports correctly even where the font is not installed.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:

Adding a Font to the Resource

Используя этот сайт, вы соглашаетесь на использование файлов Cookie для аналитики и персонализированного контента. Файлы Cookie хранят полезную информацию на вашем компьютере, чтобы помочь нам повысить эффективность и удобство использования. Для получения дополнительной информации, пожалуйста, прочтите Конфиденциальность и Использование Cookie.