• Hey there,

    Been using this plugin for a while now. Love it.

    In terms of using Font Awesome 5 – I’ve added the beta but noticed you can only use your domains for CDN enqueuing. I typically add the actual fonts themselves and import sass files to my sites instead of going through a CDN. Is there any sort of setup I could implement to utilize my local fonts instead of using the CDN?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Matt Keys

    (@mattkeys)

    Hey Kalsch,

    Glad you like the plugin. There are two areas where FontAwesome may be enqueued by this plugin, one of which is optional.

    1) Backend area (wp-admin area), the font is enqueued here to make it available to be chosen when in the ACF field this plugin creates. Currently this area is not optional.

    2) On the frontend area of your site, the plugin can also enqueue FontAwesome on pages that are using the FontAwesome ACF field. This part is optional, and can be configured when creating the ACF FA field.

    Does your scenario fit under the second area (front end)? Or are you saying you have a need/desire to enqueue manually in the backend as well?

    Matt Keys

    Thread Starter kalsch

    (@kalsch)

    I actually use it almost exclusively on the backend wp-admin area. Basically I’d just like it to use the local fonts instead of a CDN url. So like right now I’m using SASS and its importing the font-faces from the actual physical font files within the project.

    So there is no need to enqueue any CDN url but I still want a full list of pro version fonts to be selectable in the dropdown of the field. Does that make sense?

    Plugin Author Matt Keys

    (@mattkeys)

    Understood, currently that isn’t available as an option. Tt is possible to do, but there are some challenges.

    One of the trickiest things about writing and supporting this plugin is keeping an up to date list of all available icons. In previous versions of this plugin the FontAwesome CSS itself was parsed with regex to ‘scrape’ out all of the icons to generate an inventory.

    As FontAwesome got more complex with all of the different icon sets this problem became much more difficult to fix with a regex. Thankfully the 5.x versions of FontAwesome ship with a YAML file that details all of the icons in each version of the font.

    I wrote a companion plugin that I run on my own web server to keep an up to date copy of that YAML file for both free and pro version in a reliable location hosted on GitHub and CDN’d through jsDelivr. The plugin then parses through this YAML and caches the list of icons in the database.

    A manual enqueue would require that the user also provide that YAML file in some way, possibly placing it in a directory of the plugin so that it can be read. There will also need to be a way to invalidate the cached icon set if/when the YAML file was replaced with a new version.

    I’d be interested to hear from more users if this is a feature that more people would like to see before I invest the extra dev time to make it happen.

    Thread Starter kalsch

    (@kalsch)

    Ahh, I did wonder how you compiled your lists.

    So for me personally it’s not the end of the world if your list is up-to-date but my local files are not. Having 98% of the icons load in the dropdown is better than nothing. If anything it would remind me to update my font files if I see broken ones in the list. Off the top of my head, though, if you wanted to be able to offer this feature while trying to keep things synced you could make a filter for the YAML file location that we can use to point it to our local version if it is available and we feel like updating it ourselves.

    Plugin Author Matt Keys

    (@mattkeys)

    The YAML location filter is a good idea.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Using Font Awesome 5 Pro with local fonts’ is closed to new replies.