xtd 0.2.0
Loading...
Searching...
No Matches
font_family.h
Go to the documentation of this file.
1
4#pragma once
5#include "../drawing_export.h"
6#include "font_style.h"
8#include <xtd/iequatable>
9#include <xtd/object>
10#include <xtd/ustring>
11#include <cstdint>
12#include <memory>
13#include <ostream>
14#include <stdexcept>
15#include <vector>
16
18namespace xtd {
20 namespace drawing {
22 namespace text {
23 class font_collection;
24 }
26
38 class drawing_export_ font_family final : public xtd::object, public xtd::iequatable<font_family> {
39 struct data;
40
41 public:
43
48 explicit font_family(const xtd::ustring& name);
49
52 explicit font_family(text::generic_font_families generic_font_families);
53
58 font_family(const xtd::ustring& name, const text::font_collection& font_collection);
60
63 font_family(const font_family& value);
65 font_family& operator =(const font_family& value);
67
69
73 const xtd::ustring& name() const noexcept;
75
77
81 static std::vector<font_family> families() noexcept;
82
85 static font_family generic_monospace() noexcept;
86
89 static font_family generic_sans_serif() noexcept;
90
93 static font_family generic_serif() noexcept;
95
97
99 bool equals(const font_family& value) const noexcept override;
100
104 int32 get_cell_ascent(font_style style) const;
105
109 int32 get_cell_descent(font_style style) const;
110
114 int32 get_em_height(font_style style) const noexcept;
115
119 int32 get_line_spacing(font_style style) const;
120
125 xtd::ustring get_name(int32 language) const;
126
130 bool is_style_available(font_style style) const;
131
134 xtd::ustring to_string() const noexcept override;
136
137 private:
138 std::shared_ptr<data> data_;
139 };
140 }
141}
Defines a group of type faces having a similar basic design and certain variations in styles....
Definition font_family.h:38
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.
font_family(const xtd::ustring &name)
Initializes a new xtd::drawing::font_family with the specified name.
const xtd::ustring & name() const noexcept
Gets the name of this font_family.
font_family(text::generic_font_families generic_font_families)
Initializes a new xtd::drawing::font_family from the specified generic font family.
Provides a base class for installed and private font collections.
Definition font_collection.h:22
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.h:18
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:32
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
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.h:17
generic_font_families
Specifies a generic font_family object.
Definition generic_font_families.h:19
#define drawing_export_
Define shared library export.
Definition drawing_export.h:13
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
@ text
The xtd::forms::status_bar_panel displays text in the standard font.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10