xtd 0.2.0
Loading...
Searching...
No Matches
font.h
Go to the documentation of this file.
1
4#pragma once
5#include "../drawing_export.h"
6#include "font_family.h"
7#include "graphics_unit.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 forms {
21 namespace native {
22 class font_dialog;
23 }
24 }
26
28 namespace drawing {
30 class graphics;
31 class system_fonts;
33
45 class drawing_export_ font final : public xtd::object, public xtd::iequatable<font> {
46 struct data;
47
48 public:
50
55 font(const font& prototype, float em_size);
56
61 font(const font& prototype, float em_size, font_style style);
62
66 font(const font& prototype, font_style style);
67
77 font(xtd::string family_name, float em_size, font_style style, graphics_unit unit, xtd::byte gdi_char_set, bool gdi_vertical_font);
78
88 font(const drawing::font_family& font_family, float em_size, font_style style, graphics_unit unit, xtd::byte gdi_char_set, bool gdi_vertical_font);
89
98 font(xtd::string family_name, float em_size, font_style style, graphics_unit unit, xtd::byte gdi_char_set);
99
108 font(const drawing::font_family& font_family, float em_size, font_style style, graphics_unit unit, xtd::byte gdi_char_set);
109
116 font(xtd::string family_name, float em_size, font_style style, graphics_unit unit);
117
124 font(const drawing::font_family& font_family, float em_size, font_style style, graphics_unit unit);
125
131 font(xtd::string family_name, float em_size, font_style style);
132
138 font(const drawing::font_family& font_family, float em_size, font_style style);
139
145 font(xtd::string family_name, float em_size, graphics_unit unit);
146
153
158 font(xtd::string family_name, float em_size);
159
164 font(const drawing::font_family& font_family, float em_size);
166
168 font(const font& value);
169 font& operator =(const font& value);
170 ~font();
172
174
178 bool bold() const noexcept;
179
183 drawing::font_family font_family() const noexcept;
184
210 xtd::byte gdi_char_set() const noexcept;
211
216 bool gdi_vertical_font() const noexcept;
217
220 intptr handle() const noexcept;
221
228 int32 height() const noexcept;
229
233 bool is_system_font() const noexcept;
234
237 bool italic() const noexcept;
238
241 const xtd::string& name() const noexcept;
242
245 const xtd::string& original_font_name() const noexcept;
246
249 float size() const noexcept;
250
253 float size_in_points() const noexcept;
254
257 bool strikeout() const noexcept;
258
261 font_style style() const noexcept;
262
265 bool underline() const noexcept;
266
269 graphics_unit unit() const noexcept;
271
273
275 using object::equals;
276 bool equals(const font& value) const noexcept override;
277
282 float get_height() const;
283
289 float get_height(const graphics& graphics) const;
290
295 float get_height(float dpi) const;
296
300 intptr to_hfont() const;
301
304 xtd::string to_string() const noexcept override;
306
308
313 static font from_hdc(const intptr hdc);
314
318 static font from_hfont(const intptr hfont);
320
321 private:
322 friend class graphics;
323 friend class system_fonts;
324 friend class xtd::forms::native::font_dialog;
325 font();
326 explicit font(intptr hfont);
327
328 xtd::sptr<data> data_;
329 };
330 }
331}
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
Defines a particular format for text, including font face, size, and style attributes....
Definition font.h:45
font(const font &prototype, float em_size)
IInitializes a new Font that uses the specified existing xtd::drawing::font and size.
font(xtd::string family_name, float em_size, font_style style, graphics_unit unit, xtd::byte gdi_char_set, bool gdi_vertical_font)
IInitializes a new xtd::drawing::font using the specified size, style, unit, and character set.
font(const drawing::font_family &font_family, float em_size, font_style style, graphics_unit unit)
Initializes a new xtd::drawing::font using the specified size, style and unit.
font(const drawing::font_family &font_family, float em_size, graphics_unit unit)
Initializes a new xtd::drawing::font using the specified size and unit.
font(const drawing::font_family &font_family, float em_size, font_style style, graphics_unit unit, xtd::byte gdi_char_set)
Initializes a new xtd::drawing::font using the specified size, style, unit, and character set.
font(xtd::string family_name, float em_size, font_style style, graphics_unit unit, xtd::byte gdi_char_set)
Initializes a new xtd::drawing::font using the specified size, style, unit, and character set.
font(const drawing::font_family &font_family, float em_size, font_style style, graphics_unit unit, xtd::byte gdi_char_set, bool gdi_vertical_font)
Initializes a new xtd::drawing::font using the specified size, style, unit, and character set.
font(xtd::string family_name, float em_size, graphics_unit unit)
Initializes a new xtd::drawing::font using the specified size and unit.
font(const drawing::font_family &font_family, float em_size, font_style style)
Initializes a new xtd::drawing::font using the specified size and style.
font(const font &prototype, float em_size, font_style style)
IInitializes a new Font that uses the specified existing xtd::drawing::font, size and font_style enum...
font(const drawing::font_family &font_family, float em_size)
Initializes a new xtd::drawing::font using the specified size.
font(xtd::string family_name, float em_size)
Initializes a new xtd::drawing::font using the specified size and unit.
font(const font &prototype, font_style style)
IInitializes a new Font that uses the specified existing xtd::drawing::font and font_style enumeratio...
font(xtd::string family_name, float em_size, font_style style)
Initializes a new xtd::drawing::font using the specified size and style.
bool bold() const noexcept
Gets a value that indicates whether this xtd::drawing::font is bold.
font(xtd::string family_name, float em_size, font_style style, graphics_unit unit)
Initializes a new xtd::drawing::font using the specified size, style and unit.
Defines an object used to draw lines and curves. This class cannot be inherited.
Definition graphics.h:70
Stores an ordered pair of integers, which specify a height and width.
Definition size.h:31
Specifies the fonts used to display text in Windows display elements.
Definition system_fonts.h:25
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_family class.
Contains xtd::drawing::graphics_unit 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
#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
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.h:23
uint8_t byte
Represents a 8-bit unsigned integer.
Definition byte.h:23
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.h:25
graphics_unit
Specifies the unit of measure for the given data. This enumeration has a flags attribute that allows ...
Definition graphics_unit.h:17
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10