glyph_raster_grob | R Documentation |
This is a convenience function that helps in creating rasterGrob with the
correct settings for the glyph. It takes inot account the sizing and offset
returned by glyph_raster()
and allows you to only consider the baseline
position of the glyph.
glyph_raster_grob(glyph, x, y, ..., default.units = "bigpts")
glyph |
The nativeRaster object returned as one of the elements by
|
x , y |
The baseline location of the glyph |
... |
Arguments passed on to
|
default.units |
A string indicating the default units to use
if |
A rasterGrob object
font <- font_info()
glyph <- glyph_info("R", path = font$path, index = font$index)
R <- glyph_raster(glyph$index, font$path, font$index, size = 150)
grob <- glyph_raster_grob(R[[1]], 50, 50)
grid::grid.newpage()
# Mark the baseline location
grid::grid.points(50, 50, default.units = "bigpts")
# Draw the glyph
grid::grid.draw(grob)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.