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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Font family in button text

Hello everyone 🙂

 

I have created a custon theme for my dashboard with a JSON file, where I specify the font family I want to use:

 

"visualStyles":{
    "*": {
        "*": {
            "*": [{
                "fontFamily": "HP Simplified",
                "fontSize":11
            }]
        }
    }
}

 

This works in all visualizations except on the button's text. I know I could change the font selecting the button and going to "Visualizations -> Button Text -> Font family", but the font I want to use is not available in the options.

 

I would really appreciate any ideas. Thank you!

9 REPLIES 9
Anonymous
Not applicable

Hey. I know this is old, but I wanted to provide the solution as this was the only thread I found while googling.

 

You have to specify the JSON class name "lightLabel", as this changes button text fonts. Here is a working example:

 

 

{
    "name": "CustomTheme",
    "textClasses": {
        "lightLabel": {
            "fontSize": 45,
            "fontFace": "Harlow Solid",
            "color": "#252423"
        }
    }
}

 

 

You can read more and find examples here: https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-report-themes#report-theme-json-fil... 

It works for me, thx!

Thanks, good timing actually. Are you sure this works...? I've just tested and nothing is changing. 

Trying to change the Text from buttons on default state, just to be clear.

 

regards!

Anonymous
Not applicable

Just tried again, and it works for me. Copy-paste the script into a notepad, and save as filename.json.  From report view go to View->Theme dropdown->browse for themes->select your file. Here is with HP Simplified, as irenereche was looking for. Arial on the left button for comparison.

mn11079_0-1639567927761.png

 

Also, If I can borrow a little bit more of your knowledge 🙂,  would you know how to do change a gauge callout value text to bold? I managed to change the font, but I can't change it to bold.

lvallinoto_0-1639569273114.png

 

Yeah, now that I tested your script alone it does work, thanks.

I was trying to add that to my existing Theme, which was basically applying the Custom Font to the rest of report :

 
    "visualStyles":{
        "*":{
            "*":{
                "*":[{"fontFamily""MyFont"}]
                }
            }
        }


Then it didn't work. Maybe I've done something wrong, don't know much about editing Json files.

Anyway, sorted now.

Thanks again!

Anonymous
Not applicable

Happy to help. I recommend checking out the table under the "Setting formatted text defaults" chapter in the documentation.

Other text classes, considered secondary classes, automatically derive their properties from their associated primary classes. Often, a secondary class selects a lighter shade of text color, or a percentage large or smaller text size compared to the primary class.

It looks like it is easy to accidentally overwrite one theme when using another, higher level theme. 

Not sure about Gauge callout value. It says something about Gauge callout value color in the table, but not sure if that includes bold-formatting

v-jiascu-msft
Employee
Employee

Hi @Anonymous,

 

According to desktop-report-themes, the button text isn't supported yet while the button title is supported. I would suggest you vote up this idea.

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you! 🙂 I have voted up the idea.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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