1 Upstream style file relies on font files being present on the system
2 globally. This is not quite how Nix usually does thing, so this patch
3 changes the style file to instead look fonts up in hardcoded
4 locations, which are later patched up to refer to the package outputs,
5 thus ensuring the style always uses the fonts packaged with it.
7 diff --git a/TeX/junicode.sty b/TeX/junicode.sty
8 index 83bd45d..8fe671c 100644
10 +++ b/TeX/junicode.sty
13 \RequirePackage{fontspec}
14 \defaultfontfeatures{Ligatures=TeX, Extension=.\junicode@fonttype}
15 -\defaultfontfeatures{Ligatures=TeX}
17 +\def\junicode@fonttype@otf{otf}
19 +\ifx\junicode@fonttype\junicode@fonttype@otf
20 + \def\junicode@fontpath{@@@opentype_path@@@}
22 + \def\junicode@fontpath{@@@truetype_path@@@}
26 \typeout{\junicode@regstylename}
28 ItalicFont = *-\junicode@italstylename,
29 BoldFont = *-\junicode@boldstylename,
30 BoldItalicFont = *-\junicode@boldstylename Italic,
31 + Path = \junicode@fontpath,
36 ItalicFont = *-\junicode@italstylename,
37 BoldFont = *-\junicode@boldstylename,
38 BoldItalicFont = *-\junicode@boldstylename Italic,
39 + Path = \junicode@fontpath,
45 Numbers = {\junicode@figurealign,\junicode@figurestyle},
46 SmallCapsFeatures = {Letters=SmallCaps},
47 + Path = \junicode@fontpath,
53 Numbers = {\junicode@figurealign,\junicode@figurestyle},
54 SmallCapsFeatures = {Letters=SmallCaps},
55 + Path = \junicode@fontpath,
59 diff --git a/TeX/junicodevf.lua b/TeX/junicodevf.lua
60 index 7148668..acebe82 100644
61 --- a/TeX/junicodevf.lua
62 +++ b/TeX/junicodevf.lua
63 @@ -148,7 +148,7 @@ function mkfontcommands()
64 romfontcmd = "jRegular"
65 italfontcmd = "jItalic"
67 - tex.print("\\junicodevf@newfont{\\" .. romfontcmd .. "}{JunicodeVF}{\\" .. defcmd .. "}{\\" .. defsizecmd .. "}")
68 + tex.print("\\junicodevf@newfont{\\" .. romfontcmd .. "}{JunicodeVF-Roman}{\\" .. defcmd .. "}{\\" .. defsizecmd .. "}")
69 tex.print("\\junicodevf@newfont{\\" .. italfontcmd .. "}{JunicodeVF-Italic}{\\" .. defcmd .. "}{\\" .. defsizecmd .. "}")
72 diff --git a/TeX/junicodevf.sty b/TeX/junicodevf.sty
73 index c01ccaf..07a99ad 100644
74 --- a/TeX/junicodevf.sty
75 +++ b/TeX/junicodevf.sty
76 @@ -168,11 +168,13 @@ mkwidthcommands(wdindex, adjustment)}}
80 -\setmainfont{JunicodeVF}[
81 - ItalicFont = {*-Italic},
83 - BoldItalicFont = {*-Italic},
84 +\setmainfont{JunicodeVF-Roman}[
85 + ItalicFont = {JunicodeVF-Italic},
86 + BoldFont = {JunicodeVF-Roman},
87 + BoldItalicFont = {JunicodeVF-Italic},
90 + Path = @@@truetype_path@@@,
91 Numbers = {\junicodevf@figurealign,\junicodevf@figurestyle},
93 UprightFeatures = {\MainRegDef
94 @@ -188,6 +190,8 @@ mkwidthcommands(wdindex, adjustment)}}
95 \newcommand*{\junicodevf@newfont}[4]{
99 + Path = @@@truetype_path@@@,
100 Numbers = {\junicodevf@figurealign,\junicodevf@figurestyle},
102 SmallCapsFeatures = {Letters=SmallCaps},
103 @@ -200,43 +204,59 @@ mkwidthcommands(wdindex, adjustment)}}
107 -\setfontface\EnlargedOne{JunicodeVF}[
108 +\setfontface\EnlargedOne{JunicodeVF-Roman}[
111 + Path = @@@truetype_path@@@,
115 \setfontface\EnlargedOneItalic{JunicodeVF-Italic}[
118 + Path = @@@truetype_path@@@,
122 -\setfontface\EnlargedTwo{JunicodeVF}[
123 +\setfontface\EnlargedTwo{JunicodeVF-Roman}[
126 + Path = @@@truetype_path@@@,
130 \setfontface\EnlargedTwoItalic{JunicodeVF-Italic}[
133 + Path = @@@truetype_path@@@,
137 -\setfontface\EnlargedThree{JunicodeVF}[
138 +\setfontface\EnlargedThree{JunicodeVF-Roman}[
141 + Path = @@@truetype_path@@@,
145 \setfontface\EnlargedThreeItalic{JunicodeVF-Italic}[
148 + Path = @@@truetype_path@@@,
152 -\setfontface\EnlargedFour{JunicodeVF}[
153 +\setfontface\EnlargedFour{JunicodeVF-Roman}[
156 + Path = @@@truetype_path@@@,
160 \setfontface\EnlargedFourItalic{JunicodeVF-Italic}[
163 + Path = @@@truetype_path@@@,