This class represents an interface to the font description. This will depend
on the font type for the actual implementation. If it is a AFM/cmap/or embedded font.
getAscent
public abstract float getAscent()
This will get the ascent for the font.
getAverageWidth
public abstract float getAverageWidth()
throws IOException
This will get the average width for the font. This is part of the
definition in the font description. If it is not present then PDFBox
will make an attempt to calculate it.
getCapHeight
public abstract float getCapHeight()
This will get the CapHeight for the font.
getCharSet
public abstract String getCharSet()
This will get the character set for the font.
getDescent
public abstract float getDescent()
This will get the descent for the font.
getFlags
public abstract int getFlags()
This will get the font flags.
getFontBoundingBox
public abstract PDRectangle getFontBoundingBox()
This will get the fonts bouding box.
getFontFamily
public abstract String getFontFamily()
A string representing the preferred font family.
getFontName
public abstract String getFontName()
Get the font name.
getFontStretch
public abstract String getFontStretch()
A string representing the preferred font stretch.
According to the PDF Spec:
The font stretch value; it must be one of the following (ordered from
narrowest to widest): UltraCondensed, ExtraCondensed, Condensed, SemiCondensed,
Normal, SemiExpanded, Expanded, ExtraExpanded or UltraExpanded.
getFontWeight
public abstract float getFontWeight()
The weight of the font. According to the PDF spec "possible values are
100, 200, 300, 400, 500, 600, 700, 800 or 900" Where a higher number is
more weight and appears to be more bold.
getItalicAngle
public abstract float getItalicAngle()
This will get the italic angle for the font.
getLeading
public abstract float getLeading()
This will get the leading for the font.
getMaxWidth
public abstract float getMaxWidth()
This will get the max width for the font.
getStemH
public abstract float getStemH()
This will get the stemH for the font.
getStemV
public abstract float getStemV()
This will get the stemV for the font.
getXHeight
public abstract float getXHeight()
This will get the x height for the font.
isAllCap
public boolean isAllCap()
A convenience method that checks the flag bit.
isFixedPitch
public boolean isFixedPitch()
A convenience method that checks the flag bit.
isForceBold
public boolean isForceBold()
A convenience method that checks the flag bit.
isItalic
public boolean isItalic()
A convenience method that checks the flag bit.
isNonSymbolic
public boolean isNonSymbolic()
A convenience method that checks the flag bit.
isScript
public boolean isScript()
A convenience method that checks the flag bit.
isSerif
public boolean isSerif()
A convenience method that checks the flag bit.
isSmallCap
public boolean isSmallCap()
A convenience method that checks the flag bit.
isSymbolic
public boolean isSymbolic()
A convenience method that checks the flag bit.
setAllCap
public void setAllCap(boolean flag)
A convenience method that sets the flag bit.
setAscent
public abstract void setAscent(float ascent)
This will set the ascent for the font.
ascent
- The new ascent for the font.
setAverageWidth
public abstract void setAverageWidth(float averageWidth)
This will set the average width for the font.
averageWidth
- The new average width for the font.
setCapHeight
public abstract void setCapHeight(float capHeight)
This will set the cap height for the font.
capHeight
- The new cap height for the font.
setCharacterSet
public abstract void setCharacterSet(String charSet)
This will set the character set for the font.
charSet
- The new character set for the font.
setDescent
public abstract void setDescent(float descent)
This will set the descent for the font.
descent
- The new descent for the font.
setFixedPitch
public void setFixedPitch(boolean flag)
A convenience method that sets the flag bit.
setFlags
public abstract void setFlags(int flags)
This will set the font flags.
flags
- The new font flags.
setFontBoundingBox
public abstract void setFontBoundingBox(PDRectangle rect)
Set the fonts bounding box.
rect
- The new bouding box.
setFontFamily
public abstract void setFontFamily(String fontFamily)
This will set the font family.
fontFamily
- The font family.
setFontName
public abstract void setFontName(String fontName)
This will set the font name.
fontName
- The new name for the font.
setFontStretch
public abstract void setFontStretch(String fontStretch)
This will set the font stretch.
fontStretch
- The font stretch
setFontWeight
public abstract void setFontWeight(float fontWeight)
Set the weight of the font.
fontWeight
- The new weight of the font.
setForceBold
public void setForceBold(boolean flag)
A convenience method that sets the flag bit.
setItalic
public void setItalic(boolean flag)
A convenience method that sets the flag bit.
setItalicAngle
public abstract void setItalicAngle(float angle)
This will set the italic angle for the font.
angle
- The new italic angle for the font.
setLeading
public abstract void setLeading(float leading)
This will set the leading for the font.
leading
- The new leading for the font.
setMaxWidth
public abstract void setMaxWidth(float maxWidth)
This will set the max width for the font.
maxWidth
- The new max width for the font.
setNonSymbolic
public void setNonSymbolic(boolean flag)
A convenience method that sets the flag bit.
setScript
public void setScript(boolean flag)
A convenience method that sets the flag bit.
setSerif
public void setSerif(boolean flag)
A convenience method that sets the flag bit.
setSmallCap
public void setSmallCap(boolean flag)
A convenience method that sets the flag bit.
setStemH
public abstract void setStemH(float stemH)
This will set the stem H for the font.
stemH
- The new stem h for the font.
setStemV
public abstract void setStemV(float stemV)
This will set the stem V for the font.
stemV
- The new stem v for the font.
setSymbolic
public void setSymbolic(boolean flag)
A convenience method that sets the flag bit.
setXHeight
public abstract void setXHeight(float xHeight)
This will set the x height for the font.
xHeight
- The new x height for the font.