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/ustring>
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::ustring 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::ustring 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::ustring 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::ustring 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::ustring family_name, float em_size, graphics_unit unit);
146
153
158 font(xtd::ustring 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::ustring& name() const noexcept;
242
245 const xtd::ustring& 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 bool equals(const font& value) const noexcept override;
276
281 float get_height() const;
282
288 float get_height(const graphics& graphics) const;
289
294 float get_height(float dpi) const;
295
299 intptr to_hfont() const;
300
303 xtd::ustring to_string() const noexcept override;
305
307
312 static font from_hdc(const intptr hdc);
313
317 static font from_hfont(const intptr hfont);
319
320 private:
321 friend class graphics;
322 friend class system_fonts;
323 friend class xtd::forms::native::font_dialog;
324 font();
325 explicit font(intptr hfont);
326
327 std::shared_ptr<data> data_;
328 };
329 }
330}
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(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(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(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(const font &prototype, font_style style)
IInitializes a new Font that uses the specified existing xtd::drawing::font and font_style enumeratio...
font(xtd::ustring 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::ustring family_name, float em_size, graphics_unit unit)
Initializes a new xtd::drawing::font using the specified size and unit.
font(xtd::ustring family_name, float em_size)
Initializes a new xtd::drawing::font using the specified size and unit.
font(xtd::ustring 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(xtd::ustring 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(xtd::ustring 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: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_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
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
intmax_t intptr
Represent a pointer or a handle.
Definition types.h:153
uint_least8_t byte
Represents a 8-bit unsigned integer.
Definition types.h:41
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