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 714d9d666b
commit f09674c8e2
1 changed files with 12 additions and 4 deletions

View File

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