Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating with shadowtext::geom_shadowtext or similar functionality? #35

Open
rossdrucker opened this issue Sep 12, 2022 · 3 comments

Comments

@rossdrucker
Copy link

Might end up as more of a feature request here, but is there a way to add a shadow/outline to the text?

@wilkox
Copy link
Owner

wilkox commented Sep 18, 2022

There's not an easy way to do this currently. Is the contrast argument to geom_fit_text() of any help for your use case?

@rossdrucker
Copy link
Author

Unfortunately I don't believe it's useful in my case. I'm looking to mimic the functionality of shadowtext::geom_shadowtext to outline the characters in the text, not necessarily just contrast against the background if I'm understanding how the contrast argument works properly.

@wilkox
Copy link
Owner

wilkox commented Oct 2, 2022

I've had a go at implementing this, but run up against two problems:

  1. The shadows make it quite a bit harder to accurately compute the height and width of the text.
  2. The easiest approach requires adding shadowtext::shadowtextGrob as a third option alongside gridtext::richtext_grob and plain old grid::textGrob for drawing text. I'm already unhappy with the overhead of having two different grobs for drawing text. Ultimately I'm going to need to write my own textGrob replacement with features for rich text, text in polar coordinates, and shadow text, but this will be a big job.

Thanks for the suggestion though and I've marked it as a feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants