module FontAwesomePackager
  class Font
    attr_accessor :name

    def initialize(name)
      @name = name
    end

    def uni
      @uni ||= self.class.uni_from_name(name)
    end

    def to_hash
      { :name => name, :uni => uni }
    end

    # The unicode characters taken from here:
    # https://github.com/johnsmclay/icnfnt/blob/master/static/app/js/controllers.js#L104
    # have had this replace over them to turn to ruby
    #
    # gsub(/{name:"(.*)",\s*uni:"(.*)"}/, '\'\1\' => \'\2\'')
    #
    def self.uni_from_name(name)
      {
        'glass' => '000',
        'music' => '001',
        'search' => '002',
        'envelope' => '003',
        'heart' => '004',
        'star' => '005',
        'star-empty' => '006',
        'user' => '007',
        'film' => '008',
        'th-large' => '009',
        'th' => '00a',
        'th-list' => '00b',
        'ok' => '00c',
        'remove' => '00d',
        'zoom-in' => '00e',

        'zoom-out' => '010',
        'off' => '011',
        'signal' => '012',
        'cog' => '013',
        'trash' => '014',
        'home' => '015',
        'file' => '016',
        'time' => '017',
        'road' => '018',
        'download-alt' => '019',
        'download' => '01a',
        'upload' => '01b',
        'inbox' => '01c',
        'play-circle' => '01d',
        'repeat' => '01e',
        'refresh' => '021',
        'list-alt' => '022',
        'lock' => '023',
        'flag' => '024',
        'headphones' => '025',
        'volume-off' => '026',
        'volume-down' => '027',
        'volume-up' => '028',
        'qrcode' => '029',
        'barcode' => '02a',
        'tag' => '02b',
        'tags' => '02c',
        'book' => '02d',
        'bookmark' => '02e',
        'print' => '02f',

        'camera' => '030',
        'font' => '031',
        'bold' => '032',
        'italic' => '033',
        'text-height' => '034',
        'text-width' => '035',
        'align-left' => '036',
        'align-center' => '037',
        'align-right' => '038',
        'align-justify' => '039',
        'list' => '03a',
        'indent-left' => '03b',
        'indent-right' => '03c',
        'facetime-video' => '03d',
        'picture' => '03e',

        'pencil' => '040',
        'map-marker' => '041',
        'adjust' => '042',
        'tint' => '043',
        'edit' => '044',
        'share' => '045',
        'check' => '046',
        'move' => '047',
        'step-backward' => '048',
        'fast-backward' => '049',
        'backward' => '04a',
        'play' => '04b',
        'pause' => '04c',
        'stop' => '04d',
        'forward' => '04e',

        'fast-forward' => '050',
        'step-forward' => '051',
        'eject' => '052',
        'chevron-left' => '053',
        'chevron-right' => '054',
        'plus-sign' => '055',
        'minus-sign' => '056',
        'remove-sign' => '057',
        'ok-sign' => '058',
        'question-sign' => '059',
        'info-sign' => '05a',
        'screenshot' => '05b',
        'remove-circle' => '05c',
        'ok-circle' => '05d',
        'ban-circle' => '05e',

        'arrow-left' => '060',
        'arrow-right' => '061',
        'arrow-up' => '062',
        'arrow-down' => '063',
        'share-alt' => '064',
        'resize-full' => '065',
        'resize-small' => '066',
        'plus' => '067',
        'minus' => '068',
        'asterisk' => '069',
        'exclamation-sign' => '06a',
        'gift' => '06b',
        'leaf' => '06c',
        'fire' => '06d',
        'eye-open' => '06e',

        'eye-close' => '070',
        'warning-sign' => '071',
        'plane' => '072',
        'calendar' => '073',
        'random' => '074',
        'comment' => '075',
        'magnet' => '076',
        'chevron-up' => '077',
        'chevron-down' => '078',
        'retweet' => '079',
        'shopping-cart' => '07a',
        'folder-close' => '07b',
        'folder-open' => '07c',
        'resize-vertical' => '07d',
        'resize-horizontal' => '07e',

        'bar-chart' => '080',
        'twitter-sign' => '081',
        'facebook-sign' => '082',
        'camera-retro' => '083',
        'key' => '084',
        'cogs' => '085',
        'comments' => '086',
        'thumbs-up' => '087',
        'thumbs-down' => '088',
        'star-half' => '089',
        'heart-empty' => '08a',
        'signout' => '08b',
        'linkedin-sign' => '08c',
        'pushpin' => '08d',
        'external-link' => '08e',

        'signin' => '090',
        'trophy' => '091',
        'github-sign' => '092',
        'upload-alt' => '093',
        'lemon' => '094',
        'phone' => '095',
        'check-empty' => '096',
        'bookmark-empty' => '097',
        'phone-sign' => '098',
        'twitter' => '099',
        'facebook' => '09a',
        'github' => '09b',
        'unlock' => '09c',
        'credit-card' => '09d',
        'rss' => '09e',

        'hdd' => '0a0',
        'bullhorn' => '0a1',
        'bell' => '0a2',
        'certificate' => '0a3',
        'hand-right' => '0a4',
        'hand-left' => '0a5',
        'hand-up' => '0a6',
        'hand-down' => '0a7',
        'circle-arrow-left' => '0a8',
        'circle-arrow-right' => '0a9',
        'circle-arrow-up' => '0aa',
        'circle-arrow-down' => '0ab',
        'globe' => '0ac',
        'wrench' => '0ad',
        'tasks' => '0ae',

        'filter' => '0b0',
        'briefcase' => '0b1',
        'fullscreen' => '0b2',

        'group' => '0c0',
        'link' => '0c1',
        'cloud' => '0c2',
        'beaker' => '0c3',
        'cut' => '0c4',
        'copy' => '0c5',
        'paper-clip' => '0c6',
        'save' => '0c7',
        'sign-blank' => '0c8',
        'reorder' => '0c9',
        'list-ul' => '0ca',
        'list-ol' => '0cb',
        'strikethrough' => '0cc',
        'underline' => '0cd',
        'table' => '0ce',

        'magic' => '0d0',
        'truck' => '0d1',
        'pinterest' => '0d2',
        'pinterest-sign' => '0d3',
        'google-plus-sign' => '0d4',
        'google-plus' => '0d5',
        'money' => '0d6',
        'caret-down' => '0d7',
        'caret-up' => '0d8',
        'caret-left' => '0d9',
        'caret-right' => '0da',
        'columns' => '0db',
        'sort' => '0dc',
        'sort-down' => '0dd',
        'sort-up' => '0de',

        'envelope-alt' => '0e0',
        'linkedin' => '0e1',
        'undo' => '0e2',
        'legal' => '0e3',
        'dashboard' => '0e4',
        'comment-alt' => '0e5',
        'comments-alt' => '0e6',
        'bolt' => '0e7',
        'sitemap' => '0e8',
        'umbrella' => '0e9',
        'paste' => '0ea',
        'lightbulb' => '0eb',
        'exchange' => '0ec',
        'cloud-download' => '0ed',
        'cloud-upload' => '0ee',

        'user-md' => '0f0',
        'stethoscope' => '0f1',
        'suitcase' => '0f2',
        'bell-alt' => '0f3',
        'coffee' => '0f4',
        'food' => '0f5',
        'file-alt' => '0f6',
        'building' => '0f7',
        'hospital' => '0f8',
        'ambulance' => '0f9',
        'medkit' => '0fa',
        'fighter-jet' => '0fb',
        'beer' => '0fc',
        'h-sign' => '0fd',
        'plus-sign-alt' => '0fe',

        'double-angle-left' => '100',
        'double-angle-right' => '101',
        'double-angle-up' => '102',
        'double-angle-down' => '103',
        'angle-left' => '104',
        'angle-right' => '105',
        'angle-up' => '106',
        'angle-down' => '107',
        'desktop' => '108',
        'laptop' => '109',
        'tablet' => '10a',
        'mobile-phone' => '10b',
        'circle-blank' => '10c',
        'quote-left' => '10d',
        'quote-right' => '10e',

        'spinner' => '110',
        'circle' => '111',
        'reply' => '112',
        'github-alt' => '113',
        'folder-close-alt' => '114',
        'folder-open-alt' => '115'
      }[name.to_s]
    end
  end
end
