The ragg png device produces a "tofu" symbol when there is a newline character (\n) at the beginning or the end of a text string.
This does not happen with the Cairo png device.
library(ggplot2)
#+ dev = "ragg_png"
ggplot() +
geom_text(aes(x = 0, y = 0, label = "\n")) +
labs(x = "\nat the beginning", y = "at the end\n")

#+ dev = "png", dev.args = list(type = "cairo-png")
ggplot() +
geom_text(aes(x = 0, y = 0, label = "\n")) +
labs(x = "\nat the beginning", y = "at the end\n")

Created on 2022-04-13 by the reprex package (v2.0.1)
The ragg png device produces a "tofu" symbol when there is a newline character (\n) at the beginning or the end of a text string.
This does not happen with the Cairo png device.
Created on 2022-04-13 by the reprex package (v2.0.1)