Search code examples
rfontstitleofficer

Cannot change PPT title font with officer


Title font not changing in Powerpoints created with officer.

I have tried adding fp_text into ph_with, and while it runs nothing it produced from it.


library(officer)
library(magrittr)

title.font <- fp_text(font.size = 28)    

example_pp <- read_pptx() %>% 
  # LMS slide ----  
  add_slide(layout = "Title and Content", master = "Office Theme") %>% 
  ph_with(paste("Title font test"),
          location = ph_location_type(type = "title"), 
          fp_text(font.size = 28))


Solution

  • There is no argument for fp_text in ph_with.

    library(officer)
    library(magrittr)
    
    example_pp <- read_pptx() %>% 
      # LMS slide ----  
    add_slide(layout = "Title and Content", master = "Office Theme") %>% 
      ph_with(block_list(fpar(ftext("Title font test", prop = fp_text(font.size = 28, color = "red")))),
              location = ph_location_type(type = "title") )
    

    See ?block_list