Skip to content

libass Font Setup

WangBin edited this page Aug 27, 2015 · 7 revisions

Dirs

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

Default Font and Fonts Dir Look Up

  • 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)

Force the Default 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).

Clone this wiki locally