#> [1] "arcade" "gridfont" "gridfont_smooth"
Type | Name | Sizes | Unicode? | # glyphs |
---|---|---|---|---|
Vector | gridfont | Lower case ASCII only | ||
Vector | gridfont_smooth | Lower case ASCII only | ||
Vector | arcade | Upper case ASCII only |
vector_text_coords()
returns a data.frame of
strokesvector_text_matrix()
returns a binary matrix with pixel
locations set to 1vector_text_raster()
returns a raster image of the
textText may be rendered with a vector font to
raster
object#> # A tibble: 6 × 11
#> char_idx codepoint stroke_idx point_idx x y line x0 y0 width
#> <int> <int> <int> <int> <dbl> <dbl> <int> <dbl> <dbl> <int>
#> 1 1 104 1 1 0 9 0 0 9 4
#> 2 1 104 1 2 0 3 0 0 3 4
#> 3 1 104 2 1 0 5.67 0 0 5.67 4
#> 4 1 104 2 2 0.167 6.33 0 0.167 6.33 4
#> 5 1 104 2 3 0.667 6.83 0 0.667 6.83 4
#> 6 1 104 2 4 1.17 7 0 1.17 7 4
#> # ℹ 1 more variable: xoffset <int>
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
#> [1,] 1 0 0 0 0 0 0 0 1 1 0 0 0
#> [2,] 1 0 0 0 0 0 0 0 1 1 0 0 0
#> [3,] 1 1 1 0 0 1 1 0 1 1 0 1 1
#> [4,] 1 0 0 1 1 0 0 1 1 1 1 0 0
#> [5,] 1 0 0 1 1 1 1 1 1 1 1 0 0
#> [6,] 1 0 0 1 1 0 0 1 1 1 1 0 0
#> [7,] 1 0 0 0 0 1 1 0 1 1 0 1 1
#> [8,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [9,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [10,] 0 0 0 0 0 0 0 0 0 0 0 0 0
#> [,14]
#> [1,] 0
#> [2,] 0
#> [3,] 0
#> [4,] 1
#> [5,] 1
#> [6,] 1
#> [7,] 0
#> [8,] 0
#> [9,] 0
#> [10,] 0
This is an example of bespoke rendering of the strokes for an example string.
For each character (char_idx
) there are 1-or-more
strokes (stroke
). Each stroke has at least 2 points
(indicated by idx
).
When plotting with ggplot, draw path for the points-within-strokes-within-characters.
#> # A tibble: 6 × 11
#> char_idx codepoint stroke_idx point_idx x y line x0 y0 width
#> <int> <int> <int> <int> <dbl> <dbl> <int> <dbl> <dbl> <int>
#> 1 1 104 1 1 0 9 0 0 9 4
#> 2 1 104 1 2 0 3 0 0 3 4
#> 3 1 104 2 1 0 5.67 0 0 5.67 4
#> 4 1 104 2 2 0.167 6.33 0 0.167 6.33 4
#> 5 1 104 2 3 0.667 6.83 0 0.667 6.83 4
#> 6 1 104 2 4 1.17 7 0 1.17 7 4
#> # ℹ 1 more variable: xoffset <int>