Package com.adobe.fontengine.font
Class PDFFontDescription
java.lang.Object
com.adobe.fontengine.font.PDFFontDescription
- Direct Known Subclasses:
XDCFontDescription
A helper class useful for building pdf font objects.
Metrics
Metrics returned by this class are expressed in 1/1000th of em.
Synchronization
This class is immutable after contruction and contains no mutable static data. It is therefore threadsafe.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract doublegetAdvance(int glyphID) Fetch the horizontal advance width for the specified glyph.abstract Stringabstract doubleFetch the height above the baseline of capital lettersabstract intGet the CID count associated with the CIDKeyedFontabstract RectFetch the font bounding box.abstract StringFetches the preferred family name associated with this font.abstract intgetGlyphCid(int glyphID) Fetch the CID for a given glyph.abstract StringgetGlyphName(int gid) abstract doubleFetch the italic angle.abstract intThe number of glyphs in the font.abstract StringFetches the preferred postscript name for the font.abstract ROSgetROS()Get the Registry, Ordering and Supplement associated with the font.abstract doublegetStemV()Fetch the font's primary vertical stem widthabstract doubleFetch the height above the baseline for lowercase letters.abstract booleanabstract booleanabstract booleanabstract booleanabstract voidstream(OutputStream out, boolean openTypeFontsAllowed) Streams a font suitable for embedding in a PDF for editting situations.abstract voidsubsetAndStream(Subset subset, OutputStream out, boolean preserveROS) abstract voidsubsetAndStream(SubsetSimpleTrueType subset, OutputStream out) abstract voidsubsetAndStream(SubsetSimpleType1 subset, OutputStream out)
-
Constructor Details
-
PDFFontDescription
public PDFFontDescription()
-
-
Method Details
-
getPostscriptName
Fetches the preferred postscript name for the font. The Postscript name is not required, in which case this returns null. -
getFontFamily
Fetches the preferred family name associated with this font. The family name is not required, in which case this returns null. -
getStemV
Fetch the font's primary vertical stem width- Returns:
- the stemv scaled to 1000 ppem.
- Throws:
UnsupportedFontExceptionInvalidFontException
-
getFontBBox
Fetch the font bounding box. The font bbox is not required in fonts, in which case this returns null.- Returns:
- the fontbbox scaled to 1000 ppem.
- Throws:
InvalidFontExceptionUnsupportedFontException
-
getCapHeight
Fetch the height above the baseline of capital letters- Returns:
- the capHeight scaled to 1000 ppem.
- Throws:
UnsupportedFontExceptionInvalidFontException
-
getXHeight
Fetch the height above the baseline for lowercase letters.- Returns:
- the xHeight scaled to 1000 ppem.
- Throws:
UnsupportedFontExceptionInvalidFontException
-
getItalicAngle
Fetch the italic angle. This is the angle of the primary vertical strokes in the font given in degrees counter clockwise from vertical (e.g. most non-italic fonts will have 0 for their italic angle; italic fonts will often have italic angles around -15). -
getNumGlyphs
The number of glyphs in the font. -
getAdvance
public abstract double getAdvance(int glyphID) throws InvalidFontException, UnsupportedFontException Fetch the horizontal advance width for the specified glyph.- Parameters:
glyphID- the glyph to be fetched- Returns:
- the advance width scaled to 1000 ppem.
- Throws:
InvalidGlyphException- thrown when the glyph contains data that cannot be interpretted and cannot be ignoredUnsupportedFontException- thrown when the font contains data that indicates that AFE does not support that class of fonts.InvalidFontException
-
getROS
Get the Registry, Ordering and Supplement associated with the font. If the font does not have a ROS, return null. The ROS is described in technote 5014: "Adobe CMap and CIDFont Files Specification" found at http://partners.adobe.com/public/developer/en/font/5014.CIDFont_Spec.pdf -
getCIDCount
Get the CID count associated with the CIDKeyedFont -
getGlyphCid
Fetch the CID for a given glyph. This function must only be called if getROS returns a non-null ROS.- Parameters:
glyphID-- Returns:
- the CID associated with glyphID
- Throws:
UnsupportedFontExceptionInvalidFontException
-
pdfFontIsTrueType
-
getGlyphName
-
getBase14Name
-
isSerifFont
-
isSmallCapFont
-
isAllCapFont
-
stream
public abstract void stream(OutputStream out, boolean openTypeFontsAllowed) throws InvalidFontException, UnsupportedFontException, IOException Streams a font suitable for embedding in a PDF for editting situations.- Parameters:
out- The stream to which the font is streamed.openTypeFontsAllowed- True iff the target pdf can contain OpenType fonts (i.e., it is at least PDF 1.7)- Throws:
InvalidFontExceptionUnsupportedFontExceptionIOException
-
subsetAndStream
public abstract void subsetAndStream(Subset subset, OutputStream out, boolean preserveROS) throws InvalidFontException, UnsupportedFontException, IOException -
subsetAndStream
public abstract void subsetAndStream(SubsetSimpleType1 subset, OutputStream out) throws InvalidFontException, UnsupportedFontException, IOException -
subsetAndStream
public abstract void subsetAndStream(SubsetSimpleTrueType subset, OutputStream out) throws InvalidFontException, UnsupportedFontException, IOException
-