demonstrates the use of xtd::drawing::font_families method, which returns an array of xtd::drawing::font_family objects associated with the current graphics context.
#include <xtd/forms/application>
#include <xtd/forms/form>
#include <xtd/forms/label>
#include <xtd/forms/list_box>
namespace font_family_example {
class form1 :
public form {
public:
form1() {
text("Font families example");
start_position(form_start_position::manual);
location({300, 150});
client_size({400, 500});
label_font_famlies_count.parent(*this);
label_font_famlies_count.auto_size(true);
label_font_famlies_count.location({20, 20});
list_box_font_families.parent(*this);
list_box_font_families.bounds({20, 60, 360, 420});
list_box_font_families.anchor(anchor_styles::left | anchor_styles::top | anchor_styles::right | anchor_styles::bottom);
std::vector<drawing::font_family> font_families = drawing::font_family::families();
label_font_famlies_count.text(ustring::format("There are {0} font families :", font_families.size()));
list_box_font_families.items().push_back(fontFamily.name());
}
private:
label label_font_famlies_count;
};
}
auto main()->int {
application::run(font_family_example::form1 {});
}
Defines a group of type faces having a similar basic design and certain variations in styles....
Definition font_family.h:38
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.h:11
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10