/**
 * AI Design Icons Build Tool
 * @requires grunt-webfont, fontforge
 * @author Wayne
 */
const path = require('path');
const fontVersion = '1.0.6';
const fontDist = 'src/icons/aid-dist-v'+fontVersion;
const fontSrc = 'src/icons';
module.exports = function (grunt) {
  'use strict';
  grunt.initConfig({
    clean: [fontDist],
    webfont: {
      aidregular: {
        //alert-circle close-octagon-outline battery-10 battery-80 access-point-network access-point chemical-weapon battery-charging-90
        src: fontSrc+'/svg/*.svg',
        // src: [fontSrc+'/svg/alert-circle.svg', fontSrc+'/svg/close-octagon-outline.svg', fontSrc+'/svg/access-point-network.svg', fontSrc+'/svg/access-point.svg', fontSrc+'/svg/chemical-weapon.svg', fontSrc+'/svg/battery-charging-10.svg', fontSrc+'/svg/battery-charging-20.svg', fontSrc+'/svg/battery-charging-90.svg'],
        dest: fontDist+'/fonts',
        destScss: fontDist+'/scss',
        options: {
          font: 'aidesignicons',
          fontFilename: 'aidesignicons-regular',//regular
          fontFamilyName: 'AI Design Icons',
          types: 'eot,woff2,woff,ttf,svg',
/*          engine:'node',
          normalize: false,
          fontHeight:1001,
          autoHint: false,
          optimize: true,*/
          codepointsFile: fontSrc+'/tmpl/codepoints-'+fontVersion,
          // syntax: 'bootstrap',
          template: fontSrc+'/tmpl/tmpl.scss',
          templateOptions: {
            cssPrefix: 'aid',
            fontName: 'AI Design Icons',
            fontSizeBase: '24px',
            fontWeight: 'regular',
          },
          htmlDemo: true,
          htmlDemoTemplate: fontSrc+'/tmpl/tmpl.html',
          htmlDemoFilename: 'aidesignicons-preview',
          relativeFontPath: '../fonts',
          version: fontVersion
        }
      }
    }
  });
  grunt.loadNpmTasks('grunt-webfont');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.registerTask('default', ['clean','webfont']);
};
