How to autoinstall fonts to system (e.g. for all-the-icon support) on first init run like autoinstalling emacs packages. I need crossplatfom solution (mac and linux). Or what is best practice to avoid it? For example, I don't remember that I installed fonts manually when I tried spacemacs. Thanks!
Installing fonts can be done in many different ways and needs to be done in different ways in different cases (depending on the underlying system, depending on whether you want it to be available globally or not). You can probably come up with some ad-hoc code which tries to handle the most common cases, but it would probably be better to do it as a shell script than as an Elisp program (so that it can be reused elsewhere, since it's fundamentally unrelated to Emacs itself).
I don't think such a script/tool exists already, sadly.
As for the best practice to deal with the problem, it likely depends on why you need to install a font, but I'd guess that the best practice is to arrange for your package not to depend on the presence of a particular font (e.g. just use standard and common Unicode chars and nothing more exotic).
system-type
variable, and when it comes to checking if fonts were already installed, thefile-exists-p
function should be the right one to use. – user12563 Mar 2 '17 at 17:38image-type-available-p
– lawlist Mar 6 '17 at 22:51