Class DrFont

Class DrFont

Namespace: Aspose.Page.Font
Assembly: Aspose.Page.dll (25.1.2)

Use this class instead of GDI+ Font

public class DrFont

Inheritance

objectDrFont

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Properties

AscentLis

Cell ascent of this font (lis). This is a vertical distance from cell top to cell baseline.

public int AscentLis { get; }

Property Value

int

Remarks

This value is also called cell baseline.

AscentPoints

Returns the cell ascent in points.

public float AscentPoints { get; }

Property Value

float

CellHeightLis

Returns cell height of this font (lis). This is a shortcut for Aspose.Page.Font.DrFont.AscentLis + Aspose.Page.Font.DrFont.DescentLis.

public int CellHeightLis { get; }

Property Value

int

CellHeightPoints

Shortcut for Aspose.Page.Font.DrFont.AscentPoints + Aspose.Page.Font.DrFont.DescentPoints.

public float CellHeightPoints { get; }

Property Value

float

DescentLis

Cell descent of this font (lis). This is a vertical distance from cell bottom to cell baseline.

public int DescentLis { get; }

Property Value

int

DescentPoints

Returns the cell descent in points.

public float DescentPoints { get; }

Property Value

float

FamilyName

Gets name of this font.

public string FamilyName { get; }

Property Value

string

IsBold

Gets a value indicating whether this instance is bold.

public bool IsBold { get; }

Property Value

bool

IsItalic

Gets a value indicating whether this instance is italic.

public bool IsItalic { get; }

Property Value

bool

LeadingLis

Returns leading of this font (lis). This is a shortcut for Aspose.Page.Font.DrFont.LineSpacingLis - Aspose.Page.Font.DrFont.CellHeightLis.

public int LeadingLis { get; }

Property Value

int

LeadingPoints

Returns leading of this font (lis). This is a shortcut for Aspose.Page.Font.DrFont.LineSpacingLis - Aspose.Page.Font.DrFont.CellHeightLis.

public float LeadingPoints { get; }

Property Value

float

LineSpacingLis

Returns cell spacing of this font (lis). This is a vertical distance between baselines of the two glyphs.

public int LineSpacingLis { get; }

Property Value

int

LineSpacingPoints

Returns cell spacing of this font (points). This is a vertical distance between baselines of the two glyphs.

public float LineSpacingPoints { get; }

Property Value

float

SizePoints

Gets size of this font (points).

public float SizePoints { get; set; }

Property Value

float

SmallCapsScaleFactor

Gets the SmallCaps scale factor.

public float SmallCapsScaleFactor { get; }

Property Value

float

Style

Gets style of this font.

public FontStyle Style { get; }

Property Value

FontStyle

StyleEx

This property contains additional information about font’s style

public short StyleEx { get; set; }

Property Value

short

Methods

Equals(DrFont)

Equalses the specified other.

protected bool Equals(DrFont other)

Parameters

other DrFont

The other object.

Returns

bool

true if the specified Aspose.Page.Font.DrFont is equal to this instance; otherwise, false.

Equals(object)

Determines whether the specified System.Object, is equal to this instance.

public override bool Equals(object obj)

Parameters

obj object

The System.Object to compare with this instance.

Returns

bool

true if the specified System.Object is equal to this instance; otherwise, false.

GetCharWidthLis(char)

Gets the char width lis.

public int GetCharWidthLis(char c)

Parameters

c char

The symbol to calculate.

Returns

int

Returns width

GetCharWidthPoints(char)

Returns width of the character (points).

public float GetCharWidthPoints(char c)

Parameters

c char

The symbol to calculate.

Returns

float

Returns width

GetHashCode()

Returns a hash code for this instance.

public override int GetHashCode()

Returns

int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

GetTextSizePoints(string)

Returns measurement text box of the text in points.

public SizeF GetTextSizePoints(string text)

Parameters

text string

The text to calculate.

Returns

SizeF

Returns size

GetTextWidthLis(string)

Gets the text width lis.

public int GetTextWidthLis(string text)

Parameters

text string

The text to calculate.

Returns

int

Returns width

GetTextWidthPoints(string)

Gets the text width points.

public float GetTextWidthPoints(string text)

Parameters

text string

The text to calculate.

Returns

float

Returns width

GetTextWidthPoints(string, int, int)

Gets the text width points.

public float GetTextWidthPoints(string text, int startIndex, int charCount)

Parameters

text string

The text to calculate.

startIndex int

The start index.

charCount int

The char count.

Returns

float

Returns width

IsPoorlyRenderedByGdiPlus(string)

Returns True for “Microsoft Sans Serif” font. This one is poorly rendered by GDI+. See Test286 and Gemini-6959.

public static bool IsPoorlyRenderedByGdiPlus(string fontName)

Parameters

fontName string

Name of the font.

Returns

bool

true if [is poorly rendered by GDI plus] [the specified font name]; otherwise, false.

Replace(DrFont)

Replace font content

public void Replace(DrFont font)

Parameters

font DrFont

The source font.

 English