File tree 1 file changed +13
-11
lines changed
web/packages/core/src/internal/player
1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -615,17 +615,19 @@ export class InnerPlayer {
615
615
}
616
616
} else if ( typeof fontSource === "object" ) {
617
617
// Handle new format (object with additional properties)
618
- try {
619
- const response = await fetch ( key ) ;
620
- builder . addFont (
621
- key ,
622
- typeof fontSource [ 'name' ] === "string" ? fontSource [ 'name' ] : null ,
623
- typeof fontSource [ 'bold' ] === "boolean" ? fontSource [ 'bold' ] : null ,
624
- typeof fontSource [ 'italics' ] === "boolean" ? fontSource [ 'italics' ] : null ,
625
- new Uint8Array ( await response . arrayBuffer ( ) ) ,
626
- ) ;
627
- } catch ( error ) {
628
- console . warn ( `Couldn't download font source from ${ key } ` , error ) ;
618
+ for ( const [ url , fontInfo ] of Object . entries ( fontSource ) ) {
619
+ try {
620
+ const response = await fetch ( url ) ;
621
+ builder . addFont (
622
+ url ,
623
+ fontInfo ?. [ 'name' ] || null ,
624
+ fontInfo ?. [ 'bold' ] ?? null ,
625
+ fontInfo ?. [ 'italics' ] ?? null ,
626
+ new Uint8Array ( await response . arrayBuffer ( ) ) ,
627
+ ) ;
628
+ } catch ( error ) {
629
+ console . warn ( `Couldn't download font source from ${ key } ` , error ) ;
630
+ }
629
631
}
630
632
}
631
633
}
You can’t perform that action at this time.
0 commit comments