|
fop 0.93 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.fop.fonts.truetype.TTFFile
Reads a TrueType file or a TrueType Collection. The TrueType spec can be found at the Microsoft. Typography site: http://www.microsoft.com/truetype/
Field Summary | |
protected java.util.Map |
dirTabs
Table directory |
protected long |
lastLoca
Offset to last loca |
protected org.apache.commons.logging.Log |
log
logging instance |
protected org.apache.fop.fonts.truetype.TTFMtxEntry[] |
mtxTab
Contains glyph data |
static boolean |
TRACE_ENABLED
Set to true to get even more debug output than with level DEBUG |
Constructor Summary | |
TTFFile()
|
Method Summary | |
protected boolean |
checkTTC(FontFileReader in,
java.lang.String name)
Check if this is a TrueType collection and that the given name exists in the collection. |
int |
convertTTFUnit2PDFUnit(int n)
Convert from truetype unit to pdf unit based on the unitsPerEm field in the "head" table |
java.util.Map |
getAnsiKerning()
Returns the ANSI kerning table. |
int |
getCapHeight()
Returns the CapHeight attribute of the font. |
java.lang.String |
getCharSetName()
Returns the name of the character set used. |
int |
getCharWidth(int idx)
Returns the width of a given character. |
java.util.List |
getCMaps()
Return a List with TTFCmapEntry. |
java.lang.String |
getFamilyName()
Returns the font family name of the font. |
short |
getFirstChar()
Returns the index of the first character. |
int |
getFlags()
Returns the Flags attribute of the font. |
int[] |
getFontBBox()
Returns the font bounding box. |
java.lang.String |
getItalicAngle()
Returns the ItalicAngle attribute of the font. |
java.util.Map |
getKerning()
Returns the kerning table. |
short |
getLastChar()
Returns the index of the last character, but this is for WinAnsiEncoding only, so the last char is < 256. |
int |
getLowerCaseAscent()
Returns the LowerCaseAscent attribute of the font. |
int |
getLowerCaseDescent()
Returns the LowerCaseDescent attribute of the font. |
protected void |
getNumGlyphs(FontFileReader in)
Read the number of glyphs from the "maxp" table |
java.lang.String |
getPostScriptName()
Returns the PostScript name of the font. |
java.lang.String |
getStemV()
Returns the StemV attribute of the font. |
int[] |
getWidths()
Returns an array of character widths. |
java.lang.String |
getWindowsName()
Returns the Windows name of the font. |
int |
getXHeight()
Returns the XHeight attribute of the font. |
boolean |
isEmbeddable()
Indicates if the font may be embedded. |
static void |
main(java.lang.String[] args)
Static main method to get info about a TrueType font. |
void |
printStuff()
Dumps a few informational values to System.out. |
protected void |
readDirTabs(FontFileReader in)
Read Table Directory from the current position in the FontFileReader and fill the global HashMap dirTabs with the table name (String) as key and a TTFDirTabEntry as value. |
void |
readFont(FontFileReader in)
Reads the font using a FontFileReader. |
boolean |
readFont(FontFileReader in,
java.lang.String name)
Read the font data. |
protected void |
readFontHeader(FontFileReader in)
Read the "head" table, this reads the bounding box and sets the upem (unitsPerEM) variable |
protected void |
readHorizontalHeader(FontFileReader in)
Read the "hhea" table to find the ascender and descender and size of "hmtx" table, as a fixed size font might have only one width. |
protected void |
readHorizontalMetrics(FontFileReader in)
Read "hmtx" table and put the horizontal metrics in the mtxTab array. |
protected void |
readIndexToLocation(FontFileReader in)
Read the "loca" table. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final boolean TRACE_ENABLED
protected java.util.Map dirTabs
protected long lastLoca
protected org.apache.fop.fonts.truetype.TTFMtxEntry[] mtxTab
protected org.apache.commons.logging.Log log
Constructor Detail |
public TTFFile()
Method Detail |
public int convertTTFUnit2PDFUnit(int n)
n
- truetype unit
public void readFont(FontFileReader in) throws java.io.IOException
in
- The FontFileReader to use
java.io.IOException
- In case of an I/O problempublic boolean readFont(FontFileReader in, java.lang.String name) throws java.io.IOException
in
- The FontFileReader to usename
- The name of the font
java.io.IOException
- In case of an I/O problempublic java.lang.String getWindowsName()
public java.lang.String getPostScriptName()
public java.lang.String getFamilyName()
public java.lang.String getCharSetName()
public int getCapHeight()
public int getXHeight()
public int getFlags()
public java.lang.String getStemV()
public java.lang.String getItalicAngle()
public int[] getFontBBox()
public int getLowerCaseAscent()
public int getLowerCaseDescent()
public short getLastChar()
public short getFirstChar()
public int[] getWidths()
public int getCharWidth(int idx)
idx
- Index of the character
public java.util.Map getKerning()
public java.util.Map getAnsiKerning()
public boolean isEmbeddable()
protected void readDirTabs(FontFileReader in) throws java.io.IOException
in
- FontFileReader to read the table directory from
java.io.IOException
- in case of an I/O problemprotected void readFontHeader(FontFileReader in) throws java.io.IOException
in
- FontFileReader to read the header from
java.io.IOException
- in case of an I/O problemprotected void getNumGlyphs(FontFileReader in) throws java.io.IOException
in
- FontFileReader to read the number of glyphs from
java.io.IOException
- in case of an I/O problemprotected void readHorizontalHeader(FontFileReader in) throws java.io.IOException
in
- FontFileReader to read the hhea table from
java.io.IOException
- in case of an I/O problemprotected void readHorizontalMetrics(FontFileReader in) throws java.io.IOException
in
- FontFileReader to read the hmtx table from
java.io.IOException
- in case of an I/O problemprotected final void readIndexToLocation(FontFileReader in) throws java.io.IOException
in
- FontFileReader to read from
java.io.IOException
- In case of a I/O problempublic java.util.List getCMaps()
protected final boolean checkTTC(FontFileReader in, java.lang.String name) throws java.io.IOException
in
- FontFileReader to read fromname
- The name to check
java.io.IOException
- In case of an I/O problempublic void printStuff()
public static void main(java.lang.String[] args)
args
- The command line arguments
|
fop 0.93 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |