GNU-devel ELPA - svg-lib

svg-lib

Description
SVG tags, progress bars & icons
Latest
svg-lib-0.3.0.20240219.161327.tar (.sig), 2024-Mar-31, 1.07 MiB
Maintainer
Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
Atom feed
svg-lib.xml
Website
https://github.com/rougier/svg-lib
Browse ELPA's repository
CGit or Gitweb
Badge

To install this package from Emacs, use package-install or list-packages.

Full description

1. SVG Library

svg-lib is an Emacs library that allows to create and display various SVG objects, namely tags, icons, buttons, progress bars, progress pies and dates. Each object is guaranteed to fit nicely in a text buffer ensuring width is a multiple of character width and height a multiple of character height.

2. Installation

M-x package-install RET svg-lib RET

3. Quick start

For the impatient, evaluate the following expression:

M-: (insert-image (svg-lib-tag "TODO"))

This should insert a SVG tag displaying "TODO" in a rounded box whose size is exactly 5 characters wide (because of padding).

4. Usage

4.1. Objects

  • svg-lib-tag LABEL
  • svg-lib-icon ICON
  • svg-lib-icon+tag ICON LABEL
  • svg-lib-button LABEL HOOK
  • svg-lib-progress-bar VALUE
  • svg-lib-progress-pie VALUE
  • svg-lib-date DATE

4.2. Styling

Each library object can be styled using a style property list that defines:

  • foreground color
  • background color
  • internal padding (tag and icon)
  • external margin (in char)
  • stroke width (in pixels)
  • corner radius (in pixels) for the rounded box
  • horizontal alignment (0 to 1) inside margins
  • width (in characters)
  • height as a scale of line height
  • scale (for icon)
  • ascent (for text)
  • crop-left to crop object on the left
  • crop-right to crop object on the right
  • collection to use for icon
  • font family
  • font size
  • font weight

5. Icon repositories

Icons can be created by parsing remote collections whose license are compatibles with GNU Emacs. The default size of an icon is exactly 2x1 characters such that it can be inserted inside a text without disturbing alignment.

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. If you want to add new collections (i.e. URL), make sure the icons are monochrome, that their size is consistent and that they include a 'viewBox' node.

5.1. Material Design (7447 icons)

Open-source iconography for designers and developers.

5.2. Simple icons (2926 icons)

Over 2900 Free SVG icons for popular brands.

5.3. Bootstrap (> 2000 icons)

Official open source SVG icon library for Bootstrap.

5.4. Boxicons (1634 icons)

Simple Open Source icons carefully crafted for designers & developers.

5.5. Octicons (322 icons)

Octicons are a set of SVG icons built by GitHub for GitHub.

5.6. VSCode (209 icons)

Icons used in Visual Studio Code.

6. Screenshots

screenshot.png

screenshot-2.png

Old versions

svg-lib-0.3.0.20240116.145654.tar.lz2024-Jan-16 865 KiB
svg-lib-0.3.0.20240110.131418.tar.lz2024-Jan-10 865 KiB
svg-lib-0.3.0.20240109.211641.tar.lz2024-Jan-10 865 KiB
svg-lib-0.3.0.20240108.113737.tar.lz2024-Jan-08 865 KiB
svg-lib-0.3.0.20240102.102609.tar.lz2024-Jan-02 865 KiB
svg-lib-0.3.0.20231231.90921.tar.lz2023-Dec-31 865 KiB
svg-lib-0.3.0.20231229.141443.tar.lz2023-Dec-29 865 KiB
svg-lib-0.2.8.0.20231122.73323.tar.lz2023-Nov-22 861 KiB
svg-lib-0.2.0.20211018.82904.tar.lz2021-Oct-18 644 KiB
svg-lib-0.1.0.20210928.53958.tar.lz2021-Sep-28 644 KiB

News

Version 0.3.1
- Added icon only button
- Added face-or-style option to creation functions
- Make svg-lib-tag more generic (can now create tag, icon or icon+tag)
- Various bug fixes

Version 0.3
- Renamed 'svg-lib-button' to 'svg-lib-icon+tag'
- Added interactive 'svg-lib-button' with associtated 'svg-lib-button-mode'
- Added proper documentation in the README

Version 0.2.8
- No background for icon when background color is nil
- Refactored date icons

Version 0.2.7
- Added a dynamic date icon

Version 0.2.6
- Bug fix with bootstrap icon directory

Version 0.2.5
- Bug fix in text size computation

Version 0.2.4
- Better error handling if SVG support is missing

Version 0.2.2
- Added a left/right crop style argument to allow for tags collage.

Version 0.2.1
- Added an alignment parameter for moving tags inside margins.

Version 0.2
- Fix most of the warnings.

Version 0.1:
- Submission to ELPA