Font family plugin

Basic usage

User can pick some fonts in Trumbowyg.

Read font family plugin documentation

Change the font!

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus, aliquam, minima fugiat placeat provident optio nam reiciendis eius beatae quibusdam!

The code


$('#editor')
.trumbowyg({
    btns: [
        ['fontfamily']
    ]
});
            

Custom font list

Change the font!

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus, aliquam, minima fugiat placeat provident optio nam reiciendis eius beatae quibusdam!

The code


$('#editor-custom-font-list')
.trumbowyg({
    btns: [
        ['fontfamily']
    ],
    plugins: {
        fontfamily: {
            fontList: [
                {name: 'Arial', family: 'Arial, Helvetica, sans-serif'},
                {name: 'Comic Sans', family: '\'Comic Sans MS\', Textile, cursive, sans-serif'},
                {name: 'Open Sans', family: '\'Open Sans\', sans-serif'}
            ]
        }
    }
});
            

Setup

In head tag


            

At the end of body


<!-- Import jQuery -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.3.1.min.js"><\/script>')</script>