colorizing words in text-info

615 views
Skip to first unread message

Vittorio Cagnetta

unread,
Mar 28, 2013, 1:07:15 PM3/28/13
to yad-c...@googlegroups.com
Hi Victor!

Congratulations for your great work.

I added a "yad mode" to my library EasyBashGUI (https://sites.google.com/site/easybashgui)

Beside EBG, I work on an other open source project, related to a karaoke player.
It is finished, but it misses a better karaoke window (now it uses xterm).

I'm working on yad to add such feature:
E.g.:

...
echo "...Singing the song..." | yad --back=grey --fontname="60" --wrap --justify=center --margins=10 --tail --width 800 --height 600 --center --undecorated --text-info --button=Close:1 --button=Fullscreen:9
return_value="${?}"
if [ ${return_value} -eq 1 ]; then
...
...

My problem is that I need to color some words with *two* colors (words sung, and words to sing), and reload phrase with color that "moves" from left to right.

Is it possible?

Thanks in advance

Julio C. Neves

unread,
Mar 28, 2013, 2:46:40 PM3/28/13
to yad-c...@googlegroups.com
Try to do it adapting a stuff like this:
$ Bold=$(tput bold)
$ Red=$(tput setaf 1)
$ Rst=$(tput setaf 9)
$ Blue=$(tput setaf 4)
$ Reset=$(tput sgr0)
$ echo ${Bold}I can write${Red} RED$Rst or$Blue BLUE$Reset

If it doesn't work, research about Pango Markup Language.

I don't remember how to change colors using Pango, but I do remember how to change size:

yad --text "Using <big>big</big> chars"

Or how to change emphasys:

yad --text "Using <b>bold</b> chars"

Or Both:

yad --text "Using <big><b>bigbold</b></big> chars"

or:

yad --text "Using <big><big><big><big><big><big><b>bigbold</b></big></big></big></big></big></big> chars"

Abcs,
Julio
@juliobash



2013/3/28 Vittorio Cagnetta <vais...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "yad-common" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yad-common+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Vittorio Cagnetta

unread,
Mar 29, 2013, 3:43:25 AM3/29/13
to yad-c...@googlegroups.com


Hi Julio!


Thanks for the answer.


No. Those tips don't fix my problem.  :(


Those tips modify chars in "normal" dialog, but I need "--text-info" dialog (for its "--tail" option).

In --text-info dialog, chars in file (or in StdIn) remain unchanged: control chars used to colorize are interpreted literally, and this behaviour is for tput chars as well for pango tags.


So my question is: how to change chars visualisation in --text-info depending directly from input text to display/render ???

Victor Ananjevsky

unread,
Mar 29, 2013, 4:52:23 AM3/29/13
to yad-c...@googlegroups.com
В Thu, 28 Mar 2013 10:07:15 -0700 (PDT)
Vittorio Cagnetta <vais...@gmail.com> писал:
> --
> You received this message because you are subscribed to the Google Groups "yad-common" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to yad-common+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

hi. sorry, but this is impossible right now. i'll plan to add some
subset of html or pango markup for implement rich text functionality to
text-info dialog in a future, but now only plain text can be shown

--
Victor Ananjevsky <anan...@gmail.com>

Vittorio Cagnetta

unread,
Mar 29, 2013, 4:58:11 AM3/29/13
to yad-c...@googlegroups.com


hi. sorry, but this is impossible right now. i'll plan to add some
subset of html or pango markup for implement rich text functionality to
text-info dialog in a future, but now only plain text can be shown

--
Victor Ananjevsky <anan...@gmail.com>

Hi Victor!

What a pity! please, let me know... because when you'll add those features, my karaoke project wil be finished!!!  ;-D

Anyway thanks for your nice program...


Keep up good work!

--
Vittorio Cagnetta
Reply all
Reply to author
Forward
0 new messages