xtd 0.2.0
font_family.hpp
Go to the documentation of this file.
1
4#pragma once
6#include "font_style.hpp"
8#include <xtd/iequatable>
9#include <xtd/object>
10#include <xtd/string>
11
13namespace xtd {
15 namespace drawing {
17 namespace text {
18 class font_collection;
19 }
21
33 class drawing_export_ font_family final : public xtd::object, public xtd::iequatable<font_family> {
34 struct data;
35
36 public:
38
43 explicit font_family(const xtd::string& name);
44
47 explicit font_family(text::generic_font_families generic_font_families);
48
53 font_family(const xtd::string& name, const text::font_collection& font_collection);
55
58 font_family(const font_family& value);
60 font_family& operator =(const font_family& value);
62
64
68 const xtd::string& name() const noexcept;
70
72
76 static xtd::array<font_family> families() noexcept;
77
80 static font_family generic_monospace() noexcept;
81
85
88 static font_family generic_serif() noexcept;
90
92
97 bool equals(const xtd::object& obj) const noexcept override;
101 bool equals(const font_family& other) const noexcept override;
102
107
112
116 int32 get_em_height(font_style style) const noexcept;
117
120 xtd::size get_hash_code() const noexcept override;
121
126
131 xtd::string get_name(int32 language) const;
132
137
140 xtd::string to_string() const noexcept override;
142
143 private:
144 xtd::sptr<data> data_;
145 };
146 }
147}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:61
int32 get_line_spacing(font_style style) const
Returns the line spacing, in design units, of the font_family of the specified style....
xtd::string to_string() const noexcept override
Converts this font_family to a human-readable string representation.
int32 get_cell_ascent(font_style style) const
Returns the cell ascent, in design units, of the font_family of the specified style.
static font_family generic_monospace() noexcept
Gets a generic monospace font_family.
static font_family generic_serif() noexcept
Gets a generic serif font_family.
const xtd::string & name() const noexcept
Gets the name of this 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.
int32 get_cell_descent(font_style style) const
Returns the cell descent, in design units, of the font_family of the specified style.
static font_family generic_sans_serif() noexcept
Gets a generic sans serif font_family.
xtd::size get_hash_code() const noexcept override
Serves as a hash function for a particular type.
font_family(text::generic_font_families generic_font_families)
Initializes a new xtd::drawing::font_family from the specified generic font family.
bool is_style_available(font_style style) const
Indicates whether the specified font_style enumeration is available.
font_family(const xtd::string &name)
Initializes a new xtd::drawing::font_family with the specified name.
static xtd::array< font_family > families() noexcept
Returns an array that contains all the font_family objects associated with the current graphics conte...
xtd::string get_name(int32 language) const
Returns the name, in the specified language, of this font_family.
int32 get_em_height(font_style style) const noexcept
Gets the height, in font design units, of the em square for the specified style.
bool equals(const xtd::object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
Provides a base class for installed and private font collections.
Definition font_collection.hpp:22
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
Contains drawing_export_ keyword.
Contains xtd::drawing::font_style enum class.
Contains xtd::drawing::text::generic_font_families enum class.
font_style
Specifies style information applied to text. This enumeration has a flags attribute that allows a bit...
Definition font_style.hpp:17
generic_font_families
Specifies a generic font_family object.
Definition generic_font_families.hpp:19
#define drawing_export_
Define shared library export.
Definition drawing_export.hpp:13
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
@ other
The operating system is other.
Definition platform_id.hpp:58
The xtd::drawing::text namespace provides advanced GDI+ typography functionality.
Definition font_collection.hpp:14
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
constexpr const_pointer data() const noexcept
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:201
Stores an ordered pair of integers, which specify a height and width.
Definition size.hpp:31