xtd 1.0.0
Loading...
Searching...
No Matches
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 [[nodiscard]] auto name() const noexcept -> const xtd::string&;
70
72
76 [[nodiscard]] static auto families() noexcept -> xtd::array<font_family>;
77
80 [[nodiscard]] static auto generic_monospace() noexcept -> font_family;
81
84 [[nodiscard]] static auto generic_sans_serif() noexcept -> font_family;
85
88 [[nodiscard]] static auto generic_serif() noexcept -> font_family;
90
92
97 [[nodiscard]] auto equals(const xtd::object& obj) const noexcept -> bool override;
101 [[nodiscard]] auto equals(const font_family& other) const noexcept -> bool override;
102
106 [[nodiscard]] auto get_cell_ascent(font_style style) const -> xtd::int32;
107
111 [[nodiscard]] auto get_cell_descent(font_style style) const -> xtd::int32;
112
116 [[nodiscard]] auto get_em_height(font_style style) const noexcept -> xtd::int32;
117
120 [[nodiscard]] auto get_hash_code() const noexcept -> xtd::usize override;
121
125 [[nodiscard]] auto get_line_spacing(font_style style) const -> xtd::int32;
126
131 [[nodiscard]] auto get_name(int32 language) const -> xtd::string;
132
136 [[nodiscard]] auto is_style_available(font_style style) const -> bool;
137
140 [[nodiscard]] auto to_string() const noexcept -> xtd::string 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:64
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 to_string() const noexcept -> xtd::string override
Converts this font_family to a human-readable string representation.
static auto generic_serif() noexcept -> font_family
Gets a generic serif font_family.
static auto generic_monospace() noexcept -> font_family
Gets a generic monospace font_family.
auto is_style_available(font_style style) const -> bool
Indicates whether the specified font_style enumeration is available.
auto name() const noexcept -> const xtd::string &
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.
auto get_name(int32 language) const -> xtd::string
Returns the name, in the specified language, of this font_family.
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_em_height(font_style style) const noexcept -> xtd::int32
Gets the height, in font design units, of the em square for the specified style.
font_family(text::generic_font_families generic_font_families)
Initializes a new xtd::drawing::font_family from the specified generic font family.
static auto generic_sans_serif() noexcept -> font_family
Gets a generic sans serif font_family.
font_family(const xtd::string &name)
Initializes a new xtd::drawing::font_family with the specified name.
auto equals(const xtd::object &obj) const noexcept -> bool override
Determines whether the specified object is equal to the current object.
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....
auto get_hash_code() const noexcept -> xtd::usize override
Serves as a hash function for a particular type.
static auto families() noexcept -> xtd::array< font_family >
Returns an array that contains all the font_family objects associated with the current graphics conte...
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:23
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
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
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:25
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
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 auto data() const noexcept -> const_pointer
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:197