Hello I need an Iconmoon provider for the Icon API. If you posted your development work I would be willing to post any patches I come up with to get it working.

Thanks.

Comments

markhalliwell’s picture

Status: Active » Postponed

Actually I don't have any code yet. I've been waiting for that the maintainer of that project to add a packaged JSON file:
https://github.com/Keyamoon/IcoMoon-App/issues/57#issuecomment-23023621

Apparently though, they removed their GH project entirely. I was able to find this comment in my mail:

On Aug 21, 2013, at 10:02 AM, Keyamoon <notifications@github.com> wrote:

The entirely new version of the app (which is almost ready now), adds a JSON in the font pack.

I have no idea when this project will even be able to begin development. I simply claimed the namespace so it will work with Icon API.

markhalliwell’s picture

I've updated the project page.

dustin@pi’s picture

Thanks for the update!

dustin@pi’s picture

Two things:

  1. I just noticed that my icomoon downloads have started to include a JSON file in the Font pack
  2. Also, for anyone who needs to use icomoon files right away, I've discovered that you can download the SVG files from icomoon, upload them to Fontello and the load them into the Icon API via the Fontello module. It's not as good as native support but it's not bad

Mark, if you are interested in starting this in the next little bit I can help with testing (and some debugging/patching).

markhalliwell’s picture

@Dustin@PI: I would appreciate any patches. It will likely be very identical to the https://drupal.org/project/fontello module, expect checking for and parsing the IcoMoon specific json file.

dustin@pi’s picture

Hi Mark,

I have been looking at cloning the Fontello module (I'll probablly post it to a sandbox rather than as a patch).

One question: does the IconAPI assume that it's always going to be a .zip file and open the archive for you? In the Fontello module code all the file operations seem to be directly against the files and there doesn't seem to be anything that deals with the archive format.

Thanks!
Dustin.

markhalliwell’s picture

Title: Any code or work on this project? » Make an initial 7.x-1.0 release.
Category: Support request » Task
Issue summary: View changes
Status: Postponed » Active

No, Icon API utilizes core's archiver class automatically and, yes, does extract the archive depending on what the server configuration allows. This means that technically any archive (zip, tar.gz, etc.) could be extracted, however these services typically just spit out a zip. @see icon_archive_extract()

I would recommend going over includes/import.inc in Icon API pretty extensively. From there you can see the form, how it validates (which calls hook_icon_PROVIDER_import_validate() for the automatic detection feature) and submission (which calls hook_icon_PROVIDER_import_process() to process the archive).

There's really no need for a sandbox. To be completely honest, I'd rather just make you a co-maintainer so you can commit directly. These types of modules aren't that difficult to maintain once they're initially setup.

I'll go ahead clone the fontello module and rename some stuff to create the initial branch.

markhalliwell’s picture

Ok, I created the initial module from a clone of the fontello module. I renamed most of everything, but you'll likely need to do some cleanup. I added a few @todo's through out. When you're ready to make a release, just ping me here so I can review and test as well.

Thanks @Dustin@PI!

markhalliwell’s picture

Assigned: Unassigned » dustin@pi
dustin@pi’s picture

FYI ... I'm nearly done, just a bit more clean up. There's a lot less features for icomoon (no animations, only one include method, no IE 7 support), so the work was mainly removing code and remapping config.json to selections.json.

Questions:

(1) do you want me to attach as a Diff? Alternately I'm fine being a committer.

(2) Having a bit of problem with the way icon_archive_extract is setting the $extract location. Fontello has it's files an extra level deep, but icomoon's json file is right at the root of the archive.

i.e.

  • fontello: archive_name.zip/archive_name/config.json
  • iconmoon: archive_name.zip/selection.json

I patched icon/includes/import.inc as per the following (let me know if you want me to post a issue/patch to the icon issue queue).


  $files = $archiver->listContents();
  //check if the files are nested a layer deep in the archive
  if (count($files) > 1) {
    $sub_directory = '';
    $extract_location = $directory;
  } else {
    $sub_directory = strtok($files[0], '/\\');
    $extract_location = $directory. '/' . $sub_directory;
  }

markhalliwell’s picture

1. just commit directly to this repo.
2. provide a patch in the icon module.

drupov’s picture

Hi Dustin@PI,

do you have something commitable already?

I guess this module should be in a starting phase together with the patch https://drupal.org/node/2183233 (as in #10 (2))?

Thanks

markhalliwell’s picture

Assigned: dustin@pi » markhalliwell
Status: Active » Reviewed & tested by the community

Committed 95fd6ca:

Finished initial migration of IcoMoon imports.

I'll have to release icon-7.x-1.0-beta4 before I can make a release here.

markhalliwell’s picture

Status: Reviewed & tested by the community » Fixed

Icon API: 7.x-1.0-beta4 (https://drupal.org/node/2197225)
Icomoon: 7.x-1.0 (https://drupal.org/node/2197235)

drupov’s picture

Version: » 7.x-1.0

Cool, just confirming that it works!

Thanks!

dustin@pi’s picture

Thanks Mark! I had it mostly working two weeks ago but I still had one bug and I haven't had time to go back and figure out what it was. Your code is a bit cleaner then what I had anyway. I'll run some tests today.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.