resolve('Arial.ttf'); } else { return LocalPath::createFromPathString('/usr/share/fonts/liberation/LiberationSans-Regular.ttf'); } } /** * @return LocalPath - the font locale path * https://github.com/liberationfonts/liberation-fonts/releases */ static public function getLiberationSansFontRegularPath(): LocalPath { return WikiPath::createComboResource(":fonts:LiberationSans-Regular.ttf")->toLocalPath(); } static public function getLiberationSansFontBoldPath(): LocalPath { return WikiPath::createComboResource(":fonts:LiberationSans-Bold.ttf")->toLocalPath(); } static public function printWindowsTrueTypeFont() { $path = self::getWindowsFontDirectory(); foreach (FileSystems::getChildrenLeaf($path) as $path) { $extension = strtolower($path->getExtension()); if ($extension === "ttf") { echo $path->toAbsoluteId() . "\n"; } } } public static function getWindowsFontDirectory(): LocalPath { return LocalPath::createFromPathString('c:\windows\fonts'); } }