public class SingleByteFont extends CustomFont
eventListener, NOT_FOUND
Constructor and Description |
---|
SingleByteFont()
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addUnencodedCharacter(NamedCharacter ch,
int width)
Adds an unencoded character (one that is not supported by the primary encoding).
|
void |
encodeAllUnencodedCharacters()
Makes all unencoded characters available through additional encodings.
|
SimpleSingleByteEncoding |
getAdditionalEncoding(int index)
Returns an additional encoding.
|
int |
getAdditionalEncodingCount()
Returns the number of additional encodings this single-byte font maintains.
|
int[] |
getAdditionalWidths(int index)
Returns an array with the widths for an additional encoding.
|
SingleByteEncoding |
getEncoding()
Returns the code point mapping (encoding) of this font.
|
java.lang.String |
getEncodingName()
Get the encoding of the font.
|
int |
getWidth(int i,
int size)
Return the width (in 1/1000ths of point size) of the character at
code point i.
|
int[] |
getWidths()
Return the array of widths.
|
boolean |
hasAdditionalEncodings()
Indicates whether the encoding has additional encodings besides the primary encoding.
|
boolean |
hasChar(char c)
Determines whether this font contains a particular character/glyph.
|
boolean |
isEmbeddable()
Indicates if this font may be embedded.
|
boolean |
isUsingNativeEncoding()
Indicates whether this font is configured to use its native encoding.
|
char |
mapChar(char c)
Map a Unicode character to a code point in the font.
|
void |
setEncoding(CodePointMapping encoding)
Sets the encoding of the font.
|
void |
setEncoding(java.lang.String encoding)
Sets the encoding of the font.
|
void |
setUseNativeEncoding(boolean value)
Controls whether the font is configured to use its native encoding or if it
may need to be re-encoded for the target format.
|
void |
setWidth(int index,
int w)
Sets a width for a character.
|
protected void |
updateMapping(java.lang.String encoding)
Updates the mapping variable based on the encoding.
|
getAscender, getAscender, getCapHeight, getCapHeight, getDescender, getDescender, getEmbedFileName, getEmbedFileSource, getEmbedFontName, getEmbedResourceName, getFamilyNames, getFirstChar, getFlags, getFontBBox, getFontName, getFontSubName, getFontType, getFullName, getItalicAngle, getKerningInfo, getLastChar, getMissingWidth, getStemV, getStrippedFontName, getWeight, getXHeight, hasKerningInfo, isKerningEnabled, isSymbolicFont, putKerningEntry, replaceKerningMap, setAscender, setCapHeight, setDescender, setEmbedFileName, setEmbedResourceName, setFamilyNames, setFirstChar, setFlags, setFontBBox, setFontName, setFontSubFamilyName, setFontType, setFullName, setItalicAngle, setKerningEnabled, setLastChar, setMissingWidth, setResolver, setStemV, setWeight, setXHeight
getMaxAscent, hadMappingOperations, isMultiByte, notifyMapOperation, setEventListener, toString, warnMissingGlyph
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getMaxAscent
public boolean isEmbeddable()
public java.lang.String getEncodingName()
getEncodingName
in class Typeface
public SingleByteEncoding getEncoding()
public int getWidth(int i, int size)
i
- code point indexsize
- font sizepublic int[] getWidths()
This is used to get an array for inserting in an output format. It should not be used for lookup.
public char mapChar(char c)
public boolean hasChar(char c)
protected void updateMapping(java.lang.String encoding)
encoding
- the name of the encodingpublic void setEncoding(java.lang.String encoding)
encoding
- the encoding (ex. "WinAnsiEncoding" or "SymbolEncoding")public void setEncoding(CodePointMapping encoding)
encoding
- the encoding informationpublic void setUseNativeEncoding(boolean value)
value
- true indicates that the configured encoding is the font's native encodingpublic boolean isUsingNativeEncoding()
public void setWidth(int index, int w)
index
- index of the characterw
- the width of the characterpublic void addUnencodedCharacter(NamedCharacter ch, int width)
ch
- the named characterwidth
- the width of the characterpublic void encodeAllUnencodedCharacters()
public boolean hasAdditionalEncodings()
public int getAdditionalEncodingCount()
public SimpleSingleByteEncoding getAdditionalEncoding(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of the additional encodingjava.lang.IndexOutOfBoundsException
- if the index is out of boundspublic int[] getAdditionalWidths(int index)
index
- the index of the additional encodingCopyright 1999-2010 The Apache Software Foundation. All Rights Reserved.