Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Possible to scroll text w/ transparent bg on top of image?

54 views
Skip to first unread message

Dave

unread,
Apr 4, 2017, 8:30:38 PM4/4/17
to
I can't think of a way to do this. I'd like to have a bg image and be
able to scroll text over it without obscuring the bg except for the
characters themselves.

It would also be great if one could use a custom font. When I searched
for this, I found that I'm not alone in wanting to do this but there is
no cross-platform way (one has to use either twapi for windows or put a
font file into ~/.fonts or something like that for unix).
--
computerjock AT mail DOT com

Alexandre Ferrieux

unread,
Apr 5, 2017, 2:20:59 AM4/5/17
to
If the text is single-font and not too long, a text item with empty bgcolor (the default) will happily let any other item from behind shine through. So you just need one image item and one text item. Of course, scrolling will need manual update of coordinates, and possibly logical clipping for performance.

-Alex

Dave

unread,
Apr 5, 2017, 3:05:25 AM4/5/17
to
You're suggesting a canvas with text items I think.

What I would want is a text widget with a transparent bg so I could
"place" it on top of an image (label widget). The scrollbar would not be
transparent, but I can live with that.

I didn't think it would work, but I tried text .t config -bg {} and sure
enough, I got an error.

Matthew Hiles

unread,
Apr 5, 2017, 10:20:15 AM4/5/17
to
Regarding using a custom font:

I really doubt you'll find a cross-platform way to do this--unless you feel androwish / undroidwish is a viable option.

Since it renders in SDL, using FreeType, you can embed fonts and it will work across all supported androwish platforms.

Alexandre Ferrieux

unread,
Apr 5, 2017, 4:56:33 PM4/5/17
to
On Wednesday, April 5, 2017 at 9:05:25 AM UTC+2, Dave wrote:
> On 4/5/2017 1:20 AM, Alexandre Ferrieux wrote:
> > On Wednesday, April 5, 2017 at 2:30:38 AM UTC+2, Dave wrote:
> >> I can't think of a way to do this. I'd like to have a bg image and be
> >> able to scroll text over it without obscuring the bg except for the
> >> characters themselves.
> >>
> >> It would also be great if one could use a custom font. When I searched
> >> for this, I found that I'm not alone in wanting to do this but there is
> >> no cross-platform way (one has to use either twapi for windows or put a
> >> font file into ~/.fonts or something like that for unix).
> >
> > If the text is single-font and not too long, a text item with empty bgcolor (the default) will happily let any other item from behind shine through. So you just need one image item and one text item. Of course, scrolling will need manual update of coordinates, and possibly logical clipping for performance.
> >
> > -Alex
> >
> You're suggesting a canvas with text items I think.

Yes, sorry for not stating it clearly :)

> What I would want is a text widget with a transparent bg so I could
> "place" it on top of an image (label widget). The scrollbar would not be
> transparent, but I can live with that.

What you want is pretty clear, but since currently Tk widgets follow the opaque-stacking-and-tiling model, you won't have it as such. Hence my suggestion for a plan B, with its acknowledged limitations.

-Alex
0 new messages