Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 30 Aug 2014, 16:14
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Derivatives
dzen2 - use of fonts
Moderators: Flash, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
linuph


Joined: 03 Jun 2012
Posts: 128
Location: Philippines

PostPosted: 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
View user's profile Send_private_message 
linuph


Joined: 03 Jun 2012
Posts: 128
Location: Philippines

PostPosted: 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
View user's profile Send_private_message 
SFR


Joined: 26 Oct 2011
Posts: 1063

PostPosted: 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!
dzen2.png
 Description   
 Filesize   14.54 KB
 Viewed   629 Time(s)

dzen2.png


_________________
[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
View user's profile Send_private_message 
Keef


Joined: 20 Dec 2007
Posts: 622
Location: Staffordshire

PostPosted: 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.
dzen2.png
 Description   
 Filesize   185.37 KB
 Viewed   631 Time(s)

dzen2.png

Back to top
View user's profile Send_private_message 
linuph


Joined: 03 Jun 2012
Posts: 128
Location: Philippines

PostPosted: 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
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Puppy Derivatives
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0537s ][ Queries: 13 (0.0081s) ][ GZIP on ]