8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/asposeslidesjava/Text/managefont.rb', line 8
def replace_font()
data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/Text/'
pres = Rjb::import('com.aspose.slides.Presentation').new(data_dir + 'input.pptx')
source_font = Rjb::import('com.aspose.slides.FontData').new("Arial")
dest_font = Rjb::import('com.aspose.slides.FontData').new("Times New Roman")
fonts_manager = Rjb::import('com.aspose.slides.FontsManager')
pres.fonts_manager.replaceFont(source_font, dest_font)
pres.save(data_dir + "ReplaceFont.pptx", Rjb::import('com.aspose.slides.SaveFormat').Pptx)
puts "Replaced font, please check the output file."
end
|