File tree 1 file changed +10
-13
lines changed
1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -780,25 +780,22 @@ class CompiledFont {
780
780
781
781
getPathJs ( unicode ) {
782
782
const { charCode, glyphId } = lookupCmap ( this . cmap , unicode ) ;
783
- let fn = this . compiledGlyphs [ glyphId ] ;
783
+ let fn = this . compiledGlyphs [ glyphId ] ,
784
+ compileEx ;
784
785
if ( ! fn ) {
785
786
try {
786
- fn = this . compiledGlyphs [ glyphId ] = this . compileGlyph (
787
- this . glyphs [ glyphId ] ,
788
- glyphId
789
- ) ;
787
+ fn = this . compileGlyph ( this . glyphs [ glyphId ] , glyphId ) ;
790
788
} catch ( ex ) {
791
- // Avoid attempting to re-compile a corrupt glyph.
792
- this . compiledGlyphs [ glyphId ] = NOOP ;
789
+ fn = NOOP ; // Avoid attempting to re-compile a corrupt glyph.
793
790
794
- if ( this . compiledCharCodeToGlyphId [ charCode ] === undefined ) {
795
- this . compiledCharCodeToGlyphId [ charCode ] = glyphId ;
796
- }
797
- throw ex ;
791
+ compileEx = ex ;
798
792
}
793
+ this . compiledGlyphs [ glyphId ] = fn ;
799
794
}
800
- if ( this . compiledCharCodeToGlyphId [ charCode ] === undefined ) {
801
- this . compiledCharCodeToGlyphId [ charCode ] = glyphId ;
795
+ this . compiledCharCodeToGlyphId [ charCode ] ??= glyphId ;
796
+
797
+ if ( compileEx ) {
798
+ throw compileEx ;
802
799
}
803
800
return fn ;
804
801
}
You can’t perform that action at this time.
0 commit comments