function getFont(opt, ecModel) {
    var gTextStyleModel = ecModel && ecModel.getModel('textStyle');
    return trim([
        // FIXME in node-canvas fontWeight is before fontStyle
        opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '',
        opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '',
        (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px',
        opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'
    ].join(' '));
}
@param {string} direction 'left' 'right' 'top' 'bottom'
@param {Array.<number>} transform Transform matrix: like [1, 0, 0, 1, 0, 0]
@param {boolean=} invert Whether use invert matrix.
@return {string} Transformed direction. 'left' 'right' 'top' 'bottom'