Days
Hours
Minutes
Seconds
x

New Froala Editor v5.0.0 is here โ€“ Learn More

Skip to content
Froala Documentation

Font Family Plugin

Plugins are fully functional during your trial once you've added your trial key to the setup.

Allows users to select from different font families which is set by the fontFamily option. This option is an Object where the key represents the font name (just the way you would pass it to the font-family CSS rule e.g. font-family: 'Roboto', sans-serif;) and its value is the font name that appears in the dropdown list e.g. Roboto, so, you can use it to add your custom font type either.


Plugin options:

fontFamily
Object -
Defines the fonts that appear under the Font Family button from the rich text editor's toolbar.
Default: {
'Arial,Helvetica,sans-serif': 'Arial',
'Georgia,serif': 'Georgia', 'Impact,Charcoal,sans-serif': 'Impact',
'Tahoma,Geneva,sans-serif': 'Tahoma',
"'Times New Roman',Times,serif": 'Times New Roman',
'Verdana,Geneva,sans-serif': 'Verdana'
}
fontFamilyDefaultSelection
String -
The text to display when the font family is unknown or nothing is selected.
Default: 'Font Family'
fontFamilySelection
Boolean -
The Font Family button from the WYSIWYG editor's toolbar is replaced with a dropdown showing the actual font family name for the current text selection.
Default: false

Plugin methods:

fontFamily.apply (value)
returns: Object
Set the font family of the selected text.
โ— value: The value of the font family.
Type: String

Add Plugin to your code:

Plugin name: fontFamily

Plugin JS Script: ../js/plugins/font_family.min.js

Or from CDN https://cdn.jsdelivr.net/npm/froala-editor@latest/js/plugins/font_family.min.js

Plugin CSS link:

Example:

Font Family

Ready to dive in? Explore our plans

Sign up

Download the code by signing up for our newsletter

Sign up

Download the code by signing up for our newsletter

Note: By registering, you confirm that you agree to the processing of your personal data by Froala, Inc. - Froala as described in the Privacy Statement. Froala, Inc. - Froala is part of the Idera group and may share your information with its parent company Idera, Inc., and its affiliates. For further details on how your data is used, stored, and shared, please review our Privacy Statement.