For some reason if text with character "₂" (subscript 2) is rendered with vg2png, the whole text is rendered as bold. vg2svg and the online vega editor do not render the text like that.
{
"width": 500,
"height": 500,
"autosize": "pad",
"marks": [
{
"type": "text",
"from": {"data": "table"},
"encode": {
"enter": {
"x": {"field": {"group": "width"}, "mult": 0.5},
"radius": {"signal": "width / 2 - 10"},
"text": {
"signal": "datum.id"
},
"fill": {"value": "#000"},
"fontSize": {"value": 20},
"baseline": {"value": "middle"},
"y": {"field": {"group": "width"}, "mult": 0.5},
"theta": {"signal": "(datum.startAngle + datum.endAngle)/2"}
}
}
},
{
"type": "arc",
"from": {"data": "table"},
"encode": {
"enter": {
"fill": {"scale": "color", "field": "id"},
"x": {"signal": "width / 2"},
"y": {"signal": "width / 2"}
},
"update": {
"startAngle": {"field": "startAngle"},
"endAngle": {"field": "endAngle"},
"innerRadius": {"value": 120},
"outerRadius": {"value": 140}
}
}
}
],
"scales": [
{
"name": "color",
"type": "ordinal",
"domain": {"data": "table", "field": "id"},
"range": {"scheme": "blueorange"}
}
],
"legends": [
{
"fill": "color",
"labelFontSize": 30
}
],
"$schema": "https//vega.github.io/schema/vega/v5.json",
"data": [
{
"name": "table",
"values": [
{
"id": "foo₂",
"field": 4
},
{
"id": "foofoo₂",
"field": 6
},
{
"id": "bar",
"field": 10
}
],
"transform": [
{"type": "pie", "field": "field", "sort": true},
{
"type": "window",
"groupby": [],
"ops": ["sum"],
"fields": ["field"],
"as": ["total"],
"frame": [null, null]
}
]
}
],
"background": "white",
"description": "A basic donut chart example.",
"config": {}
}
For some reason if text with character "₂" (subscript 2) is rendered with vg2png, the whole text is rendered as bold. vg2svg and the online vega editor do not render the text like that.
For example this document
with command

vl-convert vg2png --input visualization.vg.json --output test.pngwill render likewhile

vl-convert vg2svg --input visualization.vg.json --output test.svglike