about summary refs log tree commit diff
path: root/nixpkgs/pkgs/data/fonts/junicode/tex-font-path.patch
blob: 13b311b39ce65a741627018ff617fe27d23be6d0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
Upstream style file relies on font files being present on the system
globally.  This is not quite how Nix usually does thing, so this patch
changes the style file to instead look fonts up in hardcoded
locations, which are later patched up to refer to the package outputs,
thus ensuring the style always uses the fonts packaged with it.

diff --git a/TeX/junicode.sty b/TeX/junicode.sty
index 83bd45d..8fe671c 100644
--- a/TeX/junicode.sty
+++ b/TeX/junicode.sty
@@ -208,7 +208,14 @@
 
 \RequirePackage{fontspec}
 \defaultfontfeatures{Ligatures=TeX, Extension=.\junicode@fonttype}
-\defaultfontfeatures{Ligatures=TeX}
+
+\def\junicode@fonttype@otf{otf}
+
+\ifx\junicode@fonttype\junicode@fonttype@otf
+  \def\junicode@fontpath{@@@opentype_path@@@}
+\else
+  \def\junicode@fontpath{@@@truetype_path@@@}
+\fi
 
 \ifxetex
 \typeout{\junicode@regstylename}
@@ -219,6 +226,7 @@
    ItalicFont =        *-\junicode@italstylename,
    BoldFont =          *-\junicode@boldstylename,
    BoldItalicFont =    *-\junicode@boldstylename Italic,
+   Path =              \junicode@fontpath,
   ]{Junicode}
 \fi
 \ifluatex
@@ -230,6 +238,7 @@
    ItalicFont =        *-\junicode@italstylename,
    BoldFont =          *-\junicode@boldstylename,
    BoldItalicFont =    *-\junicode@boldstylename Italic,
+   Path =              \junicode@fontpath,
   ]{Junicode}
 \fi
 
@@ -242,6 +251,7 @@
         #3
         Numbers =           {\junicode@figurealign,\junicode@figurestyle},
         SmallCapsFeatures = {Letters=SmallCaps},
+        Path =              \junicode@fontpath,
     ]
 }
 \fi
@@ -252,6 +262,7 @@
         #3
         Numbers =           {\junicode@figurealign,\junicode@figurestyle},
         SmallCapsFeatures = {Letters=SmallCaps},
+        Path =              \junicode@fontpath,
     ]
 }
 \fi
diff --git a/TeX/junicodevf.lua b/TeX/junicodevf.lua
index 7148668..acebe82 100644
--- a/TeX/junicodevf.lua
+++ b/TeX/junicodevf.lua
@@ -148,7 +148,7 @@ function mkfontcommands()
          romfontcmd = "jRegular"
          italfontcmd = "jItalic"
       end
-      tex.print("\\junicodevf@newfont{\\" .. romfontcmd .. "}{JunicodeVF}{\\" .. defcmd .. "}{\\" .. defsizecmd .. "}")
+      tex.print("\\junicodevf@newfont{\\" .. romfontcmd .. "}{JunicodeVF-Roman}{\\" .. defcmd .. "}{\\" .. defsizecmd .. "}")
       tex.print("\\junicodevf@newfont{\\" .. italfontcmd .. "}{JunicodeVF-Italic}{\\" .. defcmd .. "}{\\" .. defsizecmd .. "}")
    end
 end
diff --git a/TeX/junicodevf.sty b/TeX/junicodevf.sty
index c01ccaf..07a99ad 100644
--- a/TeX/junicodevf.sty
+++ b/TeX/junicodevf.sty
@@ -168,11 +168,13 @@ mkwidthcommands(wdindex, adjustment)}}
 
 % DECLARE THE FONTS
 
-\setmainfont{Junicode VF}[
-    ItalicFont =         {*-Italic},
-    BoldFont =           {*},
-    BoldItalicFont =     {*-Italic},
+\setmainfont{JunicodeVF-Roman}[
+    ItalicFont =         {JunicodeVF-Italic},
+    BoldFont =           {JunicodeVF-Roman},
+    BoldItalicFont =     {JunicodeVF-Italic},
     Renderer =           HarfBuzz,
+    Extension =          .ttf,
+    Path =               @@@truetype_path@@@,
     Numbers =            {\junicodevf@figurealign,\junicodevf@figurestyle},
     \MainDef,
     UprightFeatures =    {\MainRegDef
@@ -188,6 +190,8 @@ mkwidthcommands(wdindex, adjustment)}}
 \newcommand*{\junicodevf@newfont}[4]{
     \setfontface#1{#2}[
         Renderer =          HarfBuzz,
+        Extension =          .ttf,
+        Path =               @@@truetype_path@@@,
         Numbers =           {\junicodevf@figurealign,\junicodevf@figurestyle},
         SmallCapsFont =     {*},
         SmallCapsFeatures = {Letters=SmallCaps},
@@ -200,43 +204,59 @@ mkwidthcommands(wdindex, adjustment)}}
 
 % ENLARGED FACES
 
-\setfontface\EnlargedOne{JunicodeVF}[
+\setfontface\EnlargedOne{JunicodeVF-Roman}[
     Renderer = HarfBuzz,
+    Extension = .ttf,
+    Path = @@@truetype_path@@@,
     \ENLAOneSizeDef
 ]
 
 \setfontface\EnlargedOneItalic{JunicodeVF-Italic}[
     Renderer = HarfBuzz,
+    Extension = .ttf,
+    Path = @@@truetype_path@@@,
     \ENLAOneSizeDef
 ]
 
-\setfontface\EnlargedTwo{JunicodeVF}[
+\setfontface\EnlargedTwo{JunicodeVF-Roman}[
     Renderer = HarfBuzz,
+    Extension = .ttf,
+    Path = @@@truetype_path@@@,
     \ENLATwoSizeDef
 ]
 
 \setfontface\EnlargedTwoItalic{JunicodeVF-Italic}[
     Renderer = HarfBuzz,
+    Extension = .ttf,
+    Path = @@@truetype_path@@@,
     \ENLATwoSizeDef
 ]
 
-\setfontface\EnlargedThree{JunicodeVF}[
+\setfontface\EnlargedThree{JunicodeVF-Roman}[
     Renderer = HarfBuzz,
+    Extension = .ttf,
+    Path = @@@truetype_path@@@,
     \ENLAThreeSizeDef
 ]
 
 \setfontface\EnlargedThreeItalic{JunicodeVF-Italic}[
     Renderer = HarfBuzz,
+    Extension = .ttf,
+    Path = @@@truetype_path@@@,
     \ENLAThreeSizeDef
 ]
 
-\setfontface\EnlargedFour{JunicodeVF}[
+\setfontface\EnlargedFour{JunicodeVF-Roman}[
     Renderer = HarfBuzz,
+    Extension = .ttf,
+    Path = @@@truetype_path@@@,
     \ENLAFourSizeDef
 ]
 
 \setfontface\EnlargedFourItalic{JunicodeVF-Italic}[
     Renderer = HarfBuzz,
+    Extension = .ttf,
+    Path = @@@truetype_path@@@,
     \ENLAFourSizeDef
 ]