Map a java character (unicode) to a font character. Default uses CodePointMapping. @param c character to map @return the mapped character
(char c)
| 231 | * @return the mapped character |
| 232 | */ |
| 233 | public char mapChar(char c) { |
| 234 | |
| 235 | if (metric instanceof org.apache.fop.fonts.Typeface) { |
| 236 | return ((org.apache.fop.fonts.Typeface)metric).mapChar(c); |
| 237 | } |
| 238 | |
| 239 | // Use default CodePointMapping |
| 240 | char d = CodePointMapping.getMapping("WinAnsiEncoding").mapChar(c); |
| 241 | if (d != SingleByteEncoding.NOT_FOUND_CODE_POINT) { |
| 242 | c = d; |
| 243 | } else { |
| 244 | log.warn("Glyph " + (int) c + " not available in font " + fontName); |
| 245 | c = Typeface.NOT_FOUND; |
| 246 | } |
| 247 | |
| 248 | return c; |
| 249 | } |
| 250 | |
| 251 | /** |
| 252 | * Map a unicode code point to a font character. |