php-debugbar icon indicating copy to clipboard operation
php-debugbar copied to clipboard

CDN for fontawesome (and perhaps more)

Open barryvdh opened this issue 11 years ago • 6 comments

You've mentioned Assetic, but how do you normally handle fonts etc if you dump the css/assets? Also dump the fonts?

Wouldn't it be easier to use the CDN for FontAwesome? And perhaps also for things like jquery etc.

It does make it easier to update, is cached etc and don't have to worry about relative resources.

Or are you worried about working offline? In that case, font-awesome isn't 100% required of course, or we could make it an option (setUseCDN()?)

Any thoughts?

barryvdh avatar Aug 31 '14 16:08 barryvdh

Or we can inline the icons as well. See https://icomoon.io/app

With that, you can select multiple icon fonts, make a selection, add a prefix, set the font name and embed the font. This should prevent issues with icon namespaces (use debugbar-icon- instead of fa-), older/newer versions, offline loading and embedding css.

The icomoon project can be exported to a .json file, with the selection + preferences, so should be easy to update it. And will probably make it easier to switch to different fonts or add some more fonts if needed in the future.

barryvdh avatar Sep 01 '14 13:09 barryvdh

Okay, not so super easy, that doesn't support all tools. The easier way to embed them as data I can find now is using http://www.fontsquirrel.com/tools/webfont-generator Just upload the ttf file from font-awesome and copy the @fontface definitions and paste them in the css file. Seems to work fine, see https://github.com/barryvdh/laravel-debugbar/tree/master/src/Resources/vendor/font-awesome

barryvdh avatar Sep 01 '14 15:09 barryvdh

Or do you suggest we proxy the fonts also? I now map the css/js like mydomain.com/_debugbar/assets.css (and .js) but could also do something like /_debugbar/vendor/font-awesome/css/font-awesome.min.css and let that output the actual file from the vendor dir, and also do the same for all paths etc. What would you suggest? Do you want to add something like this to the core or do you suggest you let every framework handle it?

barryvdh avatar Sep 06 '14 17:09 barryvdh

use cnd :+1:

junxy avatar Apr 23 '15 13:04 junxy

  • CDN :+1:
  • Alternative: Remove asset dependency on fontawesome.

veloper avatar May 07 '15 15:05 veloper

An alternative could be to use SVG icons directly in the HTML, but not sure how that impacts everything. Similar to https://github.com/blog/2112-delivering-octicons-with-svg For example, using https://github.com/encharm/Font-Awesome-SVG-PNG

barryvdh avatar May 09 '16 06:05 barryvdh