Sujet : Re: canvas: change the background of a text item
De : undroidwish (at) *nospam* googlemail.com (undroidwish)
Groupes : comp.lang.tclDate : 30. Oct 2024, 20:29:38
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vfu1f3$29gua$1@dont-email.me>
References : 1 2
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0
On 10/30/24 14:42, Ralf Fassel wrote:
Ok, found a workaround on the WIKI:
https://wiki.tcl-lang.org/page/canvas+text
...
thanks for digging, that's intriguing. The XLFD allowed in ancient times
for transformations, didn't know that. Not that it is relevant for now,
since we all render our texts in Tk using libxft. But until 2.3.5, that library, too, had still problems scaling/rotating/translating
bitmap fonts (especially the color emojis).
- create a rectangle with the bbox of the text and lower it beneath
the text.
And yes, the challenge now is to make the rectangle (ahem, rotated, a
polygon) for a somewhat rotated text out of its bbox (if you'd like to
have a text background).
And please, enhance the wiki in this regard.
BR,
Christian