Forum Discussion

smpa01's avatar
smpa01
Community Champion
3 years ago
Solved

Importing Google fonts /using Google Fonts in cust Viz dev

Is there any way to use Google fonts in custViz.   I am developing the custViz using powerbi-visuals-api and I am very keen to find out if this is a possibility.   In a classic html set up, t...
  • dm-p's avatar
    dm-p
    3 years ago

    Hi smpa01,

     

    Assumning that you've added https://fonts.gstatic.com to your visual's privileges for web access and it's still being refused, the Google domains may be imposing further cross domain issues against the custom visual sandboxing from their end.

     

    However, if you're OK with bundling the font as part of your visual, then this will be possible.

     

    With Deneb I've loaded the DIN font (as this doesn't seem to be available to custom visuals) as a base64 URL into my visual.less and this gets packaged and works inside the visual. You can see an example of how I set this up here.

     

    If you're using a custom webpack configuration and have an appropriate loader, you may just be able to load the font using a relative URL in your source (I don't use powerbi-visuals-webpack-plugin as it never seems to be reliable enough for me and it defintiely doesn't work using powerbi-visuals-tools as-is).

     

    Anyway, this may give you a way to achieve what you want, even if not as you were intending originally.

     

    Regards,

     

    Daniel