Rename FontItem to EmbossStyle
This commit is contained in:
parent
ee03ed6d07
commit
003c7fc54f
16 changed files with 294 additions and 324 deletions
|
@ -136,7 +136,7 @@ TEST_CASE("CutSurface in 3mf", "[Emboss]")
|
|||
CHECK(mv_text->text_configuration.has_value());
|
||||
TextConfiguration &tc = *mv_text->text_configuration;
|
||||
/* // Need GUI to load font by wx
|
||||
std::optional<wxFont> wx_font = GUI::WxFontUtils::load_wxFont(tc.font_item.path);
|
||||
std::optional<wxFont> wx_font = GUI::WxFontUtils::load_wxFont(tc.style.path);
|
||||
CHECK(wx_font.has_value());
|
||||
Emboss::FontFileWithCache ff(GUI::WxFontUtils::create_font_file(*wx_font));
|
||||
CHECK(ff.font_file != nullptr);
|
||||
|
@ -157,7 +157,7 @@ TEST_CASE("CutSurface in 3mf", "[Emboss]")
|
|||
|
||||
std::pair<float, float> z_range{mesh_bb_tr.min.z(), mesh_bb_tr.max.z()};
|
||||
|
||||
FontProp fp = tc.font_item.prop;
|
||||
FontProp fp = tc.style.prop;
|
||||
ExPolygons shapes = Emboss::text2shapes(ff, tc.text.c_str(), fp);
|
||||
double shape_scale = Emboss::get_shape_scale(fp, *ff.font_file);
|
||||
|
||||
|
@ -165,7 +165,7 @@ TEST_CASE("CutSurface in 3mf", "[Emboss]")
|
|||
cut_projection_tr, shape_scale, get_extents(shapes), z_range);
|
||||
|
||||
float projection_ratio = -z_range.first / (z_range.second - z_range.first);
|
||||
SurfaceCut cut = cut_surface(shapes, its, projection, projection_ratio);
|
||||
SurfaceCut cut = cut_surface(shapes, its, projection, projection_ratio);
|
||||
its_write_obj(cut, "C:/data/temp/cutSurface/result_cut.obj");
|
||||
}
|
||||
|
||||
|
|
|
@ -346,11 +346,11 @@ TEST_CASE("UndoRedo serialization", "[Emboss]")
|
|||
{
|
||||
TextConfiguration tc;
|
||||
tc.text = "Dovede-li se člověk zasmát sám sobě, nevyjde ze smíchu po celý život.";
|
||||
FontItem& fi = tc.font_item;
|
||||
fi.name = "Seneca";
|
||||
fi.path = "Simply the best";
|
||||
fi.type = FontItem::Type::file_path;
|
||||
FontProp &fp = fi.prop;
|
||||
EmbossStyle& es = tc.style;
|
||||
es.name = "Seneca";
|
||||
es.path = "Simply the best";
|
||||
es.type = EmbossStyle::Type::file_path;
|
||||
FontProp &fp = es.prop;
|
||||
fp.angle = 100.;
|
||||
fp.distance = 10.;
|
||||
fp.char_gap = 1;
|
||||
|
@ -369,7 +369,7 @@ TEST_CASE("UndoRedo serialization", "[Emboss]")
|
|||
cereal::BinaryInputArchive iarchive(ss); // Create an input archive
|
||||
iarchive(tc_loaded);
|
||||
}
|
||||
CHECK(tc.font_item == tc_loaded.font_item);
|
||||
CHECK(tc.style == tc_loaded.style);
|
||||
CHECK(tc.text == tc_loaded.text);
|
||||
CHECK(tc.fix_3mf_tr.has_value() == tc_loaded.fix_3mf_tr.has_value());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue