Table of Contents

Class PdfSimpleFont<T>

Namespace
iText.Kernel.Font
Assembly
itext.kernel.dll
public abstract class PdfSimpleFont<T> : PdfFont where T : FontProgram

Type Parameters

T
Inheritance
PdfSimpleFont<T>
Derived
Inherited Members

Constructors

PdfSimpleFont()

protected PdfSimpleFont()

PdfSimpleFont(PdfDictionary)

protected PdfSimpleFont(PdfDictionary fontDictionary)

Parameters

fontDictionary PdfDictionary

Fields

fontEncoding

protected FontEncoding fontEncoding

Field Value

FontEncoding

forceWidthsOutput

Forces the output of the width array.

protected bool forceWidthsOutput

Field Value

bool

Remarks

Forces the output of the width array. Only matters for the 14 built-in fonts.

toUnicode

Currently only exists for the fonts that are parsed from the document.

protected CMapToUnicode toUnicode

Field Value

CMapToUnicode

Remarks

Currently only exists for the fonts that are parsed from the document. In the future, we might provide possibility to add custom mappings after a font has been created from a font file.

usedGlyphs

The array used with single byte encodings.

protected byte[] usedGlyphs

Field Value

byte[]

Methods

AddFontStream(PdfDictionary)

protected abstract void AddFontStream(PdfDictionary fontDescriptor)

Parameters

fontDescriptor PdfDictionary

AppendAnyGlyph(string, int, IList<Glyph>)

public override int AppendAnyGlyph(string text, int from, IList<Glyph> glyphs)

Parameters

text string
from int
glyphs IList<Glyph>

Returns

int

AppendDecodedCodesToGlyphsList(IList<Glyph>, PdfString)

public override bool AppendDecodedCodesToGlyphsList(IList<Glyph> list, PdfString characterCodes)

Parameters

list IList<Glyph>
characterCodes PdfString

Returns

bool

AppendGlyphs(string, int, int, IList<Glyph>)

public override int AppendGlyphs(string text, int from, int to, IList<Glyph> glyphs)

Parameters

text string
from int
to int
glyphs IList<Glyph>

Returns

int

BuildWidthsArray(int, int)

protected virtual PdfArray BuildWidthsArray(int firstChar, int lastChar)

Parameters

firstChar int
lastChar int

Returns

PdfArray

ConvertToBytes(string)

public override byte[] ConvertToBytes(string text)

Parameters

text string

Returns

byte[]

ConvertToBytes(Glyph)

public override byte[] ConvertToBytes(Glyph glyph)

Parameters

glyph Glyph

Returns

byte[]

ConvertToBytes(GlyphLine)

public override byte[] ConvertToBytes(GlyphLine glyphLine)

Parameters

glyphLine GlyphLine

Returns

byte[]

CreateGlyphLine(string)

public override GlyphLine CreateGlyphLine(string content)

Parameters

content string

Returns

GlyphLine

Decode(PdfString)

public override string Decode(PdfString content)

Parameters

content PdfString

Returns

string

DecodeIntoGlyphLine(PdfString)

public override GlyphLine DecodeIntoGlyphLine(PdfString content)

Parameters

content PdfString

Returns

GlyphLine

FlushFontData(string, PdfName)

protected virtual void FlushFontData(string fontName, PdfName subtype)

Parameters

fontName string
subtype PdfName

GetContentWidth(PdfString)

public override float GetContentWidth(PdfString content)

Parameters

content PdfString

Returns

float

GetFontDescriptor(string)

Generates the font descriptor for this font or null if it is one of the 14 built in fonts.

protected override PdfDictionary GetFontDescriptor(string fontName)

Parameters

fontName string

Returns

PdfDictionary

the PdfDictionary containing the font descriptor or null.

GetFontEncoding()

Get the font encoding.

public virtual FontEncoding GetFontEncoding()

Returns

FontEncoding

the FontEncoding

GetToUnicode()

Get the mapping of character codes to unicode values based on /ToUnicode entry of font dictionary.

public virtual CMapToUnicode GetToUnicode()

Returns

CMapToUnicode

the CMapToUnicode built based on /ToUnicode, or null if /ToUnicode is not available

IsBuiltInFont()

Indicates that the font is built in, i.e. it is one of the 14 Standard fonts

protected virtual bool IsBuiltInFont()

Returns

bool

true in case the font is a Standard font and false otherwise

IsBuiltWith(string, string)

public override bool IsBuiltWith(string fontProgram, string encoding)

Parameters

fontProgram string
encoding string

Returns

bool

IsForceWidthsOutput()

Gets the state of the property.

public virtual bool IsForceWidthsOutput()

Returns

bool

value of property forceWidthsOutput

SetFontProgram(T)

protected virtual void SetFontProgram(T fontProgram)

Parameters

fontProgram T

SetForceWidthsOutput(bool)

Set to true to force the generation of the widths array.

public virtual void SetForceWidthsOutput(bool forceWidthsOutput)

Parameters

forceWidthsOutput bool

true to force the generation of the widths array

WriteText(string, PdfOutputStream)

public override void WriteText(string text, PdfOutputStream stream)

Parameters

text string
stream PdfOutputStream

WriteText(GlyphLine, int, int, PdfOutputStream)

public override void WriteText(GlyphLine text, int from, int to, PdfOutputStream stream)

Parameters

text GlyphLine
from int
to int
stream PdfOutputStream