Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'd like to use the same font being used for the callout value on the gauge chart. In the browser inspector, it's reported as being 'wf_standard-font_light'. I've tried simply setting that font in visual.less, but that font family doesn't appear to be available from my custom visual's iframe.
What is the best way to make this font available for use in my custom visual? Is there a common style sheet I should be referencing?
I've been looking into this and discovered a way to use custom font files in custom visuals.
So for your need of the "wf_standard-font_light" font, you would get the font using developer tools on some browser (I used firefox):
and download the woff file listed (you can also use the css associated for your css), then you will take that file and encode it to base64 using a site like this. And create a css font-face rule in your .less file, but replacing the src url with this:
src: url("<output of base64 encoder>") format("woff");
Then you will be able to use the font-face and it should work correctly. I know this is a dirty method, but it's the only way I could work around the sandbox and not letting you include woff (etc.) files in the build process.
We wouldn't recommend such method since this font is private and we don't have any plans to share it.
Our recommendation is to use free fonts instead.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Initially fonts were turned off to reduce the payload for iframe that is used for isolation of custom visuals.
There're also some licensing issues that prevents us from allowing the fonts for external custom visuals.
We'd recommend that you should use free fonts instead.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Hello @joshberry,
Thanks for your feedback.
The wf_standard-font_light isn't available for custom visuals now. There's no way use this font with custom visuals at least now.
However, you are able to use other public fonts.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.