Coder Social home page Coder Social logo

emacs-svg-icon's Introduction

Introduction

This library allows you to create SVG icons by parsing remote collections, whose license are compatible with GNU Emacs. The default size of an icon is exactly 2x1 characters, such that it can be inserted into text, without disturbing alignment. Note that each icon is cached locally, to speed-up loading the next time you use it. If for some reason the cache is corrupted, you can force reload using the svg-icon-get-data function.

Usage

;; Direct insertion
(insert-image (svg-icon "material" "attachment"))
(insert-image (svg-icon "bootstrap" "alarm"))
(insert-image (svg-icon "octicons" "alert"))
(insert-image (svg-icon "boxicons" "dizzy"))

;; Defining a "string icon"
(setq material-attach (propertize "--"
                      'display (svg-icon "material" "attachment")))

(insert (format "[%s]" material-attach))

Output

Available collections:

If you want to add a new collections (i.e. URL), make sure the icons are monochrome and that their sizes are consistent.

The built-in collections are:

  • Boxicons, available under a Creative Commons 4.0 license. As of version 2.07 (December 2020), this collection offers 1500 icons in two styles (regular & solid). Browse gallery

  • Octicons, available under a MIT License with some usage restriction for the GitHub logo. As of version 11.2.0 (December 2020), this collection offers 201 icons. Browse gallery

  • Material, available under an Apache 2.0 license. As of version 4.0.0 (December 2020), this collection offers 5000+ icons in 4 styles (filled, outlined, rounded, sharp). Browse gallery

  • Bootstrap, available under an MIT license. As of version 1.2.1 (December 2020), this collection offers 1200+ icons in 2 styles (regular & filled). Browse gallery

emacs-svg-icon's People

Contributors

rougier avatar zevlg avatar jasonm23 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.