com.lowagie.text.pdf
class Type1Font extends BaseFont
Field Summary | |
---|---|
int | Ascender A variable. |
boolean | builtinFonttrue if this font is one of the 14 built in fonts. |
int | CapHeight A variable. |
String | CharacterSet The character set of the font. |
HashMap | CharMetrics Represents the section CharMetrics in the AFM file. |
int | Descender A variable. |
String | EncodingScheme The font's encoding name. |
String | fileName The file in use. |
String | FamilyName The family name of the font. |
String | FontName The Postscript font name. |
String | FullName The full name of the font. |
boolean | IsFixedPitchtrue if all the characters have the same
width. |
float | ItalicAngle The italic angle of the font, usually 0.0 or negative. |
HashMap | KernPairs Represents the section KernPairs in the AFM file. |
int | llx The llx of the FontBox. |
int | lly The lly of the FontBox. |
protected byte[] | pfb The PFB file if the input was made with a byte array. |
static int[] | PFB_TYPES Types of records in a PFB file. |
static FontsResourceAnchor | resourceAnchor |
int | StdHW A variable. |
int | StdVW A variable. |
int | urx The lurx of the FontBox. |
int | ury The ury of the FontBox. |
int | UnderlinePosition The underline position. |
int | UnderlineThickness The underline thickness. |
String | Weight The weight of the font: normal, bold, etc. |
int | XHeight A variable. |
Constructor Summary | |
---|---|
Type1Font(String afmFile, String enc, boolean emb, byte[] ttfAfm, byte[] pfb) Creates a new Type1 font. |
Method Summary | |
---|---|
String[][] | getFamilyFontName() Gets the family name of the font. |
PdfDictionary | getFontBaseType(PdfIndirectReference fontDescriptor, int firstChar, int lastChar, byte[] shortTag) Generates the font dictionary for this font. |
PdfDictionary | getFontDescriptor(PdfIndirectReference fontStream) Generates the font descriptor for this font or null if it is
one of the 14 built in fonts. |
float | getFontDescriptor(int key, float fontSize) Gets the font parameter identified by key . |
PdfStream | getFontStream() If the embedded flag is false or if the font is
one of the 14 built in types, it returns null ,
otherwise the font is read and output in a PdfStream object. |
String[][] | getFullFontName() Gets the full name of the font. |
int | getKerning(char char1, char char2) Gets the kerning between two Unicode characters. |
String | getPostscriptFontName() Gets the postscript font name. |
protected int[] | getRawCharBBox(int c, String name) |
int | getRawWidth(int c, String name) Gets the width from the font according to the name or,
if the name is null, meaning it is a symbolic font,
the char c . |
boolean | hasKernPairs() Checks if the font has any kerning pairs. |
void | process(RandomAccessFileOrArray rf) Reads the font metrics |
boolean | setKerning(char char1, char char2, int kern)
Sets the kerning between two Unicode chars. |
void | setPostscriptFontName(String name)
Sets the font name that will appear in the pdf font dictionary.
|
void | writeFont(PdfWriter writer, PdfIndirectReference ref, Object[] params) Outputs to the writer the font dictionaries and streams. |
true
if this font is one of the 14 built in fonts.Object[4]
with an
Integer, Integer, String and int[]. This is the code, width, name and char bbox.
The key is the name of the char and also an Integer with the char number.true
if all the characters have the same
width.Object[]
with 2 elements for each kern pair. Position 0 is the name of
the second character and position 1 is the kerning distance. This is
repeated for all the pairs.byte
array.Parameters: ttfAfm the AFM file if the input is made with a byte
array pfb the PFB file if the input is made with a byte
array afmFile the name of one of the 14 built-in fonts or the location of an AFM file. The file must end in '.afm' enc the encoding to be applied to this font emb true if the font is to be embedded in the PDF
Throws: DocumentException the AFM file is invalid IOException the AFM file could not be read
Returns: the family name of the font
Parameters: firstChar the first valid character lastChar the last valid character shortTag a 256 bytes long byte
array where each unused byte is represented by 0 fontDescriptor the indirect reference to a PdfDictionary containing the font descriptor or null
Returns: the PdfDictionary containing the font dictionary
null
if it is
one of the 14 built in fonts.Parameters: fontStream the indirect reference to a PdfStream containing the font or null
Returns: the PdfDictionary containing the font descriptor or null
key
. Valid values
for key
are ASCENT
, CAPHEIGHT
, DESCENT
,
ITALICANGLE
, BBOXLLX
, BBOXLLY
, BBOXURX
and BBOXURY
.Parameters: key the parameter to be extracted fontSize the font size in points
Returns: the parameter in points
false
or if the font is
one of the 14 built in types, it returns null
,
otherwise the font is read and output in a PdfStream object.Returns: the PdfStream containing the font or null
Throws: DocumentException if there is an error reading the font
Returns: the full name of the font
HashMap
KernPairs
.Parameters: char1 the first char char2 the second char
Returns: the kerning to be applied
Returns: the postscript font name
name
or,
if the name
is null, meaning it is a symbolic font,
the char c
.Parameters: c the char if the font is symbolic name the glyph name
Returns: the width of the char
Returns: true
if the font has any kerning pairs
Parameters: rf the AFM file
Throws: DocumentException the AFM file is invalid IOException the AFM file could not be read
Parameters: char1 the first char char2 the second char kern the kerning to apply in normalized 1000 units
Returns: true
if the kerning was applied, false
otherwise
Parameters: name the new font name
Parameters: writer the writer for this document ref the font indirect reference params several parameters that depend on the font type
Throws: IOException on error DocumentException error in generating the object