@@ -177,7 +177,7 @@ describe("Context2D: standard tests", () => {
177177 doc . addFont ( "fa-solid-900.ttf" , "Font Awesome 6 Free Solid" , "normal" ) ;
178178
179179 const ctx = doc . context2d ;
180- ctx . font = " normal 16pt \ "Font Awesome 6 Free Solid\"" ;
180+ ctx . font = ' normal 16pt "Font Awesome 6 Free Solid"' ;
181181
182182 expect ( doc . getFont ( ) . fontName ) . toBe ( "Font Awesome 6 Free Solid" ) ;
183183 } ) ;
@@ -762,12 +762,17 @@ describe("Context2D: standard tests", () => {
762762 } ) ;
763763
764764 it ( "font face map cache invalidation" , ( ) => {
765+ const ptSans = loadBinaryResource ( "reference/PTSans.ttf" ) ;
766+
765767 var doc = new jsPDF ( {
766768 orientation : "p" ,
767769 unit : "pt" ,
768770 format : "a4" ,
769771 floatPrecision : 2
770772 } ) ;
773+ doc . addFileToVFS ( "CustomFont" , ptSans ) ;
774+ doc . addFont ( "CustomFont" , "CustomFont" , "normal" ) ;
775+
771776 var ctx = doc . context2d ;
772777
773778 // Set up font faces for context2d
@@ -786,7 +791,8 @@ describe("Context2D: standard tests", () => {
786791
787792 // Add a new font to the document (simulating dynamic font loading)
788793 // This should trigger font face map cache invalidation
789- doc . addFont ( "dummy-font-data" , "NewCustomFont" , "normal" ) ;
794+ doc . addFileToVFS ( "NewCustomFont" , ptSans ) ;
795+ doc . addFont ( "NewCustomFont" , "NewCustomFont" , "normal" ) ;
790796
791797 // Change font again - this should rebuild the font face map
792798 // and not use stale cached data
0 commit comments