Skip to content

Commit

Permalink
create matching base font
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMarvin committed May 28, 2023
1 parent 30b7d97 commit f515873
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions R/class-workbook.R
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,19 @@ wbWorkbook <- R6::R6Class(

if (sel <= length(themes)) {
self$theme <- stringi::stri_unescape_unicode(themes[[sel]])

# create the default font for the style
font_scheme <- xml_node(wb$theme, "a:theme", "a:themeElements", "a:fontScheme")
minor_font <- xml_attr(font_scheme, "a:fontScheme", "a:minorFont", "a:latin")[[1]][["typeface"]]

self$styles_mgr$styles$fonts <- create_font(
sz = 11,
color = wb_color(theme = 1),
name = minor_font,
family = "2",
scheme = "minor"
)

} else {
message("theme not found")
}
Expand Down

0 comments on commit f515873

Please sign in to comment.