1.1.0
font-size.hpp
1 #ifndef FONT_CHEF_FONT_SIZE_HPP
2 #define FONT_CHEF_FONT_SIZE_HPP
3 
9 #include "font-chef/font-chef-export.h"
10 #include "font-chef/font-size.h"
11 
12 namespace fc {
18  struct FONT_CHEF_EXPORT font_size {
23 
25  font_size() : data() {};
26 
36  font_size(fc_font_size const & fs) : data(fs) {} //NOLINT
37 
42  font_size(font_size const & other) = default;
43 
49  font_size(float value, enum fc_font_size_type type) : data{value, type} {}
50  };
51 
59  FONT_CHEF_EXPORT inline font_size px(float v) {
60  return font_size(v, fc_size_type__px);
61  }
62 
70  FONT_CHEF_EXPORT inline font_size pt(float v) {
71  return font_size(v, fc_size_type__pt);
72  }
73 }
74 
75 #endif //FONT_CHEF_FONT_SIZE_HPP
fc::font_size::font_size
font_size(fc_font_size const &fs)
Creates a fc::font_size instance from a fc_font_size structure, copying its contents.
Definition: font-size.hpp:36
fc_font_size
Specifies the size of a font either in pixels or in points.
Definition: font-size.h:33
fc::font_size::font_size
font_size(float value, enum fc_font_size_type type)
Constructs a font size from a value and a type.
Definition: font-size.hpp:49
fc_font_size_type
fc_font_size_type
Used to tell if a fc_font_size value is specified in pixels or in points.
Definition: font-size.h:24
fc::px
font_size px(float v)
Constructs a fc::font_size instance in pixels with specified value.
Definition: font-size.hpp:59
fc::font_size::font_size
font_size()
Definition: font-size.hpp:25
fc::pt
font_size pt(float v)
Constructs a fc::font_size instance in points with specified value.
Definition: font-size.hpp:70
fc::font_size::data
fc_font_size data
the actual fc_font_size data. You can and are encouraged to use it directly, if needed.
Definition: font-size.hpp:22
fc::font_size
A wrapper class for fc_font_size.
Definition: font-size.hpp:18