I noticed this is happening on the GitHub actions pkgdown.yaml workflows running on ubuntu-latest (and I have reproduced this on a local install of Ubuntu 24.04).
You can see on this plot using agg_png() the hats are put in the wrong place.
library(ragg)
agg_png("ragg-plot.png")
par(mar = c(5, 5, 5, 5), cex.lab = 1.3)
plot(1:10, ylab = expression(hat(beta)), xlab = expression(hat(beta)))
title("Plot saved with ragg_png()")
dev.off()
Whereas using png() they are above the betas as expected.
png("png-plot.png")
par(mar = c(5, 5, 5, 5), cex.lab = 1.3)
plot(1:10, ylab = expression(hat(beta)), xlab = expression(hat(beta)))
title("Plot saved with png()")
dev.off()
Note this doesn't occur on either macOS nor Windows 11.
Tested using ragg version 1.4.0.
Maybe related to #89