poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paoim101084 <paokimsr...@gmail.com>
Subject Re: XSLFTextRun definition
Date Tue, 18 Dec 2018 19:47:56 GMT
1. Register Font
Font font = Font.createFont(Font.TRUETYPE_FONT, new
File("input/myfont.ttf"));
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
ge.registerFont(font);
String[] names = ge.getAvailableFontFamilyNames();
2. Set font name as font family:
XSLFTextParagraph p =... 
XSLFTextRun r = p.addNewTextRun(); 
for (String name : names) {
   r.setFontFamily(name);
}

Will support all available font family or just get the last one of Array?



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message