@@ -49,6 +49,10 @@ export async function loadBuiltInFontsRaw(glyphSet = 'latin') {
49
49
let /** @type {Promise<ArrayBuffer> } */ nimbusMonoItalic ;
50
50
let /** @type {Promise<ArrayBuffer> } */ nimbusMonoBold ;
51
51
let /** @type {Promise<ArrayBuffer> } */ nimbusMonoBoldItalic ;
52
+ let /** @type {Promise<ArrayBuffer> } */ gothicNormal ;
53
+ let /** @type {Promise<ArrayBuffer> } */ gothicItalic ;
54
+ let /** @type {Promise<ArrayBuffer> } */ gothicBold ;
55
+ let /** @type {Promise<ArrayBuffer> } */ gothicBoldItalic ;
52
56
if ( typeof process === 'undefined' ) {
53
57
if ( glyphSet === 'latin' ) {
54
58
carlitoNormal = fetch ( new URL ( '../fonts/latin/Carlito-Regular.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
@@ -79,6 +83,10 @@ export async function loadBuiltInFontsRaw(glyphSet = 'latin') {
79
83
nimbusMonoItalic = fetch ( new URL ( '../fonts/latin/NimbusMono-Italic.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
80
84
nimbusMonoBold = fetch ( new URL ( '../fonts/latin/NimbusMono-Bold.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
81
85
nimbusMonoBoldItalic = fetch ( new URL ( '../fonts/latin/NimbusMono-BoldItalic.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
86
+ gothicNormal = fetch ( new URL ( '../fonts/latin/URWGothicBook-Regular.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
87
+ gothicItalic = fetch ( new URL ( '../fonts/latin/URWGothicBook-Italic.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
88
+ gothicBold = fetch ( new URL ( '../fonts/latin/URWGothicBook-Bold.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
89
+ gothicBoldItalic = fetch ( new URL ( '../fonts/latin/URWGothicBook-BoldItalic.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
82
90
} else {
83
91
carlitoNormal = fetch ( new URL ( '../fonts/all/Carlito-Regular.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
84
92
carlitoItalic = fetch ( new URL ( '../fonts/all/Carlito-Italic.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
@@ -108,6 +116,10 @@ export async function loadBuiltInFontsRaw(glyphSet = 'latin') {
108
116
nimbusMonoItalic = fetch ( new URL ( '../fonts/all/NimbusMono-Italic.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
109
117
nimbusMonoBold = fetch ( new URL ( '../fonts/all/NimbusMono-Bold.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
110
118
nimbusMonoBoldItalic = fetch ( new URL ( '../fonts/all/NimbusMono-BoldItalic.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
119
+ gothicNormal = fetch ( new URL ( '../fonts/all/URWGothicBook-Regular.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
120
+ gothicItalic = fetch ( new URL ( '../fonts/all/URWGothicBook-Italic.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
121
+ gothicBold = fetch ( new URL ( '../fonts/all/URWGothicBook-Bold.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
122
+ gothicBoldItalic = fetch ( new URL ( '../fonts/all/URWGothicBook-BoldItalic.woff' , import . meta. url ) ) . then ( ( res ) => res . arrayBuffer ( ) ) ;
111
123
}
112
124
} else {
113
125
const { readFile } = await import ( 'fs/promises' ) ;
@@ -139,6 +151,10 @@ export async function loadBuiltInFontsRaw(glyphSet = 'latin') {
139
151
nimbusMonoItalic = readFile ( new URL ( '../fonts/all/NimbusMono-Italic.woff' , import . meta. url ) ) . then ( ( res ) => res . buffer ) ;
140
152
nimbusMonoBold = readFile ( new URL ( '../fonts/all/NimbusMono-Bold.woff' , import . meta. url ) ) . then ( ( res ) => res . buffer ) ;
141
153
nimbusMonoBoldItalic = readFile ( new URL ( '../fonts/all/NimbusMono-BoldItalic.woff' , import . meta. url ) ) . then ( ( res ) => res . buffer ) ;
154
+ gothicNormal = readFile ( new URL ( '../fonts/all/URWGothicBook-Regular.woff' , import . meta. url ) ) . then ( ( res ) => res . buffer ) ;
155
+ gothicItalic = readFile ( new URL ( '../fonts/all/URWGothicBook-Italic.woff' , import . meta. url ) ) . then ( ( res ) => res . buffer ) ;
156
+ gothicBold = readFile ( new URL ( '../fonts/all/URWGothicBook-Bold.woff' , import . meta. url ) ) . then ( ( res ) => res . buffer ) ;
157
+ gothicBoldItalic = readFile ( new URL ( '../fonts/all/URWGothicBook-BoldItalic.woff' , import . meta. url ) ) . then ( ( res ) => res . buffer ) ;
142
158
}
143
159
144
160
const srcObj = {
@@ -151,6 +167,9 @@ export async function loadBuiltInFontsRaw(glyphSet = 'latin') {
151
167
Garamond : {
152
168
normal : await garamondNormal , italic : await garamondItalic , bold : await garamondBold , boldItalic : await garamondBoldItalic ,
153
169
} ,
170
+ Gothic : {
171
+ normal : await gothicNormal , italic : await gothicItalic , bold : await gothicBold , boldItalic : await gothicBoldItalic ,
172
+ } ,
154
173
Palatino : {
155
174
normal : await palatinoNormal , italic : await palatinoItalic , bold : await palatinoBold , boldItalic : await palatinoBoldItalic ,
156
175
} ,
@@ -430,22 +449,25 @@ export async function optimizeFontContainerAll(fontPrivate, charMetricsObj) {
430
449
const carlitoPromise = optimizeFontContainerFamily ( fontPrivate . Carlito , charMetricsObj ) ;
431
450
const centuryPromise = optimizeFontContainerFamily ( fontPrivate . Century , charMetricsObj ) ;
432
451
const garamondPromise = optimizeFontContainerFamily ( fontPrivate . Garamond , charMetricsObj ) ;
452
+ const gothicPromise = optimizeFontContainerFamily ( fontPrivate . Gothic , charMetricsObj ) ;
433
453
const palatinoPromise = optimizeFontContainerFamily ( fontPrivate . Palatino , charMetricsObj ) ;
434
454
const nimbusRomanPromise = optimizeFontContainerFamily ( fontPrivate . NimbusRoman , charMetricsObj ) ;
435
455
const nimbusSansPromise = optimizeFontContainerFamily ( fontPrivate . NimbusSans , charMetricsObj ) ;
436
456
const nimbusMonoPromise = optimizeFontContainerFamily ( fontPrivate . NimbusMono , charMetricsObj ) ;
437
457
438
- const results = await Promise . all ( [ carlitoPromise , centuryPromise , garamondPromise , palatinoPromise , nimbusRomanPromise , nimbusSansPromise , nimbusMonoPromise ] ) ;
458
+ const results = await Promise . all ( [ carlitoPromise , centuryPromise , garamondPromise , gothicPromise ,
459
+ palatinoPromise , nimbusRomanPromise , nimbusSansPromise , nimbusMonoPromise ] ) ;
439
460
440
461
if ( results . every ( ( x ) => x === null ) ) return null ;
441
462
442
463
return {
443
464
Carlito : results [ 0 ] ,
444
465
Century : results [ 1 ] ,
445
466
Garamond : results [ 2 ] ,
446
- Palatino : results [ 3 ] ,
447
- NimbusRoman : results [ 4 ] ,
448
- NimbusSans : results [ 5 ] ,
449
- NimbusMono : results [ 6 ] ,
467
+ Gothic : results [ 3 ] ,
468
+ Palatino : results [ 4 ] ,
469
+ NimbusRoman : results [ 5 ] ,
470
+ NimbusSans : results [ 6 ] ,
471
+ NimbusMono : results [ 7 ] ,
450
472
} ;
451
473
}
0 commit comments