I have a chart with custom font. This font is defined in CSS (@font-face) on the website, so the integrated chart looks fine.
But when i try to export the chart (any format), the font is getting lost.
After long research i found out, that the SVG is sent over to your exporting-server and converted into the wished format. But since the SVG is not having the font definition, it cant export the chart exactly the way it is shown on the website. This happens also, when i go via local exporting (offline-exporting.js).
After some additional research, i found a solution, that i can modify the SVG and add the font in the <defs> tags. Highcharts is already using <defs> for <clipPath> so i need to add following:
Code: Select all
<style>
@import url("https://fonts.googleapis.com/css?family=Roboto:400,400i,700,700i");
</style>
Code: Select all
<defs aria-hidden="true">
<clipPath id="highcharts-4285z2x-354-">
<rect x="0" y="0" width="636" height="828" fill="none"></rect>
</clipPath>
<style>
@import url("https://fonts.googleapis.com/css?family=Roboto:400,400i,700,700i");
</style>
</defs>
Additionally, are you thinking of making it possible to add font-definition via chart-configuration? I think
Code: Select all
Highcharts.setOptions()
Kind regards,
Oleg