In beginning to make images for TW I'd like to better understand the default approach for what become interface icons.
Best wishes
Josiah
TW works well with SVG. Its well understood & integrated into it.
Two things I don't understand ...
- WHY is the normative icon set at 22pt (points) rather than 22px (pixels)?
Some specific examples:
1in
is always96px.
3pt
is always4px
.25.4mm
is always96px.
- Am I right in thinking that the viewBox setting of "0 0 128 128" makes an ultimate SVG viewport 28% bigger than the content overall, with the svg content auto-centred?
In beginning to make images for TW I'd like to better understand the default approach for what become interface icons.
<symbol id="shape-icon-2" viewBox="0 26 100 48">
<!-- <path>s and whatever other shapes in here -->
</symbol>
<svg class="icon">
<use xlink:href="#shape-icon-2" />
</svg>
I've partly answered my own question. It will work using ID's in TW but only so long as the Tiddler containing the source SVG is also open. Once its closed the href's from any other Tiddler to it expire. I don't have the skill to figure out how to programmatically deal with this or even if you can.
BUT I'm wondering if there is a way to transclude a multiple "symbol" SVG into a tiddler so its hidden but still fully "alive". That might work for the use case since the "symbol set" in only for use in one Tiddler a time anyway. Just not sure what would happen if you had two Tiddlers open both of which had the same "symbol set" SVG ... In effect having the same ID in two places at once (albeit with identical content).
<symbol id="shape-icon-2" viewBox="0 26 100 48">
<!-- <path>s and whatever other shapes in here -->
</symbol>
I hide my alerts in a section in the top right bar that is 1px x 1px and did not notice any side effects until now.
for inspiration :)
Good attempt anyway!
Thomas
It works very well and saves clogging up the TW with hundreds of Tiddlers.
I was very surprised on the performance extracting and using them from the DD, which is excellent.
Daniello: what is the bad thing about having hundreds of tiddlers ?
I was very surprised on the performance extracting and using them from the DD, which is excellent.
Daniello: This may be because TW keeps a cache of recently requested tiddlers.