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

font looks slightly different, particularly when article is a github website #29

Closed
davidhodge931 opened this issue Jun 6, 2024 · 10 comments

Comments

@davidhodge931
Copy link

Does the font (or font spacing) change when using element_marquee()?

Maybe it looks ever-so-slightly different in the console and in a Rmd article - but it looks very different when the article is pushed to github.

Console without marquee
image

Console with marquee
image

pkdown Rmd article in local with marquee
image

pkdown Rmd article on github built website with marquee
image

I noticed this in this blog as well
https://nrennie.rbind.io/blog/coloured-text-legend-ggplot-ggtext-marquee/

@davidhodge931 davidhodge931 changed the title font looks slightly different, particularly when an article is pushed to github font looks slightly different, particularly when article is a github website Jun 6, 2024
@thomasp85
Copy link
Member

Thanks for this. It is somewhat expected and impossible to guard against. Marquee uses textshaping and systemfonts to find and place glyphs which may be different from how the graphics device works for regular text.

Can you tell me which graphics devices are in effect in the above plots?

@davidhodge931
Copy link
Author

Thanks for the explanation.

If that is the case, it'd be cool to have a function to convert all element_text elements in a theme to element_marquee, so the font within the plot looked 100% consistent.

The global settings had Cairo png

@thomasp85
Copy link
Member

yes, especially Cairo will look a bit different. Emphasised if you are using the font aliases as these may map to a different font entirely. If you use the ragg devices it should all look pretty similar

@thomasp85
Copy link
Member

There is now a marquefy_theme() function as well as a bunch of fixes to make justification and margins of element_marquee more in line with element_text

@davidhodge931
Copy link
Author

Awesome, thanks!!

@davidhodge931
Copy link
Author

Something that just came to mind.. I wonder whether it'll get slightly confusing, if you spell marquefy with one e here.

A couple of other ideas are:

  • as_marquee
  • marquee_theme

This function will be super useful, thanks!

@teunbrand
Copy link
Contributor

Wouldn't it more ideal if + theme(text = element_marquee()) would just work?

@thomasp85
Copy link
Member

I'm not sure that is possible... How would you, as user, then have a root level marquee element but set a specific element to element_text()

@teunbrand
Copy link
Contributor

For sure it isn't currently possible. But I think you could either add an inherit.class argument or have an element_placeholder() that just adopts the parent's class.

@thomasp85
Copy link
Member

We can muse about this in the ggplot2 repo - this isn't really up to marquee :-)

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

3 participants