Problem/Motivation

Within fontawsome.module - "hook_icon_bundles", I noticed an "@todo" which read "Extract icons from CSS or JSON file (currently not possible)". I thought I would propose a patch, since I need some icons that aren't included in the hard-coded list.

Proposed resolution

Implement simple parsing logic that gets "_variables.scss" file (which is provided by the font awesome library) to provide a list of icons relative to the library version. Additionally I have remove the large array of font styles into a separate "inc", in-case the library doesn't exists.

Remaining tasks

Create a patch

See patch below.

User interface changes

None

API changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kingmackenzie created an issue. See original summary.

j1mb0b’s picture

Version: 7.x-2.5 » 7.x-2.x-dev
j1mb0b’s picture

j1mb0b’s picture

Issue summary: View changes
j1mb0b’s picture

Issue summary: View changes
j1mb0b’s picture

Fixed file_get_contents notice / spelling mistake.

j1mb0b’s picture

Status: Active » Needs review
stefan.r’s picture

Status: Needs review » Reviewed & tested by the community

#6 looks fine! It allows us to use the newly defined icons in 4.5.0, asthe hardcoded list in DEV is still based on 4.2.0.

Maybe just in case we use a different version locally than on the CDN,

+  if (!empty($fontawesome_path) && $font_vars = file_get_contents($fontawesome_path . '/scss/_variables.scss')) {
-  if (variable_get('fontawesome_use_cdn', FALSE) && !empty($fontawesome_path) && $font_vars = file_get_contents($fontawesome_path . '/scss/_variables.scss')) {

stefan.r’s picture

FileSize
25.19 KB

Attaching the list generated by the parser for 4.5.0.

bahuma20’s picture

The newer versions of fontawesome (v3.2.0 and above) have a icons.yml included which could be used, too. (Maybe easier)

akalata’s picture

How is this issue different from what's been going on at #2427005: Extract icons automatically ?

inders’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
bahuma20’s picture

Added related issue