#ifndef slic3r_TextConfiguration_hpp_ #define slic3r_TextConfiguration_hpp_ #include #include #include namespace Slic3r { // user defined font property struct FontProp { // define extra space between letters, negative mean closer letter std::optional char_gap; // define extra space between lines, negative mean closer lines std::optional line_gap; // Z depth of text [in mm] float emboss; // positive value mean wider character shape // negative value mean tiner character shape std::optional boldness; // [in mm] // positive value mean italic of character (CW) // negative value mean CCW skew (unItalic) std::optional skew; // TODO: add enum class Align: center/left/right ////// // Duplicit data to wxFontDescriptor // used for store/load .3mf file ////// // Height of letter [in mm], // duplicit to wxFont::PointSize float size_in_mm; // Define type of font std::optional family; std::optional face_name; std::optional style; std::optional weight; FontProp(float line_height = 10.f, float depth = 2.f) : emboss(depth), size_in_mm(line_height) {} }; // represent selected font // Name must be human readable is visible in gui // (Path + Type) must define how to open font for using on different OS struct FontItem { std::string name; std::string path; enum class Type; Type type; FontProp prop; FontItem() : type(Type::undefined){} // set undefined type // when name is empty than Font item was loaded from .3mf file // and potentionaly it is not reproducable FontItem(const std::string &name, const std::string &path, Type type, const FontProp & prop) : name(name), path(path), type(type), prop(prop) {} // define data stored in path enum class Type { undefined = 0, file_path, // TrueTypeFont file loacation on computer - for privacy: path is NOT stored into 3mf // wx font descriptors are platform dependent wx_win_font_descr, // path is font descriptor generated by wxWidgets on windows wx_lin_font_descr, // path is font descriptor generated by wxWidgets on windows wx_mac_font_descr // path is font descriptor generated by wxWidgets on windows }; }; // Font item name inside list is unique // FontList is not map beacuse items order matters (view of list) using FontList = std::vector; // define how to create 'Text volume' struct TextConfiguration { // define font FontItem font_item; std::string text = "None"; TextConfiguration() = default; // optional needs empty constructor TextConfiguration(const FontItem &font_item, const std::string &text) : font_item(font_item), text(text) {} }; } // namespace Slic3r #endif // slic3r_TextConfiguration_hpp_