| @@ -609,11 +609,15 @@ get_theme_font <- function(element = c("text", "header", "code")) { | |||
| element_family <- paste0(element, "_font_family") | |||
| element_google <- paste0(element, "_font_google") | |||
| element_is_google <- paste0(element, "_font_is_google") | |||
| element_url <- paste0(element, "_font_url") | |||
| family <- xaringanthemer_env[[element_family]] | |||
| is_google_font <- !is.null(xaringanthemer_env[[element_google]]) || | |||
| grepl("fonts.google", xaringanthemer_env[[element_url]], fixed = TRUE) | |||
| is_google_font <- xaringanthemer_env[[element_is_google]] | |||
| if (is.null(is_google_font)) { | |||
| is_google_font <- !is.null(xaringanthemer_env[[element_google]]) || | |||
| grepl("fonts.google", xaringanthemer_env[[element_url]], fixed = TRUE) | |||
| } | |||
| register_font(family, google = is_google_font, fn = sys.calls()[[max(1, length(sys.calls()) - 1)]]) | |||
| } | |||
| @@ -681,9 +685,9 @@ requires_package <- function(pkg = "ggplot2", fn = "", required = TRUE) { | |||
| requires_xaringanthemer_env <- function() { | |||
| if (!exists("xaringanthemer_env") || is.null(xaringanthemer_env$header_color)) { | |||
| stop("Please call a xaringanthemer theme function first.") | |||
| stop("Please call a xaringanthemer theme function first.") | |||
| } | |||
| } | |||
| } | |||
| #' Get the Value of xaringanthemer Style Setting | |||
| #' | |||
| @@ -136,6 +136,8 @@ style_xaringan <- function( | |||
| f_args <- names(formals(sys.function())) | |||
| for (var in f_args[grepl("font_family$", f_args)]) { | |||
| eval(parse(text = paste0(var, "<-quote_elements_w_spaces(", var, ")"))) | |||
| # set an is_google flag default of FALSE that is possibly overwritten later | |||
| eval(parse(text = paste0(sub("font_family$", "font_is_google", var), "<-0"))) | |||
| } | |||
| # Use font_..._google args to overwrite font args | |||
| @@ -147,15 +149,16 @@ style_xaringan <- function( | |||
| } | |||
| group <- strsplit(var, "_")[[1]][1] | |||
| if (group == "text") { | |||
| text_font_family <- gf$family | |||
| text_font_family <- quote_elements_w_spaces(gf$family) | |||
| text_font_weight <- gf$weights %||% "normal" | |||
| text_font_weight <- substr(text_font_weight, 1, regexpr(",", text_font_weight)[1] - 1) | |||
| text_font_url <- gf$url | |||
| } else { | |||
| for (thing in c("family", "url")) { | |||
| eval(parse(text = paste0(group, "_font_", thing, " <- gf$", thing ))) | |||
| eval(parse(text = paste0(group, "_font_", thing, " <- gf$", quote_elements_w_spaces(thing)))) | |||
| } | |||
| } | |||
| eval(parse(text = paste0(group, "_font_is_google <- 1"))) | |||
| } | |||
| extra_font_imports <- if (is.null(extra_fonts)) "" else list2fonts(extra_fonts) | |||
| @@ -25,9 +25,14 @@ | |||
| :root { | |||
| /* Fonts */ | |||
| --body-font-family: {{body_font_family}}; | |||
| --text-font-family: {{text_font_family}}; | |||
| --text-font-is-google: {{text_font_is_google}}; | |||
| --text-font-family-fallback: {{text_font_family_fallback}}; | |||
| --text-font-base: {{text_font_base}}; | |||
| --header-font-family: {{header_font_family}}; | |||
| --header-font-is-google: {{header_font_is_google}}; | |||
| --code-font-family: {{code_font_family}}; | |||
| --code-font-is-google: {{code_font_is_google}}; | |||
| --text-font-size: {{text_font_size}}; | |||
| --code-font-size: {{code_font_size}}; | |||
| --code-inline-font-size: {{code_inline_font_size}}; | |||
| @@ -59,7 +64,7 @@ html { | |||
| } | |||
| body { | |||
| font-family: var(--body-font-family); | |||
| font-family: var(--text-font-family), var(--text-font-family-fallback), var(--text-font-base); | |||
| font-weight: {{text_font_weight}}; | |||
| color: var(--text-color); | |||
| } | |||
| @@ -2,6 +2,8 @@ | |||
| f_args <- names(formals(sys.function())) | |||
| for (var in f_args[grepl("font_family$", f_args)]) { | |||
| eval(parse(text = paste0(var, "<-quote_elements_w_spaces(", var, ")"))) | |||
| # set an is_google flag default of FALSE that is possibly overwritten later | |||
| eval(parse(text = paste0(sub("font_family$", "font_is_google", var), "<-0"))) | |||
| } | |||
| # Use font_..._google args to overwrite font args | |||
| @@ -13,15 +15,16 @@ for (var in f_args[grepl("font_google$", f_args)]) { | |||
| } | |||
| group <- strsplit(var, "_")[[1]][1] | |||
| if (group == "text") { | |||
| text_font_family <- gf$family | |||
| text_font_family <- quote_elements_w_spaces(gf$family) | |||
| text_font_weight <- gf$weights %||% "normal" | |||
| text_font_weight <- substr(text_font_weight, 1, regexpr(",", text_font_weight)[1] - 1) | |||
| text_font_url <- gf$url | |||
| } else { | |||
| for (thing in c("family", "url")) { | |||
| eval(parse(text = paste0(group, "_font_", thing, " <- gf$", thing ))) | |||
| eval(parse(text = paste0(group, "_font_", thing, " <- gf$", quote_elements_w_spaces(thing)))) | |||
| } | |||
| } | |||
| eval(parse(text = paste0(group, "_font_is_google <- 1"))) | |||
| } | |||
| extra_font_imports <- if (is.null(extra_fonts)) "" else list2fonts(extra_fonts) | |||
| @@ -18,16 +18,21 @@ | |||
| * Version: a.b.c.d.eeee | |||
| * | |||
| * ------------------------------------------------------- */ | |||
| @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |||
| @import url(https://fonts.googleapis.com/css?family=Noto+Serif); | |||
| @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | |||
| :root { | |||
| /* Fonts */ | |||
| --body-font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; | |||
| --text-font-family: 'Noto Serif'; | |||
| --text-font-is-google: 1; | |||
| --text-font-family-fallback: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC'; | |||
| --text-font-base: serif; | |||
| --header-font-family: 'Yanone Kaffeesatz'; | |||
| --header-font-is-google: 0; | |||
| --code-font-family: 'Source Code Pro'; | |||
| --code-font-is-google: 0; | |||
| --text-font-size: 20px; | |||
| --code-font-size: 0.9em; | |||
| --code-inline-font-size: 1em; | |||
| @@ -54,8 +59,8 @@ html { | |||
| } | |||
| body { | |||
| font-family: var(--body-font-family); | |||
| font-weight: normal; | |||
| font-family: var(--text-font-family), var(--text-font-family-fallback), var(--text-font-base); | |||
| font-weight: ; | |||
| color: var(--text-color); | |||
| } | |||
| h1, h2, h3 { | |||
| @@ -18,16 +18,21 @@ | |||
| * Version: a.b.c.d.eeee | |||
| * | |||
| * ------------------------------------------------------- */ | |||
| @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |||
| @import url(https://fonts.googleapis.com/css?family=Noto+Serif); | |||
| @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | |||
| :root { | |||
| /* Fonts */ | |||
| --body-font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; | |||
| --text-font-family: 'Noto Serif'; | |||
| --text-font-is-google: 1; | |||
| --text-font-family-fallback: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC'; | |||
| --text-font-base: serif; | |||
| --header-font-family: 'Yanone Kaffeesatz'; | |||
| --header-font-is-google: 0; | |||
| --code-font-family: 'Source Code Pro'; | |||
| --code-font-is-google: 0; | |||
| --text-font-size: 20px; | |||
| --code-font-size: 0.9em; | |||
| --code-inline-font-size: 1em; | |||
| @@ -54,8 +59,8 @@ html { | |||
| } | |||
| body { | |||
| font-family: var(--body-font-family); | |||
| font-weight: normal; | |||
| font-family: var(--text-font-family), var(--text-font-family-fallback), var(--text-font-base); | |||
| font-weight: ; | |||
| color: var(--text-color); | |||
| } | |||
| h1, h2, h3 { | |||
| @@ -18,16 +18,21 @@ | |||
| * Version: a.b.c.d.eeee | |||
| * | |||
| * ------------------------------------------------------- */ | |||
| @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |||
| @import url(https://fonts.googleapis.com/css?family=Noto+Serif); | |||
| @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | |||
| :root { | |||
| /* Fonts */ | |||
| --body-font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; | |||
| --text-font-family: 'Noto Serif'; | |||
| --text-font-is-google: 1; | |||
| --text-font-family-fallback: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC'; | |||
| --text-font-base: serif; | |||
| --header-font-family: 'Yanone Kaffeesatz'; | |||
| --header-font-is-google: 0; | |||
| --code-font-family: 'Source Code Pro'; | |||
| --code-font-is-google: 0; | |||
| --text-font-size: 20px; | |||
| --code-font-size: 0.9em; | |||
| --code-inline-font-size: 1em; | |||
| @@ -54,8 +59,8 @@ html { | |||
| } | |||
| body { | |||
| font-family: var(--body-font-family); | |||
| font-weight: normal; | |||
| font-family: var(--text-font-family), var(--text-font-family-fallback), var(--text-font-base); | |||
| font-weight: ; | |||
| color: var(--text-color); | |||
| } | |||
| h1, h2, h3 { | |||
| @@ -18,16 +18,21 @@ | |||
| * Version: a.b.c.d.eeee | |||
| * | |||
| * ------------------------------------------------------- */ | |||
| @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |||
| @import url(https://fonts.googleapis.com/css?family=Noto+Serif); | |||
| @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | |||
| :root { | |||
| /* Fonts */ | |||
| --body-font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; | |||
| --text-font-family: 'Noto Serif'; | |||
| --text-font-is-google: 1; | |||
| --text-font-family-fallback: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC'; | |||
| --text-font-base: serif; | |||
| --header-font-family: 'Yanone Kaffeesatz'; | |||
| --header-font-is-google: 0; | |||
| --code-font-family: 'Source Code Pro'; | |||
| --code-font-is-google: 0; | |||
| --text-font-size: 20px; | |||
| --code-font-size: 0.9em; | |||
| --code-inline-font-size: 1em; | |||
| @@ -54,8 +59,8 @@ html { | |||
| } | |||
| body { | |||
| font-family: var(--body-font-family); | |||
| font-weight: normal; | |||
| font-family: var(--text-font-family), var(--text-font-family-fallback), var(--text-font-base); | |||
| font-weight: ; | |||
| color: var(--text-color); | |||
| } | |||
| h1, h2, h3 { | |||
| @@ -18,16 +18,21 @@ | |||
| * Version: a.b.c.d.eeee | |||
| * | |||
| * ------------------------------------------------------- */ | |||
| @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |||
| @import url(https://fonts.googleapis.com/css?family=Noto+Serif); | |||
| @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | |||
| :root { | |||
| /* Fonts */ | |||
| --body-font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; | |||
| --text-font-family: 'Noto Serif'; | |||
| --text-font-is-google: 1; | |||
| --text-font-family-fallback: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC'; | |||
| --text-font-base: serif; | |||
| --header-font-family: 'Yanone Kaffeesatz'; | |||
| --header-font-is-google: 0; | |||
| --code-font-family: 'Source Code Pro'; | |||
| --code-font-is-google: 0; | |||
| --text-font-size: 20px; | |||
| --code-font-size: 0.9em; | |||
| --code-inline-font-size: 1em; | |||
| @@ -54,8 +59,8 @@ html { | |||
| } | |||
| body { | |||
| font-family: var(--body-font-family); | |||
| font-weight: normal; | |||
| font-family: var(--text-font-family), var(--text-font-family-fallback), var(--text-font-base); | |||
| font-weight: ; | |||
| color: var(--text-color); | |||
| } | |||
| h1, h2, h3 { | |||
| @@ -18,16 +18,21 @@ | |||
| * Version: a.b.c.d.eeee | |||
| * | |||
| * ------------------------------------------------------- */ | |||
| @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |||
| @import url(https://fonts.googleapis.com/css?family=Noto+Serif); | |||
| @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | |||
| :root { | |||
| /* Fonts */ | |||
| --body-font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; | |||
| --text-font-family: 'Noto Serif'; | |||
| --text-font-is-google: 1; | |||
| --text-font-family-fallback: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC'; | |||
| --text-font-base: serif; | |||
| --header-font-family: 'Yanone Kaffeesatz'; | |||
| --header-font-is-google: 0; | |||
| --code-font-family: 'Source Code Pro'; | |||
| --code-font-is-google: 0; | |||
| --text-font-size: 20px; | |||
| --code-font-size: 0.9em; | |||
| --code-inline-font-size: 1em; | |||
| @@ -54,8 +59,8 @@ html { | |||
| } | |||
| body { | |||
| font-family: var(--body-font-family); | |||
| font-weight: normal; | |||
| font-family: var(--text-font-family), var(--text-font-family-fallback), var(--text-font-base); | |||
| font-weight: ; | |||
| color: var(--text-color); | |||
| } | |||
| h1, h2, h3 { | |||
| @@ -18,16 +18,21 @@ | |||
| * Version: a.b.c.d.eeee | |||
| * | |||
| * ------------------------------------------------------- */ | |||
| @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |||
| @import url(https://fonts.googleapis.com/css?family=Noto+Serif); | |||
| @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | |||
| :root { | |||
| /* Fonts */ | |||
| --body-font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; | |||
| --text-font-family: 'Noto Serif'; | |||
| --text-font-is-google: 1; | |||
| --text-font-family-fallback: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC'; | |||
| --text-font-base: serif; | |||
| --header-font-family: 'Yanone Kaffeesatz'; | |||
| --header-font-is-google: 0; | |||
| --code-font-family: 'Source Code Pro'; | |||
| --code-font-is-google: 0; | |||
| --text-font-size: 20px; | |||
| --code-font-size: 0.9em; | |||
| --code-inline-font-size: 1em; | |||
| @@ -54,8 +59,8 @@ html { | |||
| } | |||
| body { | |||
| font-family: var(--body-font-family); | |||
| font-weight: normal; | |||
| font-family: var(--text-font-family), var(--text-font-family-fallback), var(--text-font-base); | |||
| font-weight: ; | |||
| color: var(--text-color); | |||
| } | |||
| h1, h2, h3 { | |||
| @@ -18,16 +18,21 @@ | |||
| * Version: a.b.c.d.eeee | |||
| * | |||
| * ------------------------------------------------------- */ | |||
| @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |||
| @import url(https://fonts.googleapis.com/css?family=Noto+Serif); | |||
| @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | |||
| :root { | |||
| /* Fonts */ | |||
| --body-font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; | |||
| --text-font-family: 'Noto Serif'; | |||
| --text-font-is-google: 1; | |||
| --text-font-family-fallback: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC'; | |||
| --text-font-base: serif; | |||
| --header-font-family: 'Yanone Kaffeesatz'; | |||
| --header-font-is-google: 0; | |||
| --code-font-family: 'Source Code Pro'; | |||
| --code-font-is-google: 0; | |||
| --text-font-size: 20px; | |||
| --code-font-size: 0.9em; | |||
| --code-inline-font-size: 1em; | |||
| @@ -54,8 +59,8 @@ html { | |||
| } | |||
| body { | |||
| font-family: var(--body-font-family); | |||
| font-weight: normal; | |||
| font-family: var(--text-font-family), var(--text-font-family-fallback), var(--text-font-base); | |||
| font-weight: ; | |||
| color: var(--text-color); | |||
| } | |||
| h1, h2, h3 { | |||
| @@ -18,16 +18,21 @@ | |||
| * Version: a.b.c.d.eeee | |||
| * | |||
| * ------------------------------------------------------- */ | |||
| @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |||
| @import url(https://fonts.googleapis.com/css?family=Noto+Serif); | |||
| @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | |||
| :root { | |||
| /* Fonts */ | |||
| --body-font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; | |||
| --text-font-family: 'Noto Serif'; | |||
| --text-font-is-google: 1; | |||
| --text-font-family-fallback: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC'; | |||
| --text-font-base: serif; | |||
| --header-font-family: 'Yanone Kaffeesatz'; | |||
| --header-font-is-google: 0; | |||
| --code-font-family: 'Source Code Pro'; | |||
| --code-font-is-google: 0; | |||
| --text-font-size: 20px; | |||
| --code-font-size: 0.9em; | |||
| --code-inline-font-size: 1em; | |||
| @@ -54,8 +59,8 @@ html { | |||
| } | |||
| body { | |||
| font-family: var(--body-font-family); | |||
| font-weight: normal; | |||
| font-family: var(--text-font-family), var(--text-font-family-fallback), var(--text-font-base); | |||
| font-weight: ; | |||
| color: var(--text-color); | |||
| } | |||
| h1, h2, h3 { | |||
| @@ -18,16 +18,21 @@ | |||
| * Version: a.b.c.d.eeee | |||
| * | |||
| * ------------------------------------------------------- */ | |||
| @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |||
| @import url(https://fonts.googleapis.com/css?family=Noto+Serif); | |||
| @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | |||
| :root { | |||
| /* Fonts */ | |||
| --body-font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; | |||
| --text-font-family: 'Noto Serif'; | |||
| --text-font-is-google: 1; | |||
| --text-font-family-fallback: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC'; | |||
| --text-font-base: serif; | |||
| --header-font-family: 'Yanone Kaffeesatz'; | |||
| --header-font-is-google: 0; | |||
| --code-font-family: 'Source Code Pro'; | |||
| --code-font-is-google: 0; | |||
| --text-font-size: 20px; | |||
| --code-font-size: 0.9em; | |||
| --code-inline-font-size: 1em; | |||
| @@ -54,8 +59,8 @@ html { | |||
| } | |||
| body { | |||
| font-family: var(--body-font-family); | |||
| font-weight: normal; | |||
| font-family: var(--text-font-family), var(--text-font-family-fallback), var(--text-font-base); | |||
| font-weight: ; | |||
| color: var(--text-color); | |||
| } | |||
| h1, h2, h3 { | |||
| @@ -18,16 +18,21 @@ | |||
| * Version: a.b.c.d.eeee | |||
| * | |||
| * ------------------------------------------------------- */ | |||
| @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |||
| @import url(https://fonts.googleapis.com/css?family=Noto+Serif); | |||
| @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | |||
| :root { | |||
| /* Fonts */ | |||
| --body-font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; | |||
| --text-font-family: 'Noto Serif'; | |||
| --text-font-is-google: 1; | |||
| --text-font-family-fallback: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC'; | |||
| --text-font-base: serif; | |||
| --header-font-family: 'Yanone Kaffeesatz'; | |||
| --header-font-is-google: 0; | |||
| --code-font-family: 'Source Code Pro'; | |||
| --code-font-is-google: 0; | |||
| --text-font-size: 20px; | |||
| --code-font-size: 0.9em; | |||
| --code-inline-font-size: 1em; | |||
| @@ -54,8 +59,8 @@ html { | |||
| } | |||
| body { | |||
| font-family: var(--body-font-family); | |||
| font-weight: normal; | |||
| font-family: var(--text-font-family), var(--text-font-family-fallback), var(--text-font-base); | |||
| font-weight: ; | |||
| color: var(--text-color); | |||
| } | |||
| h1, h2, h3 { | |||
| @@ -18,16 +18,21 @@ | |||
| * Version: a.b.c.d.eeee | |||
| * | |||
| * ------------------------------------------------------- */ | |||
| @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |||
| @import url(https://fonts.googleapis.com/css?family=Noto+Serif); | |||
| @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | |||
| :root { | |||
| /* Fonts */ | |||
| --body-font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; | |||
| --text-font-family: 'Noto Serif'; | |||
| --text-font-is-google: 1; | |||
| --text-font-family-fallback: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC'; | |||
| --text-font-base: serif; | |||
| --header-font-family: 'Yanone Kaffeesatz'; | |||
| --header-font-is-google: 0; | |||
| --code-font-family: 'Source Code Pro'; | |||
| --code-font-is-google: 0; | |||
| --text-font-size: 20px; | |||
| --code-font-size: 0.9em; | |||
| --code-inline-font-size: 1em; | |||
| @@ -54,8 +59,8 @@ html { | |||
| } | |||
| body { | |||
| font-family: var(--body-font-family); | |||
| font-weight: normal; | |||
| font-family: var(--text-font-family), var(--text-font-family-fallback), var(--text-font-base); | |||
| font-weight: ; | |||
| color: var(--text-color); | |||
| } | |||
| h1, h2, h3 { | |||
| @@ -18,16 +18,21 @@ | |||
| * Version: a.b.c.d.eeee | |||
| * | |||
| * ------------------------------------------------------- */ | |||
| @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic); | |||
| @import url(https://fonts.googleapis.com/css?family=Noto+Serif); | |||
| @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz); | |||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | |||
| :root { | |||
| /* Fonts */ | |||
| --body-font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; | |||
| --text-font-family: 'Noto Serif'; | |||
| --text-font-is-google: 1; | |||
| --text-font-family-fallback: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC'; | |||
| --text-font-base: serif; | |||
| --header-font-family: 'Yanone Kaffeesatz'; | |||
| --header-font-is-google: 0; | |||
| --code-font-family: 'Source Code Pro'; | |||
| --code-font-is-google: 0; | |||
| --text-font-size: 20px; | |||
| --code-font-size: 0.9em; | |||
| --code-inline-font-size: 1em; | |||
| @@ -55,8 +60,8 @@ html { | |||
| } | |||
| body { | |||
| font-family: var(--body-font-family); | |||
| font-weight: normal; | |||
| font-family: var(--text-font-family), var(--text-font-family-fallback), var(--text-font-base); | |||
| font-weight: ; | |||
| color: var(--text-color); | |||
| } | |||
| h1, h2, h3 { | |||
| @@ -18,7 +18,7 @@ test_theme_file <- function(theme = "duo", theme_file = paste0(theme, ".css"), . | |||
| tmpfile <- tempfile() | |||
| theme_fun(outfile = tmpfile, ...) | |||
| theme_fun(outfile = tmpfile, ..., text_font_google = google_font("Noto Serif")) | |||
| theme_css <- readLines(tmpfile) | |||
| # Mask package version in test files | |||
| theme_css <- sub("( \\* Version: )[\\d.-]+", "\\1a.b.c.d.eeee", theme_css, perl = TRUE) | |||