Description: Removed fallback mechanism in AbstractCodePointMapping. This is superfluous now that SingleByteFont handles all substitutions. This actually fixes a bug: the glyph "minus" was painted using "hyphen" but used the width of "minus" due to this fallback mechanism.
Bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=50605
Last-Update: 2011-09-11
Origin: http://svn.apache.org/viewvc?view=revision&revision=1142188

Index: fop-1.0/src/java/org/apache/fop/fonts/AbstractCodePointMapping.java
===================================================================
--- fop-1.0.orig/src/java/org/apache/fop/fonts/AbstractCodePointMapping.java	2011-09-11 14:51:37.000000000 +0200
+++ fop-1.0/src/java/org/apache/fop/fonts/AbstractCodePointMapping.java	2011-09-11 14:52:41.000000000 +0200
@@ -20,7 +20,6 @@
 package org.apache.fop.fonts;
 
 import java.util.Arrays;
-import java.util.Map;
 
 import org.apache.xmlgraphics.fonts.Glyphs;
 
@@ -37,7 +36,6 @@
     private char[] codepoints;
     private char[] unicodeMap; //code point to Unicode char
     private String[] charNameMap; //all character names in the encoding
-    private Map fallbackMap; //Here we accumulate all mappings we have found through substitution
 
     /**
      * Main constructor.
@@ -140,44 +138,9 @@
                 bot = mid + 1;
             }
         }
-
-        //Fallback: using cache
-        synchronized (this) {
-            if (fallbackMap != null) {
-                Character fallback = (Character)fallbackMap.get(new Character(c));
-                if (fallback != null) {
-                    return fallback.charValue();
-                }
-            }
-        }
-        //Fallback: find alternatives (slow!)
-        String glyphName = Glyphs.charToGlyphName(c);
-        if (glyphName.length() > 0) {
-            String[] alternatives = Glyphs.getCharNameAlternativesFor(glyphName);
-            if (alternatives != null) {
-                for (int i = 0, ic = alternatives.length; i < ic; i++) {
-                    int idx = getCodePointForGlyph(alternatives[i]);
-                    if (idx >= 0) {
-                        putFallbackCharacter(c, (char)idx);
-                        return (char)idx;
-                    }
-                }
-            }
-        }
-
-        putFallbackCharacter(c, NOT_FOUND_CODE_POINT);
         return NOT_FOUND_CODE_POINT;
     }
 
-    private void putFallbackCharacter(char c, char mapTo) {
-        synchronized (this) {
-            if (this.fallbackMap == null) {
-                this.fallbackMap = new java.util.HashMap();
-            }
-            this.fallbackMap.put(new Character(c), new Character(mapTo));
-        }
-    }
-
     /**
      * Returns the main Unicode value that is associated with the given code point in the encoding.
      * Note that multiple Unicode values can theoretically be mapped to one code point in the
