diff --git a/src/iconim.nim b/src/iconim.nim index 2d28e16..2f37912 100644 --- a/src/iconim.nim +++ b/src/iconim.nim @@ -7,10 +7,12 @@ import std/[os, tables, strtabs, xmltree, xmlparser, json] from std/strutils import indent, join +export XmlAttributes + type SVGIcon = ref object path, code: string - attrs: XmlAttributes + attrs*: XmlAttributes Library = ref object name: string @@ -96,6 +98,11 @@ proc size*(svg: SVGIcon, s: int): SVGIcon = svg.attrs["height"] = $s result = svg +proc strokeWidth*(svg: SVGIcon, i: int): SVGIcon = + ## Change `stroke-width` attribute value + svg.attrs["stroke-width"] = $i + result = svg + proc `$`*(svg: SVGIcon): string = if svg != nil: result = "" & svg.code & ""