|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.icepdf.core.pobjects.fonts.ofont.OFont
public class OFont
OFont is an awt Font wrapper used to aid in the paint of glyphs.
| Field Summary | |
|---|---|
protected float |
ascent
|
protected java.util.Map<java.lang.Integer,java.lang.Float> |
cidWidths
|
protected char[] |
cMap
|
protected float |
descent
|
protected Encoding |
encoding
|
protected int |
firstCh
|
protected float |
missingWidth
|
protected CMap |
toUnicode
|
protected float[] |
widths
|
| Fields inherited from interface org.icepdf.core.pobjects.fonts.FontFile |
|---|
LAYOUT_NONE |
| Constructor Summary | |
|---|---|
OFont(java.awt.Font awtFont)
|
|
| 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 displayText,
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. |
char |
getCharDiff(char character)
Return the width of the given character |
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 displayText,
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 c1)
|
java.lang.String |
toUnicode(java.lang.String displayText)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected float[] widths
protected java.util.Map<java.lang.Integer,java.lang.Float> cidWidths
protected float missingWidth
protected int firstCh
protected float ascent
protected float descent
protected Encoding encoding
protected CMap toUnicode
protected char[] cMap
| Constructor Detail |
|---|
public OFont(java.awt.Font awtFont)
| Method Detail |
|---|
public FontFile deriveFont(Encoding encoding,
CMap toUnicode)
deriveFont in interface FontFile
public FontFile deriveFont(float[] widths,
int firstCh,
float missingWidth,
float ascent,
float descent,
char[] diff)
deriveFont in interface FontFile
public FontFile deriveFont(java.util.Map<java.lang.Integer,java.lang.Float> widths,
int firstCh,
float missingWidth,
float ascent,
float descent,
char[] diff)
deriveFont in interface FontFilepublic FontFile deriveFont(java.awt.geom.AffineTransform at)
deriveFont in interface FontFilepublic boolean canDisplayEchar(char ech)
FontFile
canDisplayEchar in interface FontFilepublic FontFile deriveFont(float pointsize)
FontFilederiveFont methods use this to make a clone and might make subsequent changes.
deriveFont in interface FontFilepublic java.awt.geom.Point2D echarAdvance(char ech)
echarAdvance in interface FontFilepublic char getCharDiff(char character)
character - character to retreive width of
characterpublic CMap getToUnicode()
getToUnicode in interface FontFilepublic int getStyle()
getStyle in interface FontFilepublic java.lang.String getFamily()
FontFile
getFamily in interface FontFilepublic float getSize()
getSize in interface FontFilepublic double getAscent()
FontFile
getAscent in interface FontFilepublic double getDescent()
FontFile
getDescent in interface FontFilepublic java.awt.geom.Rectangle2D getMaxCharBounds()
FontFile
getMaxCharBounds in interface FontFilepublic java.awt.geom.AffineTransform getTransform()
FontFile
getTransform in interface FontFilepublic int getRights()
FontFile
getRights in interface FontFilepublic java.lang.String getName()
FontFile
getName in interface FontFilepublic boolean isHinted()
FontFiletrue iff nfont has hinted outlines, which is Type 1 and TrueType is a sign of higher quality.
isHinted in interface FontFilepublic int getNumGlyphs()
FontFile
getNumGlyphs in interface FontFilepublic char getSpaceEchar()
FontFile
getSpaceEchar in interface FontFile
public java.awt.geom.Rectangle2D getEstringBounds(java.lang.String estr,
int beginIndex,
int limit)
getEstringBounds in interface FontFilepublic java.lang.String getFormat()
FontFile
getFormat in interface FontFile
public void drawEstring(java.awt.Graphics2D g,
java.lang.String displayText,
float x,
float y,
long layout,
int mode,
java.awt.Color strokecolor)
drawEstring in interface FontFilepublic java.lang.String toUnicode(java.lang.String displayText)
toUnicode in interface FontFilepublic java.lang.String toUnicode(char c1)
toUnicode in interface FontFilepublic boolean isOneByteEncoding()
isOneByteEncoding in interface FontFile
public java.awt.Shape getEstringOutline(java.lang.String displayText,
float x,
float y)
FontFile
getEstringOutline in interface FontFiledisplayText - text to calculate glyph outline shapex - x coordinate to translate outline shape.y - y coordinate to translate outline shape.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||