org.icepdf.core.pobjects.fonts
Interface FontFile

All Known Implementing Classes:
OFont

public interface FontFile

Font file interfaces. Common methods which encapsulate NFont and OFont font rendering libraries.

Since:
3.0

Field Summary
static long LAYOUT_NONE
           
 
Method Summary
 boolean canDisplayEchar(char ech)
          Can the character ch in the nfont's encoding be rendered?
 FontFile deriveFont(java.awt.geom.AffineTransform at)
           
 FontFile deriveFont(Encoding encoding, CMap toUnicode)
           
 FontFile deriveFont(float pointsize)
          Creates nfont a new pointsize, assuming 72 ppi.
 FontFile deriveFont(float[] widths, int firstCh, float missingWidth, float ascent, float descent, char[] diff)
           
 FontFile deriveFont(java.util.Map<java.lang.Integer,java.lang.Float> widths, int firstCh, float missingWidth, float ascent, float descent, char[] diff)
           
 void drawEstring(java.awt.Graphics2D g, java.lang.String estr, float x, float y, long layout, int mode, java.awt.Color strokecolor)
           
 java.awt.geom.Point2D echarAdvance(char ech)
           
 double getAscent()
          Returns maximum ascent glyphs above baseline.
 double getDescent()
          Returns maximum descent of glyphs below baseline.
 java.awt.geom.Rectangle2D getEstringBounds(java.lang.String estr, int beginIndex, int limit)
           
 java.awt.Shape getEstringOutline(java.lang.String estr, float x, float y)
          Get the glyph outline shape for the given estr translated to x,y.
 java.lang.String getFamily()
          Returns name of nfont, such as "Times".
 java.lang.String getFormat()
          Returns primary format, such as "Type1" or "OpenType".
 java.awt.geom.Rectangle2D getMaxCharBounds()
          Returns left in rectangle's x, ascent in y, width in width, height in height.
 java.lang.String getName()
          Returns name of nfont, such as "Times-Roman", which is different than the filename.
 int getNumGlyphs()
          Returns number of glyphs defined in nfont.
 int getRights()
          Returns nfont usage rights bit mask.
 float getSize()
           
 char getSpaceEchar()
          Returns the character that seems to be used as a space in the current encoding, or NOTDEF_CHAR if no such character.
 int getStyle()
           
 CMap getToUnicode()
           
 java.awt.geom.AffineTransform getTransform()
          Returns a copy of the transform associated with this font file.
 boolean isHinted()
          Returns true iff nfont has hinted outlines, which is Type 1 and TrueType is a sign of higher quality.
 boolean isOneByteEncoding()
           
 java.lang.String toUnicode(char displayChar)
           
 java.lang.String toUnicode(java.lang.String displayText)
           
 

Field Detail

LAYOUT_NONE

static final long LAYOUT_NONE
See Also:
Constant Field Values
Method Detail

echarAdvance

java.awt.geom.Point2D echarAdvance(char ech)

deriveFont

FontFile deriveFont(java.awt.geom.AffineTransform at)

deriveFont

FontFile deriveFont(Encoding encoding,
                    CMap toUnicode)

deriveFont

FontFile deriveFont(float[] widths,
                    int firstCh,
                    float missingWidth,
                    float ascent,
                    float descent,
                    char[] diff)

deriveFont

FontFile deriveFont(java.util.Map<java.lang.Integer,java.lang.Float> widths,
                    int firstCh,
                    float missingWidth,
                    float ascent,
                    float descent,
                    char[] diff)

canDisplayEchar

boolean canDisplayEchar(char ech)
Can the character ch in the nfont's encoding be rendered?


deriveFont

FontFile deriveFont(float pointsize)
Creates nfont a new pointsize, assuming 72 ppi. Note to subclassers: you must make a complete independent instance of the nfont here, even if pointsize and everything else is the same, as other deriveFont methods use this to make a clone and might make subsequent changes.


getToUnicode

CMap getToUnicode()

toUnicode

java.lang.String toUnicode(java.lang.String displayText)

toUnicode

java.lang.String toUnicode(char displayChar)

getFamily

java.lang.String getFamily()
Returns name of nfont, such as "Times".


getSize

float getSize()

getAscent

double getAscent()
Returns maximum ascent glyphs above baseline.


getDescent

double getDescent()
Returns maximum descent of glyphs below baseline.


getMaxCharBounds

java.awt.geom.Rectangle2D getMaxCharBounds()
Returns left in rectangle's x, ascent in y, width in width, height in height.


getTransform

java.awt.geom.AffineTransform getTransform()
Returns a copy of the transform associated with this font file.


getRights

int getRights()
Returns nfont usage rights bit mask.


getName

java.lang.String getName()
Returns name of nfont, such as "Times-Roman", which is different than the filename.


isHinted

boolean isHinted()
Returns true iff nfont has hinted outlines, which is Type 1 and TrueType is a sign of higher quality.


getNumGlyphs

int getNumGlyphs()
Returns number of glyphs defined in nfont.


getStyle

int getStyle()

getSpaceEchar

char getSpaceEchar()
Returns the character that seems to be used as a space in the current encoding, or NOTDEF_CHAR if no such character.


getEstringBounds

java.awt.geom.Rectangle2D getEstringBounds(java.lang.String estr,
                                           int beginIndex,
                                           int limit)

getFormat

java.lang.String getFormat()
Returns primary format, such as "Type1" or "OpenType".


drawEstring

void drawEstring(java.awt.Graphics2D g,
                 java.lang.String estr,
                 float x,
                 float y,
                 long layout,
                 int mode,
                 java.awt.Color strokecolor)

getEstringOutline

java.awt.Shape getEstringOutline(java.lang.String estr,
                                 float x,
                                 float y)
Get the glyph outline shape for the given estr translated to x,y.

Parameters:
estr - text to calculate glyph outline shape
x - x coordinate to translate outline shape.
y - y coordinate to translate outline shape.
Returns:
glyph outline of the estr.

isOneByteEncoding

boolean isOneByteEncoding()