I am trying to import a local font but I keep on getting a console error:
"@font-face failed cross-origin request. Resource access is restricted."
Is it possible at all to import a custom font for custom visualizations?
Thanks in advance!
Go to Solution.
Google "Access-Control-Allow-Origin" to learn more about this issue. Instead, you may use Google Fonts.
Thanks for the answer!
I tried using Google fonts and using:
in my visual.less.
But it keeps on fallbacking to the original fonts (Arial etc)...
Any idea how to fix this?
Based on my test, you need to import it as .less file.
@import (less) url('https://fonts.googleapis.com/css?family=Lato');
Works like charm!
Thanks alot for taking the time to help me with this, very much appreciated!
How did you import fonts or where/on wich platform ?
I would like to import the "roboto" family in my power bi desktop, which I will be publishing to the web (refresh through cloud). Thank you for your answer!
I used the following line to import a google font into my project, placing it first in my visual.less file:
This works in both web and desktop version of Power BI
In your case it would look something like:
@import (less) url('https://fonts.googleapis.com/css?family=Roboto');
font-family: 'Roboto', sans-serif;
Thank you very much!
Hi I am also face same issue (import roboto font) in power BI Desktop . I have only .pbix file . In this how do I generate and import this visual.less file . Please help me in details because I am new to this.
You can import custom fonts to your own custom visuals by using the solution above.
However, you can't import custom fonts and apply them to Power BI Desktop and other visuals w/o some code modifications.
Microsoft Power BI Custom Visuals
Engage and empower students with Power BI!
Continue your learning in our online communities.
Travel to Melbourne and network with thousands of peers!