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 Feb 16, 2024
1 parent d12325c commit 872c35f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,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 872c35f

Please sign in to comment.