浏览代码

Update theme_xaringan*() examples and safer sysfonts font adder

Seems Droid Serif is no longer "in" Google Fonts

Need to remove all the warnings from docs
tags/v0.3.0
父节点
当前提交
9a9d4b79c4
共有 9 个文件被更改,包括 14 次插入 和 10 次删除
  1. +7
    -3
      R/ggplot2.R
  2. 二进制
      docs/reference/theme_xaringan-1.png
  3. +2
    -2
      docs/reference/theme_xaringan.html
  4. 二进制
      docs/reference/theme_xaringan_base-1.png
  5. +1
    -1
      docs/reference/theme_xaringan_base.html
  6. 二进制
      docs/reference/theme_xaringan_inverse-1.png
  7. +2
    -2
      docs/reference/theme_xaringan_inverse.html
  8. +1
    -1
      man/theme_xaringan.Rd
  9. +1
    -1
      man/theme_xaringan_inverse.Rd

+ 7
- 3
R/ggplot2.R 查看文件

@@ -17,7 +17,7 @@
#' @examples
#' if (requireNamespace("ggplot2", quietly = TRUE)) {
#' # Set xaringanthemer theme but save to tempfile
#' duo_accent(outfile = tempfile())
#' style_duo_accent(outfile = tempfile())
#'
#' library(ggplot2)
#' ggplot(iris) +
@@ -67,7 +67,7 @@ theme_xaringan <- function(
#' @examples
#' if (requireNamespace("ggplot2", quietly = TRUE)) {
#' # Set xaringanthemer theme but save to tempfile
#' duo_accent(outfile = tempfile())
#' style_duo_accent(outfile = tempfile())
#'
#' library(ggplot2)
#' ggplot(iris) +
@@ -395,7 +395,11 @@ register_font <- function(
"Roboto", "Source Code Pro", "Yanone Kaffeesatz"
)
if (identical(google, TRUE) || is_default_font) {
sysfonts::font_add_google(family, ...)
tryCatch(
sysfonts::font_add_google(family, ...),
error = function(e) warning(e$message),
warning = function(w) warning(w$message)
)
} else {
warning(paste(
"Please manually register fonts not served by Google Fonts.",

二进制
docs/reference/theme_xaringan-1.png 查看文件

之前 之后
宽度: 1400  |  高度: 866  |  大小: 58KB

+ 2
- 2
docs/reference/theme_xaringan.html
文件差异内容过多而无法显示
查看文件


二进制
docs/reference/theme_xaringan_base-1.png 查看文件

之前 之后
宽度: 1400  |  高度: 866  |  大小: 82KB

+ 1
- 1
docs/reference/theme_xaringan_base.html
文件差异内容过多而无法显示
查看文件


二进制
docs/reference/theme_xaringan_inverse-1.png 查看文件

之前 之后
宽度: 1400  |  高度: 866  |  大小: 58KB

+ 2
- 2
docs/reference/theme_xaringan_inverse.html
文件差异内容过多而无法显示
查看文件


+ 1
- 1
man/theme_xaringan.Rd 查看文件

@@ -58,7 +58,7 @@ styles.
\examples{
if (requireNamespace("ggplot2", quietly = TRUE)) {
# Set xaringanthemer theme but save to tempfile
duo_accent(outfile = tempfile())
style_duo_accent(outfile = tempfile())

library(ggplot2)
ggplot(iris) +

+ 1
- 1
man/theme_xaringan_inverse.Rd 查看文件

@@ -57,7 +57,7 @@ A \link{ggplot2} xaringanthemer plot theme to seamlessly match the "inverse"
\examples{
if (requireNamespace("ggplot2", quietly = TRUE)) {
# Set xaringanthemer theme but save to tempfile
duo_accent(outfile = tempfile())
style_duo_accent(outfile = tempfile())

library(ggplot2)
ggplot(iris) +

正在加载...
取消
保存