Forum Discussion
Import custom local font?
- 9 years ago
Google "Access-Control-Allow-Origin" to learn more about this issue. Instead, you may use Google Fonts.
Hi lattys!
I used the following line to import a google font into my project, placing it first in my visual.less file:
@import (less) url('https://fonts.googleapis.com/css?family=Lato');
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');
body {
font-family: 'Roboto', sans-serif;
}
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.
- v-viig8 years agoCommunity Champion
Hello murali_r
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.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
- Friso8 years agoFrequent Visitor
Hello,
How and where can I import the code beneath?
And is it not possible yet to use is alwasy (one import or for each visual a seperate import?)
@import (less) url('https://fonts.googleapis.com/css?family=Roboto'); body { font-family: 'Roboto', sans-serif; }Friso
- v-viig8 years agoCommunity Champion
Please write a valid CSS code to import Roboto Font from Google's servers.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals