Re: Improvement to locating font directories

Posted by dxli on
URL: https://forum.librecad.org/Improvement-to-locating-font-directories-tp5706774p5706775.html

Hi bgoodr,

wonderful feature!

Is it possible to add searching list for various case of building shadowed or not. I'm not sure about in-place building in source folder, for example, in linux/macx/mingw

qmake librecad.pro
make

the binary is unix/librecad. running from there should be supported auto.

Regards,

Dongxu
On Sat, Jun 16, 2012 at 2:04 AM, bgoodr [via LibreCAD] <[hidden email]> wrote:
The default location of things like fonts needs to be relative to wherever the librecad executable is located. This is for local installs versus in /usr/bin.  This is in the use case of when you are building from source.

I have hacked my local sources to effect this by storing the fonts and other runtime directories in ../share relative to the bin directory, which is fairly standard fare.

Here is the patch:

diff --git a/librecad/src/lib/engine/rs_system.cpp b/librecad/src/lib/engine/rs_system.cpp
index 8fa40f8..15d5ce9 100644
--- a/librecad/src/lib/engine/rs_system.cpp
+++ b/librecad/src/lib/engine/rs_system.cpp
@@ -536,6 +536,10 @@ QStringList RS_System::getDirectoryList(const QString& _subDirectory) {
             }
         }
 
+        // share directory relative to the bin directory in the installation directory:
+        QFileInfo fileinfo(QCoreApplication::applicationDirPath());
+        QString finalDir(fileinfo.dir().path() + "/share/" + appDirName + "/" + subDirectory);
+        dirList.append(finalDir);
         // Ubuntu
         dirList.append("/usr/share/doc/" + appDirName + "/" + subDirectory);
 



If you reply to this email, your message will be added to the discussion below:
http://forum.librecad.org/Improvement-to-locating-font-directories-tp5706774.html
To start a new topic under LibreCAD-dev, email [hidden email]
To unsubscribe from LibreCAD-dev, click here.
NAML



--
Dongxu Li, Ph.D.
www.librecad.org