7#include "otype_utilities.hpp"
8#include "font_weight.hpp"
9#include "../utility/utility.hpp"
13hi_export_module(hikogui.font.otype_os2);
15hi_export
namespace hi {
inline namespace v1 {
33 big_uint16_buf_t version;
37 big_uint16_buf_t type;
55 big_uint16_buf_t selection;
68 otype_fword_buf_t x_height;
69 otype_fword_buf_t cap_height;
77 bool condensed =
false;
79 bool monospace =
false;
81 float x_height = 0.0f;
82 float cap_height = 0.0f;
86 hi_check(*
header.version <= 5,
"'OS/2' version must be between 0 and 5");
112 switch (
header.panose.weight) {
114 r.weight = font_weight::thin;
117 r.weight = font_weight::extra_light;
120 r.weight = font_weight::light;
123 r.weight = font_weight::regular;
126 r.weight = font_weight::medium;
129 r.weight = font_weight::semi_bold;
132 r.weight = font_weight::bold;
135 r.weight = font_weight::extra_bold;
138 r.weight = font_weight::black;
141 r.weight = font_weight::extra_black;
147 switch (
header.panose.proportion) {
174 if (*
header.version >= 2) {
DOXYGEN BUG.
Definition algorithm.hpp:16
hi_export constexpr font_weight font_weight_from_int(numeric_integral auto rhs)
Convert a font weight value between 50 and 1000 to a font weight.
Definition font_weight.hpp:60
font_weight
Definition font_weight.hpp:18
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
@ italic
A font that is italic.
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377