Adding a Font to the Resource
Our sample projects and report templates can help you learn the basics of working with our products.A font can be embedded into a dashboard as a resource so it renders identically everywhere; here a TrueType font is added to the dictionary.
Registering the resource. Load or register the external resource before rendering so the finished dashboard remains portable across environments.
Registering the resource. Load or register the external resource before rendering so the finished dashboard remains portable across environments.
<script setup lang="ts">
import { Designer, Stimulsoft } from 'stimulsoft-dashboards-js-vuejs/designer';
var report = new Stimulsoft.Report.StiReport();
report.loadFile('Dashboards/CustomFontDashboard.mrt');
var fileContent = Stimulsoft.System.IO.File.getFile('Fonts/LongCang-Regular.ttf', true);
var resource = new Stimulsoft.Report.Dictionary.StiResource('LongCang', 'LongCang', false, Stimulsoft.Report.Dictionary.StiResourceType.FontTtf, fileContent);
report.dictionary.resources.add(resource);
var designerOptions = new Stimulsoft.Designer.StiDesignerOptions();
</script>
<template>
<Designer :report="report" :options="designerOptions" />
</template>