Package com.evopdf
Class PdfFont
java.lang.Object
com.evopdf.PdfFont
This class represents a font in the PDF document that can be used by the text
 elements
- 
Constructor SummaryConstructorsConstructorDescriptionPdfFont(byte[] fontData, float fontSizePoints) Creates a PDF font from font dataPdfFont(StandardCJKFont standardCJK, float fontSizePoints) Creates a CJK fontPdfFont(StdFontBaseFamily standardFamily, float fontSizePoints) Creates a standard PDF fontCreates a PDF font from a font fileCreates a PDF font for a font family name.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanbold()Gets the flag indicating if the font is boldbooleanGets the flag indicating if the font should be embedded in PDF document.byte[]fontData()Gets the font dataGets the name of the font family of this PDF fontbooleanitalic()Gets the flag indicating if the font is italicvoidsetBold(boolean bold) Sets the flag indicating if the font is boldvoidsetEmbedFont(boolean embedFont) Sets the flag indicating if the font should be embedded in PDF document.voidsetFontData(byte[] fontData) Sets the font datavoidsetFontFamily(String familyName) Sets the name of the font family of this PDF fontvoidsetItalic(boolean italic) Sets the flag indicating if the font is italicvoidsetSize(float fontSizePoints) Sets the PDF font size in pointsvoidsetStandardCJK(StandardCJKFont standardCJK) Sets the predefined CJK fontvoidsetStandardFamily(StdFontBaseFamily standardFamily) Sets the predefined family name of this PDF fontvoidsetStrikeout(boolean strikeout) Sets the flag indicating if the font is strikeoutvoidsetUnderline(boolean underline) Sets the flag indicating if the font is underlinefloatsize()Gets the PDF font size in pointsGets the predefined CJK fontGets the predefined family name of this PDF fontbooleanGets the flag indicating if the font is strikeoutbooleanGets the flag indicating if the font is underline
- 
Constructor Details- 
PdfFontCreates a PDF font for a font family name. The font must be installed on the server- Parameters:
- familyName- the font family name
- fontSizePoints- the font size in points
- embedFont- a flag indicating if the font will be embedded in PDF. A- TextElementusing this font can override this option
 
- 
PdfFontCreates a standard PDF font- Parameters:
- standardFamily- the standard PDF font family
- fontSizePoints- the standard font size in points
 
- 
PdfFontCreates a CJK font- Parameters:
- standardCJK- the CJK font
- fontSizePoints- the standard font size in points
 
- 
PdfFontCreates a PDF font from a font file- Parameters:
- fontFilePath- the font file full path
- fontSizePoints- the font size in points
- Throws:
- Exception- an exception is thrown if the font cannot be created
 
- 
PdfFontpublic PdfFont(byte[] fontData, float fontSizePoints) Creates a PDF font from font data- Parameters:
- fontData- the font data
- fontSizePoints- the font size in points
 
 
- 
- 
Method Details- 
fontFamilyGets the name of the font family of this PDF font- Returns:
- the name of the font family
 
- 
setFontFamilySets the name of the font family of this PDF font- Parameters:
- familyName- the name of the font family to set
 
- 
embedFontpublic boolean embedFont()Gets the flag indicating if the font should be embedded in PDF document. This is flag is used when the font is constructed with font family name and can be overridden byTextElementoptions- Returns:
- the flag value
 
- 
setEmbedFontpublic void setEmbedFont(boolean embedFont) Sets the flag indicating if the font should be embedded in PDF document. This is flag is used when the font is constructed with font family name and can be overridden byTextElementoptions. Default value is true- Parameters:
- embedFont- the flag value to set
 
- 
standardFamilyGets the predefined family name of this PDF font- Returns:
- the predefined family name of this PDF font
 
- 
setStandardFamilySets the predefined family name of this PDF font- Parameters:
- standardFamily- the predefined family name to set
 
- 
fontDatapublic byte[] fontData()Gets the font data- Returns:
- the font data
 
- 
setFontDatapublic void setFontData(byte[] fontData) Sets the font data- Parameters:
- fontData- the font data to set
 
- 
standardCJKGets the predefined CJK font- Returns:
- the predefined CJK font
 
- 
setStandardCJKSets the predefined CJK font- Parameters:
- standardCJK- the predefined CJK font to set
 
- 
sizepublic float size()Gets the PDF font size in points- Returns:
- the PDF font size in points
 
- 
setSizepublic void setSize(float fontSizePoints) Sets the PDF font size in points- Parameters:
- fontSizePoints- the PDF font size in points to set
 
- 
boldpublic boolean bold()Gets the flag indicating if the font is bold- Returns:
- the flag value
 
- 
setBoldpublic void setBold(boolean bold) Sets the flag indicating if the font is bold- Parameters:
- bold- the flag value to set
 
- 
italicpublic boolean italic()Gets the flag indicating if the font is italic- Returns:
- the flag value
 
- 
setItalicpublic void setItalic(boolean italic) Sets the flag indicating if the font is italic- Parameters:
- italic- the flag value to set
 
- 
underlinepublic boolean underline()Gets the flag indicating if the font is underline- Returns:
- the flag value
 
- 
setUnderlinepublic void setUnderline(boolean underline) Sets the flag indicating if the font is underline- Parameters:
- underline- the flag value to set
 
- 
strikeoutpublic boolean strikeout()Gets the flag indicating if the font is strikeout- Returns:
- the flag value
 
- 
setStrikeoutpublic void setStrikeout(boolean strikeout) Sets the flag indicating if the font is strikeout- Parameters:
- strikeout- the flag value to set
 
 
-