1

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))

David Gohel
  • 9,180
  • 2
  • 16
  • 34
jarichardson
  • 165
  • 8

1 Answers1

5

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

David Gohel
  • 9,180
  • 2
  • 16
  • 34
  • 1
    Thank you David! Always nice to see a package author be involved in helping users. – jarichardson Sep 20 '19 at 14:30
  • 1
    Along these same lines, how would we then center the title? Am I correct in thinking that would be with `fp_par(text.align = "center"`? Everywhere I've tried to place that has either not worked, or printed the word "center". – jarichardson Sep 20 '19 at 18:10
  • 2
    You can have a look at the documentation of fpar, there is an illustration for your need: https://davidgohel.github.io/officer/reference/fpar.html#examples – David Gohel Sep 21 '19 at 13:39