-
Notifications
You must be signed in to change notification settings - Fork 1.5k
libass Font Setup
libass should work for desktop and mobile devices now with the correct font setup.
AppDir: executable dir
AppFontsDir: QStandardPaths::writableLocation(QStandardPaths::DataLocation)+"/fonts"
or QDesktopServices::storageLocation(QDesktopServices::DataLocation)+"/fonts"
. The value may vary from different Qt versions.
FontsDir: QStandardPaths::standardLocations(QStandardPaths::FontsLocation).first()
or QDesktopServices::storageLocation(QDesktopServices::FontsLocation)
. Usually it's system fonts dir and not writable
- If AppDir/fonts has (ttf, otf) fonts: use it as libass(FontConfig) fonts dir.
- has default.ttf: use default.ttf as default font
- AppFontsDir (no fonts in AppDir/fonts)
- no fonts: If has a valid
qrc:/fonts/default.ttf
, extract to AppFontsDir and use it as default font, the dir is set as fontsdir - has default.ttf: use it as default font
- FontsDir (no fonts in AppFontsDir and no default.ttf in qrc)
If there is a default font set, it's able to use the font and disable FontConfig. Disabling FontConfig will skip font cache generating and speed up the font load. The effect is notable on windows and android(no other device tested, but should be the same).
-
QML API:
Subtitle.fontFile
andSubtitle.fontFileForced
-
C++ API:
SubtitleFilter.setFontFile(const QString&)
andSubtitleFilter.setFontFileForced(bool)