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/string>
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::string& name);
49
52 explicit font_family(text::generic_font_families generic_font_families);
53
58 font_family(const xtd::string& 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::string& 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 using object::equals;
100 bool equals(const font_family& value) const noexcept override;
101
105 int32 get_cell_ascent(font_style style) const;
106
110 int32 get_cell_descent(font_style style) const;
111
115 int32 get_em_height(font_style style) const noexcept;
116
120 int32 get_line_spacing(font_style style) const;
121
126 xtd::string get_name(int32 language) const;
127
131 bool is_style_available(font_style style) const;
132
135 xtd::string to_string() const noexcept override;
137
138 private:
139 xtd::sptr<data> data_;
140 };
141 }
142}
Represents text as a sequence of character units.
Definition basic_string.h:79
Defines a group of type faces having a similar basic design and certain variations in styles....
Definition font_family.h:38
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.
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)
Initializes a new xtd::drawing::font_family with the specified name.
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:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
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
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.h:25
@ 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