xtd 0.2.0
font_family.h
Go to the documentation of this file.
1 #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 
18 namespace 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 
53 
58  font_family(const xtd::ustring& name, const text::font_collection& font_collection);
60 
62  ~font_family();
63  font_family(const font_family& value);
64  font_family();
65  font_family& operator =(const font_family& value);
67 
69 
73  static std::vector<font_family> families() noexcept;
74 
77  static font_family generic_monospace() noexcept;
78 
81  static font_family generic_sans_serif() noexcept;
82 
85  static font_family generic_serif() noexcept;
86 
89  const xtd::ustring& name() const noexcept;
91 
93 
95  bool equals(const font_family& value) const noexcept override;
96 
100  int32 get_cell_ascent(font_style style) const;
101 
105  int32 get_cell_descent(font_style style) const;
106 
110  int32 get_em_height(font_style style) const noexcept;
111 
115  int32 get_line_spacing(font_style style) const;
116 
121  xtd::ustring get_name(int32 language) const;
122 
126  bool is_style_available(font_style style) const;
127 
130  xtd::ustring to_string() const noexcept override;
132 
133  private:
134  std::shared_ptr<data> data_;
135  };
136  }
137 }
Defines a group of type faces having a similar basic design and certain variations in styles...
Definition: font_family.h:38
Contains xtd::drawing::font_style enum class.
generic_font_families
Specifies a generic font_family object.
Definition: generic_font_families.h:19
Provides a base class for installed and private font collections.
Definition: font_collection.h:22
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1063
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
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
font_style
Specifies style information applied to text. This enumeration has a flags attribute that allows a bit...
Definition: font_style.h:17
The xtd::forms::status_bar_panel displays text in the standard font.
Contains xtd::drawing::text::generic_font_families enum class.