From 471bdac9081a410565ff7c07f2966399b0d947dc Mon Sep 17 00:00:00 2001 From: Oliver von Seydlitz Date: Wed, 28 Feb 2024 15:31:10 +0100 Subject: [PATCH] load fonts from file if not available on system --- fth/fth-lang.sty | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/fth/fth-lang.sty b/fth/fth-lang.sty index d9868fc..c43d114 100644 --- a/fth/fth-lang.sty +++ b/fth/fth-lang.sty @@ -30,8 +30,20 @@ % Fonts für die Sprachen * % ======================== \RequirePackage{fontspec} -\newfontfamily{\greekfont}{SBL Greek} -\newfontfamily{\greekfontsf}{SBL Greek} -\newfontfamily{\hebrewfont}{SBL Hebrew} -\newfontfamily{\hebrewfontsf}{SBL Hebrew} + +% Zunächst wird versucht, den Font über das System zu laden, andernfalls wird lokal nach einer passenden Datei gesucht (z.B. bei Overleaf nötig) +\IfFontExistsTF{SBL Greek}{ + \newfontfamily{\greekfont}{SBL Greek} + \newfontfamily{\greekfontsf}{SBL Greek} +}{ + \newfontfamily{\greekfont}{SBL_grk.ttf} + \newfontfamily{\greekfontsf}{SBL_grk.ttf} +} +\IfFontExistsTF{SBL Hebrew}{ + \newfontfamily{\hebrewfont}{SBL Hebrew} + \newfontfamily{\hebrewfontsf}{SBL Hebrew} +}{ + \newfontfamily{\hebrewfont}{SBL_Hbrw.ttf} + \newfontfamily{\hebrewfontsf}{SBL_Hbrw.ttf} +}