@@ -50,6 +50,24 @@ export interface ICertificateConfigData {
5050 | undefined
5151}
5252
53+ const notoSansFont : Record < string , FontFamilyTypes > = {
54+ 'Noto Sans' : {
55+ normal : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
56+ bold : '/api/countryconfig/fonts/NotoSans-Bold.ttf' ,
57+ italics : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
58+ bolditalics : '/api/countryconfig/fonts/NotoSans-Regular.ttf'
59+ }
60+ }
61+
62+ const libreBaskervilleFont : Record < string , FontFamilyTypes > = {
63+ 'Libre Baskerville' : {
64+ normal : '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf' ,
65+ bold : '/api/countryconfig/fonts/LibreBaskerville-Bold.ttf' ,
66+ italics : '/api/countryconfig/fonts/LibreBaskerville-Italic.ttf' ,
67+ bolditalics : '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf'
68+ }
69+ }
70+
5371export async function certificateHandler ( request : Request , h : ResponseToolkit ) {
5472 if ( request . params . id ) {
5573 const filePath = `${ __dirname } /source/${ request . params . id } `
@@ -71,14 +89,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
7189 delayed : 15
7290 } ,
7391 svgUrl : '/api/countryconfig/certificates/birth-certificate.svg' ,
74- fonts : {
75- 'Libre Baskerville' : {
76- normal : '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf' ,
77- bold : '/api/countryconfig/fonts/LibreBaskerville-Bold.ttf' ,
78- italics : '/api/countryconfig/fonts/LibreBaskerville-Italic.ttf' ,
79- bolditalics : '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf'
80- }
81- }
92+ fonts : libreBaskervilleFont
8293 } ,
8394 {
8495 id : 'birth-certificate-certified-copy' ,
@@ -96,14 +107,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
96107 } ,
97108 svgUrl :
98109 '/api/countryconfig/certificates/birth-certificate-certified-copy.svg' ,
99- fonts : {
100- 'Noto Sans' : {
101- normal : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
102- bold : '/api/countryconfig/fonts/NotoSans-Bold.ttf' ,
103- italics : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
104- bolditalics : '/api/countryconfig/fonts/NotoSans-Regular.ttf'
105- }
106- } ,
110+ fonts : notoSansFont ,
107111 conditionals : [
108112 {
109113 type : 'SHOW' ,
@@ -127,14 +131,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
127131 delayed : 18
128132 } ,
129133 svgUrl : '/api/countryconfig/certificates/birth-registration-receipt.svg' ,
130- fonts : {
131- 'Noto Sans' : {
132- normal : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
133- bold : '/api/countryconfig/fonts/NotoSans-Bold.ttf' ,
134- italics : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
135- bolditalics : '/api/countryconfig/fonts/NotoSans-Regular.ttf'
136- }
137- }
134+ fonts : notoSansFont
138135 } ,
139136 {
140137 id : 'death-certificate' ,
@@ -151,14 +148,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
151148 delayed : 12
152149 } ,
153150 svgUrl : '/api/countryconfig/certificates/death-certificate.svg' ,
154- fonts : {
155- 'Noto Sans' : {
156- normal : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
157- bold : '/api/countryconfig/fonts/NotoSans-Bold.ttf' ,
158- italics : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
159- bolditalics : '/api/countryconfig/fonts/NotoSans-Regular.ttf'
160- }
161- }
151+ fonts : notoSansFont
162152 } ,
163153 {
164154 id : 'death-certificate-certified-copy' ,
@@ -176,14 +166,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
176166 } ,
177167 svgUrl :
178168 '/api/countryconfig/certificates/death-certificate-certified-copy.svg' ,
179- fonts : {
180- 'Noto Sans' : {
181- normal : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
182- bold : '/api/countryconfig/fonts/NotoSans-Bold.ttf' ,
183- italics : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
184- bolditalics : '/api/countryconfig/fonts/NotoSans-Regular.ttf'
185- }
186- } ,
169+ fonts : notoSansFont ,
187170 conditionals : [
188171 {
189172 type : 'SHOW' ,
@@ -207,14 +190,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
207190 delayed : 13.5
208191 } ,
209192 svgUrl : '/api/countryconfig/certificates/marriage-certificate.svg' ,
210- fonts : {
211- 'Noto Sans' : {
212- normal : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
213- bold : '/api/countryconfig/fonts/NotoSans-Bold.ttf' ,
214- italics : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
215- bolditalics : '/api/countryconfig/fonts/NotoSans-Regular.ttf'
216- }
217- }
193+ fonts : notoSansFont
218194 } ,
219195 {
220196 id : 'marriage-certificate-certified-copy' ,
@@ -232,14 +208,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
232208 } ,
233209 svgUrl :
234210 '/api/countryconfig/certificates/marriage-certificate-certified-copy.svg' ,
235- fonts : {
236- 'Noto Sans' : {
237- normal : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
238- bold : '/api/countryconfig/fonts/NotoSans-Bold.ttf' ,
239- italics : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
240- bolditalics : '/api/countryconfig/fonts/NotoSans-Regular.ttf'
241- }
242- }
211+ fonts : notoSansFont
243212 } ,
244213 {
245214 id : 'v2.birth-certificate' ,
@@ -257,14 +226,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
257226 delayed : 18
258227 } ,
259228 svgUrl : '/api/countryconfig/certificates/v2.birth-certificate.svg' ,
260- fonts : {
261- 'Libre Baskerville' : {
262- normal : '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf' ,
263- bold : '/api/countryconfig/fonts/LibreBaskerville-Bold.ttf' ,
264- italics : '/api/countryconfig/fonts/LibreBaskerville-Italic.ttf' ,
265- bolditalics : '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf'
266- }
267- } ,
229+ fonts : notoSansFont ,
268230 conditionals : [
269231 {
270232 type : 'SHOW' ,
@@ -289,14 +251,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
289251 } ,
290252 svgUrl :
291253 '/api/countryconfig/certificates/v2.birth-certificate-certified-copy.svg' ,
292- fonts : {
293- 'Libre Baskerville' : {
294- normal : '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf' ,
295- bold : '/api/countryconfig/fonts/LibreBaskerville-Bold.ttf' ,
296- italics : '/api/countryconfig/fonts/LibreBaskerville-Italic.ttf' ,
297- bolditalics : '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf'
298- }
299- } ,
254+ fonts : libreBaskervilleFont ,
300255 conditionals : [
301256 {
302257 type : 'SHOW' ,
@@ -325,14 +280,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
325280 } ,
326281 svgUrl :
327282 '/api/countryconfig/certificates/v2.tennis-club-membership-certificate.svg' ,
328- fonts : {
329- 'Noto Sans' : {
330- normal : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
331- bold : '/api/countryconfig/fonts/NotoSans-Bold.ttf' ,
332- italics : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
333- bolditalics : '/api/countryconfig/fonts/NotoSans-Regular.ttf'
334- }
335- } ,
283+ fonts : notoSansFont ,
336284 conditionals : [
337285 {
338286 type : 'SHOW' ,
@@ -358,14 +306,26 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
358306 } ,
359307 svgUrl :
360308 '/api/countryconfig/certificates/v2.tennis-club-membership-certified-certificate.svg' ,
361- fonts : {
362- 'Noto Sans' : {
363- normal : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
364- bold : '/api/countryconfig/fonts/NotoSans-Bold.ttf' ,
365- italics : '/api/countryconfig/fonts/NotoSans-Regular.ttf' ,
366- bolditalics : '/api/countryconfig/fonts/NotoSans-Regular.ttf'
367- }
368- }
309+ fonts : notoSansFont
310+ } ,
311+ {
312+ id : 'v2.tennis-club-membership-certificate-multipage' ,
313+ event : Event . TENNIS_CLUB_MEMBERSHIP ,
314+ isV2Template : true ,
315+ label : {
316+ id : 'certificates.tennis-club-membership.certificate.multipage' ,
317+ defaultMessage : 'Tennis Club Membership Certificate Multipage' ,
318+ description : 'The label for a tennis club membership certificate'
319+ } ,
320+ isDefault : false ,
321+ fee : {
322+ onTime : 7 ,
323+ late : 10.6 ,
324+ delayed : 18
325+ } ,
326+ svgUrl :
327+ '/api/countryconfig/certificates/v2.tennis-club-membership-certificate-multipage.svg' ,
328+ fonts : libreBaskervilleFont
369329 } ,
370330 {
371331 id : 'v2.death-certificate' ,
@@ -383,14 +343,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
383343 delayed : 18
384344 } ,
385345 svgUrl : '/api/countryconfig/certificates/v2.death-certificate.svg' ,
386- fonts : {
387- 'Libre Baskerville' : {
388- normal : '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf' ,
389- bold : '/api/countryconfig/fonts/LibreBaskerville-Bold.ttf' ,
390- italics : '/api/countryconfig/fonts/LibreBaskerville-Italic.ttf' ,
391- bolditalics : '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf'
392- }
393- }
346+ fonts : libreBaskervilleFont
394347 } ,
395348 {
396349 id : 'v2.death-certified-certificate' ,
@@ -409,14 +362,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
409362 } ,
410363 svgUrl :
411364 '/api/countryconfig/certificates/v2.death-certificate-certified-copy.svg' ,
412- fonts : {
413- 'Libre Baskerville' : {
414- normal : '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf' ,
415- bold : '/api/countryconfig/fonts/LibreBaskerville-Bold.ttf' ,
416- italics : '/api/countryconfig/fonts/LibreBaskerville-Italic.ttf' ,
417- bolditalics : '/api/countryconfig/fonts/LibreBaskerville-Regular.ttf'
418- }
419- }
365+ fonts : libreBaskervilleFont
420366 }
421367 ]
422368 return certificateConfigs
0 commit comments