R/felt_tips_font.R

#' show words in felt tips(粗头笔) fonts
#'
#' @author lgm
#' @param words words you want to show in felt tips woman font
#' @param file the save file name
#' @param delete save it or not
#' @return jpg files
#' @export
#' @examples
#' #felt_tips_font("hello,This is Li guomin. I come from China.")

felt_tips_font <- function(words,file="test.jpg",delete = FALSE){
	url= paste0("https://frs.monotypeimaging.com/ImagingService.ashx?imagetype=typeit&shopid=790412&width=738&RenderText=",URLencode(words),"&TextSize=32&TextColor=%2314b5d1&BgColor=%23ffffff")
	curl::curl_download(url,destfile = file)
	system(paste("open",file))

	Sys.sleep(4) # system pause 4 seconds

	if (delete == TRUE) {
		system(paste("rm",file))
		return("well done")
	} else {
		return("well done!go to the CWD to see the font picture.")
	}

}
Gabegit/gmtools documentation built on May 6, 2019, 5:32 p.m.