Table of Contents

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 PdfWriter

the writer

colorized bool

if 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 PdfWriter

the writer

chars char[]

an array of chars corresponding to the glyphs used (not used, prisent for compability only)

colorized bool

if 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

string

Methods

CharExists(int)

public override bool CharExists(int c)

Parameters

c int

Returns

bool

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 char

the character to match this glyph.

wx float

the advance this character will have

llx float

the X lower left corner of the glyph bounding box. If the colorize option is

lly float

the Y lower left corner of the glyph bounding box. If the colorize option is

urx float

the X upper right corner of the glyph bounding box. If the colorize option is

ury float

the 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

key int
fontSize float

Returns

float

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

char1 int
char2 int

Returns

int

GetRawCharBBox(int, string)

protected override int[] GetRawCharBBox(int c, string name)

Parameters

c int
name string

Returns

int[]

GetWidth(int)

public override int GetWidth(int char1)

Parameters

char1 int

Returns

int

GetWidth(string)

public override int GetWidth(string text)

Parameters

text string

Returns

int

HasKernPairs()

public override bool HasKernPairs()

Returns

bool

SetCharAdvance(int, int)

public override bool SetCharAdvance(int c, int advance)

Parameters

c int
advance int

Returns

bool

SetKerning(int, int, int)

public override bool SetKerning(int char1, int char2, int kern)

Parameters

char1 int
char2 int
kern int

Returns

bool