aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2016-12-06 00:21:22 +0000
committerAndreas Beeker <kiwiwings@apache.org>2016-12-06 00:21:22 +0000
commitf09674c8e292fb4efcfef3e14a9b2978e08e3f84 (patch)
tree3b514434c8437427df8a6a4cf5066eae3bd9b2f0
parent714d9d666bd31276268b58536628c34990478820 (diff)
downloadpoi-f09674c8e292fb4efcfef3e14a9b2978e08e3f84.tar.gz
poi-f09674c8e292fb4efcfef3e14a9b2978e08e3f84.zip
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
-rw-r--r--src/java/org/apache/poi/sl/draw/DrawTextParagraph.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java b/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java
index 751e08985f..65c22d7817 100644
--- a/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java
+++ b/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java
@@ -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("*");
+ }
}
}