如何将 google 字体导入 powerBI 以用作主题。主题是一个 JSON 文件

How to import a google-font into powerBI to use as a theme. The theme is a JSON file

我正在为 PowerBI 报告中的企业品牌创建主题。我遇到的问题是我想使用的字体不是默认的 PowerBI 字体,我不知道如何将它与主题一起导入或导入到软件中并保存。 This 论坛建议有一种方法可以导入 google-字体作为主题的一部分,但我无法让它工作,而且我不确定将代码片段放在哪里。

我想使用的字体是 Rubik,我拥有的指定字体的 JSON 代码是:

"background": "#ffffff",
"foreground": "#000000",
"tableAccent": "#FF637D",
"dataColors": [ "#003E51", "#00BFD6", "#BCBCBB", "#8AD4EB", "#575756", "#C8D308" ],    
"visualStyles": {
        "*": {
            "*": {
                "*": [
                    {
                        "fontSize": 12,
                        "fontFamily": "DIN",
                        "color": { "solid": {} }
                    }
                ],
                "general": [ { "responsive": true } ]
            }
        },

我认为我的预期结果是使用如下代码片段:

@import (less) url('https://fonts.googleapis.com/css?family=Lato');

文件中的某人,然后我可以将 "fontFamily" 更改为 "Rubik",例如:

"fontFamily" : "Rubik",

Power BI 不支持标准视觉对象和主题的自定义字体。您所指的论坛 post 与开发自定义视觉对象有关,这与创建 Power BI 主题不同。

如果您想在 Power BI 中使用自定义字体,请考虑投票:

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/9007054-allow-fonts-to-be-customized

我不确定您是否可以在 JSON 文件中使用 @import ...,但是如果您的系统中安装了这样的字体,作为 Windows 中的 .ttf 文件,可以通过修改 JSON 主题文件在您的桌面上使用它。例如:

 {
        "name": "my theme",
        "dataColors": ["#568410", "#3A6108", "#70A322", "#915203", "#D79A12", "#bb7711", "#114400", "#aacc66"],
        "background":"#FFFFFF",
        "foreground": "#3A6108",
        "tableAccent": "#568410",
        "visualStyles":{
            "*": {
                "*": {
                    "*":  [{
                            "fontFamily": "Roboto Condensed"
                        }]
                }
            }
        }
    }