xmlgraphics-commons 2.0.1

org.apache.xmlgraphics.fonts
Class Glyphs

java.lang.Object
  extended by org.apache.xmlgraphics.fonts.Glyphs

public final class Glyphs
extends Object

This class provides a number of constants for glyph management.


Field Summary
static char[] ADOBECYRILLIC_ENCODING
          The characters in AdobeStandardCyrillicEncoding
static 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.
static String NOTDEF
          Glyph name for the "notdef" glyph
static String[] TEX8R_GLYPH_NAMES
          Glyph names for tex8r encoding
static char[] WINANSI_ENCODING
          The characters in WinAnsiEncoding
 
Method Summary
static String charToGlyphName(char ch)
          Return the glyphname from a character, eg, charToGlyphName('\\') returns "backslash"
static String[] getCharNameAlternativesFor(String charName)
          Returns an array of char names which can serve as alternatives for the given one.
static String getUnicodeSequenceForGlyphName(String glyphName)
          Returns a String containing the Unicode sequence the given glyph name represents.
static String glyphToString(String name)
          Deprecated. User getUnicodeCodePointsForGlyphName instead. This method only returns the first Unicode code point it finds.
static String stringToGlyph(String name)
          Return the string representation of a glyphname, eg stringToGlyph("backslash") returns "\\"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOTDEF

public static final String NOTDEF
Glyph name for the "notdef" glyph

See Also:
Constant Field Values

MAC_GLYPH_NAMES

@Deprecated
public static final 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 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

Method Detail

charToGlyphName

public static 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 String getUnicodeSequenceForGlyphName(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 String glyphToString(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 String stringToGlyph(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 String[] getCharNameAlternativesFor(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

xmlgraphics-commons 2.0.1

Copyright 1999-2015 The Apache Software Foundation. All Rights Reserved.