| Title: | Flexible Font |
|---|---|
| Description: | Flexible font. |
| Authors: | Mike Cheng [aut, cre, cph], Roni Kaufman [aut] (Author of original font) |
| Maintainer: | Mike Cheng <[email protected]> |
| License: | CC BY-NC-SA + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-26 08:16:57 UTC |
| Source: | https://github.com/coolbutuseless/flexfont |
Create a data.frame of text coordiantes for the given text
flex_coords(s, w = 1, h = 1, hgap = 0.1, vgap = 0.1, npoints = 10)flex_coords(s, w = 1, h = 1, hgap = 0.1, vgap = 0.1, npoints = 10)
s |
string. May include newlines |
w, h
|
character width and height |
hgap, vgap
|
the gap between each letter |
npoints |
the number of points to render for each arc. Default: 10. Higher numbers will give a smoother appearance to the curves. |
data.frame of coordinates
flex_coords('x')flex_coords('x')
Create a grob to represetnt the given string in flex font
flextextGrob( txt, w = 1, h = 1, scale = 1, hgap = 0.1, vgap = 0.1, x = unit(0.5, "npc"), y = unit(0.5, "npc"), hjust = 0.5, vjust = 0.5, default.units = "npc", gp = grid::gpar(), npoints = 10 )flextextGrob( txt, w = 1, h = 1, scale = 1, hgap = 0.1, vgap = 0.1, x = unit(0.5, "npc"), y = unit(0.5, "npc"), hjust = 0.5, vjust = 0.5, default.units = "npc", gp = grid::gpar(), npoints = 10 )
txt |
chracter string. May contain newlines. Only letters A-Z are rendered |
w, h
|
the size of each letter |
scale |
A scaling factor applied to the letter size. Default: 1 |
hgap, vgap
|
the gap between each letter |
x, y
|
location of text on page. Default: centre |
hjust, vjust
|
justificaiton for this block of text. Default 0.5 (middle) |
default.units |
default units for grid rendering. Default: 'npc' |
gp |
graphics parameters e.g. lwd, color, linetype |
npoints |
the number of points to render for each arc. Default: 10. Higher numbers will give a smoother appearance to the curves. |
grid graphics object
g <- flextextGrob("hello") grid::grid.draw(g)g <- flextextGrob("hello") grid::grid.draw(g)