Skip to content

"Tofu" when newline character is at the edge of character string #111

@long39ng

Description

@long39ng

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions