/**
 * Get random font data.
 * @function task.worker._randomFont
 * @returns {object}
 * @protected
 * @ignore
 * @author Taka Okunishi
 */
var path = require('path'),
    lib = require('../../lib'),
    array = lib.array,
    shuffled = array.shuffled
    ;
module.exports = function () {
    var fontsData = require('../data/fonts-data')
        .filter(function (data) {
            var extname = path.extname(data.filename);
            return extname === '.ttf' || extname === '.otf';
        });
    return shuffled(fontsData)
        .shift();
};