Add "*" option to font_map/fallback to provide a catch-all configuration

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1772816 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2016-12-06 00:21:22 +00:00
parent 48bdfca1c4
commit 83ff0e5ec4

View File

@ -531,11 +531,19 @@ public class DrawTextParagraph implements Drawable {
fallbackFont = font;
}
} else {
if (fontMap != null && fontMap.containsKey(mappedFont)) {
if (fontMap != null) {
if (fontMap.containsKey(mappedFont)) {
mappedFont = fontMap.get(mappedFont);
} else if (fontMap.containsKey("*")) {
mappedFont = fontMap.get("*");
}
if (fallbackMap != null && fallbackMap.containsKey(mappedFont)) {
}
if (fallbackMap != null) {
if (fallbackMap.containsKey(mappedFont)) {
fallbackFont = fallbackMap.get(mappedFont);
} else if (fallbackMap.containsKey("*")) {
fallbackFont = fallbackMap.get("*");
}
}
}