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

Idea: interpolate glyphs with text #5

Closed
teunbrand opened this issue Feb 23, 2024 · 2 comments · Fixed by #20
Closed

Idea: interpolate glyphs with text #5

teunbrand opened this issue Feb 23, 2024 · 2 comments · Fixed by #20

Comments

@teunbrand
Copy link
Owner

See https://fosstodon.org/@teunbrand/111982829941145048

@teunbrand
Copy link
Owner Author

Proof of concept using {marquee} as text backend.

library(grid)
library(marquee)
#> 
#> Attaching package: 'marquee'
#> The following object is masked from 'package:graphics':
#> 
#>     box

new_point <- function(col = "black", pch = 19, size = 12) {
  pointsGrob(
    x = 0.5, y = 0.5, default.units = "npc", pch = pch,
    gp = gpar(col = col, fontsize = size),
    vp = viewport(width = unit(size, "pt"), height = unit(size, "pt"),
                  just = c(0.5, 0.5))
  )
}

red_pt <- new_point("tomato")
blue_pt <- new_point("dodgerblue", pch = 17)
green_pt <- new_point("limegreen", pch = 15)

grob <- marquee_grob(
  "I'm text with
  ![](red_pt) and
  ![](blue_pt) and
  ![](green_pt) as interspersed points",
  classic_style(), x = 0.1, y = 0.9
)

grid.newpage()
grid.draw(grob)

Created on 2024-04-27 with reprex v2.1.0

@teunbrand
Copy link
Owner Author

teunbrand commented Sep 16, 2024

Implemented in r-lib/marquee#28.
Leaving this issue open as reminder to remove gguidance::guide_subtitle() in favour of the marquee guide.

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

Successfully merging a pull request may close this issue.

1 participant