From 1d9bd0ab7cb784feacc9cca1690207588c696e66 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Mon, 2 Jun 2003 20:00:26 +0000 Subject: [PATCH] Fix bug in WinAnsiEncoding: trademark was shown as bullet 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 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/fop/fonts/Glyphs.java b/src/java/org/apache/fop/fonts/Glyphs.java index 96d35242b..576658004 100644 --- a/src/java/org/apache/fop/fonts/Glyphs.java +++ b/src/java/org/apache/fop/fonts/Glyphs.java @@ -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) { -- 2.39.5