Class Type3Font
- Namespace
- iTextSharp.text.pdf
- Assembly
- iTextSharp.LGPLv2.Core.dll
A class to support Type3 fonts.
public class Type3Font : BaseFont
- Inheritance
-
Type3Font
- Inherited Members
Constructors
Type3Font(PdfWriter, bool)
Creates a Type3 font. This implementation assumes that the /FontMatrix is [0.001 0 0 0.001 0 0] or a 1000-unit glyph coordinate system. 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(); and only images as masks can be used
public Type3Font(PdfWriter writer, bool colorized)
Parameters
writer
PdfWriterthe writer
colorized
boolif true the font may specify color, if false no color commands are allowed
Type3Font(PdfWriter, char[], bool)
Creates a Type3 font. and only images as masks can be used
public Type3Font(PdfWriter writer, char[] chars, bool colorized)
Parameters
writer
PdfWriterthe writer
chars
char[]an array of chars corresponding to the glyphs used (not used, prisent for compability only)
colorized
boolif true the font may specify color, if false no color commands are allowed
Properties
AllNameEntries
public override string[][] AllNameEntries { get; }
Property Value
- string[][]
FamilyFontName
public override string[][] FamilyFontName { get; }
Property Value
- string[][]
FullFontName
public override string[][] FullFontName { get; }
Property Value
- string[][]
PostscriptFontName
public override string PostscriptFontName { get; set; }
Property Value
Methods
CharExists(int)
public override bool CharExists(int c)
Parameters
c
int
Returns
DefineGlyph(char, float, float, float, float, float)
Defines a glyph. If the character was already defined it will return the same content true the value is ignored true the value is ignored true the value is ignored true the value is ignored
public PdfContentByte DefineGlyph(char c, float wx, float llx, float lly, float urx, float ury)
Parameters
c
charthe character to match this glyph.
wx
floatthe advance this character will have
llx
floatthe X lower left corner of the glyph bounding box. If the colorize option is
lly
floatthe Y lower left corner of the glyph bounding box. If the colorize option is
urx
floatthe X upper right corner of the glyph bounding box. If the colorize option is
ury
floatthe Y upper right corner of the glyph bounding box. If the colorize option is
Returns
- PdfContentByte
a content where the glyph can be defined
GetCharBBox(int)
public override int[] GetCharBBox(int c)
Parameters
c
int
Returns
- int[]
GetFontDescriptor(int, float)
public override float GetFontDescriptor(int key, float fontSize)
Parameters
Returns
GetFullFontStream()
Always returns null, because you can't get the FontStream of a Type3 font. @since 2.1.3
public override PdfStream GetFullFontStream()
Returns
- PdfStream
null
GetKerning(int, int)
public override int GetKerning(int char1, int char2)
Parameters
Returns
GetRawCharBBox(int, string)
protected override int[] GetRawCharBBox(int c, string name)
Parameters
Returns
- int[]
GetWidth(int)
public override int GetWidth(int char1)
Parameters
char1
int
Returns
GetWidth(string)
public override int GetWidth(string text)
Parameters
text
string
Returns
HasKernPairs()
public override bool HasKernPairs()
Returns
SetCharAdvance(int, int)
public override bool SetCharAdvance(int c, int advance)
Parameters
Returns
SetKerning(int, int, int)
public override bool SetKerning(int char1, int char2, int kern)