audinux / fedora-spec

Spec files for fedora packages
https://audinux.github.io
GNU General Public License v3.0
24 stars 7 forks source link

(F37) pianobooster doesn't start because of hardcoded font paths #27

Closed jn64 closed 1 year ago

jn64 commented 1 year ago
$ pianobooster
ERROR: Font DejaVuSans.ttf was not found !

$ dnf rq --installed pianobooster
pianobooster-0:1.0.0-7.fc37.x86_64

Upstream had this issue https://github.com/pianobooster/PianoBooster/issues/24, but even after the fix they still hardcoded font paths:

https://github.com/pianobooster/PianoBooster/blob/a9e0809a824c88469eb387ac6356f1457c93efc0/src/Draw.cpp#L48-L56

In F37, DejaVu Sans font is installed to /usr/share/fonts/dejavu-sans-fonts/DejaVuSans.ttf

Temporary fix is to symlink to an expected path:

$ sudo mkdir -p /usr/share/games/pianobooster/fonts/
$ sudo ln -s /usr/share/fonts/dejavu-sans-fonts/DejaVuSans.ttf /usr/share/games/pianobooster/fonts/DejaVuSans.ttf
$ pianobooster # run successfully

Or we can patch Draw.cpp. I will do PR when I have time.

ycollet commented 1 year ago

I will patch the path. I think it's the best way to go. Thanks a lot for the report !

ycollet commented 1 year ago

I used this patch:

From e431e12124df37deeadc921a0bbad5dbf5baa0dc Mon Sep 17 00:00:00 2001
From: Yann Collette <ycollette.nospam@free.fr>
Date: Sat, 14 Jan 2023 09:59:21 +0100
Subject: [PATCH] fix dejavu font path

---
 src/Draw.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/Draw.cpp b/src/Draw.cpp
index 09fc2a2..c898d7a 100644
--- a/src/Draw.cpp
+++ b/src/Draw.cpp
@@ -54,7 +54,8 @@ CDraw::CDraw(CSettings* settings)
     listPathFonts.append("/usr/share/fonts/TTF/DejaVuSans.ttf");
     listPathFonts.append("/usr/share/fonts/truetype/DejaVuSans.ttf");
     listPathFonts.append("/usr/local/share/fonts/dejavu/DejaVuSans.ttf");
-
+    listPathFonts.append("/usr/share/fonts/dejavu-sans-fonts/DejaVuSans.ttf");
+   
     for (int i=0;i<listPathFonts.size();i++){
         QFile file(listPathFonts.at(i));
         if (file.exists()){
-- 
2.39.0

And switched pianobooster to use the system fluidsynth too.

ycollet commented 1 year ago

New build ready

jn64 commented 1 year ago

Thanks!