Include osifont in TechDraw
- also use PropertyFont instead of PropertyString
This commit is contained in:
@@ -48,7 +48,7 @@ public:
|
||||
virtual ~DrawViewAnnotation();
|
||||
|
||||
App::PropertyStringList Text;
|
||||
App::PropertyString Font;
|
||||
App::PropertyFont Font;
|
||||
App::PropertyColor TextColor;
|
||||
App::PropertyInteger TextSize;
|
||||
App::PropertyInteger LineSpace;
|
||||
|
||||
@@ -186,6 +186,7 @@ App::DocumentObjectExecReturn *DrawViewDimension::execute(void)
|
||||
}
|
||||
|
||||
//TODO: if MeasureType = Projected and the Projected shape changes, the Dimension may become invalid (see tilted Cube example)
|
||||
requestPaint();
|
||||
|
||||
return App::DocumentObject::execute();;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
App::PropertyEnumeration Type; //DistanceX,DistanceY,Diameter, etc
|
||||
|
||||
/// Properties for Visualisation
|
||||
App::PropertyString Font;
|
||||
App::PropertyFont Font;
|
||||
App::PropertyFloat Fontsize;
|
||||
App::PropertyString FormatSpec;
|
||||
App::PropertyFloat LineWidth;
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
App::PropertyLink Source;
|
||||
App::PropertyString CellStart;
|
||||
App::PropertyString CellEnd;
|
||||
App::PropertyString Font;
|
||||
App::PropertyFont Font;
|
||||
App::PropertyColor TextColor;
|
||||
App::PropertyFloat LineWidth;
|
||||
App::PropertyFloat TextSize;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <Base/Console.h>
|
||||
#include <Base/PyObjectBase.h>
|
||||
#include <Base/Interpreter.h>
|
||||
#include <Base/Tools.h>
|
||||
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/Language/Translator.h>
|
||||
@@ -66,6 +67,15 @@ void loadTechDrawResource()
|
||||
// add resources and reloads the translators
|
||||
Q_INIT_RESOURCE(TechDraw);
|
||||
Gui::Translator::instance()->refresh();
|
||||
|
||||
// add osifont
|
||||
std::string fontDir = App::Application::getResourceDir() + "Mod/TechDraw/Resources/fonts/";
|
||||
QString fontFile = Base::Tools::fromStdString(fontDir + "osifont-lgpl3fe.ttf");
|
||||
QFontDatabase fontDB;
|
||||
int rc = fontDB.addApplicationFont(fontFile);
|
||||
if (rc) {
|
||||
Base::Console().Log("TechDraw failed to load osifont file: %d from: %s\n",rc,qPrintable(fontFile));
|
||||
}
|
||||
}
|
||||
|
||||
namespace TechDrawGui {
|
||||
|
||||
@@ -246,6 +246,15 @@ fc_copy_sources(TechDrawGui "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Te
|
||||
|
||||
INSTALL(FILES ${TechDrawGuiIcon_SVG} DESTINATION "${CMAKE_INSTALL_DATADIR}/Mod/TechDraw/Resources/icons")
|
||||
|
||||
##install OSIFONT
|
||||
SET(TechDrawGuiFonts
|
||||
Resources/fonts/osifont-lgpl3fe.ttf
|
||||
Resources/fonts/osifont.license
|
||||
)
|
||||
fc_copy_sources(TechDrawGui "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/TechDraw" ${TechDrawGuiFonts})
|
||||
INSTALL(FILES ${TechDrawGuiFonts} DESTINATION "${CMAKE_INSTALL_DATADIR}/Mod/TechDraw/Resources/fonts")
|
||||
|
||||
|
||||
SET_BIN_DIR(TechDrawGui TechDrawGui /Mod/TechDraw)
|
||||
SET_PYTHON_PREFIX_SUFFIX(TechDrawGui)
|
||||
|
||||
|
||||
9
src/Mod/TechDraw/Gui/Resources/fonts/osifont.license
Normal file
9
src/Mod/TechDraw/Gui/Resources/fonts/osifont.license
Normal file
@@ -0,0 +1,9 @@
|
||||
osifont license:
|
||||
|
||||
osifont-lgpl3fe.ttf is used under one or more of the following licenses:
|
||||
- GNU GPL licence version 3 with GPL font exception,
|
||||
- GNU GPL licence version 2 with GPL font exception,
|
||||
- GNU LGPL licence version 3 with GPL font exception.
|
||||
|
||||
|
||||
https://github.com/hikikomori82/osifont/
|
||||
Reference in New Issue
Block a user