Class FontDescriptionX
- Namespace
- VisioForge.Core.Types.X
- Assembly
- VisioForge.Core.dll
Represents a description of a font, including its family name and available font faces (styles). This class is used to enumerate and select fonts for text rendering within the VisioForge X engine.
public class FontDescriptionX : IComparableInheritance
Implements
Inherited Members
Examples
// Assume 'fontList' is a collection of FontDescriptionX objects obtained from the system.
// var fontList = VisioForge.Core.FontManager.GetAvailableFonts();
foreach (var font in fontList)
{
Console.WriteLine($"Font Family: {font.Name}");
if (font.Faces != null && font.Faces.Length > 0)
{
Console.WriteLine($" Available Faces: {string.Join(", ", font.Faces)}");
}
}
// To select a specific font for text rendering (conceptual):
// var selectedFont = fontList.FirstOrDefault(f => f.Name == "Arial");
// if (selectedFont != null)
// {
// textOverlay.Font = selectedFont;
// }
Remarks
This class wraps a Pango FontFamily object, providing a .NET-friendly representation of font information.
It is primarily used for text overlay and rendering features where specific font selection is required.
Properties
Faces
Gets an array of available font faces (styles) for this font family (e.g., "Regular", "Bold", "Italic").
public string[] Faces { get; }Property Value
- string[]
Name
Gets the family name of the font (e.g., "Arial", "Times New Roman").
public string Name { get; }Property Value
Methods
CompareTo(object)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. The comparison is based on the font family name.
public int CompareTo(object obj)Parameters
objobject-
An object to compare with this instance. It is expected to be another VisioForge.Core.Types.X.FontDescriptionX instance.
Returns
- int
-
A value that indicates the relative order of the objects being compared.
Value Meaning Less than zero This instance precedes objin the sort order.Zero This instance occurs in the same position in the sort order as obj.Greater than zero This instance follows objin the sort order.
ToString()
Returns a string that represents the current VisioForge.Core.Types.X.FontDescriptionX instance. The string includes the font family name and a comma-separated list of its available faces in parentheses.
public override string ToString()