• ANNOUNCE: TkSVG 0.15 with color-order support

    From Harald Oehlmann@wortkarg3@yahoo.com to comp.lang.tcl on Mon Oct 13 18:15:43 2025
    From Newsgroup: comp.lang.tcl

    TkSVG, the SVG Tk 9 support for Tk 8.6, has a 0.15 release:

    https://github.com/tcltk-depot/tksvg/releases/tag/0.15

    This is due to upstream changes in great SVGNANO project.

    The changes are:

    - support of the svg "color-order" attribute
    - fixing a possible race condition in color values

    There are binaries for MAC-OS, Linux and Win32/64.

    Please comment, if those are helpful for you.

    And thanks to magic other Christian to bring us all this gems !

    Harald
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Harald Oehlmann@wortkarg3@yahoo.com to comp.lang.tcl on Mon Oct 13 18:42:24 2025
    From Newsgroup: comp.lang.tcl

    Am 13.10.2025 um 18:15 schrieb Harald Oehlmann:
    TkSVG, the SVG Tk 9 support for Tk 8.6, has a 0.15 release:

    https://github.com/tcltk-depot/tksvg/releases/tag/0.15

    This is due to upstream changes in great SVGNANO project.

    The changes are:

    - support of the svg "color-order" attribute
    - fixing a possible race condition in color values

    There are binaries for MAC-OS, Linux and Win32/64.

    Please comment, if those are helpful for you.

    And thanks to magic other Christian to bring us all this gems !

    Harald

    Sorry, it is paint-order, not color order:

    https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/paint-order

    Harald
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mark Summerfield@m.n.summerfield@gmail.com to comp.lang.tcl on Tue Oct 14 07:40:31 2025
    From Newsgroup: comp.lang.tcl

    On Mon, 13 Oct 2025 18:15:43 +0200, Harald Oehlmann wrote:

    TkSVG, the SVG Tk 9 support for Tk 8.6, has a 0.15 release:

    https://github.com/tcltk-depot/tksvg/releases/tag/0.15

    This is due to upstream changes in great SVGNANO project.

    The changes are:

    - support of the svg "color-order" attribute
    - fixing a possible race condition in color values

    There are binaries for MAC-OS, Linux and Win32/64.

    Please comment, if those are helpful for you.

    And thanks to magic other Christian to bring us all this gems !

    Harald

    I find Tcl/Tk 9's SVG support really useful.

    For my GUI applications _all_ my icons are SVG and for my buttons'
    and menu items' -image I use this tiny function:

    proc icon {svg {width 0}} {
    if {!$width} {
    return [image create photo -file $::APPPATH/images/$svg]
    }
    image create photo -file $::APPPATH/images/$svg \
    -format "svg -scaletowidth $width"
    }

    And for color menus I generate color swatches programmatically,
    again using SVG:

    proc swatch {color size} {
    const R [expr {max(3, $size / 4.0)}]
    const W [expr {$R + 2.5}]
    const SVG "<svg width=\"$size\" height=\"$size\"><rect x=\"0\"
    y=\"0\" width=\"$size\" height=\"$size\" rx=\"$R\" ry=\"$R\"
    fill=\"$color\" stroke-width=\"$W\" stroke=\"white\"></svg>"
    image create photo -data $SVG
    }

    The only caveat is that for icons that contain text I must (once
    each) load them into inkscape and for the text do "Object to Path"
    so that they don't need any fonts.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Harald Oehlmann@wortkarg3@yahoo.com to comp.lang.tcl on Tue Oct 14 10:02:28 2025
    From Newsgroup: comp.lang.tcl

    Am 14.10.2025 um 09:40 schrieb Mark Summerfield:
    On Mon, 13 Oct 2025 18:15:43 +0200, Harald Oehlmann wrote:

    TkSVG, the SVG Tk 9 support for Tk 8.6, has a 0.15 release:

    https://github.com/tcltk-depot/tksvg/releases/tag/0.15

    This is due to upstream changes in great SVGNANO project.

    The changes are:

    - support of the svg "color-order" attribute
    - fixing a possible race condition in color values

    There are binaries for MAC-OS, Linux and Win32/64.

    Please comment, if those are helpful for you.

    And thanks to magic other Christian to bring us all this gems !

    Harald

    I find Tcl/Tk 9's SVG support really useful.

    For my GUI applications _all_ my icons are SVG and for my buttons'
    and menu items' -image I use this tiny function:

    proc icon {svg {width 0}} {
    if {!$width} {
    return [image create photo -file $::APPPATH/images/$svg]
    }
    image create photo -file $::APPPATH/images/$svg \
    -format "svg -scaletowidth $width"
    }

    And for color menus I generate color swatches programmatically,
    again using SVG:

    proc swatch {color size} {
    const R [expr {max(3, $size / 4.0)}]
    const W [expr {$R + 2.5}]
    const SVG "<svg width=\"$size\" height=\"$size\"><rect x=\"0\"
    y=\"0\" width=\"$size\" height=\"$size\" rx=\"$R\" ry=\"$R\"
    fill=\"$color\" stroke-width=\"$W\" stroke=\"white\"></svg>"
    image create photo -data $SVG
    }

    The only caveat is that for icons that contain text I must (once
    each) load them into inkscape and for the text do "Object to Path"
    so that they don't need any fonts.

    Great, that it is useful for you.
    Ren|- replaced BLT by generated svg to render high quality anti-aliased
    graphs on the fly.

    If you look to Csabas work in Tk, some icon colors are also modified on
    the fly, for example on dark themes.

    Yes, the missing font support is often demanded, beside some color
    shading options. There are TkSVG hooks to parse the font information and
    to paint the font components externally. Nevertheless, this is currently
    not implemented. I also use Inkscape.

    And I think, the new paint-order is also useful.

    Thanks for all,
    Harald
    --- Synchronet 3.21a-Linux NewsLink 1.2