C# Class Xwt.Drawing.Font

Inheritance: XwtObject
Afficher le fichier Open project: TheBrainTech/xwt Class Usage Examples

Méthodes publiques

Méthode Description
Equals ( object obj ) : bool
FromName ( string name ) : Font

Creates a new font description from a string representation in the form "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]"

Creates a new font description from a string representation in the form "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]", where FAMILY-LIST is a comma separated list of families optionally terminated by a comma, STYLE_OPTIONS is a whitespace separated list of words where each WORD describes one of style, weight or stretch, and SIZE is a decimal number (size in points). Any one of the options may be absent. If FAMILY-LIST is absent, the default font family will be used. If STYLE-OPTIONS is missing, then all style options will be set to the default values. If SIZE is missing, the size in the resulting font description will be set to the default font size. If the font doesn't exist, it returns the system font.

GetAvailableFontFaces ( ) : ReadOnlyCollection

Gets the available variants of the font with varying weight, style and stretch.

Not all weights, styles or strech variants and combinations are available for every font or family. In case of an invalid combination, most toolkits fallback to a system default variant. GetAvailableFontFaces helps to retrieve only valid combinations for a specific font family.

GetAvailableFontFaces ( string fontFamily ) : ReadOnlyCollection

Gets the available family/font variants with varying weight, style and stretch.

Not all weights, styles or strech variants and combinations are available for every font or family. In case of an invalid combination, most toolkits fallback to a system default variant. GetAvailableFontFaces helps to retrieve only valid combinations for a specific font family.

GetHashCode ( ) : int
RegisterFontFromFile ( string fontPath ) : bool

Register a font file with the system font manager that is then accessible through FromName. The font is only available during the lifetime of the process.

ToString ( ) : string
WithFamily ( string fontFamily ) : Font

Returns a copy of the font using the provided font family

WithScaledSize ( double scale ) : Font
WithSettings ( Font fromFont ) : Font
WithSettings ( double size, FontStyle style, FontWeight weight, FontStretch stretch ) : Font
WithSize ( double size ) : Font
WithStretch ( FontStretch stretch ) : Font
WithStyle ( FontStyle style ) : Font
WithWeight ( FontWeight weight ) : Font

Private Methods

Méthode Description
Font ( object backend ) : System
Font ( object backend, Toolkit toolkit ) : System
FromName ( string name, Toolkit toolkit ) : Font
GetDefaultFont ( string unknownFont ) : string
GetSupportedFont ( string fontNames ) : string
InitForToolkit ( Toolkit tk ) : void
IsFontSupported ( string fontNames ) : bool
LoadInstalledFonts ( ) : void
RegisterFontFromFile ( string fontPath, Toolkit toolkit ) : bool

Method Details

Equals() public méthode

public Equals ( object obj ) : bool
obj object
Résultat bool

FromName() public static méthode

Creates a new font description from a string representation in the form "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]"
Creates a new font description from a string representation in the form "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]", where FAMILY-LIST is a comma separated list of families optionally terminated by a comma, STYLE_OPTIONS is a whitespace separated list of words where each WORD describes one of style, weight or stretch, and SIZE is a decimal number (size in points). Any one of the options may be absent. If FAMILY-LIST is absent, the default font family will be used. If STYLE-OPTIONS is missing, then all style options will be set to the default values. If SIZE is missing, the size in the resulting font description will be set to the default font size. If the font doesn't exist, it returns the system font.
public static FromName ( string name ) : Font
name string /// Font description ///
Résultat Font

GetAvailableFontFaces() public méthode

Gets the available variants of the font with varying weight, style and stretch.
Not all weights, styles or strech variants and combinations are available for every font or family. In case of an invalid combination, most toolkits fallback to a system default variant. GetAvailableFontFaces helps to retrieve only valid combinations for a specific font family.
public GetAvailableFontFaces ( ) : ReadOnlyCollection
Résultat ReadOnlyCollection

GetAvailableFontFaces() public static méthode

Gets the available family/font variants with varying weight, style and stretch.
Not all weights, styles or strech variants and combinations are available for every font or family. In case of an invalid combination, most toolkits fallback to a system default variant. GetAvailableFontFaces helps to retrieve only valid combinations for a specific font family.
public static GetAvailableFontFaces ( string fontFamily ) : ReadOnlyCollection
fontFamily string A comma separated list of families
Résultat ReadOnlyCollection

GetHashCode() public méthode

public GetHashCode ( ) : int
Résultat int

RegisterFontFromFile() public static méthode

Register a font file with the system font manager that is then accessible through FromName. The font is only available during the lifetime of the process.
public static RegisterFontFromFile ( string fontPath ) : bool
fontPath string Font path.
Résultat bool

ToString() public méthode

public ToString ( ) : string
Résultat string

WithFamily() public méthode

Returns a copy of the font using the provided font family
public WithFamily ( string fontFamily ) : Font
fontFamily string A comma separated list of families
Résultat Font

WithScaledSize() public méthode

public WithScaledSize ( double scale ) : Font
scale double
Résultat Font

WithSettings() public méthode

public WithSettings ( Font fromFont ) : Font
fromFont Font
Résultat Font

WithSettings() public méthode

public WithSettings ( double size, FontStyle style, FontWeight weight, FontStretch stretch ) : Font
size double
style FontStyle
weight FontWeight
stretch FontStretch
Résultat Font

WithSize() public méthode

public WithSize ( double size ) : Font
size double
Résultat Font

WithStretch() public méthode

public WithStretch ( FontStretch stretch ) : Font
stretch FontStretch
Résultat Font

WithStyle() public méthode

public WithStyle ( FontStyle style ) : Font
style FontStyle
Résultat Font

WithWeight() public méthode

public WithWeight ( FontWeight weight ) : Font
weight FontWeight
Résultat Font