mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 15:23:39 +02:00
Ensure builtin fonts are only loaded once
This commit is contained in:
parent
3eee818dae
commit
eac34e2ba7
1 changed files with 6 additions and 1 deletions
|
|
@ -851,10 +851,15 @@ def translate(self, *args, **kwargs):
|
|||
|
||||
qt_app = None
|
||||
|
||||
builtin_fonts_loaded = False
|
||||
|
||||
def load_builtin_fonts():
|
||||
global _rating_font
|
||||
global _rating_font, builtin_fonts_loaded
|
||||
# Load the builtin fonts and any fonts added to calibre by the user to
|
||||
# Qt
|
||||
if builtin_fonts_loaded:
|
||||
return
|
||||
builtin_fonts_loaded = True
|
||||
for ff in glob.glob(P('fonts/liberation/*.?tf')) + \
|
||||
[P('fonts/calibreSymbols.otf')] + \
|
||||
glob.glob(os.path.join(config_dir, 'fonts', '*.?tf')):
|
||||
|
|
|
|||
Loading…
Reference in a new issue