Forum Discussion
Custom visual development - issue rendering font "DIN"
- 7 years ago
Hi,
1. The latest API supports standard definition of Font list
However it will add all the possible fonts for Power BI (including these that don't work in sandbox).
However, font list may be defined manually as any enumeration in capabilities.json
Unfortunately, I am unfamiliar with all non-working in sandbox fonts, only DIN, but there may be couple of others.
Honestly, I don't recommend to define them manually because I have discussed this question with persons who is in charge of this question and there is a chance that these fonts may be supported in sandbox in the future.
Also, visuals may work in different modes so, it is better to leave this fonts as is.
2. Font size is defined in 'pt' (if it described correctly in capabilities.json)
However, inside visual it may be transformed into 'px' by the code (if developer decided, but original size storing in 'pt' anyway)
Kind Regards,
Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
[email protected]
Hi inserv,
From inspecting the card visual with the default properties set (DIN is the font in the dropdown), the following style attributes are set:
{
text-anchor: middle;
fill: rgb(51, 51, 51);
font-family: wf_standard-font, helvetica, arial, sans-serif;
font-size: 36px;
font-weight: normal;
}I'd suggest trying swapping out your appropriate .style function as follows:
.style("font-family", "wf_standard-font, helvetica, arial, sans-serif")I've had trouble getting some fonts to render as per other visuals - Segoe (Bold) is one such example, but this one seems to work.
Here's a quickly-produced custom visual with your code (swapped out with the suggested change for font-family), compared to a card visual:
Hopefully this should be all you need.
Good luck!
Daniel