| element_family <- paste0(element, "_font_family") | element_family <- paste0(element, "_font_family") | ||||
| element_google <- paste0(element, "_font_google") | element_google <- paste0(element, "_font_google") | ||||
| element_is_google <- paste0(element, "_font_is_google") | |||||
| element_url <- paste0(element, "_font_url") | element_url <- paste0(element, "_font_url") | ||||
| family <- xaringanthemer_env[[element_family]] | 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)]]) | register_font(family, google = is_google_font, fn = sys.calls()[[max(1, length(sys.calls()) - 1)]]) | ||||
| } | } | ||||
| requires_xaringanthemer_env <- function() { | requires_xaringanthemer_env <- function() { | ||||
| if (!exists("xaringanthemer_env") || is.null(xaringanthemer_env$header_color)) { | 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 | #' Get the Value of xaringanthemer Style Setting | ||||
| #' | #' |
| f_args <- names(formals(sys.function())) | f_args <- names(formals(sys.function())) | ||||
| for (var in f_args[grepl("font_family$", f_args)]) { | for (var in f_args[grepl("font_family$", f_args)]) { | ||||
| eval(parse(text = paste0(var, "<-quote_elements_w_spaces(", var, ")"))) | 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 | # Use font_..._google args to overwrite font args | ||||
| } | } | ||||
| group <- strsplit(var, "_")[[1]][1] | group <- strsplit(var, "_")[[1]][1] | ||||
| if (group == "text") { | 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 <- gf$weights %||% "normal" | ||||
| text_font_weight <- substr(text_font_weight, 1, regexpr(",", text_font_weight)[1] - 1) | text_font_weight <- substr(text_font_weight, 1, regexpr(",", text_font_weight)[1] - 1) | ||||
| text_font_url <- gf$url | text_font_url <- gf$url | ||||
| } else { | } else { | ||||
| for (thing in c("family", "url")) { | 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) | extra_font_imports <- if (is.null(extra_fonts)) "" else list2fonts(extra_fonts) |
| :root { | :root { | ||||
| /* Fonts */ | /* 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-family: {{header_font_family}}; | ||||
| --header-font-is-google: {{header_font_is_google}}; | |||||
| --code-font-family: {{code_font_family}}; | --code-font-family: {{code_font_family}}; | ||||
| --code-font-is-google: {{code_font_is_google}}; | |||||
| --text-font-size: {{text_font_size}}; | --text-font-size: {{text_font_size}}; | ||||
| --code-font-size: {{code_font_size}}; | --code-font-size: {{code_font_size}}; | ||||
| --code-inline-font-size: {{code_inline_font_size}}; | --code-inline-font-size: {{code_inline_font_size}}; | ||||
| } | } | ||||
| body { | 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}}; | font-weight: {{text_font_weight}}; | ||||
| color: var(--text-color); | color: var(--text-color); | ||||
| } | } |
| f_args <- names(formals(sys.function())) | f_args <- names(formals(sys.function())) | ||||
| for (var in f_args[grepl("font_family$", f_args)]) { | for (var in f_args[grepl("font_family$", f_args)]) { | ||||
| eval(parse(text = paste0(var, "<-quote_elements_w_spaces(", var, ")"))) | 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 | # Use font_..._google args to overwrite font args | ||||
| } | } | ||||
| group <- strsplit(var, "_")[[1]][1] | group <- strsplit(var, "_")[[1]][1] | ||||
| if (group == "text") { | 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 <- gf$weights %||% "normal" | ||||
| text_font_weight <- substr(text_font_weight, 1, regexpr(",", text_font_weight)[1] - 1) | text_font_weight <- substr(text_font_weight, 1, regexpr(",", text_font_weight)[1] - 1) | ||||
| text_font_url <- gf$url | text_font_url <- gf$url | ||||
| } else { | } else { | ||||
| for (thing in c("family", "url")) { | 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) | extra_font_imports <- if (is.null(extra_fonts)) "" else list2fonts(extra_fonts) |
| * Version: a.b.c.d.eeee | * 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=Yanone+Kaffeesatz); | ||||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | ||||
| :root { | :root { | ||||
| /* Fonts */ | /* 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-family: 'Yanone Kaffeesatz'; | ||||
| --header-font-is-google: 0; | |||||
| --code-font-family: 'Source Code Pro'; | --code-font-family: 'Source Code Pro'; | ||||
| --code-font-is-google: 0; | |||||
| --text-font-size: 20px; | --text-font-size: 20px; | ||||
| --code-font-size: 0.9em; | --code-font-size: 0.9em; | ||||
| --code-inline-font-size: 1em; | --code-inline-font-size: 1em; | ||||
| } | } | ||||
| body { | 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); | color: var(--text-color); | ||||
| } | } | ||||
| h1, h2, h3 { | h1, h2, h3 { |
| * Version: a.b.c.d.eeee | * 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=Yanone+Kaffeesatz); | ||||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | ||||
| :root { | :root { | ||||
| /* Fonts */ | /* 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-family: 'Yanone Kaffeesatz'; | ||||
| --header-font-is-google: 0; | |||||
| --code-font-family: 'Source Code Pro'; | --code-font-family: 'Source Code Pro'; | ||||
| --code-font-is-google: 0; | |||||
| --text-font-size: 20px; | --text-font-size: 20px; | ||||
| --code-font-size: 0.9em; | --code-font-size: 0.9em; | ||||
| --code-inline-font-size: 1em; | --code-inline-font-size: 1em; | ||||
| } | } | ||||
| body { | 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); | color: var(--text-color); | ||||
| } | } | ||||
| h1, h2, h3 { | h1, h2, h3 { |
| * Version: a.b.c.d.eeee | * 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=Yanone+Kaffeesatz); | ||||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | ||||
| :root { | :root { | ||||
| /* Fonts */ | /* 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-family: 'Yanone Kaffeesatz'; | ||||
| --header-font-is-google: 0; | |||||
| --code-font-family: 'Source Code Pro'; | --code-font-family: 'Source Code Pro'; | ||||
| --code-font-is-google: 0; | |||||
| --text-font-size: 20px; | --text-font-size: 20px; | ||||
| --code-font-size: 0.9em; | --code-font-size: 0.9em; | ||||
| --code-inline-font-size: 1em; | --code-inline-font-size: 1em; | ||||
| } | } | ||||
| body { | 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); | color: var(--text-color); | ||||
| } | } | ||||
| h1, h2, h3 { | h1, h2, h3 { |
| * Version: a.b.c.d.eeee | * 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=Yanone+Kaffeesatz); | ||||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | ||||
| :root { | :root { | ||||
| /* Fonts */ | /* 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-family: 'Yanone Kaffeesatz'; | ||||
| --header-font-is-google: 0; | |||||
| --code-font-family: 'Source Code Pro'; | --code-font-family: 'Source Code Pro'; | ||||
| --code-font-is-google: 0; | |||||
| --text-font-size: 20px; | --text-font-size: 20px; | ||||
| --code-font-size: 0.9em; | --code-font-size: 0.9em; | ||||
| --code-inline-font-size: 1em; | --code-inline-font-size: 1em; | ||||
| } | } | ||||
| body { | 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); | color: var(--text-color); | ||||
| } | } | ||||
| h1, h2, h3 { | h1, h2, h3 { |
| * Version: a.b.c.d.eeee | * 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=Yanone+Kaffeesatz); | ||||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | ||||
| :root { | :root { | ||||
| /* Fonts */ | /* 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-family: 'Yanone Kaffeesatz'; | ||||
| --header-font-is-google: 0; | |||||
| --code-font-family: 'Source Code Pro'; | --code-font-family: 'Source Code Pro'; | ||||
| --code-font-is-google: 0; | |||||
| --text-font-size: 20px; | --text-font-size: 20px; | ||||
| --code-font-size: 0.9em; | --code-font-size: 0.9em; | ||||
| --code-inline-font-size: 1em; | --code-inline-font-size: 1em; | ||||
| } | } | ||||
| body { | 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); | color: var(--text-color); | ||||
| } | } | ||||
| h1, h2, h3 { | h1, h2, h3 { |
| * Version: a.b.c.d.eeee | * 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=Yanone+Kaffeesatz); | ||||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | ||||
| :root { | :root { | ||||
| /* Fonts */ | /* 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-family: 'Yanone Kaffeesatz'; | ||||
| --header-font-is-google: 0; | |||||
| --code-font-family: 'Source Code Pro'; | --code-font-family: 'Source Code Pro'; | ||||
| --code-font-is-google: 0; | |||||
| --text-font-size: 20px; | --text-font-size: 20px; | ||||
| --code-font-size: 0.9em; | --code-font-size: 0.9em; | ||||
| --code-inline-font-size: 1em; | --code-inline-font-size: 1em; | ||||
| } | } | ||||
| body { | 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); | color: var(--text-color); | ||||
| } | } | ||||
| h1, h2, h3 { | h1, h2, h3 { |
| * Version: a.b.c.d.eeee | * 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=Yanone+Kaffeesatz); | ||||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | ||||
| :root { | :root { | ||||
| /* Fonts */ | /* 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-family: 'Yanone Kaffeesatz'; | ||||
| --header-font-is-google: 0; | |||||
| --code-font-family: 'Source Code Pro'; | --code-font-family: 'Source Code Pro'; | ||||
| --code-font-is-google: 0; | |||||
| --text-font-size: 20px; | --text-font-size: 20px; | ||||
| --code-font-size: 0.9em; | --code-font-size: 0.9em; | ||||
| --code-inline-font-size: 1em; | --code-inline-font-size: 1em; | ||||
| } | } | ||||
| body { | 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); | color: var(--text-color); | ||||
| } | } | ||||
| h1, h2, h3 { | h1, h2, h3 { |
| * Version: a.b.c.d.eeee | * 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=Yanone+Kaffeesatz); | ||||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | ||||
| :root { | :root { | ||||
| /* Fonts */ | /* 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-family: 'Yanone Kaffeesatz'; | ||||
| --header-font-is-google: 0; | |||||
| --code-font-family: 'Source Code Pro'; | --code-font-family: 'Source Code Pro'; | ||||
| --code-font-is-google: 0; | |||||
| --text-font-size: 20px; | --text-font-size: 20px; | ||||
| --code-font-size: 0.9em; | --code-font-size: 0.9em; | ||||
| --code-inline-font-size: 1em; | --code-inline-font-size: 1em; | ||||
| } | } | ||||
| body { | 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); | color: var(--text-color); | ||||
| } | } | ||||
| h1, h2, h3 { | h1, h2, h3 { |
| * Version: a.b.c.d.eeee | * 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=Yanone+Kaffeesatz); | ||||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | ||||
| :root { | :root { | ||||
| /* Fonts */ | /* 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-family: 'Yanone Kaffeesatz'; | ||||
| --header-font-is-google: 0; | |||||
| --code-font-family: 'Source Code Pro'; | --code-font-family: 'Source Code Pro'; | ||||
| --code-font-is-google: 0; | |||||
| --text-font-size: 20px; | --text-font-size: 20px; | ||||
| --code-font-size: 0.9em; | --code-font-size: 0.9em; | ||||
| --code-inline-font-size: 1em; | --code-inline-font-size: 1em; | ||||
| } | } | ||||
| body { | 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); | color: var(--text-color); | ||||
| } | } | ||||
| h1, h2, h3 { | h1, h2, h3 { |
| * Version: a.b.c.d.eeee | * 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=Yanone+Kaffeesatz); | ||||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | ||||
| :root { | :root { | ||||
| /* Fonts */ | /* 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-family: 'Yanone Kaffeesatz'; | ||||
| --header-font-is-google: 0; | |||||
| --code-font-family: 'Source Code Pro'; | --code-font-family: 'Source Code Pro'; | ||||
| --code-font-is-google: 0; | |||||
| --text-font-size: 20px; | --text-font-size: 20px; | ||||
| --code-font-size: 0.9em; | --code-font-size: 0.9em; | ||||
| --code-inline-font-size: 1em; | --code-inline-font-size: 1em; | ||||
| } | } | ||||
| body { | 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); | color: var(--text-color); | ||||
| } | } | ||||
| h1, h2, h3 { | h1, h2, h3 { |
| * Version: a.b.c.d.eeee | * 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=Yanone+Kaffeesatz); | ||||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | ||||
| :root { | :root { | ||||
| /* Fonts */ | /* 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-family: 'Yanone Kaffeesatz'; | ||||
| --header-font-is-google: 0; | |||||
| --code-font-family: 'Source Code Pro'; | --code-font-family: 'Source Code Pro'; | ||||
| --code-font-is-google: 0; | |||||
| --text-font-size: 20px; | --text-font-size: 20px; | ||||
| --code-font-size: 0.9em; | --code-font-size: 0.9em; | ||||
| --code-inline-font-size: 1em; | --code-inline-font-size: 1em; | ||||
| } | } | ||||
| body { | 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); | color: var(--text-color); | ||||
| } | } | ||||
| h1, h2, h3 { | h1, h2, h3 { |
| * Version: a.b.c.d.eeee | * 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=Yanone+Kaffeesatz); | ||||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | ||||
| :root { | :root { | ||||
| /* Fonts */ | /* 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-family: 'Yanone Kaffeesatz'; | ||||
| --header-font-is-google: 0; | |||||
| --code-font-family: 'Source Code Pro'; | --code-font-family: 'Source Code Pro'; | ||||
| --code-font-is-google: 0; | |||||
| --text-font-size: 20px; | --text-font-size: 20px; | ||||
| --code-font-size: 0.9em; | --code-font-size: 0.9em; | ||||
| --code-inline-font-size: 1em; | --code-inline-font-size: 1em; | ||||
| } | } | ||||
| body { | 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); | color: var(--text-color); | ||||
| } | } | ||||
| h1, h2, h3 { | h1, h2, h3 { |
| * Version: a.b.c.d.eeee | * 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=Yanone+Kaffeesatz); | ||||
| @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | @import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700); | ||||
| :root { | :root { | ||||
| /* Fonts */ | /* 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-family: 'Yanone Kaffeesatz'; | ||||
| --header-font-is-google: 0; | |||||
| --code-font-family: 'Source Code Pro'; | --code-font-family: 'Source Code Pro'; | ||||
| --code-font-is-google: 0; | |||||
| --text-font-size: 20px; | --text-font-size: 20px; | ||||
| --code-font-size: 0.9em; | --code-font-size: 0.9em; | ||||
| --code-inline-font-size: 1em; | --code-inline-font-size: 1em; | ||||
| } | } | ||||
| body { | 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); | color: var(--text-color); | ||||
| } | } | ||||
| h1, h2, h3 { | h1, h2, h3 { |
| tmpfile <- tempfile() | tmpfile <- tempfile() | ||||
| theme_fun(outfile = tmpfile, ...) | |||||
| theme_fun(outfile = tmpfile, ..., text_font_google = google_font("Noto Serif")) | |||||
| theme_css <- readLines(tmpfile) | theme_css <- readLines(tmpfile) | ||||
| # Mask package version in test files | # Mask package version in test files | ||||
| theme_css <- sub("( \\* Version: )[\\d.-]+", "\\1a.b.c.d.eeee", theme_css, perl = TRUE) | theme_css <- sub("( \\* Version: )[\\d.-]+", "\\1a.b.c.d.eeee", theme_css, perl = TRUE) |