Deneb text fonts - Din in Deneb looks different to Din in PBI standard visuals

Hi all,

I have the same font “din” selected in Power BI visual and I have also created a custom visual in Deneb and also selected “din” but the 2 fonts look different. Does anyone know how we can get the 2 to look the same?

The top is a x axis for a column chart and the below is the table visual for a visual made in Deneb:

image

I can’t see a list of fonts posted anywhere for deneb so it’s hard to match fonts in PBI.

This is my code for Deneb:

{
“$schema”: “https://vega.github.io/schema/vega-lite/v5.json”,
“width”: 400,
“height”: 80,
“data”: {“name”: “dataset”},
“transform”: [
{
“aggregate”: [
{
“op”: “sum”,
“field”: “Qty”,
“as”: “QtySum”
}
],
“groupby”: [
“Month & Year”,
“Sales Type”
]
},
{
“calculate”: “datum[‘QtySum’] >= 10 ? format(datum[‘QtySum’] / 1000, ‘,.0f’) + ‘k’ : format(datum[‘QtySum’], ‘.0%’)”,
“as”: “FormattedQtySum”
}
],
“encoding”: {
“y”: {
“field”: “Sales Type”,
“type”: “ordinal”,
“sort”: {“field”: “Order”},
“axis”: {
“title”: null,
“labelFont”: “din”,
“labelFontSize”: 11.7,
“labelAngle”: 0,
“labelColor”: “black”,
“bandPosition”: 0.5
}
},
“x”: {
“field”: “Month & Year”,
“type”: “ordinal”,
“sort”: {“field”: “MonthOffset”},
“axis”: {
“title”: null,
“labelFont”: “din”,
“labelFontSize”: 11.7,
“labelAngle”: 0,
“labelColor”: “black”,
“orient”: “top”
}
}
},
“layer”: [
{
“mark”: “text”,
“fontWeight”: “bold”,
“fontSize” : 11.7,
“encoding”: {
“text”: {
“field”: “FormattedQtySum”,
“type”: “nominal”
},
“color”: {“value”: “black”}
}
}
],
“config”: {
“axisX”: {
“domain”: true,
“domainColor”: “#B4B5BB”,
“domainWidth”: 1,
“offset”: 0
},
“axisY”: {
“domain”: true,
“domainColor”: “#B4B5BB”,
“domainWidth”: 1,
“offset”: 0
}
}
}

Many thanks,
Tim

Responding to my own post :stuck_out_tongue:

I think it has something to do with the Din font, not sure if deneb vega-lite supports it? when I change to Arial font the Deneb looks exactly the same as PBI standard fonts… annoying does anyone know of a list of supported deneb fonts that look the same as the PBI fonts?

image

I don’t have a list, but I have always used the following to make mine look like DIN:

    "labelFont": "wf_standard-font, sans-serif"

3 Likes

@DaveC’s answer is correct. Custom visuals don’t have the DIN font made available to them by Power BI. As such the DIN font is packaged into the Deneb visual as an additional asset, but you will need to refer to it as how Power BI refers to it internally, which is wf_standard-font. You can see this in the default config used by the bundled Deneb templates if you look under some of the text mark or axis label settings.

4 Likes

Hello @Timmay

Did the responses above help solve your query?

If not, can you let us know where you’re stuck and what additional assistance you need?

If it did, please mark the answer as the SOLUTION by clicking the three dots beside Reply and then tick the check box beside SOLUTION

Thank you

I know this is an old post, but Deneb 1.6 (when available) will allow you to use din as the font name and it will automatically alias it for you, so you don’t need to remember the DIN font’s ‘internal’ name.

5 Likes

That’s great Daniel, can’t wait for the new Deneb release, I’m sure many others will also be highly anticipating it!

1 Like