Package org.apache.xmlgraphics.fonts
Class Glyphs
- java.lang.Object
-
- org.apache.xmlgraphics.fonts.Glyphs
-
public final class Glyphs extends java.lang.ObjectThis class provides a number of constants for glyph management.
-
-
Field Summary
Fields Modifier and Type Field Description static char[]ADOBECYRILLIC_ENCODINGThe characters in AdobeStandardCyrillicEncodingprivate static java.util.MapCHARNAME_ALTERNATIVESprivate static java.util.MapCHARNAMES_TO_UNICODEprivate static java.lang.String[]DINGBATS_GLYPHSstatic java.lang.String[]MAC_GLYPH_NAMESDeprecated.That array was supposed to represent the standard Macintosh ordering of glyphs in a TrueType font (it does NOT correspond to the MacRoman encoding).static java.lang.StringNOTDEFGlyph name for the "notdef" glyphstatic java.lang.String[]TEX8R_GLYPH_NAMESGlyph names for tex8r encodingprivate static java.lang.String[]UNICODE_GLYPHSList of unicode glyphsstatic char[]WINANSI_ENCODINGThe characters in WinAnsiEncoding
-
Constructor Summary
Constructors Modifier Constructor Description privateGlyphs()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private static voidaddAlternatives(java.util.Map map, java.lang.String[] alternatives)static java.lang.StringcharToGlyphName(char ch)Return the glyphname from a character, eg, charToGlyphName('\\') returns "backslash"static java.lang.String[]getCharNameAlternativesFor(java.lang.String charName)Returns an array of char names which can serve as alternatives for the given one.static java.lang.StringgetUnicodeSequenceForGlyphName(java.lang.String glyphName)Returns a String containing the Unicode sequence the given glyph name represents.static java.lang.StringglyphToString(java.lang.String name)Deprecated.User getUnicodeCodePointsForGlyphName instead.private static charhexToChar(java.lang.String hex)private static java.lang.String[]loadGlyphList(java.lang.String filename, java.util.Map charNameToUnicodeMap)static java.lang.StringstringToGlyph(java.lang.String name)Return the string representation of a glyphname, eg stringToGlyph("backslash") returns "\\"
-
-
-
Field Detail
-
NOTDEF
public static final java.lang.String NOTDEF
Glyph name for the "notdef" glyph- See Also:
- Constant Field Values
-
MAC_GLYPH_NAMES
@Deprecated public static final java.lang.String[] MAC_GLYPH_NAMES
Deprecated.That array was supposed to represent the standard Macintosh ordering of glyphs in a TrueType font (it does NOT correspond to the MacRoman encoding). In addition some entries are incorrect.Glyph names for Mac encoding
-
TEX8R_GLYPH_NAMES
public static final java.lang.String[] TEX8R_GLYPH_NAMES
Glyph names for tex8r encoding
-
WINANSI_ENCODING
public static final char[] WINANSI_ENCODING
The characters in WinAnsiEncoding
-
ADOBECYRILLIC_ENCODING
public static final char[] ADOBECYRILLIC_ENCODING
The characters in AdobeStandardCyrillicEncoding
-
UNICODE_GLYPHS
private static final java.lang.String[] UNICODE_GLYPHS
List of unicode glyphs
-
DINGBATS_GLYPHS
private static final java.lang.String[] DINGBATS_GLYPHS
-
CHARNAME_ALTERNATIVES
private static final java.util.Map CHARNAME_ALTERNATIVES
-
CHARNAMES_TO_UNICODE
private static final java.util.Map CHARNAMES_TO_UNICODE
-
-
Method Detail
-
addAlternatives
private static void addAlternatives(java.util.Map map, java.lang.String[] alternatives)
-
loadGlyphList
private static java.lang.String[] loadGlyphList(java.lang.String filename, java.util.Map charNameToUnicodeMap)
-
hexToChar
private static char hexToChar(java.lang.String hex)
-
charToGlyphName
public static java.lang.String charToGlyphName(char ch)
Return the glyphname from a character, eg, charToGlyphName('\\') returns "backslash"- Parameters:
ch- glyph to evaluate- Returns:
- the name of the glyph
-
getUnicodeSequenceForGlyphName
public static java.lang.String getUnicodeSequenceForGlyphName(java.lang.String glyphName)
Returns a String containing the Unicode sequence the given glyph name represents.- Parameters:
glyphName- the glyph name- Returns:
- the Unicode sequence of the glyph (or null if the glyph name is unknown)
-
glyphToString
@Deprecated public static java.lang.String glyphToString(java.lang.String name)
Deprecated.User getUnicodeCodePointsForGlyphName instead. This method only returns the first Unicode code point it finds.Return the glyphname from a string, eg, glyphToString("\\") returns "backslash"- Parameters:
name- glyph to evaluate- Returns:
- the name of the glyph TODO: javadocs for glyphToString and stringToGlyph are confused
-
stringToGlyph
public static java.lang.String stringToGlyph(java.lang.String name)
Return the string representation of a glyphname, eg stringToGlyph("backslash") returns "\\"- Parameters:
name- name of the glyph- Returns:
- the string representation (or an empty String if no match was found)
-
getCharNameAlternativesFor
public static java.lang.String[] getCharNameAlternativesFor(java.lang.String charName)
Returns an array of char names which can serve as alternatives for the given one.- Parameters:
charName- the character name to search alternatives for- Returns:
- an array of char names or null if no alternatives are available
-
-