]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fix bug in WinAnsiEncoding: trademark was shown as bullet
authorJeremias Maerki <jeremias@apache.org>
Mon, 2 Jun 2003 20:00:26 +0000 (20:00 +0000)
committerJeremias Maerki <jeremias@apache.org>
Mon, 2 Jun 2003 20:00:26 +0000 (20:00 +0000)
Financed by: CTB/McGraw-Hill

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196483 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fonts/Glyphs.java

index 96d35242bfc0ef2da1b0ebb5cddef07189cf2799..57665800485cd9a2dcf7900c2dbcc57020855f23 100644 (file)
@@ -209,7 +209,8 @@ public class Glyphs {
         '\u2022',                                       // bullet
         '\u2013',                                       // endash
         '\u2014',                                       // emdash
-        '~', '\u2022',                                  // bullet
+        '~', 
+        '\u2122',                                       // trademark
         '\u0161', '\u203a', '\u0153', '\u2022', '\u017e', '\u0178', // 0xA0
              ' ', '\u00a1', '\u00a2', '\u00a3', '\u00a4', '\u00a5',
              '\u00a6', '\u00a7', '\u00a8', '\u00a9', '\u00aa', '\u00ab',
@@ -1295,12 +1296,25 @@ public class Glyphs {
         "\u03B6", "zeta"
     };
 
+    /**
+     * Return the glyphname from a character,
+     * eg, charToGlyphName('\\') returns "backslash"
+     *
+     * @param ch glyph to evaluate
+     * @return the name of the glyph
+     */
+    public static final String charToGlyphName(char ch) {
+        return stringToGlyph(Character.toString(ch));
+    }
+    
     /**
      * Return the glyphname from a string,
      * eg, glyphToString("\\") returns "backslash"
      *
      * @param name glyph to evaluate
      * @return the name of the glyph
+     * TODO: javadocs for glyphToString and stringToGlyph are confused
+     * TODO: Improve method names
      */
     public static final String glyphToString(String name) {
         for (int i = 0; i < UNICODE_GLYPHS.length; i += 2) {