Check-in [2136c425c2]

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add TIP 545: image photo SVG options: remove -unit and add target
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2136c425c2626cbd1501cce45fe2caca93212de92cdce6df0588a314b1d07149
User & Date: oehhar 2019-05-19 18:50:23
Context
2019-05-19
18:54
Add: TIP 545: image photo SVG options: remove -unit and add target height/width option check-in: 429d23a233 user: oehhar tags: trunk
18:50
Add TIP 545: image photo SVG options: remove -unit and add target check-in: 2136c425c2 user: oehhar tags: trunk
11:08
539 is a duplicate of 341 check-in: 372d2d307d user: dkf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to index.json.

1

2
3
4
5
6
7
8
...
541
542
543
544
545
546
547
548
549
{"tip": {

	"544":{"url":"./tip/544.md","keywords":"Tcl","":"","state":"Draft","type":"Project","author":["Jan Nijtmans <[email protected]>","François Vogel <[email protected]>"],"created":"15-May-2019","title":"# TIP 544: Export TclGetIntForIndex()","post-history":"","tcl-version":"8.7","vote":"Pending","tcl-branch":"tip-544","discussions-to":"Tcl Core list","is-jest":false},
	"543":{"url":"./tip/543.md","keywords":"Tcl, traces","created":"10-May-2019","post-history":"","state":"Draft","vote":"Pending","tcl-version":"9.0","type":"Project","title":"# TIP 543: Eliminate TCL\\_INTERP\\_DESTROYED flag value","author":["Don Porter <[email protected]>"],"is-jest":false},
	"542":{"url":"./tip/542.md","keywords":"Tcl","created":"10-May-2019","post-history":"","state":"Draft","tcl-branch":"utf-max","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 542: New encodings: UTF-16, UCS-2, Support for switchable (Androwish-compatible) Full Unicode support.","discussions-to":"Tcl Core list","author":["Jan Nijtmans <[email protected]>","Jan Nijtmans <[email protected]>"],"is-jest":false},
	"541":{"url":"./tip/541.md","keywords":"Tcl","created":"8-May-2019","post-history":"","state":"Draft","tcl-branch":"bug-2858503fff","tcl-version":"8.6","vote":"In progress","type":"Project","title":"# TIP 541: Add support for 'end' index in ttk::combobox current","author":["François Vogel <[email protected]>"],"is-jest":false},
	"540":{"url":"./tip/540.md","keywords":"Tcl, Unix, pipeline","created":"03-May-2019","post-history":"","state":"Draft","vote":"Pending","tcl-version":"8.7","type":"Project","title":"# TIP 540: Add -signal Channel Configure Option to POSIX Pipes","author":["Donal K. Fellows <[email protected]>"],"is-jest":false},
	"539":{"url":"./tip/539.md","tcl-ticket":"2370575","keywords":"Tcl, dict filter, set intersection","created":"27-Nov-2008","obsoleted-by":"341","post-history":"","state":"Withdrawn","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 539: Multiple dict filter patterns","author":["Lars Hellström <[email protected]>"],"is-jest":false},
	"538":{"url":"./tip/538.md","keywords":"Tcl","created":"9-April-2019","post-history":"","state":"Draft","tcl-branch":"digit-bit-60","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 538: Externalize libtommath","author":["Jan Nijtmans <[email protected]>"],"is-jest":false},
................................................................................
	"5":{"url":"./tip/5.md","created":"17-Oct-2000","post-history":"","state":"Final","vote":"Done","tcl-version":"8.4","type":"Project","title":"# TIP 5: Make TkClassProcs and TkSetClassProcs Public and Extensible","author":["Eric Melski <[email protected]>"],"is-jest":false},
	"4":{"url":"./tip/4.md","created":"26-Oct-2000","post-history":"","state":"Draft","vote":"Pending","type":"Informative","title":"# TIP 4: Tcl Release and Distribution Philosophy","discussions-to":"news:comp.lang.tcl","author":["Brent Welch <[email protected]>","Donal K. Fellows <[email protected]>","Larry W. Virden <[email protected]>","Larry W. Virden <[email protected]>"],"is-jest":false},
	"3":{"url":"./tip/3.md","created":"14-Sep-2000","post-history":"","state":"Accepted","vote":"Done","type":"Process","title":"# TIP 3: TIP Format","author":["Andreas Kupries <[email protected]>","Donal K. Fellows <[email protected]>"],"is-jest":false},
	"2":{"url":"./tip/2.md","created":"12-Sep-2000","post-history":"","state":"Draft","vote":"Pending","type":"Process","title":"# TIP 2: TIP Guidelines","author":["Andreas Kupries <[email protected]>","Donal K. Fellows <[email protected]>","Don Porter <[email protected]>","Mo DeJong <[email protected]>","Larry W. Virden <[email protected]>","Kevin Kenny <[email protected]>"],"is-jest":false},
	"1":{"url":"./tip/1.md","created":"14-Sep-2000","obsoleted-by":"386","post-history":"","state":"Withdrawn","vote":"No voting","type":"Informational","title":"# TIP 1: TIP Index","author":["TIP Editor <[email protected]>"],"is-jest":false},
	"0":{"url":"./tip/0.md","created":"11-Dec-2000","post-history":"","state":"Final","vote":"Done","type":"Process","title":"# TIP 0: Tcl Core Team Basic Rules","author":["John Ousterhout <[email protected]>"],"is-jest":false},
	"@min": 0,
	"@max": 544
}, "@timestamp": 1558264060}
>







 







|
|
1
2
3
4
5
6
7
8
9
...
542
543
544
545
546
547
548
549
550
{"tip": {
	"545":{"url":"./tip/545.md","keywords":"Tk, image","created":"19-May-2019","state":"Draft","tk-branch":"tip-545-svg-options","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 545: image photo SVG options: remove -unit and add target","author":["Harald Oehlmann <[email protected]>"],"is-jest":false},
	"544":{"url":"./tip/544.md","keywords":"Tcl","":"","state":"Draft","type":"Project","author":["Jan Nijtmans <[email protected]>","François Vogel <[email protected]>"],"created":"15-May-2019","title":"# TIP 544: Export TclGetIntForIndex()","post-history":"","tcl-version":"8.7","vote":"Pending","tcl-branch":"tip-544","discussions-to":"Tcl Core list","is-jest":false},
	"543":{"url":"./tip/543.md","keywords":"Tcl, traces","created":"10-May-2019","post-history":"","state":"Draft","vote":"Pending","tcl-version":"9.0","type":"Project","title":"# TIP 543: Eliminate TCL\\_INTERP\\_DESTROYED flag value","author":["Don Porter <[email protected]>"],"is-jest":false},
	"542":{"url":"./tip/542.md","keywords":"Tcl","created":"10-May-2019","post-history":"","state":"Draft","tcl-branch":"utf-max","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 542: New encodings: UTF-16, UCS-2, Support for switchable (Androwish-compatible) Full Unicode support.","discussions-to":"Tcl Core list","author":["Jan Nijtmans <[email protected]>","Jan Nijtmans <[email protected]>"],"is-jest":false},
	"541":{"url":"./tip/541.md","keywords":"Tcl","created":"8-May-2019","post-history":"","state":"Draft","tcl-branch":"bug-2858503fff","tcl-version":"8.6","vote":"In progress","type":"Project","title":"# TIP 541: Add support for 'end' index in ttk::combobox current","author":["François Vogel <[email protected]>"],"is-jest":false},
	"540":{"url":"./tip/540.md","keywords":"Tcl, Unix, pipeline","created":"03-May-2019","post-history":"","state":"Draft","vote":"Pending","tcl-version":"8.7","type":"Project","title":"# TIP 540: Add -signal Channel Configure Option to POSIX Pipes","author":["Donal K. Fellows <[email protected]>"],"is-jest":false},
	"539":{"url":"./tip/539.md","tcl-ticket":"2370575","keywords":"Tcl, dict filter, set intersection","created":"27-Nov-2008","obsoleted-by":"341","post-history":"","state":"Withdrawn","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 539: Multiple dict filter patterns","author":["Lars Hellström <[email protected]>"],"is-jest":false},
	"538":{"url":"./tip/538.md","keywords":"Tcl","created":"9-April-2019","post-history":"","state":"Draft","tcl-branch":"digit-bit-60","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 538: Externalize libtommath","author":["Jan Nijtmans <[email protected]>"],"is-jest":false},
................................................................................
	"5":{"url":"./tip/5.md","created":"17-Oct-2000","post-history":"","state":"Final","vote":"Done","tcl-version":"8.4","type":"Project","title":"# TIP 5: Make TkClassProcs and TkSetClassProcs Public and Extensible","author":["Eric Melski <[email protected]>"],"is-jest":false},
	"4":{"url":"./tip/4.md","created":"26-Oct-2000","post-history":"","state":"Draft","vote":"Pending","type":"Informative","title":"# TIP 4: Tcl Release and Distribution Philosophy","discussions-to":"news:comp.lang.tcl","author":["Brent Welch <[email protected]>","Donal K. Fellows <[email protected]>","Larry W. Virden <[email protected]>","Larry W. Virden <[email protected]>"],"is-jest":false},
	"3":{"url":"./tip/3.md","created":"14-Sep-2000","post-history":"","state":"Accepted","vote":"Done","type":"Process","title":"# TIP 3: TIP Format","author":["Andreas Kupries <[email protected]>","Donal K. Fellows <[email protected]>"],"is-jest":false},
	"2":{"url":"./tip/2.md","created":"12-Sep-2000","post-history":"","state":"Draft","vote":"Pending","type":"Process","title":"# TIP 2: TIP Guidelines","author":["Andreas Kupries <[email protected]>","Donal K. Fellows <[email protected]>","Don Porter <[email protected]>","Mo DeJong <[email protected]>","Larry W. Virden <[email protected]>","Kevin Kenny <[email protected]>"],"is-jest":false},
	"1":{"url":"./tip/1.md","created":"14-Sep-2000","obsoleted-by":"386","post-history":"","state":"Withdrawn","vote":"No voting","type":"Informational","title":"# TIP 1: TIP Index","author":["TIP Editor <[email protected]>"],"is-jest":false},
	"0":{"url":"./tip/0.md","created":"11-Dec-2000","post-history":"","state":"Final","vote":"Done","type":"Process","title":"# TIP 0: Tcl Core Team Basic Rules","author":["John Ousterhout <[email protected]>"],"is-jest":false},
	"@min": 0,
	"@max": 545
}, "@timestamp": 1558291787}

Changes to index.md.

209
210
211
212
213
214
215








216
217
218
219
220
221
222
<th>Type</th>
<th>Tcl Version</th>
<th>Status</th>
<th>Title</th>
<th>Impl.</th>
</tr></thead><tbody>









<tr class='state-draft type-project version-87'>
<td valign='top'><a href='./tip/544.md'>544</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>
<td valign='top' ><a href='./tip/544.md'>Export TclGetIntForIndex()</a></td>
<td valign='top'><a href='/tcl/timeline?r=tip-544'>Link</a></td>






>
>
>
>
>
>
>
>







209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<th>Type</th>
<th>Tcl Version</th>
<th>Status</th>
<th>Title</th>
<th>Impl.</th>
</tr></thead><tbody>

<tr class='state-draft type-project version-87'>
<td valign='top'><a href='./tip/545.md'>545</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>
<td valign='top' ><a href='./tip/545.md'>image photo SVG options: remove -unit and add target</a></td>
<td valign='top'><a href='/tk/timeline?r=tip-545-svg-options'>Link</a></td>
</tr>
<tr class='state-draft type-project version-87'>
<td valign='top'><a href='./tip/544.md'>544</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>
<td valign='top' ><a href='./tip/544.md'>Export TclGetIntForIndex()</a></td>
<td valign='top'><a href='/tcl/timeline?r=tip-544'>Link</a></td>

Added tip/545.md.




















































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# TIP 545: image photo SVG options: remove -unit and add target 
	Author:         Harald Oehlmann <[email protected]>
	State:          Draft
	Type:           Project
	Vote:           Pending
	Created:        19-May-2019
	Keywords:       Tk, image
	Tcl-Version:    8.7
	Tk-Branch:     tip-545-svg-options
-----

# Abstract

Image photo SVG support was added to Tk by TIP 507.
This TIP is about the options of SVG rendering:

   *   The option "-unit" has no effect, as it sets the unit of the intermediate representation.
   *   The option "-scale float" is the essential tool to set rendering scaling. Nevertheless, to scale to a given height or width, a two-step procedure is required. This common case should be implemented by a one step procedure.

# Rationale

This TIP included two components:

## Remove option "-unit"

Remove the option "-unit", which has no effect.
The given unit is used to set the unit of the intermediate set of polygons.
The final unit is pixel anyway, so setting this to anything else than pixels does not make sense.

## Add a possibility to scale to a given width or height in pixels

A common usage of svg is to render button images for a given button height or width.
Buttons of applications may have all the same height or width when aranged in button lines aranged horizontally or vertically.

The current solution to render a svg to a given height "$height" is:

    image create photo p -file "test.svg"
    set imageHeight [image height p]
    p configure [list svg -scale [expr {double($height) / $imageHeight}]

This two step procedure has a high performance impact, as the image is rendered twice.
The aim is to render it only once by one parameter.

# Specification

## Remove option "-unit"

## Add new option -scaletoheight

The option "-scaletoheight entier" specifies the image height in pixels to scale to.
The image width is found by the aspect-ratio.

Example with an image "test.svg" with an aspect ration of width:height = 2:1.
The required height is 16 pixels:

    % image create photo p -file "test.svg" -format {svg -scaletoheight 16}
    p
    % image height p
    16
    % image width p
    32

The entier argument must be positive.
The option may not be specified together with "-scale" and/or "-scaletowidth".

## Add new option -scaletowidth

The option "-scaletowidth entier" specifies the image width in pixels to scale to.
The image height is found by the aspect-ratio.

Example with an image "test.svg" with an aspect ration of width:height = 2:1.
The required width is 16 pixels:

    % image create photo p -file "test.svg" -format {svg -scaletowidth 16}
    p
    % image width p
    16
    % image height p
    8

The entier argument must be positive.
The option may not be specified together with "-scale" and/or "-scaletoheight".

# Implementation

Implementation may start soon with the tag tip-545-svg-options.

# Copyright

This document has been placed in the public domain.