1Upstream style file relies on font files being present on the system
2globally. This is not quite how Nix usually does thing, so this patch
3changes the style file to instead look fonts up in hardcoded
4locations, which are later patched up to refer to the package outputs,
5thus ensuring the style always uses the fonts packaged with it.
6
7diff --git a/TeX/junicode.sty b/TeX/junicode.sty
8index 3f80068..af3e3ba 100644
9--- a/TeX/junicode.sty
10+++ b/TeX/junicode.sty
11@@ -211,7 +211,14 @@
12
13 \RequirePackage{fontspec}
14 \defaultfontfeatures{Ligatures=TeX, Extension=.\junicode@fonttype}
15-\defaultfontfeatures{Ligatures=TeX}
16+
17+\def\junicode@fonttype@otf{otf}
18+
19+\ifx\junicode@fonttype\junicode@fonttype@otf
20+ \def\junicode@fontpath{@@@opentype_path@@@}
21+\else
22+ \def\junicode@fontpath{@@@truetype_path@@@}
23+\fi
24
25 \ifxetex
26 \typeout{\junicode@regstylename}
27@@ -222,6 +229,7 @@
28 ItalicFont = *-\junicode@italstylename,
29 BoldFont = *-\junicode@boldstylename,
30 BoldItalicFont = *-\junicode@boldstylename Italic,
31+ Path = \junicode@fontpath,
32 ]{Junicode}
33 \fi
34 \ifluatex
35@@ -233,6 +241,7 @@
36 ItalicFont = *-\junicode@italstylename,
37 BoldFont = *-\junicode@boldstylename,
38 BoldItalicFont = *-\junicode@boldstylename Italic,
39+ Path = \junicode@fontpath,
40 ]{Junicode}
41 \fi
42
43@@ -245,6 +254,7 @@
44 #3
45 Numbers = {\junicode@figurealign,\junicode@figurestyle},
46 SmallCapsFeatures = {Letters=SmallCaps},
47+ Path = \junicode@fontpath,
48 ]
49 }
50 \fi
51@@ -255,6 +265,7 @@
52 #3
53 Numbers = {\junicode@figurealign,\junicode@figurestyle},
54 SmallCapsFeatures = {Letters=SmallCaps},
55+ Path = \junicode@fontpath,
56 ]
57 }
58 \fi
59diff --git a/TeX/junicodevf.lua b/TeX/junicodevf.lua
60index 9c58f79..6ddcb55 100644
61--- a/TeX/junicodevf.lua
62+++ b/TeX/junicodevf.lua
63@@ -118,7 +118,7 @@ function mkfontcommands()
64 romfontcmd = "jRegular"
65 italfontcmd = "jItalic"
66 end
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 .. "}")
70 end
71 end
72diff --git a/TeX/junicodevf.sty b/TeX/junicodevf.sty
73index da987d0..4475add 100644
74--- a/TeX/junicodevf.sty
75+++ b/TeX/junicodevf.sty
76@@ -132,10 +132,12 @@ mkmainfontcommand(style_idx, weight_option, weight_adjust, width_option, width_a
77 % Set the main font, then the alternate styles. It appears that
78 % the fonts aren't embedded in the PDF unless actually used.
79
80-\setmainfont{JunicodeVF}[
81- ItalicFont = {*-Italic},
82- BoldFont = {*},
83- BoldItalicFont = {*-Italic},
84+\setmainfont{JunicodeVF-Roman}[
85+ ItalicFont = {JunicodeVF-Italic},
86+ BoldFont = {JunicodeVF-Roman},
87+ BoldItalicFont = {JunicodeVF-Italic},
88+ Extension = .ttf,
89+ Path = @@@truetype_path@@@,
90 Renderer = {\junicodevf@renderer},
91 Numbers = {\junicodevf@figurealign,\junicodevf@figurestyle},
92 \MainDef,
93@@ -152,6 +154,8 @@ mkmainfontcommand(style_idx, weight_option, weight_adjust, width_option, width_a
94 \newcommand*{\junicodevf@newfont}[4]{
95 \setfontface#1{#2}[
96 Renderer = {\junicodevf@renderer},
97+ Extension = .ttf,
98+ Path = @@@truetype_path@@@,
99 Numbers = {\junicodevf@figurealign,\junicodevf@figurestyle},
100 SmallCapsFont = {*},
101 SmallCapsFeatures = {Letters=SmallCaps},
102@@ -164,43 +168,60 @@ mkmainfontcommand(style_idx, weight_option, weight_adjust, width_option, width_a
103
104 % ENLARGED FACES
105
106-\setfontface\EnlargedOne{JunicodeVF}[
107+\setfontface\EnlargedOne{JunicodeVF-Roman}[
108 Renderer = {\junicodevf@renderer},
109+ Extension = .ttf,
110+ Path = @@@truetype_path@@@,
111 \ENLAOneSizeDef
112 ]
113
114 \setfontface\EnlargedOneItalic{JunicodeVF-Italic}[
115 Renderer = {\junicodevf@renderer},
116+ Renderer = HarfBuzz,
117+ Extension = .ttf,
118+ Path = @@@truetype_path@@@,
119 \ENLAOneSizeDef
120 ]
121
122-\setfontface\EnlargedTwo{JunicodeVF}[
123+\setfontface\EnlargedTwo{JunicodeVF-Roman}[
124 Renderer = {\junicodevf@renderer},
125+ Extension = .ttf,
126+ Path = @@@truetype_path@@@,
127 \ENLATwoSizeDef
128 ]
129
130 \setfontface\EnlargedTwoItalic{JunicodeVF-Italic}[
131 Renderer = {\junicodevf@renderer},
132+ Extension = .ttf,
133+ Path = @@@truetype_path@@@,
134 \ENLATwoSizeDef
135 ]
136
137-\setfontface\EnlargedThree{JunicodeVF}[
138+\setfontface\EnlargedThree{JunicodeVF-Roman}[
139 Renderer = {\junicodevf@renderer},
140+ Extension = .ttf,
141+ Path = @@@truetype_path@@@,
142 \ENLAThreeSizeDef
143 ]
144
145 \setfontface\EnlargedThreeItalic{JunicodeVF-Italic}[
146 Renderer = {\junicodevf@renderer},
147+ Extension = .ttf,
148+ Path = @@@truetype_path@@@,
149 \ENLAThreeSizeDef
150 ]
151
152-\setfontface\EnlargedFour{JunicodeVF}[
153+\setfontface\EnlargedFour{JunicodeVF-Roman}[
154 Renderer = {\junicodevf@renderer},
155+ Extension = .ttf,
156+ Path = @@@truetype_path@@@,
157 \ENLAFourSizeDef
158 ]
159
160 \setfontface\EnlargedFourItalic{JunicodeVF-Italic}[
161 Renderer = {\junicodevf@renderer},
162+ Extension = .ttf,
163+ Path = @@@truetype_path@@@,
164 \ENLAFourSizeDef
165 ]
166