I have several point features displayed in OpenLayers that, when a background fill is applied and small to no padding is set, don't center their text values in the center of the block fill:
This same text centers a lot better when the padding values are much larger (10)
The documentation states that for point features align, placement and baseline should have the text in the center of the block, but I'm forcing it just in case (this still doesn't work)
textStyle.setFont(`${style.FontWeight} ${style.FontSize}px ${style.FontFamily}`);
textStyle.setFill(new Fill({ color: `rgba(${ style.Colour.R }, ${ style.Colour.G },${ style.Colour.B },${style.Colour.A / 255})` }));
textStyle.setTextAlign("center");
textStyle.setTextBaseline("middle");
textStyle.setPlacement("point");
textStyle.setPadding([2, 2, 2, 2]) //[10, 10, 10, 10] centers the text way better
The font string value I'm sending in evaluates to: 300 9px Roboto
Is there anything I should be doing to improve the centering of these text labels?