Warning, /education/gcompris/src/core/GCSingletonFontLoader.qml is written in an unsupported language. File is not indexed.

0001 /* GCompris - GCSingletonFontLoader.qml
0002  *
0003  * SPDX-FileCopyrightText: 2014 Johnny Jazeix <jazeix@gmail.com>
0004  *
0005  * Authors:
0006  *   Johnny Jazeix <jazeix@gmail.com>
0007  *
0008  *   SPDX-License-Identifier: GPL-3.0-or-later
0009  */
0010 import QtQuick 2.12
0011 import GCompris 1.0
0012 
0013 //QTBUG-34418, singletons require explicit import to load qmldir file
0014 //https://qt-project.org/wiki/QmlStyling#6b81104b320e452a59cc3bf6857115ab
0015 import "."
0016 
0017 // FIXME: this triggers a doxygen error, why?
0018 pragma Singleton
0019 
0020 /**
0021  * A QML singleton helper to load currently active font based on current font
0022  * settings
0023  * @ingroup infrastructure
0024  *
0025  * @inherit QtQuick.QtObject
0026  * @sa ApplicationSettings.isEmbeddedFont, ApplicationSettings.font
0027  */
0028 QtObject {
0029     property QtObject fontLoader: ApplicationSettings.isEmbeddedFont ? sourceLoader : nameLoader
0030 
0031     property QtObject fontSourceLoader: FontLoader {
0032         id: sourceLoader
0033         source: ApplicationSettings.isEmbeddedFont ? "resource/fonts/"+ApplicationSettings.font : ""
0034     }
0035 
0036     property QtObject fontNameLoader: FontLoader {
0037         id: nameLoader
0038         name: ApplicationSettings.font
0039     }
0040 
0041 }