Package de.intarsys.cwt.font.truetype
Class TTFont
- java.lang.Object
-
- de.intarsys.cwt.font.truetype.TTFont
-
public class TTFont extends java.lang.ObjectThis class represents a true type font. Currently only single font files are supported.This class is under construction and not meant for a complete TT implementation.
-
-
Field Summary
Fields Modifier and Type Field Description static intARG_1_AND_2_ARE_WORDSstatic intMORE_COMPONENTSstatic intSFNT_TRUETYPEstatic byte[]TABLE_CMAPstatic byte[]TABLE_CVTstatic byte[]TABLE_FGPMstatic byte[]TABLE_GLYFstatic byte[]TABLE_HEADstatic byte[]TABLE_HHEAstatic byte[]TABLE_HMTXstatic byte[]TABLE_LOCAstatic byte[]TABLE_MAXPstatic byte[]TABLE_NAMEstatic byte[]TABLE_OS2static byte[]TABLE_POSTstatic byte[]TABLE_PREPstatic intWE_HAVE_A_SCALEstatic intWE_HAVE_A_TWO_BY_TWOstatic intWE_HAVE_AN_X_AND_Y_SCALE
-
Constructor Summary
Constructors Modifier Constructor Description protectedTTFont()Create an empty true type font.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intalign(int newLength)static TTFontcreateFromLocator(de.intarsys.tools.locator.ILocator locator)java.util.MapgetCMaps()java.util.MapgetCMapsAt(int platformID, int platformSpecificID)java.lang.StringgetFontFamilyName()TTFontHeadergetFontHeader()java.lang.StringgetFontName()FontStylegetFontStyle()intgetGlyphWidth(int codePoint)protected int[]getGlyphWidths()TTHorizontalHeadergetHorizontalHeader()de.intarsys.tools.locator.ILocatorgetLocator()TTMetricsgetMetrics()TTNaminggetNaming()TTPostScriptInformationgetPostScriptInformation()java.lang.StringgetPsName()intgetSfntVersion()TTTablegetTable(byte[] name)TTTable[]getTables()protected voidinitializeFromLocator()voidremoveCMapsAt(int platformID, int platformSpecificID)protected voidsetFontFamilyName(java.lang.String string)protected voidsetFontName(TTFont font)protected voidsetFontStyle(FontStyle fontStyle)protected voidsetLocator(de.intarsys.tools.locator.ILocator locator)voidsetPsName(java.lang.String string)protected voidsetSfntVersion(int sfntVersion)protected voidsetTables(TTTable[] tables)
-
-
-
Field Detail
-
ARG_1_AND_2_ARE_WORDS
public static final int ARG_1_AND_2_ARE_WORDS
- See Also:
- Constant Field Values
-
MORE_COMPONENTS
public static final int MORE_COMPONENTS
- See Also:
- Constant Field Values
-
SFNT_TRUETYPE
public static final int SFNT_TRUETYPE
- See Also:
- Constant Field Values
-
TABLE_CMAP
public static final byte[] TABLE_CMAP
-
TABLE_CVT
public static final byte[] TABLE_CVT
-
TABLE_FGPM
public static final byte[] TABLE_FGPM
-
TABLE_GLYF
public static final byte[] TABLE_GLYF
-
TABLE_HEAD
public static final byte[] TABLE_HEAD
-
TABLE_HHEA
public static final byte[] TABLE_HHEA
-
TABLE_HMTX
public static final byte[] TABLE_HMTX
-
TABLE_LOCA
public static final byte[] TABLE_LOCA
-
TABLE_MAXP
public static final byte[] TABLE_MAXP
-
TABLE_NAME
public static final byte[] TABLE_NAME
-
TABLE_OS2
public static final byte[] TABLE_OS2
-
TABLE_POST
public static final byte[] TABLE_POST
-
TABLE_PREP
public static final byte[] TABLE_PREP
-
WE_HAVE_A_SCALE
public static final int WE_HAVE_A_SCALE
- See Also:
- Constant Field Values
-
WE_HAVE_A_TWO_BY_TWO
public static final int WE_HAVE_A_TWO_BY_TWO
- See Also:
- Constant Field Values
-
WE_HAVE_AN_X_AND_Y_SCALE
public static final int WE_HAVE_AN_X_AND_Y_SCALE
- See Also:
- Constant Field Values
-
-
Method Detail
-
align
public static int align(int newLength)
-
createFromLocator
public static TTFont createFromLocator(de.intarsys.tools.locator.ILocator locator) throws java.io.IOException
- Throws:
java.io.IOException
-
getCMaps
public java.util.Map getCMaps() throws TrueTypeException- Throws:
TrueTypeException
-
getCMapsAt
public java.util.Map getCMapsAt(int platformID, int platformSpecificID) throws TrueTypeException- Throws:
TrueTypeException
-
getFontFamilyName
public java.lang.String getFontFamilyName()
-
getFontHeader
public TTFontHeader getFontHeader() throws TrueTypeException
- Throws:
TrueTypeException
-
getFontName
public java.lang.String getFontName()
-
getFontStyle
public FontStyle getFontStyle()
-
getGlyphWidth
public int getGlyphWidth(int codePoint) throws TrueTypeException- Throws:
TrueTypeException
-
getGlyphWidths
protected int[] getGlyphWidths() throws TrueTypeException- Throws:
TrueTypeException
-
getHorizontalHeader
public TTHorizontalHeader getHorizontalHeader() throws TrueTypeException
- Throws:
TrueTypeException
-
getLocator
public de.intarsys.tools.locator.ILocator getLocator()
-
getMetrics
public TTMetrics getMetrics() throws TrueTypeException
- Throws:
TrueTypeException
-
getNaming
public TTNaming getNaming() throws TrueTypeException
- Throws:
TrueTypeException
-
getPostScriptInformation
public TTPostScriptInformation getPostScriptInformation() throws TrueTypeException
- Throws:
TrueTypeException
-
getPsName
public java.lang.String getPsName()
-
getSfntVersion
public int getSfntVersion()
-
getTable
public TTTable getTable(byte[] name)
-
getTables
public TTTable[] getTables()
-
initializeFromLocator
protected void initializeFromLocator() throws java.io.IOException- Throws:
java.io.IOException
-
removeCMapsAt
public void removeCMapsAt(int platformID, int platformSpecificID) throws TrueTypeException, java.io.IOException- Throws:
TrueTypeExceptionjava.io.IOException
-
setFontFamilyName
protected void setFontFamilyName(java.lang.String string)
-
setFontName
protected void setFontName(TTFont font) throws TrueTypeException
- Throws:
TrueTypeException
-
setFontStyle
protected void setFontStyle(FontStyle fontStyle)
-
setLocator
protected void setLocator(de.intarsys.tools.locator.ILocator locator)
-
setPsName
public void setPsName(java.lang.String string)
-
setSfntVersion
protected void setSfntVersion(int sfntVersion)
-
setTables
protected void setTables(TTTable[] tables)
-
-