Class DrFont
Namespace: Aspose.Page.Font
Assembly: Aspose.Page.dll (25.1.2)
Use this class instead of GDI+ Font
public class DrFont
Inheritance
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
Remarks
This value is also called cell baseline.
AscentPoints
Returns the cell ascent in points.
public float AscentPoints { get; }
Property Value
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
CellHeightPoints
Shortcut for Aspose.Page.Font.DrFont.AscentPoints + Aspose.Page.Font.DrFont.DescentPoints.
public float CellHeightPoints { get; }
Property Value
DescentLis
Cell descent of this font (lis). This is a vertical distance from cell bottom to cell baseline.
public int DescentLis { get; }
Property Value
DescentPoints
Returns the cell descent in points.
public float DescentPoints { get; }
Property Value
FamilyName
Gets name of this font.
public string FamilyName { get; }
Property Value
IsBold
Gets a value indicating whether this instance is bold.
public bool IsBold { get; }
Property Value
IsItalic
Gets a value indicating whether this instance is italic.
public bool IsItalic { get; }
Property Value
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
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
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
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
SizePoints
Gets size of this font (points).
public float SizePoints { get; set; }
Property Value
SmallCapsScaleFactor
Gets the SmallCaps scale factor.
public float SmallCapsScaleFactor { get; }
Property Value
Style
Gets style of this font.
public FontStyle Style { get; }
Property Value
StyleEx
This property contains additional information about font’s style
public short StyleEx { get; set; }
Property Value
Methods
Equals(DrFont)
Equalses the specified other.
protected bool Equals(DrFont other)
Parameters
other
DrFont
The other object.
Returns
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
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
Returns width
GetCharWidthPoints(char)
Returns width of the character (points).
public float GetCharWidthPoints(char c)
Parameters
c
char
The symbol to calculate.
Returns
Returns width
GetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
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
Returns size
GetTextWidthLis(string)
Gets the text width lis.
public int GetTextWidthLis(string text)
Parameters
text
string
The text to calculate.
Returns
Returns width
GetTextWidthPoints(string)
Gets the text width points.
public float GetTextWidthPoints(string text)
Parameters
text
string
The text to calculate.
Returns
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
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
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.