-
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.
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
- executable_dir/fonts
- "assets:/fonts" (will copy to appFontsDir to let libass read)
- qrc ":/fonts" (will copy to appFontsDir to let libass read)
- appFontsDir
- fontsDir
If fonts dir contains "default.ttf", it will be the default font if default font is not set.
If fonts dir contains to many font files, the lookup speed will slow down.
WinRT: fonts dir is ignored because calling ass_set_fonts_dir()
with an valid fonts dir can cause crash
If there is a default font set, it's able to use the font and disable font provider (for example fontconfig). Disabling font provider will skip font cache generating(fontconfig), font lookup and speed up the font load. The effect is notable on windows and android(no other device tested, but should be the same).
If fonts dir is available or default font is not set, the font lookup may be slow. Set a default font and SubtitleProcessorLibASS.setFontFileForced(true)
can speed up font load.
-
QML API:
Subtitle.fontFile
andSubtitle.fontFileForced
-
C++ API:
SubtitleFilter.setFontFile(const QString&)
andSubtitleFilter.setFontFileForced(bool)