(function (global, factory) {
	typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
	typeof define === 'function' && define.amd ? define(factory) :
	(global = global || self, global.tools = factory());
}(this, (function () { 'use strict';
  var tools = {
    // 文字大小
    fontSize(size) {
      var  array = []
      switch(size) {
        case 'normal':
          array = [29, 33, 0]
          break
        case 'doubleHeight':
          array = [29, 33, 1]
          break
        case 'doubleWidth':
          array = [29, 33, 16]
          break
        case 'double':
          array = [29, 33, 17]
          break
      }
      return array
    },

    // 文字加粗
    fontBold() {
      return [27, 69, 1]
    },

    // 文字对齐方式
    fontAlign(align) {
      var array = []
      switch(align) {
        case 'left':
          array = [27, 97, 48]
          break
        case 'center':
          array = [27, 97, 49]
          break
        case 'right':
          array = [27, 97, 50]
          break
      }
      return array
    },

    normalizeStyle(styleString) {
      let styleArray = styleString.split(';')
      let styleObject = {}
      styleArray.forEach(item => {
        if (item) {
          var styleItem = item.split(':')
          styleObject[styleItem[0]] = styleItem[1]
        }
      })
      return styleObject
    }
  }

  return tools
})))