C# Класс Xwt.Drawing.Font

Наследование: XwtObject
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

Equals() публичный Метод

public Equals ( object obj ) : bool
obj object
Результат bool

FromName() публичный статический Метод

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 ///
Результат Font

GetAvailableFontFaces() публичный Метод

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
Результат ReadOnlyCollection

GetAvailableFontFaces() публичный статический Метод

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
Результат ReadOnlyCollection

GetHashCode() публичный Метод

public GetHashCode ( ) : int
Результат int

RegisterFontFromFile() публичный статический Метод

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.
Результат bool

ToString() публичный Метод

public ToString ( ) : string
Результат string

WithFamily() публичный Метод

Returns a copy of the font using the provided font family
public WithFamily ( string fontFamily ) : Font
fontFamily string A comma separated list of families
Результат Font

WithScaledSize() публичный Метод

public WithScaledSize ( double scale ) : Font
scale double
Результат Font

WithSettings() публичный Метод

public WithSettings ( Font fromFont ) : Font
fromFont Font
Результат Font

WithSettings() публичный Метод

public WithSettings ( double size, FontStyle style, FontWeight weight, FontStretch stretch ) : Font
size double
style FontStyle
weight FontWeight
stretch FontStretch
Результат Font

WithSize() публичный Метод

public WithSize ( double size ) : Font
size double
Результат Font

WithStretch() публичный Метод

public WithStretch ( FontStretch stretch ) : Font
stretch FontStretch
Результат Font

WithStyle() публичный Метод

public WithStyle ( FontStyle style ) : Font
style FontStyle
Результат Font

WithWeight() публичный Метод

public WithWeight ( FontWeight weight ) : Font
weight FontWeight
Результат Font