mixfonts: Unify ascii and multibyte fonts into a string

View source: R/mixfonts.r

mixfontsR Documentation

Unify ascii and multibyte fonts into a string

Description

Put ASCII font family character(s) and multibyte font family character(s) into a single string for use in ggplot.

Usage

mixfonts(strs, asciifont = "Arial", mbytefont = "MS Gothic")

Arguments

strs

A vector of character to be converted

asciifont

ASCII font family, Default: 'Arial'

mbytefont

Multi byte font family, Default: 'MS Gothic'

Details

This function is supposed to be used with ggtext::element_markdown() and ggtext::geom_richtext(). See vignette("mixfonts")

Value

Character vector of HTML span tag.

See Also

label_mixfonts element_markdown geom_richtext

Examples

if(interactive()){
 library(frabento)
 register_all_fonts()
 
 mixfonts(c("仔魚を含まない\n0歳魚", "1歳魚+"))
}

JK-junkin/frabento documentation built on Oct. 20, 2023, noon