CRload_font: Loads font.

View source: R/CRload_font.R

CRload_fontR Documentation

Loads font.

Description

Loads font (.ttf) to be used with CRdraw_text.

Usage

font_list <- CRload_font(font_list, fontfile, fontsize, status = NULL)

Arguments

font_list

List of fonts previously loaded (possibly empty), to which the loaded font is added.

fontfile

File of font (full path + filename + extension) of font to be loaded.

fontsize

Size of font to be loaded.

status

Optional list status with elements value and message to retrieve warnings and error messages.

Value

Returns updated font_list with new font added.If everything worked fine, returned font_list has an integer valid set to 1.

Examples

    fnt_list <- CRload_font(list(), "C:/Documents/myfont.ttf", 20)
    
    CRset_render_color(gs, list(r = 0, g = 0, b = 0))
    
    CRrender_clear(gs)
    
    CRset_render_color(gs, list(r = 100, g = 0, b = 0))
    
    CRdraw_text(gs, fnt_list, 1, "HELLO!", list(x = 100, y = 100))

    CRrender_present(gs)

lorweiuk/CREx documentation built on March 16, 2024, 3:04 a.m.