feat: prepared for local fonts. not really working.

This commit is contained in:
Andreas Gammelgaard Damsbo 2026-03-02 20:22:09 +01:00
commit fe1609b4f6
No known key found for this signature in database
39 changed files with 215 additions and 77 deletions

View file

@ -1 +1 @@
hosted_version <- function()'v26.3.1-260228'
hosted_version <- function()'v26.3.1-260302'

Binary file not shown.

View file

@ -4,26 +4,68 @@
#'
#' @returns theme list
#' @export
custom_theme <- function(...,
#'
#' @examples
#' if (interactive()) {
#' bs_theme_preview(FreesearchR_theme)
#' }
#'
FreesearchR_theme <- function(...,
version = 5,
primary = FreesearchR_colors("primary"),
secondary = FreesearchR_colors("secondary"),
bootswatch = "united",
# base_font = bslib::font_google("Montserrat"),
base_font = bslib::font_face(
family = "Montserrat",
src = "url('/fonts/Montserrat-Regular.ttf') format('truetype')"
),
# heading_font = bslib::font_google("Public Sans", wght = "700"),
heading_font = bslib::font_face(
family = "PublicSans",
src = "url('/fonts/PublicSans-Bold.ttf') format('truetype')"
),
# code_font = bslib::font_google("Open Sans"),
code_font = bslib::font_face(
family = "OpenSans",
src = "url('/fonts/OpenSans-Regular.ttf') format('truetype')"
),
base_font = bslib::font_google("Montserrat"),
# base_font = bslib::font_face(
# family = "Montserrat",
# src = "url('/fonts/Montserrat-VariableFont_wght.ttf') format('truetype')"
# ),
# base_font = bslib::font_face(
# family = "Montserrat",
# src = list(
# file = c(
# "fonts/montserrat/regular.ttf",
# # "fonts/montserrat/italic.ttf",
# "fonts/montserrat/bold.ttf"
# # "fonts/montserrat/bolditalic.ttf"
# )
# ),
# weight = c(400, 700)
# ),
heading_font = bslib::font_google("Public Sans", wght = "700"),
# heading_font = bslib::font_face(
# family = "PublicSans",
# src = "url('/fonts/PublicSans-VariableFont_wght.ttf') format('truetype')"
# ),
# heading_font = bslib::font_face(
# family = "PublicSans",
# src = list(
# file = c(
# "fonts/publicsans/regular.ttf",
# # "fonts/montserrat/italic.ttf",
# "fonts/publicsans/bold.ttf"
# # "fonts/montserrat/bolditalic.ttf"
# )
# ),
# weight = c(400, 700)
# ),
code_font = bslib::font_google("Open Sans"),
# code_font = bslib::font_face(
# family = "OpenSans",
# src = "url('/fonts/OpenSans-VariableFont_wght.ttf') format('truetype')"
# ),
# code_font = bslib::font_face(
# family = "OpenSans",
# src = list(
# file = c(
# "fonts/opensans/regular.ttf",
# # "fonts/montserrat/italic.ttf",
# "fonts/opensans/bold.ttf"
# # "fonts/montserrat/bolditalic.ttf"
# )
# ),
# weight = c(400, 700)
# ),
success = FreesearchR_colors("success"),
info = FreesearchR_colors("info"),
warning = FreesearchR_colors("warning"),
@ -53,6 +95,8 @@ custom_theme <- function(...,
}
FreesearchR_colors <- function(choose = NULL) {
out <- c(
primary = "#1E4A8F",