Package org.apache.fontbox
Interface FontBoxFont
-
- All Known Implementing Classes:
CFFCIDFont,CFFFont,CFFType1Font,OpenTypeFont,TrueTypeFont,Type1Font
public interface FontBoxFontCommon interface for all FontBox fonts.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BoundingBoxgetFontBBox()Returns the font's bounding box in PostScript units.java.util.List<java.lang.Number>getFontMatrix()Returns the FontMatrix in PostScript units.java.lang.StringgetName()The PostScript name of the font.java.awt.geom.GeneralPathgetPath(java.lang.String name)Returns the path for the character with the given name.floatgetWidth(java.lang.String name)Returns the advance width for the character with the given name.booleanhasGlyph(java.lang.String name)Returns true if the font contains the given glyph.
-
-
-
Method Detail
-
getName
java.lang.String getName() throws java.io.IOExceptionThe PostScript name of the font.- Returns:
- the postscript of the font or null
- Throws:
java.io.IOException- if something went wrong when accessing the font data
-
getFontBBox
BoundingBox getFontBBox() throws java.io.IOException
Returns the font's bounding box in PostScript units.- Returns:
- the bounding box of the font
- Throws:
java.io.IOException- if something went wrong when accessing the font data
-
getFontMatrix
java.util.List<java.lang.Number> getFontMatrix() throws java.io.IOExceptionReturns the FontMatrix in PostScript units.- Returns:
- the font matrix
- Throws:
java.io.IOException- if something went wrong when accessing the font data
-
getPath
java.awt.geom.GeneralPath getPath(java.lang.String name) throws java.io.IOExceptionReturns the path for the character with the given name.- Parameters:
name- PostScript glyph name- Returns:
- glyph path
- Throws:
java.io.IOException- if the path could not be read
-
getWidth
float getWidth(java.lang.String name) throws java.io.IOExceptionReturns the advance width for the character with the given name.- Parameters:
name- PostScript glyph name- Returns:
- glyph advance width
- Throws:
java.io.IOException- if the path could not be read
-
hasGlyph
boolean hasGlyph(java.lang.String name) throws java.io.IOExceptionReturns true if the font contains the given glyph.- Parameters:
name- PostScript glyph name- Returns:
- true if the font contains a glyph with the given name, otherwise false
- Throws:
java.io.IOException- if something went wrong when accessing the font data
-
-