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

ggplot theme font not getting mapped properly #168

Closed
RoyalTS opened this issue Jun 9, 2024 · 4 comments
Closed

ggplot theme font not getting mapped properly #168

RoyalTS opened this issue Jun 9, 2024 · 4 comments

Comments

@RoyalTS
Copy link

RoyalTS commented Jun 9, 2024

I'm not sure if this is a ragg bug, a systemfonts bug, or even whether it is a bug at all or just unexpected behavior. Here goes:

I've been using hrbrthemes forever, always without issue. theme_ipsum_ps() from that package (docs) uses IBM Plex Sans as its font, and using the default Rstudio device the code

mtcars |> 
  ggplot(aes(mpg, wt)) +
  geom_point() +
  hrbrthemes::theme_ipsum_ps() +
  labs(title='This is a title')

produces this plot:

Screenshot 2024-06-09 at 19 36 19

All as it should be. If I switch to the AGG device, however, the font no longer seems to be getting rendered correctly:

Screenshot 2024-06-09 at 19 36 39

This despite the relevant section of systemfonts::system_fonts() looking – at least to me – relatively innocuous:

Screenshot 2024-06-09 at 19 39 15

Possibly related?

@thomasp85
Copy link
Member

The root issue is that systemfonts matches based on the family name, not the post script name. I'll look into if this is possible to add, but I'm not sure if this is doable on all systems

@RoyalTS
Copy link
Author

RoyalTS commented Jun 13, 2024

Is there a way to hack around this in the meantime?

@thomasp85
Copy link
Member

try with dev systemfonts. I just pushed a potential fix

@RoyalTS
Copy link
Author

RoyalTS commented Jun 14, 2024

Problem solved, it seems like. Thank you much!

@RoyalTS RoyalTS closed this as completed Jun 14, 2024
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