| Author |
Message |
linuph

Joined: 03 Jun 2012 Posts: 127 Location: Philippines
|
Posted: Thu 03 Jan 2013, 07:05 Post subject:
dzen2 - use of fonts |
|
Using Dpup Exprimo 5.X.3.4.12
dzen is a configurable, flexible utility to show text on screen or even menu's.
I can't choose other fonts than 'fixed' in dzen2, though fc-list and xfontsel show fonts like courier, dejavu sans, nimbus etc.
I have not been able to find a solution. There's Archlinux info, but that doesn't suit Puppy. Does someone know how to select other fonts?
For example:
#echo "Hello World" | dzen2 -fn "DejaVu Sans" -p' gives an error: cannot load font 'DejaVu Sans'. With 'fixed' font it works.
Programmatically, a line could look as follows:
awk ..... { print x | "dzen2 | -fn '-*-fixed-bold-r-*-*-24-*-*-*-*-*-*-*' -fg white -bg black -h 30 -ta l -x 0 -y 574 -w 800" }
That works with the fixed font, but not with others. By the way, the (terrible) -*-*-*-* thing is produced by xfontsel but unforunately I cannot select/copy from xfontsel, but that's another matter.
I suspect dzen looks for fonts in a Puppy place that's not the same as in Archlinux but I don't know for sure....
Attached pets of dzen2 (standard package) and dzen2g (dzen gadgets).
Any help appreciated....
PS I wanted to upload dzen2 pets but it's too slow right now. I'll try again later.
|
|
Back to top
|
|
 |
linuph

Joined: 03 Jun 2012 Posts: 127 Location: Philippines
|
Posted: Thu 03 Jan 2013, 12:15 Post subject:
|
|
I found a solution to use 'DejaVu Sans' in stead of 'fixed' font. Well, sort of. It's a coincidence on the one hand and a classic 'escape' issue with awk on the other. This program line now works:
#awk .....{ print x | "dzen2 -fn \"-*-DejaVu Sans-*-r-*-*-22-*-*-*-*-*-*\" -bg black -fg white -h 30 -ta l -x 600 -y 450 -w 200"}
Note the the \"....\".
Fine, I'm happy with this but I have no explanation why other fonts (except 'fixed') don't work though reported by xfontsel....
|
|
Back to top
|
|
 |
SFR

Joined: 26 Oct 2011 Posts: 570
|
Posted: Thu 03 Jan 2013, 15:09 Post subject:
|
|
Hey Linuph
Nice find, thanks!
BTW, I compiled it myself from the source (simple 'make') and have no problems using other fonts in Slacko-5.4.
Greetings!
| Description |
|
| Filesize |
14.54 KB |
| Viewed |
268 Time(s) |

|
_________________ [O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
|
|
Back to top
|
|
 |
Keef

Joined: 20 Dec 2007 Posts: 428 Location: Staffordshire
|
Posted: Thu 03 Jan 2013, 15:44 Post subject:
|
|
Have you tried using a script?
| Code: | #!/bin/sh
FG='#ffffff'
BG='#003aff'
FONT='-adobe-helvetica-*-*-*-*-24-*-*-*-*-*-*-*'
while true ; do
dt=`date +"%a %b %d %l:%M %p "`
printf "%s\n" "$dt"
sleep 20
done | dzen2 -e '' -x '800' -h '24' -w '880' -ta r -fn $FONT -fg $FG -bg $BG
|
Can't remember where I got this - probably the ArchWiki...
Puts the date and time at the top right.
| Description |
|
| Filesize |
185.37 KB |
| Viewed |
261 Time(s) |

|
|
|
Back to top
|
|
 |
linuph

Joined: 03 Jun 2012 Posts: 127 Location: Philippines
|
Posted: Thu 03 Jan 2013, 21:12 Post subject:
|
|
@SFR
Yes, compiles without problems.
@Keef
I do use a script. Since I call dzen2 from within an awk command, variable substitution is not as straightforward.
Thanks!
|
|
Back to top
|
|
 |
|