xtd 1.0.0
Loading...
Searching...
No Matches
xtd::drawing::font_family Class Referencefinal
Inheritance diagram for xtd::drawing::font_family:
xtd::object xtd::iequatable< font_family > xtd::interface xtd::extensions::equality_operators< font_family, iequatable< font_family > >

Definition

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

font_family(const xtd::string &name)
Initializes a new xtd::drawing::font_family with the specified name.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
Inheritance
xtd::objectxtd::drawing::font_family
Namespace
xtd::drawing
Library
xtd.drawing

Public Constructors

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

Public Properties

auto name () const noexcept -> const xtd::string &
 Gets the name of this font_family.

Public Methods

auto equals (const xtd::object &obj) const noexcept -> bool override
 Determines whether the specified object is equal to the current object.
auto equals (const font_family &other) const noexcept -> bool override
 Determines whether the specified object is equal to the current object.
auto get_cell_ascent (font_style style) const -> xtd::int32
 Returns the cell ascent, in design units, of the font_family of the specified style.
auto get_cell_descent (font_style style) const -> xtd::int32
 Returns the cell descent, in design units, of the font_family of the specified style.
auto get_em_height (font_style style) const noexcept -> xtd::int32
 Gets the height, in font design units, of the em square for the specified style.
auto get_hash_code () const noexcept -> xtd::usize override
 Serves as a hash function for a particular type.
auto get_line_spacing (font_style style) const -> xtd::int32
 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.
auto get_name (int32 language) const -> xtd::string
 Returns the name, in the specified language, of this font_family.
auto is_style_available (font_style style) const -> bool
 Indicates whether the specified font_style enumeration is available.
auto to_string () const noexcept -> xtd::string override
 Converts this font_family to a human-readable string representation.

Public Static Properties

static auto families () noexcept -> xtd::array< font_family >
 Returns an array that contains all the font_family objects associated with the current graphics context.
static auto generic_monospace () noexcept -> font_family
 Gets a generic monospace font_family.
static auto generic_sans_serif () noexcept -> font_family
 Gets a generic sans serif font_family.
static auto generic_serif () noexcept -> font_family
 Gets a generic serif font_family.

Additional Inherited Members

 object ()=default
 Create a new instance of the ultimate base class object.
virtual auto get_type () const noexcept -> type_object
 Gets the type of the current instance.
template<typename object_t>
auto memberwise_clone () const -> xtd::unique_ptr_object< object_t >
 Creates a shallow copy of the current object.
virtual auto equals (const font_family &) const noexcept -> bool=0
 Indicates whether the current object is equal to another object of the same type.
template<typename object_a_t, typename object_b_t>
static auto equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are considered equal.
template<typename object_a_t, typename object_b_t>
static auto reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are the same instance.

Constructor & Destructor Documentation

◆ font_family() [1/3]

xtd::drawing::font_family::font_family ( const xtd::string & 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::string & 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

◆ name()

auto xtd::drawing::font_family::name ( ) const -> const xtd::string &
nodiscardnoexcept

Gets the name of this font_family.

Returns
A String that represents the name of this font_family.

◆ families()

auto xtd::drawing::font_family::families ( ) -> xtd::array< font_family >
staticnodiscardnoexcept

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.

◆ generic_monospace()

auto xtd::drawing::font_family::generic_monospace ( ) -> font_family
staticnodiscardnoexcept

Gets a generic monospace font_family.

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

◆ generic_sans_serif()

auto xtd::drawing::font_family::generic_sans_serif ( ) -> font_family
staticnodiscardnoexcept

Gets a generic sans serif font_family.

Returns
A font_family that represents a generic sans serif font.

◆ generic_serif()

auto xtd::drawing::font_family::generic_serif ( ) -> font_family
staticnodiscardnoexcept

Gets a generic serif font_family.

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

◆ equals() [1/2]

auto xtd::drawing::font_family::equals ( const xtd::object & obj) const -> bool
nodiscardoverridevirtualnoexcept

Determines whether the specified object is equal to the current object.

Parameters
objThe object to compare with the current object.
Returns
true if the specified object is equal to the current object. otherwise, false.

Reimplemented from xtd::object.

◆ equals() [2/2]

auto xtd::drawing::font_family::equals ( const font_family & other) const -> bool
nodiscardoverridenoexcept

Determines whether the specified object is equal to the current object.

Parameters
otherThe object to compare with the current object.
Returns
true if the specified object is equal to the current object. otherwise, false.

◆ get_cell_ascent()

auto xtd::drawing::font_family::get_cell_ascent ( font_style style) const -> xtd::int32
nodiscard

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()

auto xtd::drawing::font_family::get_cell_descent ( font_style style) const -> xtd::int32
nodiscard

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()

auto xtd::drawing::font_family::get_em_height ( font_style style) const -> xtd::int32
nodiscardnoexcept

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_hash_code()

auto xtd::drawing::font_family::get_hash_code ( ) const -> xtd::usize
nodiscardoverridevirtualnoexcept

Serves as a hash function for a particular type.

Returns
A hash code for the current object.

Reimplemented from xtd::object.

◆ get_line_spacing()

auto xtd::drawing::font_family::get_line_spacing ( font_style style) const -> xtd::int32
nodiscard

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()

auto xtd::drawing::font_family::get_name ( int32 language) const -> xtd::string
nodiscard

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\PlatformSDK\Include.

◆ is_style_available()

auto xtd::drawing::font_family::is_style_available ( font_style style) const -> bool
nodiscard

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.

◆ to_string()

auto xtd::drawing::font_family::to_string ( ) const -> xtd::string
nodiscardoverridevirtualnoexcept

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: