Created
February 7, 2022 13:57
-
-
Save codeeshop-oc/2304ae3d869e5130c51cffefe770a691 to your computer and use it in GitHub Desktop.
Add custom font in Summernote
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Include font style on your page. For example, I am adding the Roboto font family. | |
Single | |
<link href="https://fonts.googleapis.com/css?family=Roboto" / rel="stylesheet"> | |
Multiple | |
<link async href="https://fonts.googleapis.com/css?family=Roboto|Nunito:300,400,400i,600,700&display=swap" rel="stylesheet"> | |
$('#summernote').summernote({ | |
fontNames: ['Arial', 'Arial Black', 'Comic Sans MS', 'Courier New', 'Helvetica', 'Impact', 'Tahoma', 'Times New Roman', 'Verdana', 'Roboto'], | |
fontNamesIgnoreCheck: ['Roboto'] | |
}); | |
Configure the new font name with default fonts. Should ignore to check the new font as it takes time to load. | |
$('.summertext').summernote('fontName', 'Roboto'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment