Forum Discussion
add new fontFamily
- 6 years ago
Hi Balogh1Bence,
The linked Gist is the workaround - here's the original official suggestion from the custom visuals team. You replace your property in the capabilities.json with this enumeration, rather than the fontFamily type, and then add/modify the list as you need for the font families you want. Note that the fontFamily type contains the standard list of fonts for Power BI and is intended to be this way for consistency with the core visuals, so if you're adding your own, your results might vary for users on other browsers and operating systems.
You can indeed save a property value into the visual's dataView with persistProperties and this might work in your visual code, but this does not expose the value as a usable selection to the properties pane - for lists, you will need corresponding property metadata declared in your capabilities.json for it to show as an entry.
Because the properties pane is managed by the main Power BI window and not the visual (which is sandboxed from the main UI), the JSON in your capabilities tells Power BI how to render the properties in the pane for your visual.
Perhaps you could provide some further detail on what you are trying to achieve, along with the font you're trying to see in the list and I can provide a revised enumeration for you.
Regards,
Daniel
Thanks, but I could modify the kist using persisproperties, problem is that its for saving new settings and not for adding new options, isn't there a workaround?
Hi Balogh1Bence,
The linked Gist is the workaround - here's the original official suggestion from the custom visuals team. You replace your property in the capabilities.json with this enumeration, rather than the fontFamily type, and then add/modify the list as you need for the font families you want. Note that the fontFamily type contains the standard list of fonts for Power BI and is intended to be this way for consistency with the core visuals, so if you're adding your own, your results might vary for users on other browsers and operating systems.
You can indeed save a property value into the visual's dataView with persistProperties and this might work in your visual code, but this does not expose the value as a usable selection to the properties pane - for lists, you will need corresponding property metadata declared in your capabilities.json for it to show as an entry.
Because the properties pane is managed by the main Power BI window and not the visual (which is sandboxed from the main UI), the JSON in your capabilities tells Power BI how to render the properties in the pane for your visual.
Perhaps you could provide some further detail on what you are trying to achieve, along with the font you're trying to see in the list and I can provide a revised enumeration for you.
Regards,
Daniel