From fc2d43acfdc6262c05a08e352d10af6343ff3fdd Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Sun, 2 Mar 2025 15:15:39 +0100 Subject: [PATCH] qt,qml: move fonts to /electrum/gui for use in all guis. --- contrib/build-wine/deterministic.spec | 1 + contrib/osx/osx.spec | 1 + electrum/gui/{qml => }/fonts/PTMono-Bold.ttf | Bin electrum/gui/{qml => }/fonts/PTMono-Regular.ttf | Bin electrum/gui/{qml => }/fonts/PTMono.LICENSE | 0 electrum/gui/qml/qeapp.py | 4 ++-- 6 files changed, 4 insertions(+), 2 deletions(-) rename electrum/gui/{qml => }/fonts/PTMono-Bold.ttf (100%) rename electrum/gui/{qml => }/fonts/PTMono-Regular.ttf (100%) rename electrum/gui/{qml => }/fonts/PTMono.LICENSE (100%) diff --git a/contrib/build-wine/deterministic.spec b/contrib/build-wine/deterministic.spec index af5e65b58..c7a24248d 100644 --- a/contrib/build-wine/deterministic.spec +++ b/contrib/build-wine/deterministic.spec @@ -36,6 +36,7 @@ datas = [ (f"{PROJECT_ROOT}/{PYPKG}/locale", f"{PYPKG}/locale"), (f"{PROJECT_ROOT}/{PYPKG}/plugins", f"{PYPKG}/plugins"), (f"{PROJECT_ROOT}/{PYPKG}/gui/icons", f"{PYPKG}/gui/icons"), + (f"{PROJECT_ROOT}/{PYPKG}/gui/fonts", f"{PYPKG}/gui/fonts"), ] datas += collect_data_files(f"{PYPKG}.plugins") datas += collect_data_files('trezorlib') # TODO is this needed? and same question for other hww libs diff --git a/contrib/osx/osx.spec b/contrib/osx/osx.spec index 3ab38bb34..fce663b9a 100644 --- a/contrib/osx/osx.spec +++ b/contrib/osx/osx.spec @@ -39,6 +39,7 @@ datas = [ (f"{PROJECT_ROOT}/{PYPKG}/locale", f"{PYPKG}/locale"), (f"{PROJECT_ROOT}/{PYPKG}/plugins", f"{PYPKG}/plugins"), (f"{PROJECT_ROOT}/{PYPKG}/gui/icons", f"{PYPKG}/gui/icons"), + (f"{PROJECT_ROOT}/{PYPKG}/gui/fonts", f"{PYPKG}/gui/fonts"), ] datas += collect_data_files(f"{PYPKG}.plugins") datas += collect_data_files('trezorlib') # TODO is this needed? and same question for other hww libs diff --git a/electrum/gui/qml/fonts/PTMono-Bold.ttf b/electrum/gui/fonts/PTMono-Bold.ttf similarity index 100% rename from electrum/gui/qml/fonts/PTMono-Bold.ttf rename to electrum/gui/fonts/PTMono-Bold.ttf diff --git a/electrum/gui/qml/fonts/PTMono-Regular.ttf b/electrum/gui/fonts/PTMono-Regular.ttf similarity index 100% rename from electrum/gui/qml/fonts/PTMono-Regular.ttf rename to electrum/gui/fonts/PTMono-Regular.ttf diff --git a/electrum/gui/qml/fonts/PTMono.LICENSE b/electrum/gui/fonts/PTMono.LICENSE similarity index 100% rename from electrum/gui/qml/fonts/PTMono.LICENSE rename to electrum/gui/fonts/PTMono.LICENSE diff --git a/electrum/gui/qml/qeapp.py b/electrum/gui/qml/qeapp.py index 6a8334082..2f5108dda 100644 --- a/electrum/gui/qml/qeapp.py +++ b/electrum/gui/qml/qeapp.py @@ -426,8 +426,8 @@ class ElectrumQmlApplication(QGuiApplication): # add a monospace font as we can't rely on device having one self.fixedFont = 'PT Mono' - not_loaded = QFontDatabase.addApplicationFont('electrum/gui/qml/fonts/PTMono-Regular.ttf') < 0 - not_loaded = QFontDatabase.addApplicationFont('electrum/gui/qml/fonts/PTMono-Bold.ttf') < 0 and not_loaded + not_loaded = QFontDatabase.addApplicationFont('electrum/gui/fonts/PTMono-Regular.ttf') < 0 + not_loaded = QFontDatabase.addApplicationFont('electrum/gui/fonts/PTMono-Bold.ttf') < 0 and not_loaded if not_loaded: self.logger.warning('Could not load font PT Mono') self.fixedFont = 'Monospace' # hope for the best