All Files in undroid/phosphoricons0.1/
Not logged in

Files in directory undroid/phosphoricons0.1 in any check-in

  • make-phosporicons-svg-bundle.sh
  • phosphoricons-svg-bundle.gz
  • phosphoricons.tcl
  • pkgIndex.tcl
  • README.md
  • show.tcl

PhosphorIcons 0.1

A Tcl/Tk package wrapping SVG items from the Phosphor Icons version 2.0.8.

License

BSD for the code; the icons themselves are MIT licensed.

Dependencies

package require Tk
package require tksvg

Usage

package require PhosphorIcons
PhosphorIcons names ?pattern?
PhosphorIcons svg name ?color? ?opacity? ?stroke? ?strokewidth?
PhosphorIcons image name ?size? ?color? ?opacity?
PhosphorIcons image_nc name ?size? ?color? ?opacity?
PhosphorIcons image_ncg name imgname ?options?
PhosphorIcons flush
PhosphorIcons rebuild

Method names returns an alphabetically sorted list of icon names matching the given pattern, or all, if pattern is omitted.

Method svg returns an SVG string for the icon name with optional fill color color (defaults to black), optional fill opacity opacity (defaults to 1.0), optional stroke color stroke (defaults to none), and optional stroke width strokewidth (defaults to 1.0).

Method image creates and returns a photo image for the icon name with optional fill color color (defaults to black) and optional fill opacity opacity (defaults to 1.0). The size option specifies the integer icon size. If it is negative, the size is in pixels, otherwise in points. The default value for size is 16 points. The photo image is kept in an image cache for later re-use.

Method image_nc is similar to method image except that no caching is performed, i.e. a newly created image is returned.

Method image_ncg is similar to method image_nc but allows to provide a specific image name and render options as keyword arguments -size, -fill, -opacity, -stroke, and -strokewidth. Size and stroke width can be specified as floating point numbers with an optional unit suffix: d (density points), p (points), or m (millimeters). The stroke width is scaled unless a unit suffix is used or a negative number is given.

Method flush deletes all cached icon photo images.

Method rebuild recreates all cached icon photo images which have a size in points. This is useful when the tk scaling factor is changed at runtime.

A utility script named show.tcl demonstrates the usage of this package and displays all icons in a canvas widget.