xtd 0.2.0
xtd::drawing::font_family Class Referencefinal

Definition

Defines a group of type faces having a similar basic design and certain variations in styles. This class cannot be inherited.

class drawing_export_ font_family final : public xtd::object
Inheritance
xtd::objectxtd::drawing::font_family
Namespace
xtd::drawing
Library
xtd.drawing
Examples:
font_families.cpp.

Constructors

 font_family (const xtd::ustring &name)
 Initializes a new xtd::drawing::font_family with the specified name. More...
 
 font_family (text::generic_font_families generic_font_families)
 Initializes a new xtd::drawing::font_family from the specified generic font family. More...
 
 font_family (const xtd::ustring &name, const text::font_collection &font_collection)
 Initializes a new xtd::drawing::font_family in the specified font_collection with the specified name. More...
 

Properties

const xtd::ustringname () const noexcept
 Gets the name of this font_family. More...
 
static std::vector< font_familyfamilies () noexcept
 Returns an array that contains all the font_family objects associated with the current graphics context. More...
 
static font_family generic_monospace () noexcept
 Gets a generic monospace font_family. More...
 
static font_family generic_sans_serif () noexcept
 Gets a generic sans serif font_family. More...
 
static font_family generic_serif () noexcept
 Gets a generic serif font_family. More...
 

Methods

bool equals (const font_family &value) const noexcept override
 
int32 get_cell_ascent (font_style style) const
 Returns the cell ascent, in design units, of the font_family of the specified style. More...
 
int32 get_cell_descent (font_style style) const
 Returns the cell descent, in design units, of the font_family of the specified style. More...
 
int32 get_em_height (font_style style) const noexcept
 Gets the height, in font design units, of the em square for the specified style. More...
 
int32 get_line_spacing (font_style style) const
 Returns the line spacing, in design units, of the font_family of the specified style. The line spacing is the vertical distance between the base lines of two consecutive lines of text. More...
 
xtd::ustring get_name (int32 language) const
 Returns the name, in the specified language, of this font_family. More...
 
bool is_style_available (font_style style) const
 Indicates whether the specified font_style enumeration is available. More...
 
xtd::ustring to_string () const noexcept override
 Converts this font_family to a human-readable string representation. More...
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object. More...
 
bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object. More...
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type. More...
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance. More...
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const noexcept
 Creates a shallow copy of the current object. More...
 
- Public Member Functions inherited from xtd::iequatable< font_family >
virtual bool equals (const font_family &) const noexcept=0
 Indicates whether the current object is equal to another object of the same type. More...
 
- Static Public Member Functions inherited from xtd::object
static bool equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are considered equal. More...
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance. More...
 

Constructor & Destructor Documentation

◆ font_family() [1/3]

xtd::drawing::font_family::font_family ( const xtd::ustring name)
explicit

Initializes a new xtd::drawing::font_family with the specified name.

Parameters
nameThe name of the new xtd::drawing::font_family.
Exceptions
std::invalid_argumentname is an empty string ("") - or - name specifies a font that is not installed on the computer running the application.

◆ font_family() [2/3]

xtd::drawing::font_family::font_family ( text::generic_font_families  generic_font_families)
explicit

Initializes a new xtd::drawing::font_family from the specified generic font family.

Parameters
generic_font_familiesThe xtd::drawing::text::generic_font_families from which to create the new font_family.

◆ font_family() [3/3]

xtd::drawing::font_family::font_family ( const xtd::ustring name,
const text::font_collection font_collection 
)

Initializes a new xtd::drawing::font_family in the specified font_collection with the specified name.

Parameters
nameThe name of the new xtd::drawing::font_family.
font_collectionThe FontCollection that contains this FontFamily.
Exceptions
std::invalid_argumentname is an empty string ("") - or - name specifies a font that is not installed on the computer running the application - or - name specifies a font that is not a part of specified font_collection..

Member Function Documentation

◆ families()

static std::vector<font_family> xtd::drawing::font_family::families ( )
staticnoexcept

Returns an array that contains all the font_family objects associated with the current graphics context.

Returns
An array of font_family objects associated with the current graphics context.
Examples:
font_families.cpp.

◆ generic_monospace()

static font_family xtd::drawing::font_family::generic_monospace ( )
staticnoexcept

Gets a generic monospace font_family.

Returns
A font_family that represents a generic monospace font.
Examples:
font.cpp, system_report.cpp, and test_forms.cpp.

◆ generic_sans_serif()

static font_family xtd::drawing::font_family::generic_sans_serif ( )
staticnoexcept

Gets a generic sans serif font_family.

Returns
A font_family that represents a generic sans serif font.
Examples:
calculator.cpp, and font_box.cpp.

◆ generic_serif()

static font_family xtd::drawing::font_family::generic_serif ( )
staticnoexcept

Gets a generic serif font_family.

Returns
A font_family that represents a generic serif font.
Examples:
font.cpp.

◆ get_cell_ascent()

int32 xtd::drawing::font_family::get_cell_ascent ( font_style  style) const

Returns the cell ascent, in design units, of the font_family of the specified style.

Parameters
styleA font_style that contains style information for the font.
Returns
The cell ascent for this font_family that uses the specified font_style.

◆ get_cell_descent()

int32 xtd::drawing::font_family::get_cell_descent ( font_style  style) const

Returns the cell descent, in design units, of the font_family of the specified style.

Parameters
styleA font_style that contains style information for the font.
Returns
The cell ascent for this font_family that uses the specified font_style.

◆ get_em_height()

int32 xtd::drawing::font_family::get_em_height ( font_style  style) const
noexcept

Gets the height, in font design units, of the em square for the specified style.

Parameters
styleA font_style that contains style information for the font.
Returns
The height of the em square.

◆ get_line_spacing()

int32 xtd::drawing::font_family::get_line_spacing ( font_style  style) const

Returns the line spacing, in design units, of the font_family of the specified style. The line spacing is the vertical distance between the base lines of two consecutive lines of text.

Parameters
styleA font_style that contains style information for the font.
Returns
The distance between two consecutive lines of text.

◆ get_name()

xtd::ustring xtd::drawing::font_family::get_name ( int32  language) const

Returns the name, in the specified language, of this font_family.

Parameters
languageThe language in which the name is returned.
Returns
A String that represents the name, in the specified language, of this font_family.
Remarks
To indicate language neutral, you should specify 0 for the language parameter. For a listing of the available languages and sublanguages, see the Winnt.h header file. If you have Visual Studio installed, this header file can typically be found relative to the Visual Studio installation directory at \VC.

◆ is_style_available()

bool xtd::drawing::font_family::is_style_available ( font_style  style) const

Indicates whether the specified font_style enumeration is available.

Parameters
styleThe font_style to test.
Returns
true if the specified font_style is available; otherwise, false.

◆ name()

const xtd::ustring& xtd::drawing::font_family::name ( ) const
noexcept

Gets the name of this font_family.

Returns
A String that represents the name of this font_family.

◆ to_string()

xtd::ustring xtd::drawing::font_family::to_string ( ) const
overridevirtualnoexcept

Converts this font_family to a human-readable string representation.

Returns
The string that represents this font_family.

Reimplemented from xtd::object.


The documentation for this class was generated from the following file: