Reputation: 644
I am using Apache POI PPT API to create PPTX. I want to apply specific font family to text I have added in slide.
I have explore API and found only following method to specify color and font size, but no idea on how to set font family, Please help.
XSLFTextRun run1 = paragraph.addNewTextRun();
run1.setText("This is test");
run1.setFontColor(java.awt.Color.red);
run1.setFontSize(24);
Upvotes: 3
Views: 2150
Reputation: 688
XSLFTextRun run1 = p.addNewTextRun();
run1.setText("This is test");
run1.setFontFamily(HSSFFont.FONT_ARIAL);
run1.setFontColor(Color.red);
run1.setFontSize(24);
You can use the setFontFamily method to specify the font family
Upvotes: 5