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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
JaileneW
Frequent Visitor

How to import customized fonts (Regular, Bold, Semibold, light etc.)

Hi Team,

I am trying to import customized font family to my report theme, and want to make it Bold, Medium, Regular. 

I tried to add "FontWeight":"Bold" or "Fontweight": "Regular" in JSON file, but it doesn't work in the report. 

 

Does anyone know how to add Bold font, regular font to JSON file? 

 

To be specific,

1. can we import custom font family to the Button Text font family list so that we can customize the font ? 

Screen Shot 2020-04-27 at 3.47.37 PM.png

2. How can we customize the slicer header font? I tried to customize it by modifying JSON file and add "FontWeight":"Bold". But it doesn't show as "Bold", it still show regular font. 

Screen Shot 2020-04-27 at 3.49.20 PM.png

 

Thank you,

JW.

 

1 ACCEPTED SOLUTION

Hi @JaileneW,

My original line of thinking was that if you had a font in your system named with a heavier weight, then this would work, but upon testing further, I'm finding it very hard to find some good candidates for you. Even checking through my list of installed fonts has very mixed results.

For example, I can get Wide Latin to work, e.g.:

image.png

...and Franklin Gothic Heavy:

image.png

But for many others it seems to be a case of trial and error, which is why I generally stay with the prescribed list.

Of note, you can specify fallback fonts, by specifying another one afterwards with a comma, e.g.:

"fontFamily": "Roboto, Segoe UI"

In this case, I don't have Roboto on my system, and it will display Segoe UI instead rather than Times New Roman.

I appreciate that this doesn't really 100% solve your problem but might give you some ideas. Font support is still somewhat lacking.

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




View solution in original post

4 REPLIES 4
dm-p
Super User
Super User

Hi @JaileneW,

With theming, you can only set named properties that exist in the properties pane. There are also some considerations with the properties pane UI.

In the case of the font family, the dropdown is the official supported list of fonts across Power BI, irrespective of platform (web, mobile devices etc.) and this cannot currently be added to.

As you've already observed, you can "override" the text value for font family that gets set in the background via theming, but this will only work if the user has the font installed on their system. David Eldersveld's blog post from 2018 about it is still regarded as the current way to work around this, along with the highlighted caveats.

Custom font support is still outstanding on the ideas site.

Regarding font weight, there is no property in the pane for this for core visuals, so you can't set it via theming. You can confirm what's available in the JSON file specification - note that there is no fontWeight property in the list for any components.

For this to be supported, MS would need to add such a property anywhere a complimentary font family dropdown exists in the pane and bind it into the appropiate CSS properties for any affected elements in the visual. Here's an idea for this functionality you can add your vote to. If these properties do eventually become availble, then they would be in theming also.

The only way to manage weight at present is to select a suitable font family with a bold or light weigt as part of their definition.

Not the answer you were after, I'm sure, but hopefully clarifies the current situation with fonts in Power BI.

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




JaileneW
Frequent Visitor

@dm-p Thank you so much for the detailed explanation. 

I currently understand the Panel Font which is not customizable now. 

For the bold font, what do you mean by adding bold in their defintion? I tried to modify the JSON code as following, but it didn't work. It eventuall shows like Times New Roman....

Screen Shot 2020-04-27 at 9.34.56 PM.png

Hi @JaileneW,

My original line of thinking was that if you had a font in your system named with a heavier weight, then this would work, but upon testing further, I'm finding it very hard to find some good candidates for you. Even checking through my list of installed fonts has very mixed results.

For example, I can get Wide Latin to work, e.g.:

image.png

...and Franklin Gothic Heavy:

image.png

But for many others it seems to be a case of trial and error, which is why I generally stay with the prescribed list.

Of note, you can specify fallback fonts, by specifying another one afterwards with a comma, e.g.:

"fontFamily": "Roboto, Segoe UI"

In this case, I don't have Roboto on my system, and it will display Segoe UI instead rather than Times New Roman.

I appreciate that this doesn't really 100% solve your problem but might give you some ideas. Font support is still somewhat lacking.

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




JaileneW
Frequent Visitor

@dm-p Thank you so much for the expalination . It really helps me understand the font customization better. 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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