Summary: | XDDFRunProperties setFonts font override | ||
---|---|---|---|
Product: | POI | Reporter: | fanjiajia <fanziang78> |
Component: | XDDF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED CLOSED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 4.1.2-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
fanjiajia
2020-12-17 10:02:19 UTC
the latest source code does not look like this - could you review the latest code? Version : 4.1.2 Maven confih: ... <poi.version>4.1.2</poi.version> ... <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>${poi.version}</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-scratchpad</artifactId> <version>${poi.version}</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>${poi.version}</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml-schemas</artifactId> <version>${poi.version}</version> </dependency> ... My java code: XDDFFont[] fonts = new XDDFFont[2]; fonts[0] = new XDDFFont(FontGroup.EAST_ASIAN, StringUtils.isBlank(fontStyle.getEastAsianFontFamily()) ? Constant.DEFAULT_EA_FONT : title.getFont().getEastAsianFontFamily(), null, null, null); fonts[1] = new XDDFFont(FontGroup.LATIN, StringUtils.isBlank(fontStyle.getFontFamily()) ? Constant.DEFAULT_EN_FONT : title.getFont().getFontFamily(), null, null, null); XDDFRunProperties xddfRunProperties = new XDDFRunProperties(); xddfRunProperties.setFonts(fonts); If I set LATIN to fonts[0],EAST_ASIAN font will override LATIN font. The thing is the code is fixed already. POI 5.0.0 will be released early next year. You can also use a nightly build or do a custom build of your own based on patching the source. https://ci-builds.apache.org/job/POI/job/POI-DSL-1.8/lastSuccessfulBuild/artifact/build/dist/ |