Table of Contents

Class FontProgram

Namespace
iText.IO.Font
Assembly
itext.io.dll
public abstract class FontProgram
Inheritance
FontProgram
Derived
Inherited Members

Constructors

FontProgram()

protected FontProgram()

Fields

DEFAULT_WIDTH

public const int DEFAULT_WIDTH = 1000

Field Value

int

HORIZONTAL_SCALING_FACTOR

public const int HORIZONTAL_SCALING_FACTOR = 100

Field Value

int

UNITS_NORMALIZATION

public const int UNITS_NORMALIZATION = 1000

Field Value

int

avgWidth

protected int avgWidth

Field Value

int

codeToGlyph

protected IDictionary<int, Glyph> codeToGlyph

Field Value

IDictionary<int, Glyph>

encodingScheme

The font's encoding name.

protected string encodingScheme

Field Value

string

Remarks

The font's encoding name. This encoding is 'StandardEncoding' or 'AdobeStandardEncoding' for a font that can be totally encoded according to the characters names. For all other names the font is treated as symbolic.

fontIdentification

protected FontIdentification fontIdentification

Field Value

FontIdentification

fontMetrics

protected FontMetrics fontMetrics

Field Value

FontMetrics

fontNames

protected FontNames fontNames

Field Value

FontNames

isFontSpecific

protected bool isFontSpecific

Field Value

bool

registry

protected string registry

Field Value

string

unicodeToGlyph

protected IDictionary<int, Glyph> unicodeToGlyph

Field Value

IDictionary<int, Glyph>

Methods

ConvertGlyphSpaceToTextSpace(double)

public static double ConvertGlyphSpaceToTextSpace(double value)

Parameters

value double

Returns

double

ConvertGlyphSpaceToTextSpace(int)

public static int ConvertGlyphSpaceToTextSpace(int value)

Parameters

value int

Returns

int

ConvertGlyphSpaceToTextSpace(float)

public static float ConvertGlyphSpaceToTextSpace(float value)

Parameters

value float

Returns

float

ConvertTextSpaceToGlyphSpace(float)

public static float ConvertTextSpaceToGlyphSpace(float value)

Parameters

value float

Returns

float

CountOfGlyphs()

public virtual int CountOfGlyphs()

Returns

int

FixSpaceIssue()

protected virtual void FixSpaceIssue()

GetAvgWidth()

public virtual int GetAvgWidth()

Returns

int

GetCharBBox(int)

Get glyph's bbox.

public virtual int[] GetCharBBox(int unicode)

Parameters

unicode int

a unicode symbol or FontSpecif code.

Returns

int[]

Gets bbox in normalized 1000 units.

GetFontIdentification()

public virtual FontIdentification GetFontIdentification()

Returns

FontIdentification

GetFontMetrics()

public virtual FontMetrics GetFontMetrics()

Returns

FontMetrics

GetFontNames()

public virtual FontNames GetFontNames()

Returns

FontNames

GetGlyph(int)

public virtual Glyph GetGlyph(int unicode)

Parameters

unicode int

Returns

Glyph

GetGlyphByCode(int)

public virtual Glyph GetGlyphByCode(int charCode)

Parameters

charCode int

Returns

Glyph

GetKerning(int, int)

Gets the kerning between two glyphs.

public virtual int GetKerning(int first, int second)

Parameters

first int

the first unicode value

second int

the second unicode value

Returns

int

the kerning to be applied

GetKerning(Glyph, Glyph)

Gets the kerning between two glyphs.

public abstract int GetKerning(Glyph first, Glyph second)

Parameters

first Glyph

the first glyph

second Glyph

the second glyph

Returns

int

the kerning to be applied

GetPdfFontFlags()

public abstract int GetPdfFontFlags()

Returns

int

GetRegistry()

public virtual string GetRegistry()

Returns

string

GetWidth(int)

Get glyph's width.

public virtual int GetWidth(int unicode)

Parameters

unicode int

a unicode symbol or FontSpecif code.

Returns

int

Gets width in normalized 1000 units.

HasKernPairs()

public virtual bool HasKernPairs()

Returns

bool

IsBuiltWith(string)

Checks whether the FontProgram was built with corresponding fontName.

public virtual bool IsBuiltWith(string fontName)

Parameters

fontName string

a font name or path to a font program

Returns

bool

true, if the FontProgram was built with the fontProgram. Otherwise false.

Remarks

Checks whether the FontProgram was built with corresponding fontName. Default value is false unless overridden.

IsFontSpecific()

public virtual bool IsFontSpecific()

Returns

bool

SetBbox(int[])

protected virtual void SetBbox(int[] bbox)

Parameters

bbox int[]

SetBold(bool)

protected virtual void SetBold(bool isBold)

Parameters

isBold bool

SetCapHeight(int)

Sets the capital letters height.

protected virtual void SetCapHeight(int capHeight)

Parameters

capHeight int

cap height in 1000-units

Remarks

Sets the capital letters height. See also SetCapHeight(int).

SetFixedPitch(bool)

protected virtual void SetFixedPitch(bool isFixedPitch)

Parameters

isFixedPitch bool

SetFontFamily(string)

Sets a preferred font family name.

protected virtual void SetFontFamily(string fontFamily)

Parameters

fontFamily string

a preferred font family name.

SetFontName(string)

Sets the PostScript name of the font.

protected virtual void SetFontName(string fontName)

Parameters

fontName string

the PostScript name of the font, shall not be null or empty.

Remarks

Sets the PostScript name of the font.

If full name is null, it will be set as well.

SetFontStretch(string)

Sets font width in css notation (font-stretch property)

protected virtual void SetFontStretch(string fontWidth)

Parameters

fontWidth string

FontStretches.

SetFontWeight(int)

Sets font weight.

protected virtual void SetFontWeight(int fontWeight)

Parameters

fontWeight int

integer form 100 to 900. See FontWeights.

SetItalicAngle(int)

Sets the PostScript italic angle.

protected virtual void SetItalicAngle(int italicAngle)

Parameters

italicAngle int

in counter-clockwise degrees from the vertical

Remarks

Sets the PostScript italic angle.

Italic angle in counter-clockwise degrees from the vertical. Zero for upright text, negative for text that leans to the right (forward).

SetRegistry(string)

protected virtual void SetRegistry(string registry)

Parameters

registry string

SetStemH(int)

protected virtual void SetStemH(int stemH)

Parameters

stemH int

SetStemV(int)

protected virtual void SetStemV(int stemV)

Parameters

stemV int

SetTypoAscender(int)

Sets typo ascender.

protected virtual void SetTypoAscender(int ascender)

Parameters

ascender int

typo ascender value in 1000-units

Remarks

Sets typo ascender. See also SetTypoAscender(int).

SetTypoDescender(int)

Sets typo descender.

protected virtual void SetTypoDescender(int descender)

Parameters

descender int

typo descender value in 1000-units

Remarks

Sets typo descender. See also SetTypoDescender(int).

SetXHeight(int)

protected virtual void SetXHeight(int xHeight)

Parameters

xHeight int

ToString()

public override string ToString()

Returns

string