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

Support contextual alternates #21

Open
emiltb opened this issue Jul 9, 2018 · 1 comment
Open

Support contextual alternates #21

emiltb opened this issue Jul 9, 2018 · 1 comment

Comments

@emiltb
Copy link

emiltb commented Jul 9, 2018

I stumpled on this, when trying to display text from my Datalegreya package. The Datalegreya font uses Contextual Alternates to elegantly make axis labels on plots. If I try to do this with showtext, the result is not rendered correctly. I created an issue for reference in my own package (https://github.com/emiltb/datalegreyar/issues/1). The following simple example illustrates the problem:

library(ggplot2)
library(showtext)
#> Loading required package: sysfonts
#> Loading required package: showtextdb

font_add("Datalegreya", "Datalegreya-Gradient.otf")
showtext_auto()

ggplot() +
  annotate("text", x = 0, y = 0, label = "{2008 }d|0a|1t|2a|2l|3e|3g|3r|2e|2y|1a|0{2018 }[2    [0    ]", family = "Datalegreya", size = 12) +
  theme_void()

Created on 2018-07-09 by the reprex package (v0.2.0).

The expected result is text looking like this:

datalegreya

@yixuan
Copy link
Owner

yixuan commented Oct 12, 2018

This looks like an advanced feature of the font, and I'll see if it is possible in showtext. Do you know any existing R graphics device that can handle this?

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

No branches or pull requests

2 participants