Learn R Programming

showtext (version 0.4-1)

showtext.auto: Automatically Using 'showtext' for New Graphics Devices

Description

This function could turn on/off the automatic use of showtext functionality. If turned on, any newly opened graphics devices will use showtext to draw text. This helps to avoid the repeated calls of showtext.begin() and showtext.end().

Usage

showtext.auto(enable = TRUE)

Arguments

enable
TRUE to turn on and FALSE to turn off

See Also

showtext.begin(), showtext.end()

Examples

Run this code
pdf("test1.pdf")
plot(1, main = "\u6b22\u8fce")  ## may not render properly
dev.off()

## Automatically use showtext for future devices
showtext.auto()
plot(1, main = "\u6b22\u8fce", family = "wqy-microhei")

pdf("test2.pdf")
plot(1, main = "\u6b22\u8fce", family = "wqy-microhei")
dev.off()

## Turn off if needed
showtext.auto(FALSE)

Run the code above in your browser using DataLab