cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to Add font families in your theme

Hello, I'm learning about the possibilities edititing the json theme file. 

I'm not able to import all the members of a family font to be used in my theme. 

I need them to be available in the Text section of a - for example - shape object.

PowerBoy_1-1635431416071.png


I tried to modify the common mentioned properties of the theme file, but with no success. 

Also I would need them to be available in textbox elements. I learned about the "textbox" visual parameter


Why is so complicated to use fonts?

 

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

One option can be to use the buttons, currently buttons assume different shapes on the options and when you select the text you can change the font to the new font that you add to your theme maybe this can be a work around for the final user they will not see any difference betweent the button and the shape:

 

MFelix_0-1635855974197.png

The one on the left is a shape and the one on the right is a button:

 

MFelix_1-1635856002832.png

MFelix_2-1635856014776.png

Has you can see on the button I could put Algerian that is not a default font.

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

10 REPLIES 10
MFelix
Super User
Super User

Hi @Anonymous ,

 

For sure you have follow the steps on this blog post or a similar one but this is possible if you adjust the theme of your report.

 

Have you made all of the steps above? This can also be some limitation or error on the version. What version are you using?


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hello, 

Yup, I already followed the steps of that post. I'm using the version of August 2021, but I tried with the latest from September and happens the same. 
I see that the font is available in the title font drop-down, but not in the shape text section. Also it only imports one font of the various that this family has. 

Hi @Anonymous ,

 

This is done at a single fontm you cannot do it for a font family.

 

Regarding the text box based on the text I made I was abble to add it:

 

MFelix_0-1635437482061.png

Algerian is not a default font, I added algerian on all the font faces:

 

{"name":"sss","textClasses":{"label":{"fontFace":"Algerian"},"callout":{"fontFace":"Algerian"},"title":{"fontFace":"Algerian"},"header":{"fontFace":"Algerian,wf_standard-font, helvetica, arial, sans-serif"}}}

Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Yes. I can add a font in textbox dropdown. But I was asking how to do it in a rectangle shape. These objects have a Text section, and I need to find in their dropdown my added font. I'm looking documentation looking for specific basicShape properties for this, if exist. 

Anonymous
Not applicable

I saved a .pbix file as .zip. I consisted in a dashboard only containing a rectangle shape with the mentioned text field with the value "text" and font family 'Corbel'. Then I opened the Layout file and I believe this is the part where the object properties are defined:

 

  "config": "{\"name\":\"ee7ffec01ceae13309b1\",\"layouts\":[{\"id\":0,\"position\":{\"x\":333.81011097410607,\"y\":127.84217016029594,\"z\":0,\"width\":280.54254007398276,\"height\":279.6547472256473}}],\"singleVisual\":{\"visualType\":\"shape\",\"drillFilterOtherVisuals\":true,\"objects\":{\"shape\":[{\"properties\":{\"tileShape\":{\"expr\":{\"Literal\":{\"Value\":\"'rectangle'\"}}}}}],\"rotation\":[{\"properties\":{\"shapeAngle\":{\"expr\":{\"Literal\":{\"Value\":\"0L\"}}}}}],\"text\":[{\"properties\":{\"show\":{\"expr\":{\"Literal\":{\"Value\":\"true\"}}}}},{\"properties\":{\"text\":{\"expr\":{\"Literal\":{\"Value\":\"'text'\"}}},\"fontFamily\":{\"expr\":{\"Literal\":{\"Value\":\"'Corbel'\"}}}},\"selector\":{\"id\":\"default\"}}]},\"vcObjects\":{\"title\":[{\"properties\":{\"show\":{\"expr\":{\"Literal\":{\"Value\":\"true\"}}},\"text\":{\"expr\":{\"Literal\":{\"Value\":\"'rectangle'\"}}}}}]}}}",

 

I'm looking at the visualType: shape and text: fontFamily elements. In the documentation I see no 'shape' as a visualName, only 'basicShape'. 

I tried the following code in the theme .json file but it didn't work either. Any ideas?

 

"visualStyles": {

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

 

 



Hi PowerBoy,

 

What helped me:

 

 

"visualStyles": {
		"shape": {
			"*": {
				"title": [
					{
						"fontFamily": "Open Sans Semibold"
					}
				]
			}
		}		
	}

 

 

 

But it's for a title of Rectangle. After updating a theme, I've also needed to recreate a rectangle.

Anonymous
Not applicable

Hello, thanks for your response. Yeah, as you say, it only works for title, what I need is to show that font in the dropdown of the 'Text' section. 

Thanksf or your time. 

Hi @Anonymous,

 

One option can be to use the buttons, currently buttons assume different shapes on the options and when you select the text you can change the font to the new font that you add to your theme maybe this can be a work around for the final user they will not see any difference betweent the button and the shape:

 

MFelix_0-1635855974197.png

The one on the left is a shape and the one on the right is a button:

 

MFelix_1-1635856002832.png

MFelix_2-1635856014776.png

Has you can see on the button I could put Algerian that is not a default font.

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Thanks, I think I will try the buttons for now. Anyway, it's a shame this whole font thing, so difficult or even impossible. 

Like... how is it possible that only I'm allowed to add just one FONT to the ones available for button text? Is there a workaround for this also? 

Thanks

Hi @Anonymous ,

 

To my knowledge no.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors