Skip to content

Commit

Permalink
use installed fonts if no fonts are provided in fontpath and warn if …
Browse files Browse the repository at this point in the history
…package is installed without moving fonts into the appropriate fonts directory
  • Loading branch information
michaelroland committed Jul 14, 2023
1 parent b51739a commit 013c74a
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions jkureport.sty
Original file line number Diff line number Diff line change
Expand Up @@ -490,15 +490,30 @@
\fi

\ifbool{jkureport@xetexfonts}{%
\RequirePackage{fontspec}
% discover font path
\expandafter\IfFileExists\expandafter{\jkureport@fontpath PublicSans-Regular.ttf}{%
\IfFontExistsTF{\jkureport@fontpath PublicSans-Regular.ttf}{%
}{%
\xdef\jkureport@fontpath{}
}%
}{\expandafter\IfFileExists\expandafter{\jkureport@fontpath/PublicSans-Regular.ttf}{%
\xdef\jkureport@fontpath{\jkureport@fontpath/}
\IfFontExistsTF{\jkureport@fontpath PublicSans-Regular.ttf}{%
}{%
\xdef\jkureport@fontpath{}
}%
}{\IfFontExistsTF{PublicSans-Regular.ttf}{%
\xdef\jkureport@fontpath{}
}{%
\PackageError{jkureport}{Font files not found in `\jkureport@fontpath', forgot to set the font path with package option `fontpath='?}{}%
\stop
}}

\RequirePackage{fontspec}
}}}%
\IfFontExistsTF{\jkureport@fontpath PublicSans-Regular.ttf}{%
}{%
\PackageError{jkureport}{Font files not found in local installation. Fonts must be installed to `$TEXMF[HOME|LOCAL]/fonts/truetype/' or an alternative font path set with package option `fontpath='}{}%
\stop
}%
\defaultfontfeatures{
Path={\jkureport@fontpath},
Extension=.ttf,
Expand Down

0 comments on commit 013c74a

Please sign in to comment.