com.lowagie.text.pdf
public class Type3Font extends BaseFont
Field Summary | |
---|---|
HashMap | char2glyph |
boolean | colorized |
float | llx |
float | lly |
PageResources | pageResources |
float | urx |
float | ury |
boolean[] | usedSlot |
IntHashtable | widths3 |
PdfWriter | writer |
Constructor Summary | |
---|---|
Type3Font(PdfWriter writer, char[] chars, boolean colorized)
Creates a Type3 font. | |
Type3Font(PdfWriter writer, boolean colorized)
Creates a Type3 font. |
Method Summary | |
---|---|
boolean | charExists(char c) |
byte[] | convertToBytes(String text) |
PdfContentByte | defineGlyph(char c, float wx, float llx, float lly, float urx, float ury)
Defines a glyph. |
int[] | getCharBBox(char c) |
String[][] | getFamilyFontName() |
float | getFontDescriptor(int key, float fontSize) |
String[][] | getFullFontName() |
int | getKerning(char char1, char char2) |
String | getPostscriptFontName() |
protected int[] | getRawCharBBox(int c, String name) |
int | getRawWidth(int c, String name) |
int | getWidth(char char1) |
int | getWidth(String text) |
boolean | hasKernPairs() |
boolean | setCharAdvance(char c, int advance) |
boolean | setKerning(char char1, char char2, int kern) |
void | setPostscriptFontName(String name) |
void | writeFont(PdfWriter writer, PdfIndirectReference ref, Object[] params) |
Parameters: writer the writer chars an array of chars corresponding to the glyphs used (not used, prisent for compability only) colorized if true
the font may specify color, if false
no color commands are allowed
and only images as masks can be used
An example:
Document document = new Document(PageSize.A4); PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("type3.pdf")); document.open(); Type3Font t3 = new Type3Font(writer, false); PdfContentByte g = t3.defineGlyph('a', 1000, 0, 0, 750, 750); g.rectangle(0, 0, 750, 750); g.fill(); g = t3.defineGlyph('b', 1000, 0, 0, 750, 750); g.moveTo(0, 0); g.lineTo(375, 750); g.lineTo(750, 0); g.fill(); Font f = new Font(t3, 12); document.add(new Paragraph("ababab", f)); document.close();
Parameters: writer the writer colorized if true
the font may specify color, if false
no color commands are allowed
and only images as masks can be used
Parameters: c the character to match this glyph. wx the advance this character will have llx the X lower left corner of the glyph bounding box. If the colorize
option is
true
the value is ignored lly the Y lower left corner of the glyph bounding box. If the colorize
option is
true
the value is ignored urx the X upper right corner of the glyph bounding box. If the colorize
option is
true
the value is ignored ury the Y upper right corner of the glyph bounding box. If the colorize
option is
true
the value is ignored
Returns: a content where the glyph can be defined