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 double
getAdvance
(int glyphID) Fetch the horizontal advance width for the specified glyph.abstract String
abstract double
Fetch the height above the baseline of capital lettersabstract int
Get the CID count associated with the CIDKeyedFontabstract Rect
Fetch the font bounding box.abstract String
Fetches the preferred family name associated with this font.abstract int
getGlyphCid
(int glyphID) Fetch the CID for a given glyph.abstract String
getGlyphName
(int gid) abstract double
Fetch the italic angle.abstract int
The number of glyphs in the font.abstract String
Fetches the preferred postscript name for the font.abstract ROS
getROS()
Get the Registry, Ordering and Supplement associated with the font.abstract double
getStemV()
Fetch the font's primary vertical stem widthabstract double
Fetch the height above the baseline for lowercase letters.abstract boolean
abstract boolean
abstract boolean
abstract boolean
abstract void
stream
(OutputStream out, boolean openTypeFontsAllowed) Streams a font suitable for embedding in a PDF for editting situations.abstract void
subsetAndStream
(Subset subset, OutputStream out, boolean preserveROS) abstract void
subsetAndStream
(SubsetSimpleTrueType subset, OutputStream out) abstract void
subsetAndStream
(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:
UnsupportedFontException
InvalidFontException
-
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:
InvalidFontException
UnsupportedFontException
-
getCapHeight
Fetch the height above the baseline of capital letters- Returns:
- the capHeight scaled to 1000 ppem.
- Throws:
UnsupportedFontException
InvalidFontException
-
getXHeight
Fetch the height above the baseline for lowercase letters.- Returns:
- the xHeight scaled to 1000 ppem.
- Throws:
UnsupportedFontException
InvalidFontException
-
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:
UnsupportedFontException
InvalidFontException
-
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:
InvalidFontException
UnsupportedFontException
IOException
-
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
-