|
Gnostice PDFOne
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gnostice.pdfone.fonts.PdfFont
This class represents a font. When creating a non-standard font, it can be specified that the font file needs to embedded in the document. A "font subset" representing only the glyphs used in the document can also be embedded in a document in place of the entire font file.
Field Summary | |
static int |
BOLD
Style for bold type. |
static int |
CID_TYPE_0
|
static int |
CID_TYPE_2
|
static int |
CJK_TYPE
|
static byte |
EMBED_FULL
Constant for embedding entire font in the document. |
static byte |
EMBED_SUBSET
Constant for embedding font subset in the document. |
static PdfName |
FONT_DESCRIPTOR
|
static int |
ITALIC
Style for italic type. |
static int |
PLAIN
Style for normal type. |
static int |
STROKE
Style for stroked text rendering. |
static int |
STROKE_AND_FILL
Style for stroked and filled text rendering. |
static int |
TRUE_TYPE
|
static int |
TYPE_1
|
static int |
UNDERLINE
Style for underline decoration. |
Method Summary | |
static void |
adjustFontSize(PdfFont font,
PdfRect rect,
String value)
|
Object |
clone()
|
static PdfFont |
create(String name,
int size,
int encoding)
Returns a new PdfFont object created for the
specified font with specified size and character encoding. |
static PdfFont |
create(String name,
int size,
int encoding,
byte embedType)
Returns a new PdfFont object created for the
specified font with specified size, character encoding, and
embedding method. |
static PdfFont |
create(String name,
int style,
int size,
int encoding)
Returns a new PdfFont object created for the
specified font with specified style, size, and character
encoding. |
static PdfFont |
create(String name,
int style,
int size,
int encoding,
byte embedType)
Returns a new PdfFont object created for the specified font with specified style, size, character encoding, and embedding method. |
int |
getAscent()
|
int |
getAvgWidth()
|
int |
getCapHeight()
|
Color |
getColor()
Returns color of this font. |
abstract void |
getData(HashMap hm)
|
int |
getDescent()
|
byte |
getEmbedType()
Returns constant representing this font's embedding method. |
int |
getEncoding()
Returns constant representing this font's character encoding. |
int |
getFirstChar()
|
int |
getFlags()
Returns constant or combined value of constants representing styles used by this font. |
PdfArray |
getFontBBox()
|
abstract double |
getHeight()
Returns height of this font as specified in its font file. |
int |
getItalicangle()
Returns slope of the dominant vertical strokes of this font. |
int |
getLastChar()
|
int |
getMaxWidth()
|
String |
getName()
Returns name of this font. |
String |
getPDFName()
|
int |
getSize()
Returns user-defined size for this font. |
int |
getStemH()
|
int |
getStemV()
|
Color |
getStrokeColor()
Returns color used to stroke this font's characters. |
int |
getStrokeWidth()
Returns width of strokes used by this font's characters. |
int |
getStyle()
Returns constant or combined value of constants representing this font's styles. |
int |
getType()
|
abstract int |
getUnderlinePosition()
|
abstract int |
getUnderlineThickness()
|
abstract int |
getWidth(char c)
Returns width of character c , as mentioned in
this font's file. |
abstract double |
getWidth(char c,
int mu)
Returns width of character c in this font in
specified measurement unit. |
abstract int |
getWidth(String text)
Returns sum of widths of all characters in text ,
as mentioned in this font's file. |
abstract double |
getWidth(String text,
int mu)
Returns width of text in the font in specified
measurement unit. |
double |
getWidth(String text,
int mu,
boolean excludeEndSpaces)
Excludes trailing white space characters in specified text based on excludeEndSpaces and returns width of
resultant text in this font in specified measurement unit. |
abstract int[] |
getWidths()
Returns an array of glyph widths of all characters in this font, arranged in the order of their character codes. |
void |
setColor(Color color)
Specifies color for this font. |
void |
setSize(int size)
Specifies a size for this font. |
void |
setStrokeColor(Color strokeColor)
Specifies color that needs to be used to stroke this font's characters. |
void |
setStrokeWidth(int strokeWidth)
Specifies width of strokes that need to be used by this font's characters. |
abstract void |
setStyle(int style)
Specifies this font's styles. |
byte[] |
updateGlyphList(String text)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final PdfName FONT_DESCRIPTOR
public static final int TYPE_1
public static final int TRUE_TYPE
public static final int CJK_TYPE
public static final int CID_TYPE_2
public static final int CID_TYPE_0
public static final int PLAIN
public static final int BOLD
public static final int ITALIC
public static final int UNDERLINE
public static final int STROKE
public static final int STROKE_AND_FILL
public static final byte EMBED_FULL
public static final byte EMBED_SUBSET
Method Detail |
public static void adjustFontSize(PdfFont font, PdfRect rect, String value)
public Object clone()
public static PdfFont create(String name, int size, int encoding) throws IOException, PdfException
PdfFont
object created for the
specified font with specified size and character encoding.
name
- name of the standard font or the pathname of the
font filesize
- (expressed in page measurement units) size of the
fontencoding
- constant specifying the font's character encoding
PdfFont
object
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfEncodings
public static PdfFont create(String name, int style, int size, int encoding) throws IOException, PdfException
PdfFont
object created for the
specified font with specified style, size, and character
encoding.
name
- name of the standard font or the pathname of the
font filestyle
- constant or combined value of constants specifying
the style of the fontsize
- (expressed in page measurement units) size of the
fontencoding
- constant specifying the font's character encoding
PdfFont
object
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfEncodings
public static PdfFont create(String name, int size, int encoding, byte embedType) throws IOException, PdfException
PdfFont
object created for the
specified font with specified size, character encoding, and
embedding method.
name
- name of the built-in font or pathname of the font
filesize
- size of the fontencoding
- constant specifying the font's character encodingembedType
- constant specifying how the font needs to be
embedded
PdfFont
object
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfEncodings
public static PdfFont create(String name, int style, int size, int encoding, byte embedType) throws IOException, PdfException
name
- name of the standard font or the pathname of the
font filestyle
- constant or combined value of constants specifying
the style of the fontsize
- (expressed in page measurement units) size of the
fontencoding
- constant specifying the font's character encodingembedType
- constant specifying how the font needs to be
embedded
IOException
- if an I/O error occurs.
PdfException
- if an illegal argument is supplied.PdfEncodings
public Color getColor()
setColor(Color)
public void setColor(Color color)
color
- color for the fontpublic Color getStrokeColor()
setStrokeColor(Color)
public void setStrokeColor(Color strokeColor)
strokeColor
- color that needs to be used to stroke the font's
charactersgetStrokeColor()
public String getName()
public String getPDFName()
public int getSize()
setSize(int)
public void setSize(int size)
size
- size for the fontgetSize()
public int getType()
public int getStyle()
setStyle(int)
public int getStrokeWidth()
setStrokeWidth(int)
public void setStrokeWidth(int strokeWidth)
strokeWidth
- width of strokes that need to be used by the font's
charactersgetStrokeWidth()
public int getEncoding()
PdfEncodings
public int getAscent()
public int getAvgWidth()
public int getCapHeight()
public int getDescent()
public int getFlags()
public PdfArray getFontBBox()
public int getItalicangle()
public int getMaxWidth()
public int getStemH()
public int getStemV()
public byte getEmbedType()
public int getFirstChar()
public int getLastChar()
public byte[] updateGlyphList(String text) throws PdfException, IOException
PdfException
IOException
public double getWidth(String text, int mu, boolean excludeEndSpaces)
excludeEndSpaces
and returns width of
resultant text in this font in specified measurement unit.
text
- piece of textmu
- measurement unit in which the width is to be
expressedexcludeEndSpaces
- whether to exclude trailing white space characters
public abstract void setStyle(int style)
style
- constant or combined value of constants specifying
this font's styles.getStyle()
public abstract double getHeight()
public abstract int[] getWidths()
public abstract int getWidth(char c)
c
, as mentioned in
this font's file.
c
- single character
public abstract int getWidth(String text)
text
,
as mentioned in this font's file.
text
- piece of text
text
, as mentioned in this font's filepublic abstract double getWidth(char c, int mu)
c
in this font in
specified measurement unit.
c
- single charactermu
- measurement unit in which the width needs to be
expressed
public abstract double getWidth(String text, int mu)
text
in the font in specified
measurement unit.
text
- piece of textmu
- measurement unit in which the width needs to be
expressed
public abstract int getUnderlinePosition()
public abstract int getUnderlineThickness()
public abstract void getData(HashMap hm) throws IOException, PdfException
IOException
PdfException
|
Pro. Ed. v1.41 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |