[Part] fix bold italic measurement text

- bold and italic font did not work for measurement text, see https://github.com/FreeCAD/FreeCAD/pull/7148#issuecomment-1247989284
This commit is contained in:
Uwe
2022-09-16 03:09:24 +02:00
parent 5d0549aa7f
commit 2d61e15112

View File

@@ -227,9 +227,17 @@ void PartGui::dumpLinearResults(const BRepExtrema_DistShapeShape &measure)
auto PartGui::getDimensionsFontName()
{
ParameterGrp::handle group = App::GetApplication().GetUserParameter().GetGroup("BaseApp/Preferences/Mod/Part");
std::string fontName = group->GetASCII("DimensionsFontName", "defaultFont")
+ (group->GetBool("DimensionsFontStyleBold", false) ? " :Bold" : "")
+ (group->GetBool("DimensionsFontStyleItalic", false) ? " :Italic" : "");
std::string fontName = group->GetASCII("DimensionsFontName", "defaultFont");
// if there is only italic, we must output ":Italic", otherwise ":Bold Italic"
if (group->GetBool("DimensionsFontStyleBold")) {
fontName = fontName + " :Bold";
if (group->GetBool("DimensionsFontStyleItalic"))
fontName = fontName + " Italic";
}
else {
if (group->GetBool("DimensionsFontStyleItalic"))
fontName = fontName + " :Italic";
}
return fontName;
}