Skip to content

Commit

Permalink
Font Library: Unload the deleted font faces
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur791004 committed Mar 1, 2024
1 parent 2b219c1 commit b77d34d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,12 @@ function FontLibraryProvider( { children } ) {
...fontFamilies,
[ font.source ]: newCustomFonts,
} );

if ( font.fontFace ) {
font.fontFace.forEach( ( face ) => {
unloadFontFaceInBrowser( face, 'all' );
} );
}
};

const activateCustomFontFamilies = ( fontsToAdd ) => {
Expand Down

0 comments on commit b77d34d

Please sign in to comment.