Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to access a shape's 'text' property in .json theme file and add a font

Hello, 

I need to add a font in the theme to be available in the Text property of any shape object (the one highlighted in the image below)

PowerBoy_0-1635452286316.png




I can access the rectangle object via 'shape' visual object, but I don't know what are the other properties to get to add a font. 

I tried the following code, but it doesn't work:

 

"visualStyles" : {
"shape" : {
  "*": {
     "text": [{"fontFamily": "Ogg Regular"}]
       }
          }
                 }

 


It seems that line 

 

 "text": [{"fontFamily": "Ogg Regular"}]

 

isn't correct, and here is where I need help. 

I couldn't see in the documentation any cardName property that looks like the one I need. 

Do you know how can I reach this property and add a font?

Thanks

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , check if this solution can help

https://community.powerbi.com/t5/Desktop/Themes-For-Shapes/m-p/196835

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hello, I couldn't make use of the solution that appears in the link. I need to add a new font to the Text section of a shape object. 

The question is what card property to I have to access in the .json in order to get to the Text section and add the font, if exists. 

Hi, I (finally) found a solution for this issue.

 

You need to enter a "$id": tag in the text parameter, such as follows:

"visualStyles": {
"visualStyles": {
"shape": {
"*": {
"text": [
{
"$id": "default",
"fontFamily": "Arial Black",
"fontSize": 16,
"show": true
}
]
}
}
}


I have no clue why it is so, but it works as of today

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors