As noted on the project page, the fontawesome module is one way to include the fontawesome library, but it's not the only way. In my case, I already have fontawesome loaded by my theme, so I don't need or want the module to load it again. The iconpicker doesn't seem to actually require fontawesome to be loaded in that particular way, so I would recommend removing it as a dependency.

Thanks for your work on this module!

Comments

JeffM2001 created an issue. See original summary.

jeffm2001’s picture

d34dman’s picture

I agree there could be multiple ways to load font awesome library. As in your case you say you are doing it in your theme. Which means the module won't work as desired if somebody were to switch the theme. How do you suggest we handle that?

jeffm2001’s picture

I'm not really sure how to handle that scenario. I guess I would suggest that it's not the responsibility of this module to make sure the font is loaded. The fontawesome-iconpicker library itself doesn't even require FontAwesome — at least according to its README.md: "You can use Font Awesome or another font icon set of your choice".

I think the way I would go is for this module to strongly recommend using the fontawesome module through its documentation and maybe a message in an install hook, but not actually require it.

d34dman’s picture

I see your point. There is definitely room for improvement.

1. Remove hard dependency to any font library.
2. Expose a status page to give better feedback to the users. (What goes into this page needs to be discussed, ideas welcome).
3. Expose configuration to include/restrict available fonts for Font Awesome Icon Picker. (aka expose settings supported in Font Awesome Icon Picker as drupal configurations).

I would work on these features in a separate branch and push to D.O. when it's more or less usable.

cosmicdreams’s picture

Can we handle the support of other font libraries in a different issue? I feel that we've achieved the goal of not depending on the fontawesome module.

cosmicdreams’s picture

Status: Active » Reviewed & tested by the community
d34dman’s picture

@cosmicdreams this issue is against 7.x-1.x-dev Have you tested the patch?

thomas.frobieter’s picture

I think a cleaner way is to stay with the fontawesome library module. Seems like bad practice to me implementing the iconfont just inside the frontend theme. The fontawesome module just needs improved settings, so that we are able to load the iconfont via CDN, library, external (URL) or local (path) - this way you can still store the iconfont inside your custom theme and it will be also available to the backend theme. I will create an feature request for this (==> https://www.drupal.org/project/fontawesome/issues/2931747).

Further more: This is the "Fontawesome Iconpicker" i don't think we should care about other Iconfonts here? Sure .. having an universal Iconfont / Icon API module and an universal Iconpicker module would be much greater .. but the naming here is very clear?!

Update: As i have mentioned in the issue (https://www.drupal.org/project/fontawesome/issues/2931747) we are already able to use local fonts by using a relative path in the "External Library Location" field.

jeffm2001’s picture

I agree that we shouldn't care about other icon fonts here, and I was never really suggesting that. My point is that the only thing needed for this module to work is to have the fontawesome font included on the page — it doesn't actually depend on any of the functionality in the fontawesome module.

Many themes already include fontawesome, so for me, I don't want to install an extra module that I don't need. My suggestion is to leave it up to the site builder how they want to include the font, and you could recommend the fontawesome module as an easy way to do it.

Anyway, that's my opinion, but if others don't see it the same way I'll let it go.

truls1502’s picture

Status: Reviewed & tested by the community » Active
StatusFileSize
new386 bytes

it seems that the patch is meant for a different purpose.
However, regarding the patch you showed is fixed on the issue #2982426: Font Awesome Icon Picker Library - Not found for a different purpose.

If you actually want to remove fontawesome from this module - you should use this one patch.

d34dman’s picture

Category: Task » Feature request

@JeffM2001,

My point is that the only thing needed for this module to work is to have the fontawesome font included on the page — it doesn't actually depend on any of the functionality in the fontawesome module.

TLDR;
Makes sense and a valid point. So we should be checking for the presence of the libraries and not the modules itself. In short it is not going to make themer experience better, reason in C.3 below.

Longer Version :

A.) Update as against recent changes done.

A.1. Current state of fontawesome_iconpicker does checks against the library `fontawesome-iconpicker` and `fontawesome` Drupal contrib module.

B.) From what i understand, what @JeffM2001 desires is,

B.1. Make `fontawesome_iconpicker`module depend on `fontawesome-iconpicker` library alone.
B.2. For the said purpose in "1" above dependency to `fontawesome` module should be removed.

C.) My comments,

C.1) It is possible remove the dependency on `fontawesome` from `fontawesome_iconpicker.info`.
C.2) If we implement C.1, as a module maintainer, i would have to check for the presence of `fontawesome` library. So I would revert this patch #2982426: Font Awesome Icon Picker Library - Not found.
C.3) Implementing C.1 and C.2 would mean, theme developer has to ensure they register the library. More information on how it can be done can be found in fontawesome's hook_library_info() - https://cgit.drupalcode.org/fontawesome/tree/fontawesome.module?h=7.x-3..... Also note that if you are using a different backend theme, then fontawesome library has to be loaded in the Backend theme too. This would involve theme developer writing the hook in a module and take care of loading the library on relevant pages.
C.4) So as you can see in C.3, the cost of not having a dependency on fontawesome is much more than having one in this case.
C.5) Why patch in #2 wont be accepted - reason is in C.2.
C.6) If we want C.1 and C.2, plus avoid the experience in C.3... this module can register and load 'fontawesome' library, (this is not what patch in #2 is trying to do btw).

jeffm2001’s picture

What I was actually suggesting is that as this is a module for the iconpicker, you don't necessarily need to worry about whether the fontawesome font is loaded. It could be done in lots of ways (and doesn't need to be registered as a library).

But I agree that loading it via the fontawesome module is likely the easiest for most site builders, and if as the maintainer you want to make absolutely certain that this module works out-of-the-box with no additional work by the site builder, I won't begrudge you that approach.

Feel free to mark this issue as closed.

truls1502’s picture

Status: Active » Closed (won't fix)

Thank you for the feedback, and I am going to mark the issue as closed.

Please re-open it in case you or someone have a good solution to it.